JP2004094496A - Sequence diagram preparing device, and method therefor, sequence diagram preparing program, and recording medium therefor - Google Patents

Sequence diagram preparing device, and method therefor, sequence diagram preparing program, and recording medium therefor Download PDF

Info

Publication number
JP2004094496A
JP2004094496A JP2002253384A JP2002253384A JP2004094496A JP 2004094496 A JP2004094496 A JP 2004094496A JP 2002253384 A JP2002253384 A JP 2002253384A JP 2002253384 A JP2002253384 A JP 2002253384A JP 2004094496 A JP2004094496 A JP 2004094496A
Authority
JP
Japan
Prior art keywords
file
function
sequence diagram
source code
return
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2002253384A
Other languages
Japanese (ja)
Inventor
Yujiro Araki
荒木 勇次郎
Satoshi Matsuo
松尾 聡
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NTT Comware Corp
Original Assignee
NTT Comware Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NTT Comware Corp filed Critical NTT Comware Corp
Priority to JP2002253384A priority Critical patent/JP2004094496A/en
Publication of JP2004094496A publication Critical patent/JP2004094496A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To prepare a sequence diagram capable of expressing a calling and returning sequence of a single functional block or between a plurality of functional blocks, based on a source code. <P>SOLUTION: A tracing means 4 reads the source code from a source code file 1 to trace calling-out and returning of a function included in the source code, and to write a traced result in a tentative file 5 in a form including information of the function block related to the function, referring to a database, and the sequence diagram is prepared to express the calling and returning sequence between the functional blocks, via a diagram preparing means 6, based on the file. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明は、ソースコードを基に、単数または複数からなる機能ブロック間の呼び出しおよび戻りのシーケンスを表現するシーケンス図作成装置、およびその方法、シーケンス図作成プログラム、その記録媒体に関する。
【0002】
【従来の技術】
構造化プログラミングの構造を記述するためのチャートとして、HCP(Hierarchical・and・ComPact・description・chart)が知られている。従来は、ソースコードから関数単位の処理構造を表現し、アルゴリズム解析等のためにこのHCPチャートが多用されていた。
【0003】
但し、HCPは、関数内における処理、分岐、繰り返し、判定等の流れを記号化して表現するものであり、関数間の流れを表現するシーケンス図を作成するものではない。従って、従来、ある機能の流れを表現するシーケンス図を作成するのに、ソースコードを手作業でトレース(追跡)することが行なわれており、従って、作業者にかかる負担が大きく、非効率的であり、自動化のためのツールの出現が望まれていた。
また、試験工程におけるデバッグ作業においても同様、バグの発見、原因究明を手作業で行なうことになり、作業者にかかる負担が大きく、非効率的であった。
【0004】
【発明が解決しようとする課題】
ところで、シーケンス図を作成するためのツールを開発するにあたって考えなければならないことは、あるファイルから別のファイルを参照するための関数の呼び出し(コール)の関係を把握するのは比較的簡単であるが、処理の流れを把握するためにその戻り(リターン)を把握するためには、その関数がどの関数によって呼ばれたかを記憶しておくことが必要なことである。このための処理が複雑で面倒であり、そのための仕組み作りを必要としていた。
【0005】
本発明は上記事情に鑑みてなされたものであり、ソースコードを基に、単数または複数からなる機能ブロック間の呼び出しおよび戻りのシーケンスを表現することのできる、シーケンス図作成装置、およびその方法、シーケンス図作成プログラム、その記録媒体を提供することを目的とする。
また、試験工程におけるデバッグ作業の効率化もはかった、シーケンス図作成装置、およびその方法、シーケンス図作成プログラム、その記録媒体を提供することも目的とする。
【0006】
【課題を解決するための手段】
上記した課題を解決するために本発明は、ソースコードを基に単数または複数からなる機能ブロック間の呼び出しおよび戻りのシーケンスを表現するシーケンス図を作成するシーケンス図作成装置であって、前記ソースコードを読み取り、当該ソースコードに含まれる機能ブロックと関数との関係をデータベースに書き込むデータベース作成手段と、前記ソースコードを読み取り、当該ソースコードに含まれる関数の呼び出しおよび戻りを追跡すると共に、前記データベースを参照して前記関数に関係する機能ブロックの情報を含む形で前記追跡結果をファイルに書きこむ追跡手段と、前記ファイルに基づき、前記機能ブロック間の呼び出しおよび戻りを表現するシーケンス図を作成する図作成手段と、を備えることを特徴とする。
【0007】
本発明によれば、追跡手段が、ソースコードを読み取り、当該ソースコードに含まれる関数の呼び出しおよび戻りを追跡すると共に、データベースを参照して関数に関係する機能ブロックの情報を含む形で追跡結果をファイルに書きこみ、当該ファイルに基づき図作成手段を介して機能ブロック間の呼び出しおよび戻りを表現するシーケンス図を作成することにより、機能間の処理の流れを示すシーケンス図を作成することができ、このことにより、機能および機能ブロック間のインタフェースを容易に把握することができる。また、追跡結果が書き込まれるファイルを編集することにより情報の追加、削除が可能であり、このことにより、機能ブロック間のインタフェースを一層容易に把握可能となる。
なお、ここで、「機能ブロック」とは、1以上のソースコードファイルであって、ある特定の機能を実現する関数の集合をいう。
【0008】
また、本発明において、前記呼び出される関数の情報を呼び出された順番に記憶する記憶装置を備え、前記追跡手段は、前記関数が呼び出されるコードを検出したときに、当該関数の情報を前記記憶装置に追加して書き込み、前記関数から戻るコードを検出したときに当該関数の情報を前記記憶装置から削除すること、を特徴とする。
【0009】
本発明によれば、追跡手段が、関数が呼び出されるコードを検出したときに、当該関数の情報を、呼び出される関数の情報を呼び出された順番に記憶する記憶装置に追加して書き込み、関数から戻るコードを検出したときに当該関数の情報を記憶装置から削除することにより、あるファイルから別のファイルを参照するための関数の呼び出し(コール)の関係を把握するのは勿論のこと、処理の流れを把握するためにその戻り(リターン)も把握可能なシーケンス図作成装置を提供できる。
【0010】
また、本発明において、前記追跡手段は、あらかじめ設定される前記関数の呼び出しおよび戻りに関するネストの最大深さを監視し、当該最大深さ内における追跡結果を前記ファイルに書きこむことを特徴とする。
本発明によれば、追跡手段が、設定された関数の呼び出しおよび戻りに関するネストの最大深さを監視し、その深さ内における追跡結果のみファイルに書きこむことで、無駄なファイルを作成せずに済み、処理効率が向上する。
【0011】
また、本発明において、前記追跡手段は、前記追跡した関数の履歴を保持し、一度追跡した関数が再現したときに再度追跡して前記ファイルに書きこむことを禁止することを特徴とする。
本発明によれば、追跡手段が、一度追跡した関数が再現したときに再度追跡してファイルへの書き込みを禁止することにより、再度追跡する処理を省けるため、無駄なファイルを作成せずに済み、かつ、処理効率が向上する。
【0012】
また、本発明において、前記図作成手段は、ネストの深さによって可変となる機能ブロック間の幅を、あらかじめ設定される機能ブロック間の幅の指定によりコントロールすることを特徴とする。
本発明によれば、図作成手段が、ネストの深さによって可変となる機能ブロック間の幅を、あらかじめ設定される機能ブロック間の幅の指定によりコントロールすることで、ネストの深さによらない略一定幅で機能ブロック間を表現でき、このことにより、シーケンス図の見映えが良くなる。
【0013】
また、本発明において、前記追跡手段により追跡結果が書き込まれたファイルに修正を施したファイルと、ある試験ケースについてプログラムを実行したときの通過関数、および当該関数が読み出される毎に引数と戻り値の実数が設定される試験結果ファイルを読み込み、前記修正を施したファイルに書き込まれた関数名をキーに当該ファイルの中に、前記試験結果ファイルの中の引き数と戻り値を付与して新規ファイルを生成するファイル作成手段を備え、前記新規ファイルに基づき、前記機能ブロック間の呼び出しおよび戻りに前記引き数と戻り値の実数を反映させて表現するシーケンス図を作成することを特徴とする。
【0014】
本発明によれば、ファイル作成手段が、修正を施したファイルに書き込まれた関数名をキーに当該ファイルの中に、試験結果ファイルの中の引き数と戻り値を付与して新規ファイルを生成し、図作成手段が、当該新規ファイルに基づき、機能ブロック間の呼び出しおよび戻りに、その引き数と戻り値の実数を反映させて表現するシーケンス図を作成することにより、引き数誤り、戻り値誤りによるバグの発見が容易になり、従って、試験工程におけるデバッグの効率化がはかれる。
【0015】
上記した課題を解決するために本発明は、ソースコードを基に単数または複数からなる機能ブロック間の呼び出しおよび戻りのシーケンスを表現するシーケンス図を作成するシーケンス図作成方法であって、前記ソースコードを読み取り、当該ソースコードに含まれる機能ブロックと関数との関係をデータベースに書き込み、前記ソースコードを読み取り、当該ソースコードに含まれる関数の呼び出しおよび戻りを追跡すると共に、前記データベースを参照して前記関数に関係する機能ブロックの情報を含む形で前記追跡結果をファイルに書き込み、前記ファイルに基づき、前記機能ブロック間の呼び出しおよび戻りを表現するシーケンス図を作成すること、を特徴とする。
【0016】
また、本発明において、前記追跡結果が書き込まれたファイルに修正を施したファイルと、ある試験ケースについてプログラムを実行したときの通過関数、および当該関数が読み出される毎に引数と戻り値の実数が設定される試験結果ファイルを読み込み、前記修正を施したファイルに書き込まれた関数名をキーに当該ファイルの中に、前記試験結果ファイルの中の引き数と戻り値を付与して新規ファイルを作成し、前記作成された新規ファイルに基づき、前記機能ブロック間の呼び出しおよび戻りに前記引き数と戻り値の実数を反映させて表現するシーケンス図を作成すること、を特徴とする。
【0017】
上記した課題を解決するために本発明は、ソースコードを基に単数または複数からなる機能ブロック間の呼び出しおよび戻りのシーケンスを表現するシーケンス図を作成するシーケンス図作成装置に用いられるシーケンス図作成プログラムであって、前記ソースコードを読み取り、当該ソースコードに含まれる機能ブロックと関数との関係をデータベースに書き込むステップと、前記ソースコードを読み取り、当該ソースコードに含まれる関数の呼び出しおよび戻りを追跡すると共に、前記データベースを参照して前記関数に関係する機能ブロックの情報を含む形で前記追跡結果をファイルに書き込むステップと、前記ファイルに基づき、前記機能ブロック間の呼び出しおよび戻りを表現するシーケンス図を作成するステップと、をコンピュータに実行させることを特徴とする。
【0018】
また、本発明において、前記追跡結果が書き込まれたファイルに修正を施したファイルと、ある試験ケースについてプログラムを実行したときの通過関数、および当該関数が読み出される毎に引数と戻り値の実数が設定される試験結果ファイルを読み込み、前記修正を施したファイルに書き込まれた関数名をキーに当該ファイルの中に、前記試験結果ファイルの中の引き数と戻り値を付与して新規ファイルを作成するステップと、前記作成された新規ファイルに基づき、前記機能ブロック間の呼び出しおよび戻りに前記引き数と戻り値の実数を反映させて表現するシーケンス図を作成するステップと、をコンピュータに実行させることを特徴とする。
【0019】
上記した課題を解決するために本発明は、ソースコードを基に単数または複数からなる機能ブロック間の呼び出しおよび戻りのシーケンスを表現するシーケンス図を作成するシーケンス図作成装置に用いられるシーケンス図作成プログラムを記録したコンピュータ読み取り可能な記録媒体であって、前記ソースコードを読み取り、当該ソースコードに含まれる機能ブロックと関数との関係をデータベースに書き込むステップと、前記ソースコードを読み取り、当該ソースコードに含まれる関数の呼び出しおよび戻りを追跡すると共に、前記データベースを参照して前記関数に関係する機能ブロックの情報を含む形で前記追跡結果をファイルに書き込むステップと、前記ファイルに基づき、前記機能ブロック間の呼び出しおよび戻りを表現するシーケンス図を作成するステップと、をコンピュータに実行させるシーケンス図作成プログラムを記録したことを特徴とする。
【0020】
また、本発明において、前記追跡結果が書き込まれたファイルに修正を施したファイルと、ある試験ケースについてプログラムを実行したときの通過関数、および当該関数が読み出される毎に引数と戻り値の実数が設定される試験結果ファイルを読み込み、前記修正を施したファイルに書き込まれた関数名をキーに当該ファイルの中に、前記試験結果ファイルの中の引き数と戻り値を付与して新規ファイルを作成するステップと、前記作成された新規ファイルに基づき、前記機能ブロック間の呼び出しおよび戻りに前記引き数と戻り値の実数を反映させて表現するシーケンス図を作成するステップと、をコンピュータに実行させるシーケンス図作成プログラムを記録したことを特徴とする。
【0021】
【発明の実施の形態】
図1は、本発明のシーケンス図作成装置の内部構成を機能展開して示したブロック図である。
本発明のシーケンス図作成装置は、ソースコードを基に単数または複数からなる機能ブロック間の呼び出しおよび戻りのシーケンスを表現するシーケンス図を作成する装置であって、ソースコードファイル1と、データベース(DB)作成部2と、データベース(DB)3と、追跡部4と、一時ファイル5と、図作成部6と、記憶装置7と、エディタ8と、修正ファイル9と、試験結果ファイル10と、ファイル作成部11で構成される。
【0022】
DB作成部2は、ソースコードファイル1のソースコードを読み取り、当該ソースコードに含まれる機能ブロックと関数との関係をDB3に書きこむ。
追跡部4は、ソースコードファイル1に格納されたソースコードを読み取り、当該ソースコードに含まれる関数の呼び出しおよび戻りを追跡すると共に、DB3に書き込まれた内容を参照して関数に関係する機能ブロックの情報を含む形で先の追跡結果を一時ファイル5として書きこむ機能を持つ。追跡部4はまた、あらかじめパラメータ設定される関数の呼び出しおよび戻りに関するネストの最大深さを監視し、当該最大深さ内における追跡結果を一時ファイル部に書きこむ機能を持つ。追跡部4は更に、追跡した関数の履歴を図示せぬ別の記憶装置に保持し、都度照合することで一度追跡した関数が再現したときに再度追跡して一時ファイル5に書きこむことを禁止する機能も併せ持つ。いずれも無駄な一時ファイルを作らないための配慮である。
【0023】
図作成部6は、一時ファイル5に書き込まれた内容に基づき、機能ブロック間の呼び出しおよび戻りを表現するシーケンス図を作成する機能を持つ。図作成部6はまた、ネストの深さによって可変となる機能ブロック間の幅を、あらかじめパラメータ設定される機能ブロック間の幅の指定によりコントロールする機能も持つ。
また、本発明のシーケンス図作成装置は、呼び出される関数の情報を呼び出された順番に記憶する記憶装置7を備え、追跡部4は、関数が呼び出されるコードを検出したときに、当該関数の情報を記憶装置7に追加して書き込み、その関数から戻るコードを検出したときに当該関数の情報を記憶装置7から削除する。
【0024】
一方、ファイル作成部11は、追跡部4により追跡結果が書き込まれた一時ファイル5にエディタ8を用いて修正を施したファイル(修正ファイル9)と、ある試験ケースについてプログラムを実行したときの通過関数、および当該関数が読み出される毎に引数と戻り値の実数が設定される試験結果ファイル10の内容を読み込み、先に修正を施した修正ファイル9に書き込まれた関数名をキーに当該修正ファイル9の中に、試験結果ファイル9の中の引き数と戻り値を付与して新規ファイルを生成する機能を持つ。
図作成部6は、ファイル作成部11により作成された新規ファイルに基づき、機能ブロック間の呼び出しおよび戻りに前記引き数と戻り値の実数を反映させて表現するシーケンス図を作成することができる。
なお、本発明によれば、追跡部4による追跡結果が書き込まれる一時ファイル5の内容を、エディタ8を用いて編集することにより、情報を追加、あるいは削除して全てのルートを網羅したシーケンス図の作成が可能となり、また、必要な部分だけを一時ファイル5上で整形することにより特定機能のシーケンス図の作成が可能であり、機能、および機能ブロック間のインタフェースの把握を可能とさせるものである。
【0025】
図2は、図1に示すDB部3のデータ構造の一例を示す図であり、図3は、記憶装置7のデータ構造の一例を示す図である。
図2に示されるように、DB部3には、機能ブロック毎、その機能ブロックに含まれる関数名(1−1〜2−n)と、ソースコードから抽出される関数の概要が記述され蓄積される。また、図3に示されるように、記憶装置7には機能ブロック毎、呼ばれた順(コール順)に関数名が記録される、いわばスタックの役割を実現する。
なお、ここでいう機能ブロックとは、1以上のソースコードファイルであって、ある特定の機能を実現する関数の集合をいう。
【0026】
図4〜図7は、本発明のシーケンス図作成装置の動作を説明するために引用した図であり、DB作成部2(図4)、追跡部4(図5)、図作成部6(図6)、ファイル作成部11(図7)の動作のそれぞれを示し、全体的には本発明のシーケンス図作成プログラムの処理手順を示す。
また、図8、図9は、生成される一時ファイルの一例、図10、図11は、シーケンス図の出力フォーマットの一例を示す図である。
以下、図4〜図11を参照しながら図1〜図3に示す本発明実施形態の動作について詳細に説明する。
【0027】
まず、図4に示すフローチャートを参照しながらDB作成部2によるDBの作成から説明する。
ここでは、ソースコードファイル1から機能ブロック名および関数名を取得し、機能ブロック名および関数名の対応DB3を生成する。
すなわち、DB作成部2は、ソースコードファイル1からソースコードを読み取り、当該ソースコードに含まれる全ての機能ブロックから関数名を取得し(S401)、図2にそのデータ構造の一例が示されるDBを構築するために、機能ブロックとその中に含まれる関数との関係をデータベースに書き込む(S402)。
【0028】
次に、図5に示すフローチャートを参照しながら、追跡部4による一時ファイル5の作成について説明する。
ここでは、追跡部4が、DB3から機能ブロック名および関数名を取得し、処理の流れにネストと戻りを意識した一時ファイル5を作成する。すなわち、追跡部4は、DB3を参照することにより、パラメータとして、機能ブロック名、関数名を出力し(S501)、それぞれに対応したソースコードファイル1をオープンする(S502)。そして、そのソースコードファイル1を1行ずつ取得して(S504)関数が呼び出されているか否かを追跡(トレース)していく。
ここで、関数が呼び出されていることが確認された場合(S506Yes)、入れ子構造を示すネストを+1更新し(S507)、DB3からその関数名を取得する(S508)。関数が呼び出されていない場合は(S506No)、更にソースコードファイル1から続く1行を取得して上記の処理を繰り返す。また、同一関数名が複数機能ブロックにあった場合は(S509Yes)、ファイル名を選択し(S510)、DB3から機能ブロック名、関数名を取得して記憶装置7に記録し(S511)、S501以降の処理を繰り返す。
【0029】
一方、関数が終了後(S505Yes)、そのときのネストのみ出力して−1更新し(S512、S513)、記憶装置7に記録された全ての機能ブロック名と関数名を取得し(S514)、その機能ブロック名と関数名に対応したソースコードファイル1をオープンして(S502)、未追跡のソースコードファイルが無くなる迄(S503Yes)、S504以降の処理を繰り返す。
【0030】
図8、図9に一時ファイルの生成例が示されている。ここでは1行目に機能ブロック名mcd、および関数概要が記述され、以降、点線でネストの深さが示されている。また、黒丸(「●」)で記述された部分は、追跡部4により生成される一時ファイル5を、エディタ8を用いて編集することにより追加した情報を示す。
なお、図示していないが、パラメータ設定されるものとして他に、ネストの最大深さがあり、このとき、追跡部4は、あらかじめパラメータ設定される関数の呼び出しおよび戻りに関するネストの最大深さを監視し、当該最大深さ内における追跡結果のみ一時ファイル5に書きこむこととする。
また、記憶装置7とは別の記憶装置(スタックメモリ)を備え、このスタックメモリ内に、追跡した関数の履歴を保持し、追跡の都度照合することで一度追跡した関数が再現したときに再度追跡してその結果を一時ファイル5に書きこむことを禁止している。図8、図9に示す一時ファイル生成例の中で(略)として示されている箇所がこれに相当する。
【0031】
次に、図6に示すフローチャートを参照しながら図作成部6によるシーケンス図の作成について説明する。
ここでは、一時ファイル5を取得し、機能ブロック名とネストからシーケンス図を作成する。すなわち、まず、一時ファイル5がオープンされる(S601)。図作成部6は、一時ファイル5に記録された全ての機能ブロック名を取得し(S602)、当該取得した機能ブロックに、先に追跡部4によって得られたネストを記録する(S603)。
そして、図10にシーケンス図が例示されるように、取得した全機能ブロック名(mcd/mce/cda/mma/mca/cku/cdb)を最上部に印刷し(S604)、一時ファイル5を再オープンする(S605)。
【0032】
次に、その一時ファイル5から1行取得して(S606)関数名および機能ブロック名をチェックして(S608Yes)今回の機能ブロックを記憶装置7に記録する(S609)。そして、前回の機能ブロックと異なる場合(S610Yes)にのみインタフェース(IF)線を矢印表示し(S611)、前回の機能ブロックと同じ場合(S610No)、前回の機能ブロックのネストに対応した位置に関数名を表示する(S612)。ここでは、シーケンス図における各機能ブロックの位置決めが行なわれる。
なお、一時ファイルを生成した際にもネスト構造は把握できるが、同じネストでも機能ブロック名が異なる場合があり、ここで機能ブロック名をチェックすることにより、シーケンス図のどの位置に表示すればよいかを識別するものである。
【0033】
更に、一時ファイル5から取得した特定の行が、ネストが減った行か否かをチェックし(S613)、ネストが減った行であった場合(S613Yes)、今回の機能ブロックを記憶装置7から削除する(S614)。
また、前回と異なる機能ブロックであった場合は(S615Yes)、リターン線を矢印表示する(S616)。以上の動作を一時ファイル5として存在する行が無くなるまで繰り返す(S607)。
なお、図示していないが、パラメータ設定により、印刷されるシーケンス図の機能ブロック間の幅指定が可能となっており、このとき、図作成部6は、ネストの深さによって可変となる機能ブロック間の幅をパラメータ設定によりコントロールすることができ、一方、幅指定がなかった場合はデフォルト設定される幅で印刷される。
【0034】
最後に、図7に示すフローチャートを参照しながら、ファイル作成部11による一時ファイル生成の流れについて説明する。
ここでは、ファイル作成部11は、追跡部4により追跡結果が書き込まれた一時ファイル5にエディタ8を介して修正を施した修正ファイル9と、ある試験ケースについてプログラムを実行したときの通過関数、および当該関数が読み出される毎に引数と戻り値の実数が設定される試験結果ファイル10を読み込み、修正を施したファイルに書き込まれた関数名をキーに当該ファイルの中に、試験結果ファイル10の中の引き数と戻り値を付与して新規な一時ファイルを生成する。そして、図作成部6を介して作成された新規一時ファイルに基づき、機能ブロック間の呼び出しおよび戻りに前記引き数と戻り値の実数を反映させて表現するシーケンス図を作成する。
なお、一時ファイル5には、期待されるルートが網羅されているものとし、エディタ8を介して、分岐条件で通らないパスに相当する部分を削除し、あるいはループの場合は、その回数分、関数の呼び出しを追加する等の人的編集が付加されているものとする。以降、一時ファイル5は、修正が施されているものと解釈して説明を継続する。
【0035】
まず、一時ファイル名と試験結果ファイル名がパラメータ設定されているものとし、ファイル作成部11は、そのパラメータに基づき、一時ファイル5ならびに試験結果ファイル10をオープンする(S701、S702)。
そして、その一時ファイル5から1行データを取得し(S703)、行の属性(行種別)をチェックする(S705)。ここで、関数行、戻り行であった場合は、試験結果ファイル10から1行取得し(S706)、その他の場合は生成される新規一時ファイルに一時ファイル5の内容をそのまま出力する(S707)。
【0036】
更に、関数行の場合は(S708Yes)、同一関数名かチェックし(S709)、同一関数名であった場合は(S709Yes)、新規作成される一時ファイルに、ネスト、機能ブロック名、関数名、引き数値を出力する(S710)。一方、リターン行であった場合は(S711Yes)、新規作成される一時ファイルに、ネスト、戻り値が出力される(S712)。
なお、試験結果ファイル10から1行取得した内容が関数行でなかった、あるいは戻り行でなかった場合は、新規作成される一時ファイルにそのエラー種別が出力され(S713)、新規作成される一時ファイルの残りが出力される(S714)。上記した動作は一時ファイル5の最終行まで繰り返し実行される(S704)。
このことにより、図10、図11にシーケンス図生成例として示されるように、実際にプログラムを起動させたときの引数、および戻り値を、IF線、あるいはリターン線に埋め込む(IF線およびリターン線の部分に引数と戻り値の実数が設定)ことができ、また、実行ルートが期待したルートと比較して異なった場合、異なることがわかるキー情報をシーケンス図として表示することができる。
【0037】
以上説明のように本発明は、ソースコードを基に、単数または複数からなる機能ブロック間の呼び出しおよび戻りのシーケンスを表現するものであり、また、試験工程におけるデバッグ作業の効率化をはかるものである。
なお、図1に示すDB作成部2、追跡部4、図作成部6、ファイル作成部11のそれぞれで実行される手順をコンピュータ読み取り可能な記録媒体に記録し、この記録媒体に記録されたプログラムをコンピュータシステムに読み込ませ、実行することにより本発明のシーケンス図作成装置が実現されるものとする。
ここでいうコンピュータシステムとは、OSや周辺機器等のハードウェアを含むものである。
【0038】
また、「コンピュータシステム」は、WWWシステムを利用している場合であれば、ホームページ提供環境(あるいは表示環境)も含むものとする。
また、「コンピュータ読み取り可能な記録媒体」とは、フレキシブルディスク、光磁気ディスク、ROM、CD−ROM等の可搬媒体、コンピュータシステムに内蔵されるハードディスク等の記憶装置のことをいう。さらに「コンピュータ読み取り可能な記録媒体」とは、インターネット等のネットワークや電話回線等の通信回線を介してプログラムが送信された場合のシステムやクライアントとなるコンピュータシステム内部の揮発性メモリ(RAM)のように、一定時間プログラムを保持しているものも含むものとする。
【0039】
また、上記プログラムは、このプログラムを記憶装置等に格納したコンピュータシステムから、伝送媒体を介して、あるいは、伝送媒体中の伝送波により他のコンピュータシステムに伝送されてもよい。ここで、プログラムを伝送する「伝送媒体」は、インターネット等のネットワーク(通信網)や電話回線等の通信回線(通信線)のように情報を伝送する機能を有する媒体のことをいう。
また、上記プログラムは、前述した機能の一部を実現するためのものであっても良い。さらに、前述した機能をコンピュータシステムにすでに記録されているプログラムとの組み合わせで実現できるもの、いわゆる差分ファイル(差分プログラム)であっても良い。
【0040】
以上、この発明の実施形態につき、図面を参照して詳述してきたが、具体的な構成はこの実施形態に限られるものではなく、この発明の要旨を逸脱しない範囲の設計等も含まれる。
【0041】
【発明の効果】
以上説明のように本発明によれば、機能および機能ブロック間のインタフェースを容易に把握することができ、あるファイルから別のファイルを参照するための関数呼び出しの関係を把握できることは勿論のこと、処理の流れを把握するためにその戻りも把握可能なシーケンス図を作成できる。また、追跡結果が書き込まれるファイルを編集することにより情報の追加、削除が可能であり、このことにより、機能ブロック間のインタフェースを一層容易に把握可能となる。
更に、修正を施したファイルに書き込まれた関数名をキーに当該ファイルの中に、試験結果ファイルの中の引き数と戻り値を付与して一時ファイルを生成することにより、機能ブロック間の呼び出しおよび戻りに、その引き数と戻り値の実数を反映させて表現するシーケンス図を作成することができ、このことにより、引き数誤り、戻り値誤りによるバグの発見が容易になり、従って、試験工程におけるデバッグの効率化がはかれる。
【図面の簡単な説明】
【図1】本発明のシーケンス図作成装置の内部構成を機能展開して示したブロック図である。
【図2】図1に示すDBのデータ構造の一例を示す図である。
【図3】図1に示す記憶装置のデータ構造の一例を示す図である。
【図4】本発明実施形態の動作を説明するために引用したフローチャートである。
【図5】本発明実施形態の動作を説明するために引用したフローチャートである。
【図6】本発明実施形態の動作を説明するために引用したフローチャートである。
【図7】本発明実施形態の動作を説明するために引用したフローチャートである。
【図8】本発明により生成される一時ファイルの一例を示す図である。
【図9】本発明により生成される一時ファイルの一例を示す図である。
【図10】本発明により生成されるシーケンス図の一例を示す図である。
【図11】本発明により生成されるシーケンス図の一例を示す図である。
【符号の説明】
1…ソースコードファイル、2…DB作成部、3…データベース(DB)、4…追跡部、5…一時ファイル、6…図作成部、7…記憶装置、8…エディタ、9…修正ファイル、10…試験結果ファイル、11…ファイル作成部
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a sequence diagram creation device, a method thereof, a sequence diagram creation program, and a recording medium for expressing a sequence of call and return between one or more functional blocks based on a source code.
[0002]
[Prior art]
As a chart for describing the structure of structured programming, HCP (Hierarchical and ComPact description script) is known. Conventionally, the HCP chart has been frequently used for expressing a processing structure in function units from a source code and analyzing an algorithm.
[0003]
However, the HCP symbolizes and expresses the flow of processing, branching, repetition, determination, and the like in a function, and does not create a sequence diagram expressing the flow between functions. Therefore, conventionally, in order to create a sequence diagram expressing a flow of a certain function, tracing (tracking) the source code manually has been performed, so that the burden on the operator is large and inefficient. Therefore, the emergence of a tool for automation has been desired.
Similarly, in debugging work in the test process, a bug is found and a cause is investigated manually, which places a heavy burden on an operator and is inefficient.
[0004]
[Problems to be solved by the invention]
By the way, what should be considered when developing a tool for creating a sequence diagram is that it is relatively easy to grasp the relationship between function calls (calls) for referring to another file from one file. However, in order to grasp the return in order to grasp the flow of processing, it is necessary to memorize which function called the function. The processing for this is complicated and troublesome, and a mechanism for that has to be created.
[0005]
The present invention has been made in view of the above circumstances, and based on a source code, can represent a sequence of call and return between one or more functional blocks, a sequence diagram creating apparatus and its method, It is an object of the present invention to provide a sequence diagram creation program and a recording medium thereof.
It is also an object of the present invention to provide a sequence diagram creation device, a method thereof, a sequence diagram creation program, and a recording medium for the same, which can improve the efficiency of debugging work in a test process.
[0006]
[Means for Solving the Problems]
In order to solve the above-described problem, the present invention is a sequence diagram creating apparatus for creating a sequence diagram expressing a call and return sequence between one or more functional blocks based on a source code, Database creation means for reading the relationship between the function blocks and functions included in the source code into a database, reading the source code, tracking calls and returns of functions included in the source code, and A diagram for creating a sequence diagram expressing a call and return between the function blocks based on the file, and a tracing unit that writes the trace result in a file including information of a function block related to the function. And a creating means.
[0007]
According to the present invention, the tracing means reads the source code, traces the calls and returns of the functions included in the source code, and refers to the database to include the result of the tracing in a form including the information of the function blocks related to the functions. Is written in a file, and a sequence diagram expressing a call and a return between the function blocks is created based on the file via the diagram creating means, whereby a sequence diagram showing a flow of processing between the functions can be created. Thus, the functions and the interfaces between the function blocks can be easily grasped. Also, information can be added or deleted by editing the file in which the tracking result is written, whereby the interface between the functional blocks can be more easily grasped.
Here, the “functional block” is one or more source code files, and refers to a set of functions for realizing a specific function.
[0008]
Further, according to the present invention, the information processing apparatus further comprises a storage device for storing the information of the called function in the order in which the function is called, and the tracking unit, when detecting a code for calling the function, stores the information of the function in the storage device. In addition, when a code returned from the function is detected, the information of the function is deleted from the storage device.
[0009]
According to the present invention, when the tracking means detects a code in which a function is called, the information of the function is added to a storage device that stores the information of the called function in the order in which the function is called, and is written. When the return code is detected, the information of the function is deleted from the storage device, so that it is possible to grasp not only the relationship of the function call (call) from one file to another file but also the processing. It is possible to provide a sequence diagram creation device capable of grasping the return in order to grasp the flow.
[0010]
Further, in the present invention, the tracing means monitors the maximum depth of the nest related to the call and return of the function which is set in advance, and writes the tracing result within the maximum depth to the file. .
According to the present invention, the tracing means monitors the maximum nesting depth for the set function call and return, and writes only the tracing result within that depth to a file, so that a useless file is not created. And the processing efficiency is improved.
[0011]
Also, in the present invention, the tracking means holds a history of the tracked function, and when the tracked function is reproduced, prohibits re-tracking and writing to the file.
According to the present invention, the tracking means re-traces the function once traced and reproduces the same, thereby prohibiting writing to the file. This eliminates the process of re-tracking, so that unnecessary files are not created. In addition, the processing efficiency is improved.
[0012]
Further, in the present invention, the diagram creating means controls a width between the function blocks which is variable depending on a depth of the nest by designating a predetermined width between the function blocks.
According to the present invention, the diagram creating means controls the width between the function blocks that is variable according to the nest depth by specifying the width between the function blocks that is set in advance, and thus does not depend on the nest depth. The functional blocks can be expressed with a substantially constant width, which improves the appearance of the sequence diagram.
[0013]
Further, in the present invention, a file obtained by modifying the file in which the tracing result is written by the tracing means, a passing function when a program is executed for a certain test case, and an argument and a return value every time the function is read out The test result file in which the real number of the test result file is set is read, and the argument and return value in the test result file are added to the file with the function name written in the modified file as a key, and the new value is added. A file creation means for creating a file is provided, wherein a sequence diagram is created based on the new file, in which calls and returns between the function blocks are expressed by reflecting the real numbers of the arguments and return values.
[0014]
According to the present invention, the file creating means creates a new file by giving the argument and the return value in the test result file to the file with the function name written in the modified file as a key. Then, based on the new file, the diagram creating means creates a sequence diagram expressing the arguments and return values of the calls and returns between the function blocks by reflecting the real numbers of the arguments and the return value, so that the argument error, return value It is easy to find bugs due to errors, so that debugging in the test process is more efficient.
[0015]
In order to solve the above-described problem, the present invention is a sequence diagram creating method for creating a sequence diagram expressing a sequence of call and return between one or more functional blocks based on a source code, Read the relationship between the function blocks and the functions included in the source code into a database, read the source code, track the calls and returns of the functions included in the source code, and refer to the database to The tracking result is written in a file including information on a function block related to a function, and a sequence diagram expressing calls and returns between the function blocks is created based on the file.
[0016]
Further, in the present invention, a file obtained by modifying the file in which the tracking result is written, a passing function when a program is executed for a certain test case, and a real number of an argument and a return value each time the function is read out, Reads the set test result file and creates a new file by giving the arguments and return value in the test result file to the file using the function name written in the modified file as a key And, based on the created new file, a sequence diagram is created in which calls and returns between the function blocks are expressed by reflecting the real numbers of the arguments and return values.
[0017]
In order to solve the above-described problems, the present invention provides a sequence diagram creating program used for a sequence diagram creating apparatus that creates a sequence diagram expressing a call and return sequence between one or more functional blocks based on a source code. Reading the source code and writing a relationship between a function block and a function included in the source code to a database, reading the source code, and tracking calls and returns of functions included in the source code And writing the trace result to a file with reference to the database and including information on the function blocks related to the function, and a sequence diagram expressing calls and returns between the function blocks based on the file. Steps to create and Characterized in that to execute the data.
[0018]
Further, in the present invention, a file obtained by modifying the file in which the tracking result is written, a passing function when a program is executed for a certain test case, and a real number of an argument and a return value each time the function is read out, Reads the set test result file and creates a new file by giving the arguments and return value in the test result file to the file using the function name written in the modified file as a key And a step of creating a sequence diagram that expresses the arguments and return values in calls and returns between the function blocks based on the created new file. It is characterized by.
[0019]
In order to solve the above-described problems, the present invention provides a sequence diagram creating program used for a sequence diagram creating apparatus that creates a sequence diagram expressing a call and return sequence between one or more functional blocks based on a source code. A computer-readable recording medium recording the source code, and writing a relationship between a function block and a function included in the source code to a database, reading the source code, and including the source code in the source code. Tracing the calls and returns of the functions to be performed, and writing the tracing result to a file so as to include the information of the function blocks related to the functions with reference to the database. Express calls and returns And creating a Sequence diagram, characterized in that the recorded sequence diagram creation program executed by a computer.
[0020]
Further, in the present invention, a file obtained by modifying the file in which the tracking result is written, a passing function when a program is executed for a certain test case, and a real number of an argument and a return value each time the function is read out, Reads the set test result file and creates a new file by giving the arguments and return value in the test result file to the file using the function name written in the modified file as a key And generating a sequence diagram expressing the arguments and the real numbers of the return values in calls and returns between the function blocks based on the created new file. It is characterized in that a diagram creation program is recorded.
[0021]
BEST MODE FOR CARRYING OUT THE INVENTION
FIG. 1 is a block diagram showing the internal configuration of a sequence diagram creating apparatus according to the present invention by developing its functions.
The sequence diagram creation device of the present invention is a device for creating a sequence diagram expressing a call and return sequence between one or more functional blocks based on a source code, and includes a source code file 1 and a database (DB). ) Creation unit 2, database (DB) 3, tracking unit 4, temporary file 5, diagram creation unit 6, storage device 7, editor 8, correction file 9, test result file 10, file It is composed of a creating unit 11.
[0022]
The DB creator 2 reads the source code of the source code file 1 and writes the relationship between the function blocks and the functions included in the source code into the DB 3.
The tracing unit 4 reads the source code stored in the source code file 1, tracks the call and return of the function included in the source code, and refers to the contents written in the DB 3 to function blocks related to the function. Has the function of writing the previous tracking result as a temporary file 5 in a form including the above information. The tracing unit 4 also has a function of monitoring the maximum depth of nesting for calling and returning a function whose parameters are set in advance, and writing the tracing result within the maximum depth to a temporary file unit. The tracking unit 4 further holds the history of the tracked function in another storage device (not shown), and prohibits re-tracking and writing to the temporary file 5 when the tracked function is reproduced by collating each time. It also has the function to do. In any case, care is taken to avoid creating useless temporary files.
[0023]
The diagram creating unit 6 has a function of creating a sequence diagram expressing calls and returns between functional blocks based on the contents written in the temporary file 5. The diagram creating unit 6 also has a function of controlling the width between the function blocks that is variable depending on the depth of the nest by designating the width between the function blocks that is set in advance as a parameter.
Further, the sequence diagram creating apparatus of the present invention includes a storage device 7 for storing information of a function to be called in the order in which the function is called, and the tracking unit 4 detects information of the function when the code for calling the function is detected. Is added to the storage device 7 and written, and when a code returning from the function is detected, the information of the function is deleted from the storage device 7.
[0024]
On the other hand, the file creator 11 modifies the temporary file 5 in which the tracking result is written by the tracing unit 4 by using the editor 8 (corrected file 9), and passes when the program is executed for a certain test case. The function and the contents of the test result file 10 in which the real number of the argument and the return value are set every time the function is read are read, and the function name written in the previously corrected file 9 is used as a key to modify the file. 9 has a function of generating a new file by adding arguments and return values in the test result file 9.
Based on the new file created by the file creating unit 11, the diagram creating unit 6 can create a sequence diagram expressing the arguments and the real values of the return values in the calls and returns between the function blocks.
In addition, according to the present invention, the contents of the temporary file 5 in which the tracking result is written by the tracking unit 4 is edited by using the editor 8 to add or delete information to cover the entire route. It is also possible to create a sequence diagram of a specific function by shaping only necessary parts on the temporary file 5, and to grasp functions and interfaces between functional blocks. is there.
[0025]
FIG. 2 is a diagram illustrating an example of a data structure of the DB unit 3 illustrated in FIG. 1, and FIG. 3 is a diagram illustrating an example of a data structure of the storage device 7.
As shown in FIG. 2, the DB unit 3 describes and stores the function names (1-1 to 2-n) included in the function blocks and the outline of the functions extracted from the source code for each function block. Is done. As shown in FIG. 3, the storage device 7 realizes the function of a stack in which function names are recorded in a called order (call order) for each functional block.
Here, the functional block is one or more source code files, and is a set of functions for realizing a specific function.
[0026]
FIGS. 4 to 7 are diagrams cited for explaining the operation of the sequence diagram creating apparatus of the present invention, and include a DB creating unit 2 (FIG. 4), a tracking unit 4 (FIG. 5), and a diagram creating unit 6 (FIG. 6) shows the operation of the file creation unit 11 (FIG. 7), and generally shows the processing procedure of the sequence diagram creation program of the present invention.
FIGS. 8 and 9 show examples of the generated temporary file, and FIGS. 10 and 11 show examples of the output format of the sequence diagram.
Hereinafter, the operation of the embodiment of the present invention shown in FIGS. 1 to 3 will be described in detail with reference to FIGS.
[0027]
First, the creation of a DB by the DB creation unit 2 will be described with reference to the flowchart shown in FIG.
Here, a function block name and a function name are acquired from the source code file 1, and a correspondence DB3 of the function block name and the function name is generated.
That is, the DB creator 2 reads the source code from the source code file 1 and acquires the function names from all the function blocks included in the source code (S401), and the DB whose data structure is shown in FIG. In order to construct the function block, the relation between the function block and the function included therein is written in the database (S402).
[0028]
Next, the creation of the temporary file 5 by the tracking unit 4 will be described with reference to the flowchart shown in FIG.
Here, the tracing unit 4 acquires the function block name and the function name from the DB 3, and creates a temporary file 5 that is aware of the nest and return in the processing flow. That is, the tracking unit 4 outputs a function block name and a function name as parameters by referring to the DB 3 (S501), and opens the corresponding source code file 1 (S502). Then, the source code file 1 is acquired line by line (S504), and it is traced whether or not the function is called.
Here, when it is confirmed that the function is called (S506 Yes), the nest indicating the nested structure is updated by +1 (S507), and the function name is acquired from DB3 (S508). If the function has not been called (No in S506), one more line is acquired from the source code file 1 and the above processing is repeated. If the same function name exists in a plurality of function blocks (S509 Yes), a file name is selected (S510), and a function block name and a function name are acquired from DB3 and recorded in the storage device 7 (S511), and S501. The subsequent processing is repeated.
[0029]
On the other hand, after the function ends (S505 Yes), only the nest at that time is output and updated by -1 (S512, S513), and all the function block names and function names recorded in the storage device 7 are acquired (S514). The source code file 1 corresponding to the function block name and the function name is opened (S502), and the processing from S504 is repeated until there is no untracked source code file (S503 Yes).
[0030]
8 and 9 show examples of generating a temporary file. Here, the function block name mcd and the function outline are described on the first line, and thereafter, the depth of the nest is indicated by a dotted line. Further, a portion described by a black circle (“●”) indicates information added by editing the temporary file 5 generated by the tracking unit 4 using the editor 8.
Although not shown, there is another maximum depth of the nest that is set as a parameter. At this time, the tracking unit 4 sets the maximum depth of the nest for calling and returning of a function whose parameter is set in advance. Monitoring is performed, and only the tracking result within the maximum depth is written in the temporary file 5.
Further, a storage device (stack memory) different from the storage device 7 is provided, and the history of the tracked function is held in the stack memory, and collation is performed each time the tracking is performed. Tracking and writing the result in the temporary file 5 is prohibited. The portions shown as (abbreviated) in the temporary file generation examples shown in FIGS. 8 and 9 correspond to this.
[0031]
Next, creation of a sequence diagram by the diagram creating unit 6 will be described with reference to a flowchart shown in FIG.
Here, the temporary file 5 is obtained, and a sequence diagram is created from the function block name and the nest. That is, first, the temporary file 5 is opened (S601). The diagram creation unit 6 acquires all the function block names recorded in the temporary file 5 (S602), and records the nest previously obtained by the tracking unit 4 in the acquired function block (S603).
Then, as illustrated in the sequence diagram in FIG. 10, the acquired all function block names (mcd / mce / cda / mma / mca / ccu / cdb) are printed on the top (S604), and the temporary file 5 is re-printed. Open (S605).
[0032]
Next, one line is acquired from the temporary file 5 (S606), the function name and the function block name are checked (Yes in S608), and the current function block is recorded in the storage device 7 (S609). An interface (IF) line is indicated by an arrow only when the function block is different from the previous function block (S610 Yes) (S611), and when the same as the previous function block (S610No), the function is placed at a position corresponding to the nest of the previous function block. The name is displayed (S612). Here, the positioning of each functional block in the sequence diagram is performed.
Although the nest structure can be grasped when a temporary file is generated, the function block name may be different even in the same nest. Check the function block name here and display it in any position in the sequence diagram. It is to identify.
[0033]
Furthermore, it is checked whether the specific line acquired from the temporary file 5 is a line with a reduced nest (S613). If the specific line is a line with a reduced nest (Yes in S613), the current functional block is deleted from the storage device 7. (S614).
If the function block is different from the previous function block (S615 Yes), a return line is displayed as an arrow (S616). The above operation is repeated until there are no more lines existing as the temporary file 5 (S607).
Although not shown, the width between the functional blocks of the sequence diagram to be printed can be specified by setting the parameters. At this time, the diagram creating unit 6 sets the function blocks that can be changed according to the depth of the nest. The width between them can be controlled by parameter setting. On the other hand, if no width is specified, printing is performed at the default width.
[0034]
Finally, the flow of temporary file generation by the file creation unit 11 will be described with reference to the flowchart shown in FIG.
Here, the file creator 11 modifies the temporary file 5 in which the tracing result is written by the tracing unit 4 via the editor 8, and a pass function when a program is executed for a certain test case; The test result file 10 in which arguments and the real number of return values are set each time the function is read out is read, and the function name written in the modified file is used as a key, and the test result file 10 is stored in the file. Creates a new temporary file with the given arguments and return value. Then, based on the new temporary file created through the diagram creating unit 6, a sequence diagram is created that expresses the call and return between the function blocks by reflecting the arguments and the real number of the return value.
It is assumed that the expected route is covered in the temporary file 5, a portion corresponding to a path that does not pass under the branch condition is deleted via the editor 8, or in the case of a loop, the number of times is reduced by the number of times. It is assumed that human editing such as adding a function call has been added. Hereinafter, the temporary file 5 is interpreted as having been modified, and the description is continued.
[0035]
First, it is assumed that the temporary file name and the test result file name are set as parameters, and the file creating unit 11 opens the temporary file 5 and the test result file 10 based on the parameters (S701, S702).
Then, one line data is acquired from the temporary file 5 (S703), and the attribute (line type) of the line is checked (S705). Here, if the line is a function line or a return line, one line is obtained from the test result file 10 (S706), and otherwise, the contents of the temporary file 5 are directly output to a new temporary file to be generated (S707). .
[0036]
Further, in the case of a function line (S708 Yes), it is checked whether the function name is the same (S709). If the function name is the same (S709 Yes), the nest, function block name, function name, An argument value is output (S710). On the other hand, if it is a return line (S711 Yes), a nest and a return value are output to a newly created temporary file (S712).
If the content obtained for one line from the test result file 10 is not a function line or a return line, the error type is output to a newly created temporary file (S713), and the newly created temporary file is output. The rest of the file is output (S714). The above operation is repeatedly executed until the last line of the temporary file 5 (S704).
As a result, as shown in FIGS. 10 and 11 as a sequence diagram generation example, the arguments and the return value when the program is actually started are embedded in the IF line or the return line (the IF line and the return line). Can be set as the real number of the argument and the return value), and if the execution route is different from the expected route, key information that indicates that the execution route is different can be displayed as a sequence diagram.
[0037]
As described above, the present invention expresses a sequence of call and return between one or more functional blocks based on a source code, and aims at improving the efficiency of debugging work in a test process. is there.
The procedure executed by each of the DB creator 2, the tracing unit 4, the diagram creator 6, and the file creator 11 shown in FIG. 1 is recorded on a computer-readable recording medium, and the program recorded on the recording medium is recorded. Is loaded into a computer system and executed, thereby realizing the sequence diagram creating apparatus of the present invention.
Here, the computer system includes an OS and hardware such as peripheral devices.
[0038]
The “computer system” also includes a homepage providing environment (or a display environment) if a WWW system is used.
The “computer-readable recording medium” refers to a portable medium such as a flexible disk, a magneto-optical disk, a ROM, and a CD-ROM, and a storage device such as a hard disk built in a computer system. Further, the “computer-readable recording medium” refers to a volatile memory (RAM) inside a computer system which is a system or a client when a program is transmitted through a network such as the Internet or a communication line such as a telephone line. In addition, programs that hold programs for a certain period of time are also included.
[0039]
Further, the above program may be transmitted from a computer system storing the program in a storage device or the like to another computer system via a transmission medium or by a transmission wave in the transmission medium. Here, the “transmission medium” for transmitting a program refers to a medium having a function of transmitting information, such as a network (communication network) such as the Internet or a communication line (communication line) such as a telephone line.
Further, the program may be for realizing a part of the functions described above. Furthermore, what can implement | achieve the function mentioned above in combination with the program already recorded on the computer system, and what is called a difference file (difference program) may be sufficient.
[0040]
As described above, the embodiments of the present invention have been described in detail with reference to the drawings. However, the specific configuration is not limited to the embodiments, and includes a design and the like within a range not departing from the gist of the present invention.
[0041]
【The invention's effect】
As described above, according to the present invention, it is possible to easily grasp the interface between the function and the functional block, and of course, it is possible to grasp the relationship between the function calls for referring to another file from one file. In order to grasp the flow of processing, it is possible to create a sequence diagram capable of grasping the return. Also, information can be added or deleted by editing the file in which the tracking result is written, thereby making it easier to grasp the interface between the functional blocks.
Furthermore, by calling the function name written in the modified file as a key and adding the arguments and the return value in the test result file to the file and generating a temporary file, calls between the function blocks are created. On return, a sequence diagram can be created that reflects the argument and the real number of the return value, which makes it easier to find bugs due to argument or return value errors, and The efficiency of debugging in the process is improved.
[Brief description of the drawings]
FIG. 1 is a block diagram showing the internal configuration of a sequence diagram creating apparatus according to the present invention by developing its functions.
FIG. 2 is a diagram illustrating an example of a data structure of a DB illustrated in FIG. 1;
FIG. 3 is a diagram illustrating an example of a data structure of the storage device illustrated in FIG. 1;
FIG. 4 is a flowchart cited for explaining the operation of the embodiment of the present invention.
FIG. 5 is a flowchart cited for explaining the operation of the embodiment of the present invention.
FIG. 6 is a flowchart cited for explaining the operation of the embodiment of the present invention.
FIG. 7 is a flowchart cited for explaining the operation of the embodiment of the present invention.
FIG. 8 is a diagram showing an example of a temporary file generated according to the present invention.
FIG. 9 is a diagram showing an example of a temporary file generated according to the present invention.
FIG. 10 is a diagram showing an example of a sequence diagram generated by the present invention.
FIG. 11 is a diagram showing an example of a sequence diagram generated by the present invention.
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 1 ... Source code file, 2 ... DB creation part, 3 ... Database (DB), 4 ... Tracking part, 5 ... Temporary file, 6 ... Drawing creation part, 7 ... Storage device, 8 ... Editor, 9 ... Correction file, 10 ... Test result file, 11 ... File creation unit

Claims (12)

ソースコードを基に単数または複数からなる機能ブロック間の呼び出しおよび戻りのシーケンスを表現するシーケンス図を作成するシーケンス図作成装置であって、
前記ソースコードを読み取り、当該ソースコードに含まれる機能ブロックと関数との関係をデータベースに書き込むデータベース作成手段と、
前記ソースコードを読み取り、当該ソースコードに含まれる関数の呼び出しおよび戻りを追跡すると共に、前記データベースを参照して前記関数に関係する機能ブロックの情報を含む形で前記追跡結果をファイルに書きこむ追跡手段と、
前記ファイルに基づき、前記機能ブロック間の呼び出しおよび戻りを表現するシーケンス図を作成する図作成手段と、
を備えることを特徴とするシーケンス図作成装置。
A sequence diagram creating apparatus for creating a sequence diagram expressing a sequence of call and return between one or more functional blocks based on a source code,
A database creation unit that reads the source code and writes a relationship between a function block and a function included in the source code to a database;
A trace that reads the source code, traces calls and returns of functions included in the source code, and writes the trace result to a file by referring to the database and including information on functional blocks related to the function. Means,
Figure creating means for creating a sequence diagram expressing calls and returns between the functional blocks based on the file,
A sequence diagram creating apparatus comprising:
前記呼び出される関数の情報を呼び出された順番に記憶する記憶装置を備え、
前記追跡手段は、前記関数が呼び出されるコードを検出したときに、当該関数の情報を前記記憶装置に追加して書き込み、前記関数から戻るコードを検出したときに当該関数の情報を前記記憶装置から削除すること、
を特徴とする請求項1に記載のシーケンス図作成装置。
A storage device that stores the information of the called function in the order in which it is called,
The tracking means, when detecting a code that calls the function, adds and writes information of the function to the storage device, and when detecting a code returning from the function, outputs the information of the function from the storage device. To delete,
The sequence diagram creation device according to claim 1, wherein:
前記追跡手段は、
あらかじめ設定される前記関数の呼び出しおよび戻りに関するネストの最大深さを監視し、当該最大深さ内における追跡結果を前記ファイルに書きこむことを特徴とする請求項1または2に記載のシーケンス図作成装置。
The tracking means,
3. The sequence diagram creation according to claim 1, wherein a maximum depth of nesting related to call and return of the function set in advance is monitored, and a tracking result within the maximum depth is written in the file. apparatus.
前記追跡手段は、
前記追跡した関数の履歴を保持し、一度追跡した関数が再現したときに再度追跡して前記ファイルに書きこむことを禁止することを特徴とする請求項1〜3のいずれか1項に記載のシーケンス図作成装置。
The tracking means,
4. The method according to claim 1, wherein a history of the tracked function is retained, and when the tracked function is reproduced, the function is prohibited from being tracked again and written into the file. 5. Sequence diagram creation device.
前記図作成手段は、
ネストの深さによって可変となる機能ブロック間の幅を、あらかじめ設定される機能ブロック間の幅の指定によりコントロールすることを特徴とする請求項1に記載のシーケンス図作成装置。
The diagram creating means,
2. The sequence diagram creating apparatus according to claim 1, wherein the width between the function blocks, which is variable according to the depth of the nest, is controlled by designating a predetermined width between the function blocks.
前記追跡手段により追跡結果が書き込まれたファイルに修正を施したファイルと、ある試験ケースについてプログラムを実行したときの通過関数、および当該関数が読み出される毎に引数と戻り値の実数が設定される試験結果ファイルを読み込み、前記修正を施したファイルに書き込まれた関数名をキーに当該ファイルの中に、前記試験結果ファイルの中の引き数と戻り値を付与して新規ファイルを生成するファイル作成手段を備え、
前記新規ファイルに基づき、前記機能ブロック間の呼び出しおよび戻りに前記引き数と戻り値の実数を反映させて表現するシーケンス図を作成することを特徴とする請求項1に記載のシーケンス図作成装置。
A file obtained by modifying the file in which the tracking result is written by the tracking means, a passing function when a program is executed for a certain test case, and real numbers of arguments and return values are set each time the function is read. Create a file that reads a test result file and adds the arguments and return value in the test result file to the file with the function name written in the modified file as a key and creates a new file With means,
2. The sequence diagram creating apparatus according to claim 1, wherein a sequence diagram is created based on the new file, the sequence diagram expressing calls and returns between the function blocks by reflecting the real numbers of the arguments and return values. 3.
ソースコードを基に単数または複数からなる機能ブロック間の呼び出しおよび戻りのシーケンスを表現するシーケンス図を作成するシーケンス図作成方法であって、
前記ソースコードを読み取り、当該ソースコードに含まれる機能ブロックと関数との関係をデータベースに書き込み、
前記ソースコードを読み取り、当該ソースコードに含まれる関数の呼び出しおよび戻りを追跡すると共に、前記データベースを参照して前記関数に関係する機能ブロックの情報を含む形で前記追跡結果をファイルに書き込み、
前記ファイルに基づき、前記機能ブロック間の呼び出しおよび戻りを表現するシーケンス図を作成すること、
を特徴とするシーケンス図作成方法。
A sequence diagram creation method for creating a sequence diagram expressing a call and return sequence between one or more functional blocks based on a source code,
Reading the source code, writing the relationship between the function blocks and functions included in the source code to a database,
Reading the source code, tracing calls and returns of functions included in the source code, and writing the tracing result to a file in a form including information on functional blocks related to the functions with reference to the database;
Creating a sequence diagram representing calls and returns between the functional blocks based on the file;
A sequence diagram creation method characterized by the following.
前記追跡結果が書き込まれたファイルに修正を施したファイルと、ある試験ケースについてプログラムを実行したときの通過関数、および当該関数が読み出される毎に引数と戻り値の実数が設定される試験結果ファイルを読み込み、前記修正を施したファイルに書き込まれた関数名をキーに当該ファイルの中に、前記試験結果ファイルの中の引き数と戻り値を付与して新規ファイルを作成し、
前記作成された新規ファイルに基づき、前記機能ブロック間の呼び出しおよび戻りに前記引き数と戻り値の実数を反映させて表現するシーケンス図を作成すること、
を特徴とする請求項7に記載のシーケンス図作成方法。
A file obtained by modifying the file in which the trace result is written, a pass function when a program is executed for a certain test case, and a test result file in which real numbers of arguments and return values are set each time the function is read. Read, and in the file with the function name written in the modified file as a key, add an argument and a return value in the test result file to create a new file,
Based on the created new file, to create a sequence diagram to represent the call and return between the functional blocks to reflect the real number of the argument and return value,
The sequence diagram creation method according to claim 7, wherein:
ソースコードを基に単数または複数からなる機能ブロック間の呼び出しおよび戻りのシーケンスを表現するシーケンス図を作成するシーケンス図作成装置に用いられるシーケンス図作成プログラムであって、
前記ソースコードを読み取り、当該ソースコードに含まれる機能ブロックと関数との関係をデータベースに書き込むステップと、
前記ソースコードを読み取り、当該ソースコードに含まれる関数の呼び出しおよび戻りを追跡すると共に、前記データベースを参照して前記関数に関係する機能ブロックの情報を含む形で前記追跡結果をファイルに書き込むステップと、
前記ファイルに基づき、前記機能ブロック間の呼び出しおよび戻りを表現するシーケンス図を作成するステップと、
をコンピュータに実行させるシーケンス図作成プログラム。
A sequence diagram creation program used for a sequence diagram creation device that creates a sequence diagram expressing a call and return sequence between one or more functional blocks based on a source code,
Reading the source code and writing the relationship between the function blocks and the functions included in the source code to a database;
Reading the source code, tracing calls and returns of functions included in the source code, and writing the tracing result to a file in a form including information of functional blocks related to the function with reference to the database; ,
Creating a sequence diagram representing calls and returns between the functional blocks based on the file;
Diagram creation program that causes a computer to execute.
前記追跡結果が書き込まれたファイルに修正を施したファイルと、ある試験ケースについてプログラムを実行したときの通過関数、および当該関数が読み出される毎に引数と戻り値の実数が設定される試験結果ファイルを読み込み、前記修正を施したファイルに書き込まれた関数名をキーに当該ファイルの中に、前記試験結果ファイルの中の引き数と戻り値を付与して新規ファイルを作成するステップと、
前記作成された新規ファイルに基づき、前記機能ブロック間の呼び出しおよび戻りに前記引き数と戻り値の実数を反映させて表現するシーケンス図を作成するステップと、
をコンピュータに実行させる請求項9に記載のシーケンス図作成プログラム。
A file obtained by modifying the file in which the trace result is written, a pass function when a program is executed for a certain test case, and a test result file in which real numbers of arguments and return values are set each time the function is read. Reading, and creating a new file by giving the arguments and return values in the test result file in the file with the function name written in the modified file as a key,
Based on the created new file, creating a sequence diagram to represent the call and return between the function blocks to reflect the real number of the argument and return value,
10. The sequence diagram creation program according to claim 9, which causes a computer to execute the program.
ソースコードを基に単数または複数からなる機能ブロック間の呼び出しおよび戻りのシーケンスを表現するシーケンス図を作成するシーケンス図作成装置に用いられるシーケンス図作成プログラムを記録したコンピュータ読み取り可能な記録媒体であって、
前記ソースコードを読み取り、当該ソースコードに含まれる機能ブロックと関数との関係をデータベースに書き込むステップと、
前記ソースコードを読み取り、当該ソースコードに含まれる関数の呼び出しおよび戻りを追跡すると共に、前記データベースを参照して前記関数に関係する機能ブロックの情報を含む形で前記追跡結果をファイルに書き込むステップと、
前記ファイルに基づき、前記機能ブロック間の呼び出しおよび戻りを表現するシーケンス図を作成するステップと、
をコンピュータに実行させるシーケンス図作成プログラムを記録した記録媒体。
A computer-readable recording medium that records a sequence diagram creation program used in a sequence diagram creation device that creates a sequence diagram expressing a call and return sequence between one or more functional blocks based on a source code. ,
Reading the source code and writing the relationship between the function blocks and the functions included in the source code to a database;
Reading the source code, tracing calls and returns of functions included in the source code, and writing the tracing result to a file in a form including information of functional blocks related to the function with reference to the database; ,
Creating a sequence diagram representing calls and returns between the functional blocks based on the file;
Recording a sequence diagram creation program for causing a computer to execute the program.
前記追跡結果が書き込まれたファイルに修正を施したファイルと、ある試験ケースについてプログラムを実行したときの通過関数、および当該関数が読み出される毎に引数と戻り値の実数が設定される試験ファイルを読み込み、前記修正を施したファイルに書き込まれた関数名をキーに当該ファイルの中に、前記試験ファイルの中の引き数と戻り値を付与して新規ファイルを作成するステップと、
前記作成された新規ファイルに基づき、前記機能ブロック間の呼び出しおよび戻りに前記引き数と戻り値の実数を反映させて表現するシーケンス図を作成するステップと、
をコンピュータに実行させるシーケンス図作成プログラムを記録した請求項11に記載の記録媒体。
A file obtained by modifying the file in which the trace result is written, a pass function when a program is executed for a certain test case, and a test file in which arguments and real numbers of return values are set each time the function is read out. Reading and adding a function and a return value in the test file in the file with the function name written in the modified file as a key, and creating a new file;
Based on the created new file, creating a sequence diagram to represent the call and return between the function blocks to reflect the real number of the argument and return value,
12. The recording medium according to claim 11, wherein a sequence diagram creation program for causing a computer to execute the program is recorded.
JP2002253384A 2002-08-30 2002-08-30 Sequence diagram preparing device, and method therefor, sequence diagram preparing program, and recording medium therefor Pending JP2004094496A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002253384A JP2004094496A (en) 2002-08-30 2002-08-30 Sequence diagram preparing device, and method therefor, sequence diagram preparing program, and recording medium therefor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002253384A JP2004094496A (en) 2002-08-30 2002-08-30 Sequence diagram preparing device, and method therefor, sequence diagram preparing program, and recording medium therefor

Publications (1)

Publication Number Publication Date
JP2004094496A true JP2004094496A (en) 2004-03-25

Family

ID=32059398

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002253384A Pending JP2004094496A (en) 2002-08-30 2002-08-30 Sequence diagram preparing device, and method therefor, sequence diagram preparing program, and recording medium therefor

Country Status (1)

Country Link
JP (1) JP2004094496A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2423387A (en) * 2005-01-19 2006-08-23 Agilent Technologies Inc Application-Generic Sequence Diagram Generator Driven by a Non-Proprietary Language
JP2008234271A (en) * 2007-03-20 2008-10-02 Hitachi Software Eng Co Ltd Aspect setting method, device, and computer program
US8423985B2 (en) 2008-06-06 2013-04-16 International Business Machines Corporation System, method and computer program for generating sequence diagram
JP2017097700A (en) * 2015-11-26 2017-06-01 日本電信電話株式会社 Communication feature extraction device, packet classification device, communication feature extraction method, packet classification method, and program
CN111506402A (en) * 2020-03-31 2020-08-07 上海氪信信息技术有限公司 Computer task scheduling method, device, equipment and medium for machine learning modeling

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2423387A (en) * 2005-01-19 2006-08-23 Agilent Technologies Inc Application-Generic Sequence Diagram Generator Driven by a Non-Proprietary Language
US7849439B2 (en) 2005-01-19 2010-12-07 Ixia Application-generic sequence diagram generator driven by a non-proprietary language
JP2008234271A (en) * 2007-03-20 2008-10-02 Hitachi Software Eng Co Ltd Aspect setting method, device, and computer program
US8423985B2 (en) 2008-06-06 2013-04-16 International Business Machines Corporation System, method and computer program for generating sequence diagram
JP2017097700A (en) * 2015-11-26 2017-06-01 日本電信電話株式会社 Communication feature extraction device, packet classification device, communication feature extraction method, packet classification method, and program
CN111506402A (en) * 2020-03-31 2020-08-07 上海氪信信息技术有限公司 Computer task scheduling method, device, equipment and medium for machine learning modeling
CN111506402B (en) * 2020-03-31 2023-06-27 上海氪信信息技术有限公司 Computer task scheduling method, device, equipment and medium for machine learning modeling

Similar Documents

Publication Publication Date Title
US8095636B2 (en) Process, system and program product for executing test scripts against multiple systems
US8126716B2 (en) Method and system for collecting audio prompts in a dynamically generated voice application
US20080046868A1 (en) Method and system for template-based code generation
CN107678750A (en) A kind of SDK packaging methods, computing device and SDK packaging systems
WO2007011942A1 (en) System and method for automatic or semi-automatic software integration
JP2023072025A5 (en) Information processing system, electronic device, information processing method, and computer program
JP2009525533A (en) XNA relationship management
JP2007257629A (en) System and method for merging sub-document into collaboratively authored master document
JP2582433B2 (en) File editing method using edit tracking file
JP2009187285A (en) Program conversion method, program conversion device and program
JP2004094496A (en) Sequence diagram preparing device, and method therefor, sequence diagram preparing program, and recording medium therefor
US20110078656A1 (en) Code Edit Apparatus and Recording Medium
CN112596706A (en) Patterned code generation method, device and computer readable storage medium
CN114416840A (en) Data acquisition method and device combining RPA and AI, server and storage medium
TWI435319B (en) Automatic voice signal and mute signal processing device and method therefor
KR20180091519A (en) Apparatus for vr content authoring for vr experience and method using the same
JP2004128724A (en) Media editor, media editing method, media editing program, and recording medium
JPH09168009A (en) Network operation information setting system
JP6965480B1 (en) Data management equipment, data management methods and programs
TWI774469B (en) Management system for program compilation and method for operating the system
CN111670091B (en) Robot program instruction compiling method, robot control system and storage device
CN109933576B (en) Sound effect SDK library establishing method and device, electronic equipment and computer readable medium
Sjölander Recent developments regarding the WaveSurfer speech tool
CN110377326A (en) Installation kit generation method, device, development equipment and computer-readable medium
JP3823464B2 (en) Data processing apparatus and method including time series event data, recording medium on which time series event data processing program is recorded, and recording medium on which data including time series event data is recorded

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20050808

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050816

A02 Decision of refusal

Effective date: 20051213

Free format text: JAPANESE INTERMEDIATE CODE: A02