JP2012194748A - Configuration report generation device, program and recording medium - Google Patents
Configuration report generation device, program and recording medium Download PDFInfo
- Publication number
- JP2012194748A JP2012194748A JP2011057840A JP2011057840A JP2012194748A JP 2012194748 A JP2012194748 A JP 2012194748A JP 2011057840 A JP2011057840 A JP 2011057840A JP 2011057840 A JP2011057840 A JP 2011057840A JP 2012194748 A JP2012194748 A JP 2012194748A
- Authority
- JP
- Japan
- Prior art keywords
- configuration
- configuration item
- source code
- program
- node
- 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.)
- Withdrawn
Links
Images
Landscapes
- Stored Programmes (AREA)
Abstract
Description
本発明は、ソフトウエアの構造を解析してコンフィグレーション項目に関するレポートを作成するコンフィグレーションレポート作成装置、及びこれを実現するためのコンピュータ読み取り可能なプログラム並びに記憶媒体に関する。 The present invention relates to a configuration report creation device that analyzes a structure of software and creates a report related to configuration items, and a computer-readable program and a storage medium for realizing the configuration report creation device.
コンピュータにより実行されるプログラムを開発する現場では、C言語等のヒューマン・リーダブルな言語で記述されたソースファイル及びヘッダファイルに対して、プリプロセス、コンパイル、リンク等の処理を行って、コンピュータにより直接実行可能な機械語に変換する処理が行われている。 In the field of developing a program to be executed by a computer, the source file and header file described in a human readable language such as C language are preprocessed, compiled, linked and directly processed by the computer. Processing to convert into executable machine language is performed.
特許文献1には、ソースプログラムに対して自動最適化を実行し、オブジェクトプログラムを生成するコンパイルシステムについて記載されている。
ところで、ソースファイルやヘッダファイルには、数値、文字列その他のデータ構造を代入可能なコンフィグレーション項目が存在する。このコンフィグレーション項目は、デバッグやシミュレーションをする上で重要な要素であり、プログラム開発の現場では、コンフィグレーション項目間の関係やコンフィグレーション項目と関数の関係を認識する必要性が高い。 By the way, in the source file and the header file, there are configuration items that can be substituted with numerical values, character strings, and other data structures. This configuration item is an important element for debugging and simulation, and it is highly necessary to recognize the relationship between configuration items and the relationship between configuration items and functions in the field of program development.
従来は、このようなコンフィグレーション項目に関する情報を得るために、人がソースコードに対してOS(オペレーティングシステム)のコマンドを用いて調査を行っていた。 Conventionally, in order to obtain information on such configuration items, a person has investigated the source code using an OS (operating system) command.
しかしながら、特に大規模なプログラムでは、コンフィグレーション項目が多くなり、これらと関数との関係が入り組んだものとなる。これを人がOSのコマンドを用いて調査した場合、長い時間を要することが多く、また誤認を生じる可能性も高いものとなる。 However, especially in a large-scale program, there are many configuration items, and the relationship between these and functions is complicated. When a person investigates this using an OS command, it often takes a long time and the possibility of misidentification is high.
本発明はこのような課題を解決するためのものであり、コンフィグレーション項目の解析を自動的に行い、ソフトウエア開発を容易にすることが可能なコンフィグレーションレポート作成装置、及びこれを実現するためのプログラムを提供することを、主たる目的とする。 The present invention is to solve such problems, and a configuration report creation apparatus capable of automatically analyzing software configuration items and facilitating software development, and to realize this. The main purpose is to provide this program.
上記目的を達成するための本発明の第1の態様は、
ソフトウエアの構造を解析して、該ソフトウエアのソースプログラム中に現れ、数値、文字列その他のデータ構造を代入可能なコンフィグレーション項目に関するレポートを作成するコンフィグレーションレポート作成装置であって、
前記ソフトウエアのコンフィグレーション項目消去前のソースコードを取得するソースコード取得手段と、
該ソースコード取得手段により取得されたコンフィグレーション項目消去前のソースコードを解析して、少なくとも前記コンフィグレーション項目と、関数その他のプログラム要素との関係を認識可能なデータを出力するコンフィグレーション項目解析手段と、
前記コンフィグレーション項目解析手段の出力に基づいて、少なくとも前記コンフィグレーション項目と、関数その他のプログラム要素との関係を記述したレポートを作成するレポート作成手段と、
を備えるコンフィグレーションレポート作成装置である。
In order to achieve the above object, the first aspect of the present invention provides:
A configuration report creation device that analyzes a software structure and creates a report on a configuration item that appears in a source program of the software and can be substituted with a numerical value, a character string, and other data structures,
Source code acquisition means for acquiring source code before erasing configuration items of the software;
Configuration item analysis means for analyzing the source code before erasing the configuration item acquired by the source code acquisition means and outputting at least data capable of recognizing the relationship between the configuration item and a function or other program element When,
Based on the output of the configuration item analysis means, a report creation means for creating a report describing at least the relationship between the configuration items and functions and other program elements;
A configuration report creation device comprising:
この本発明の第1の態様によれば、コンフィグレーション項目消去前のソースコードを解析して、少なくともコンフィグレーション項目と、関数その他のプログラム要素との関係を認識可能なデータを出力するコンフィグレーション項目解析手段を備え、その出力に基づいてレポートを作成するため、コンフィグレーション項目の解析を自動的に行い、ソフトウエア開発を容易にすることができる。 According to the first aspect of the present invention, the configuration item that analyzes the source code before erasing the configuration item and outputs data that can recognize at least the relationship between the configuration item and the function or other program elements. Since an analysis means is provided and a report is created based on the output, configuration items can be automatically analyzed to facilitate software development.
本発明の第1の態様において、
前記コンフィグレーション項目解析手段は、前記ソースコード取得手段により取得されたコンフィグレーション項目消去前のソースコードを解析して、前記コンフィグレーション項目を含むプログラム要素を複数のノードとし、該複数のノードが連結されたツリー状のデータ構造を出力する手段であるものとしてもよい。
In the first aspect of the present invention,
The configuration item analysis means analyzes the source code before erasing the configuration item acquired by the source code acquisition means, and sets the program element including the configuration item as a plurality of nodes, and the plurality of nodes are connected. It may be a means for outputting the arranged tree-like data structure.
この場合、
前記コンフィグレーション項目解析手段は、前記コンフィグレーション項目消去前のソースコードにおける「#ifdef」、「#endif」、「#else」の存在に基づいて、前記ツリー状のデータ構造における分岐箇所、及び合流箇所を決定する手段であるものとしてもよい。
in this case,
The configuration item analysis means, based on the presence of “#ifdef”, “#endif”, “#else” in the source code before erasing the configuration item, branch points in the tree-like data structure, and merge It may be a means for determining a location.
また、本発明の第1の態様において、
前記ソースコード取得手段は、前記ソフトウエアを構成するソースファイルとヘッダファイルが入力されると、該ソースファイルとヘッダファイル内で定義されたインクルード関係のみを解釈して前記コンフィグレーション項目消去前のソースコードを取得する手段であるものとしてもよい。
In the first aspect of the present invention,
When the source file and the header file constituting the software are input, the source code acquisition means interprets only the include relation defined in the source file and the header file, and the source before the configuration item is deleted. It may be a means for acquiring a code.
本発明の第2の態様は、
コンピュータを、ソフトウエアの構造を解析して、該ソフトウエアのソースプログラム中に現れ、数値、文字列その他のデータ構造を代入可能なコンフィグレーション項目に関するレポートを作成するコンフィグレーションレポート作成装置として機能させるためのコンピュータ読み取り可能なプログラムであって、
該コンピュータを、
前記ソフトウエアのコンフィグレーション項目消去前のソースコードを取得するソースコード取得手段と、
該ソースコード取得手段により取得されたコンフィグレーション項目消去前のソースコードを解析して、少なくとも前記コンフィグレーション項目と、関数その他のプログラム要素との関係を認識可能なデータを出力するコンフィグレーション項目解析手段と、
前記コンフィグレーション項目解析手段の出力に基づいて、少なくとも前記コンフィグレーション項目と、関数その他のプログラム要素との関係を記述したレポートを作成するレポート作成手段と、
として機能させるためのコンピュータ読み取り可能なプログラムである。
The second aspect of the present invention is:
Analyzing the software structure and causing the computer to function as a configuration report creation device that creates reports on configuration items that appear in the software source program and that can be substituted with numerical data, character strings, and other data structures A computer readable program for
The computer
Source code acquisition means for acquiring source code before erasing configuration items of the software;
Configuration item analysis means for analyzing the source code before erasing the configuration item acquired by the source code acquisition means and outputting at least data capable of recognizing the relationship between the configuration item and a function or other program element When,
Based on the output of the configuration item analysis means, a report creation means for creating a report describing at least the relationship between the configuration items and functions and other program elements;
It is a computer readable program for making it function as.
この本発明の第2の態様によれば、コンフィグレーション項目消去前のソースコードを解析して、少なくともコンフィグレーション項目と、関数その他のプログラム要素との関係を認識可能なデータを出力するコンフィグレーション項目解析手段を備え、その出力に基づいてレポートを作成する装置としてコンピュータを機能させるため、コンフィグレーション項目の解析を自動的に行い、ソフトウエア開発を容易にすることができる。 According to the second aspect of the present invention, the configuration item that analyzes the source code before erasing the configuration item and outputs at least data that can recognize the relationship between the configuration item and the function or other program elements. Since the computer is functioned as an apparatus for generating a report based on the output of the analysis means, it is possible to automatically analyze the configuration items and facilitate software development.
本発明の第2の態様において、
前記コンフィグレーション項目解析手段は、前記ソースコード取得手段により取得されたコンフィグレーション項目消去前のソースコードを解析して、前記コンフィグレーション項目を含むプログラム要素を複数のノードとし、該複数のノードが連結されたツリー状のデータ構造を出力する手段であるものとしてもよい。
In a second aspect of the invention,
The configuration item analysis means analyzes the source code before erasing the configuration item acquired by the source code acquisition means, and sets the program element including the configuration item as a plurality of nodes, and the plurality of nodes are connected. It may be a means for outputting the arranged tree-like data structure.
この場合、
前記コンフィグレーション項目解析手段は、前記コンフィグレーション項目消去前のソースコードにおける「#ifdef」、「#endif」、「#else」の存在に基づいて、前記ツリー状のデータ構造における分岐箇所、及び合流箇所を決定する手段であるものとしてもよい。
in this case,
The configuration item analysis means, based on the presence of “#ifdef”, “#endif”, “#else” in the source code before erasing the configuration item, branch points in the tree-like data structure, and merge It may be a means for determining a location.
また、本発明の第2の態様において、
前記ソースコード取得手段は、前記ソフトウエアを構成するソースファイルとヘッダファイルが入力されると、該ソースファイルとヘッダファイル内で定義されたインクルード関係のみを解釈して前記コンフィグレーション項目消去前のソースコードを取得する手段であるものとしてもよい。
In the second aspect of the present invention,
When the source file and the header file constituting the software are input, the source code acquisition means interprets only the include relation defined in the source file and the header file, and the source before the configuration item is deleted. It may be a means for acquiring a code.
本発明の第3の態様は、
本発明の第2の態様のプログラムが格納された、コンピュータによってデータ読み取り可能な記憶媒体である。
The third aspect of the present invention is:
A computer-readable storage medium storing a program according to the second aspect of the present invention.
本発明によれば、コンフィグレーション項目の解析を自動的に行い、ソフトウエア開発を容易にすることが可能なコンフィグレーションレポート作成装置、及びこれを実現するためのプログラムを提供することができる。 According to the present invention, it is possible to provide a configuration report creation apparatus capable of automatically analyzing configuration items and facilitating software development, and a program for realizing the configuration report creation apparatus.
以下、本発明を実施するための形態について、添付図面を参照しながら実施例を挙げて説明する。 DESCRIPTION OF EMBODIMENTS Hereinafter, embodiments for carrying out the present invention will be described with reference to the accompanying drawings.
以下、図面を参照し、本発明の一実施例に係るコンフィグレーションレポート作成装置1について説明する。
Hereinafter, a configuration
[構成]
図1は、本発明の一実施例に係るコンフィグレーションレポート作成装置1のシステム構成例である。コンフィグレーションレポート作成装置1は、図示しないCPUを中心として構成され、RAM10やプログラムメモリ20を含む各種記憶装置、入力ポート30、タイマ、その他の構成要素を含んでいる。
[Constitution]
FIG. 1 is a system configuration example of a configuration
RAM10は、ワーキングメモリとして機能する。プログラムメモリ20は、例えばROM(Read Only Memory)やEEPROM(Electrically Erasable and Programmable Read Only Memory)であり、CPUが実行するプログラム22を格納している。
The
本実施例に係るコンフィグレーションレポート作成装置1は、プログラムメモリ20からプログラム22に含まれる各命令がフェッチされてデコード及び実行されることにより実現される機能ブロックとして、プリプロセッサ部40と、コンフィグレーション項目解析部50と、レポート作成部60と、を備える。
The configuration
入力ポート30には、外部記憶装置等から、レポート作成対象であるソフトウエア70のソースファイル72及びヘッダファイル74が入力される。入力されたソースファイル72及びヘッダファイル74は、プリプロセッサ部40に出力される。
A
ソースファイル72は、例えばC言語やC++言語における各種命令・関数を記述したファイルである。ヘッダファイル74は、関数プロトタイプ、グローバル変数の宣言、記号定数等を記述している。ソースファイル72は、ヘッダファイル74が記述する内容のうち、必要なものを「#include」命令によってインクルード(その場に内容を展開)する。
The
プリプロセッサ部40は、ソースファイル72とヘッダファイル74が入力されると、ソースファイル72とヘッダファイル74内で定義されたインクルード関係のみを解釈し、ソフトウエア70のコンフィグレーション項目消去前のソースコードを取得してコンフィグレーション項目解析部50に出力する(なお、「出力する」とは便宜的な表現であり、コンフィグレーション項目消去前のソースコードがRAM10に格納され、これをコンフィグレーション項目解析部50が利用するという態様であってもよい)。
When the
ここで、一般的なプリプロセスでは、インクルードによってヘッダファイル74の内容が展開されるだけでなく、コンフィグレーション項目の定義の有無に基づく条件式が消去される等の処理が行われるが、本実施例におけるプリプロセッサ40は、係るプリプロセスの一部を実行する(或いは、プリプロセスの結果として得られた依存関係を出力する)ものとする。
Here, in a general preprocess, not only the contents of the
コンフィグレーション項目解析部50は、プリプロセッサ部40から入力されたコンフィグレーション項目消去前のソースコードにおける、コンフィグレーション項目同士の関係やコンフィグレーション項目と関数の関係、コンフィグレーション項目とファイルの関係等を解析し、解析結果をRAM10上に構築されたコンフィグデータベース12に格納する。詳細については後述する。
The configuration
レポート作成部60は、コンフィグデータベース12に格納されたデータに基づき、所望の形式でコンフィグレーションレポートを作成して出力する。コンフィグレーションレポートは、表示装置により表示されてもよいし、紙或いは記憶装置等の媒体に出力されてもよい。
The
[解析処理]
以下、コンフィグレーション項目解析部50による解析処理及びその前後の処理について説明する。図2及び図3は、コンフィグレーション項目解析部50による解析処理及びその前後の処理の流れを示すフローチャートである。
[Analysis processing]
Hereinafter, the analysis process by the configuration
まず、コンフィグレーション項目解析部50は、RAM10の必要な領域に記憶された内容を消去し、startノードを作成する等の初期化処理を行う(S100)。
First, the configuration
次に、RAM10から一行分の命令を読み込み(S102)、解析処理を行う(S200〜S218)。 Next, an instruction for one line is read from the RAM 10 (S102), and analysis processing is performed (S200 to S218).
当該命令の解析処理を行うと、解析を行った命令が最終行の命令であるか否かを判定し(S104)、最終行の命令であれば終了処理を行い(S106)、最終行の命令でなければ対象命令を一行進めて(S108)、再度S102以下の処理を実行する。 When the analysis process of the instruction is performed, it is determined whether or not the analyzed instruction is the instruction on the last line (S104). If the instruction is on the last line, the termination process is performed (S106). If not, the target instruction is advanced by one line (S108), and the processing from S102 onward is executed again.
以下、解析処理について説明する。 Hereinafter, the analysis process will be described.
まず、コンフィグレーション項目解析部50は、読み込んだ命令内に「#else」が存在するか否かを判定する(S200)。「#else」が存在する場合は、次に追加するノードの位置を、コンフィグレーション終端ノードがリンクされていない直近に設定したコンフィグレーション開始ノードの下に移動する(S202)。なお、係るノード追加位置の移動は、次回のルーチンで追加されるノードについて一回のみ適用され、それ以降のノード追加、及び最初に「#else」が出現するまでの間のノード追加については、前回ルーチンで追加されたノードの直下に追加されるものとする。
First, the configuration
本実施例において、「ノード」とは、コンフィグレーション項目解析部50が生成するツリー状のデータ構造における、分岐点その他の基準点をいう。後に説明するが、コンフィグレーション項目解析部50は、ラベル、属性(サブルーチン、関数等)、上位ノード、下位ノード等が特定されたノード情報を複数生成することにより、ノードがツリー状に連結されたデータ構造を生成する。
In this embodiment, “node” refers to a branch point or other reference point in the tree-like data structure generated by the configuration
コンフィグレーション項目解析部50は、読み込んだ命令内に「#else」が存在しない場合は、読み込んだ命令内に関数定義が存在するか否かを判定する(S204)。関数定義が存在する場合は、関数ノード(属性として関数が付与されたノード;以下同様に解釈する)を追加する(S206)。
When “#else” does not exist in the read instruction, the configuration
コンフィグレーション項目解析部50は、読み込んだ命令内に関数定義が存在しない場合は、読み込んだ命令内にサブルーチンが存在するか否かを判定する(S208)。サブルーチンが存在する場合は、サブルーチンノードを追加する(S210)。
When the function definition does not exist in the read instruction, the configuration
コンフィグレーション項目解析部50は、読み込んだ命令内にサブルーチンが存在しない場合は、読み込んだ命令内に「#ifdef」が存在するか否かを判定する(S212)。「#ifdef」が存在する場合は、コンフィグレーション開始ノードを追加する(S214)。
When there is no subroutine in the read instruction, the configuration
コンフィグレーション項目解析部50は、読み込んだ命令内に「#ifdef」が存在しない場合は、読み込んだ命令内に「#endif」が存在するか否かを判定する(S216)。「#endif」が存在する場合は、直近で追加したノードの下にコンフィグレーション終端ノードを追加すると共に、関連するノード全てとのリンクを設定する(S218)。
When “#ifdef” does not exist in the read instruction, the configuration
コンフィグレーション項目解析部50は、「#endif」が存在しない場合は、何も処理を行わずに図3のフローを終了する。
If “#endif” does not exist, the configuration
[具体的処理例]
ここで、図2、3で示したフローを用いて解析処理を行った場合の具体的処理例について説明する。
[Specific processing example]
Here, a specific processing example when the analysis processing is performed using the flows shown in FIGS.
図4は、本実施例に係るプリプロセッサ部40の出力イメージである。以下、図4に示すコンフィグレーション項目消去前のソースコードに対して図2、3のフローを適用した場合の結果について順次説明する。図5〜図8は、コンフィグレーション項目解析部50がノードを追加等する様子を模式的に示すイメージ図である。
FIG. 4 is an output image of the
図5(A)は、コンフィグレーション項目解析部50がstartノードを作成した様子を模式的に示すイメージ図である。
FIG. 5A is an image diagram schematically illustrating a state in which the configuration
図5(B)は、コンフィグレーション項目解析部50が行番号100を読み込んだ後にノードを作成する様子を模式的に示すイメージ図である。図示するように、行番号100では関数Func1が定義されているため、startノードの下に関数ノードFunc1を追加する。
FIG. 5B is an image diagram schematically showing how a node is created after the configuration
当該ノードには、[ラベルとしてのファイル名(Func1)、行番号(100)、属性(関数)、上位ノード(startノード)、下位ノード(現時点では不明)]等の情報が付与される。 Information such as [file name as a label (Func1), line number (100), attribute (function), upper node (start node), lower node (unknown at this time)] is given to the node.
図5(C)は、コンフィグレーション項目解析部50が行番号102を読み込んだ後にノードを作成する様子を模式的に示すイメージ図である。図示するように、行番号102ではサブルーチンfsub1を呼び出しているため、関数ノードFunc1の下にサブルーチンノードfsub1を追加する。
FIG. 5C is an image diagram schematically showing how a node is created after the configuration
当該ノードには、[ラベルとしてのファイル名(fsub1)、行番号(102)、属性(サブルーチン)、上位ノード(関数ノードFunc1)、下位ノード(現時点では不明)]等の情報が付与される。また、サブルーチンノードfsub1の追加に伴い、関数ノードFunc1の「下位ノード」にサブルーチンノードfsub1が追加される。 Information such as [file name as label (fsub1), line number (102), attribute (subroutine), upper node (function node Func1), lower node (unknown at this time)] is assigned to the node. Further, with the addition of the subroutine node fsub1, the subroutine node fsub1 is added to the “lower node” of the function node Func1.
図5(D)は、コンフィグレーション項目解析部50が行番号103を読み込んだ後にノードを作成する様子を模式的に示すイメージ図である。図示するように、行番号103には「#ifdef」が存在するため、サブルーチンノードfsub1の下にコンフィグレーション開始ノードTypeAを追加する。
FIG. 5D is an image diagram schematically illustrating how the configuration
当該ノードには、[ラベルとしてのファイル名(TypeA)、行番号(103)、属性(コンフィグレーション開始)、上位ノード(サブルーチンノードfsub1)、下位ノード(現時点では不明)]等の情報が付与される。また、コンフィグレーション開始ノードTypeAの追加に伴い、サブルーチンノードfsub1の「下位ノード」にコンフィグレーション開始ノードTypeAが追加される。 Information such as [file name as a label (TypeA), line number (103), attribute (configuration start), upper node (subroutine node fsub1), lower node (unknown at this time)] is given to the node. The Further, with the addition of the configuration start node TypeA, the configuration start node TypeA is added to the “subordinate node” of the subroutine node fsub1.
図6(A)は、コンフィグレーション項目解析部50が行番号104を読み込んだ後にノードを作成する様子を模式的に示すイメージ図である。図示するように、行番号104ではサブルーチンfsub2が定義されているため、にコンフィグレーション開始ノードTypeAの下にサブルーチンノードfsub2を追加する。
FIG. 6A is an image diagram schematically showing how a node is created after the configuration
当該ノードには、[ラベルとしてのファイル名(fsub2)、行番号(104)、属性(サブルーチン)、上位ノード(コンフィグレーション開始ノードTypeA)、下位ノード(現時点では不明)]等の情報が付与される。また、サブルーチンノードfsub2の追加に伴い、コンフィグレーション開始ノードTypeAの「下位ノード」にサブルーチンノードfsub2が追加される。 Information such as [file name as label (fsub2), line number (104), attribute (subroutine), upper node (configuration start node TypeA), lower node (unknown at this time)] is given to the node. The Further, with the addition of the subroutine node fsub2, the subroutine node fsub2 is added to the “lower node” of the configuration start node TypeA.
図6(B)は、コンフィグレーション項目解析部50が行番号105を読み込んだ後にノードを作成する様子を模式的に示すイメージ図である。図示するように、行番号105には「#ifdef」が存在するため、サブルーチンノードfsub2の下にコンフィグレーション開始ノードTypeBを追加する。
FIG. 6B is an image diagram schematically showing how the configuration
当該ノードには、[ラベルとしてのファイル名(TypeB)、行番号(105)、属性(コンフィグレーション開始)、上位ノード(サブルーチンノードfsub2)、下位ノード(現時点では不明)]等の情報が付与される。また、コンフィグレーション開始ノードTypeBの追加に伴い、サブルーチンノードfsub2の「下位ノード」にコンフィグレーション開始ノードTypeBが追加される。 Information such as [file name as a label (TypeB), line number (105), attribute (configuration start), upper node (subroutine node fsub2), lower node (unknown at this time)] is assigned to the node. The Further, with the addition of the configuration start node TypeB, the configuration start node TypeB is added to the “subordinate node” of the subroutine node fsub2.
図6(C)は、コンフィグレーション項目解析部50が行番号106を読み込んだ後にノードを作成する様子を模式的に示すイメージ図である。図示するように、行番号106ではサブルーチンgsub1を呼び出しているため、コンフィグレーション開始ノードTypeBの下にサブルーチンノードgsub1を追加する。
FIG. 6C is an image diagram schematically showing a state in which a node is created after the configuration
当該ノードには、[ラベルとしてのファイル名(gsub1)、行番号(106)、属性(サブルーチン)、上位ノード(コンフィグレーション開始ノードTypeB)、下位ノード(現時点では不明)]等の情報が付与される。また、サブルーチンノードgsub1の追加に伴い、コンフィグレーション開始ノードTypeBの「下位ノード」にサブルーチンノードgsub1が追加される。 Information such as [file name as label (gsub1), line number (106), attribute (subroutine), upper node (configuration start node TypeB), lower node (unknown at this time)] is given to the node. The Further, with the addition of the subroutine node gsub1, the subroutine node gsub1 is added to the “lower node” of the configuration start node TypeB.
図6(D)は、コンフィグレーション項目解析部50が行番号108を読み込んだ後に次のノード追加位置を移動する様子を模式的に示すイメージ図である。図示するように、行番号108には「#else」が存在するため、次のノード追加位置をコンフィグレーション開始ノードTypeBの下に移動する。
FIG. 6D is an image diagram schematically showing how the configuration
図7(A)は、コンフィグレーション項目解析部50が行番号109を読み込んだ後にノードを作成する様子を模式的に示すイメージ図である。図示するように、行番号109ではサブルーチンgsub2を呼び出しているため、コンフィグレーション開始ノードTypeBの下にサブルーチンノードgsub2を追加する。
FIG. 7A is an image diagram schematically showing how a node is created after the configuration
当該ノードには、[ラベルとしてのファイル名(gsub2)、行番号(109)、属性(サブルーチン)、上位ノード(コンフィグレーション開始ノードTypeB)、下位ノード(現時点では不明)]等の情報が付与される。また、サブルーチンノードgsub2の追加に伴い、コンフィグレーション開始ノードTypeBの「下位ノード」にサブルーチンノードgsub2が追加される。 Information such as [file name as label (gsub2), line number (109), attribute (subroutine), upper node (configuration start node TypeB), lower node (unknown at this time)] is given to the node. The Further, with the addition of the subroutine node gsub2, the subroutine node gsub2 is added to the “lower node” of the configuration start node TypeB.
図7(B)は、コンフィグレーション項目解析部50が行番号110を読み込んだ後にノードを作成する様子を模式的に示すイメージ図である。図示するように、行番号110には「#endif」が存在するため、コンフィグレーション終端ノードTypeB*を追加する。なお、コンフィグレーション終端ノードTypeB*は、コンフィグレーション開始ノードTypeBを始点として連結されたノードの終端点の全てを上位ノードとするように、リンクが設定される。
FIG. 7B is an image diagram schematically showing a state in which a node is created after the configuration
当該ノードには、[ラベルとしてのファイル名(TypeB*)、行番号(110)、属性(コンフィグレーション終端)、上位ノード(サブルーチンノードgsub1、サブルーチンノードgsub2)、下位ノード(現時点では不明)]等の情報が付与される。また、コンフィグレーション終端ノードTypeB*の追加に伴い、サブルーチンノードgsub1、サブルーチンノードgsub2の「下位ノード」にコンフィグレーション終端ノードTypeB*が追加される。 The node includes [file name as a label (TypeB *), line number (110), attribute (end of configuration), upper node (subroutine node gsub1, subroutine node gsub2), lower node (currently unknown)], etc. Is given. In addition, with the addition of the configuration termination node TypeB *, the configuration termination node TypeB * is added to the “lower nodes” of the subroutine node gsub1 and the subroutine node gsub2.
図7(C)は、コンフィグレーション項目解析部50が行番号112を読み込んだ後に次のノード追加位置を移動する様子を模式的に示すイメージ図である。図示するように、行番号112には「#else」が存在するため、次のノード追加位置をコンフィグレーション開始ノードTypeAの下に移動する。
FIG. 7C is an image diagram schematically showing how the configuration
図8(A)は、コンフィグレーション項目解析部50が行番号113を読み込んだ後にノードを作成する様子を模式的に示すイメージ図である。図示するように、行番号113ではサブルーチンfsub3を呼び出しているため、コンフィグレーション終端ノードTypeB*の下にサブルーチンノードfsub3を追加する。
FIG. 8A is an image diagram schematically showing how a node is created after the configuration
当該ノードには、[ラベルとしてのファイル名(fsub3)、行番号(113)、属性(サブルーチン)、上位ノード(コンフィグレーション終端ノードTypeB*)、下位ノード(現時点では不明)]等の情報が付与される。また、サブルーチンノードfsub3の追加に伴い、コンフィグレーション終端ノードTypeB*の「下位ノード」にサブルーチンノードfsub3が追加される。 Information such as [file name as label (fsub3), line number (113), attribute (subroutine), upper node (configuration end node TypeB *), lower node (unknown at this time)] is assigned to the node. Is done. Further, with the addition of the subroutine node fsub3, the subroutine node fsub3 is added to the “lower node” of the configuration end node TypeB *.
図8(B)は、コンフィグレーション項目解析部50が行番号114を読み込んだ後にノードを作成する様子を模式的に示すイメージ図である。図示するように、行番号114には「#endif」が存在するため、コンフィグレーション終端ノードTypeA*を追加する。なお、コンフィグレーション終端ノードTypeA*は、コンフィグレーション開始ノードTypeAを始点として連結されたノードの終端点の全てを上位ノードとするように、リンクが設定される。
FIG. 8B is an image diagram schematically showing how a node is created after the configuration
当該ノードには、[ラベルとしてのファイル名(TypeA*)、行番号(114)、属性(コンフィグレーション終端)、上位ノード(サブルーチンノードfsub3)、下位ノード(現時点では不明)]等の情報が付与される。また、コンフィグレーション終端ノードTypeA*の追加に伴い、サブルーチンノードfsub3の「下位ノード」にコンフィグレーション終端ノードTypeA*が追加される。 Information such as [file name as label (TypeA *), line number (114), attribute (configuration end), upper node (subroutine node fsub3), lower node (unknown at the moment)] is given to the node. Is done. Further, with the addition of the configuration termination node TypeA *, the configuration termination node TypeA * is added to the “lower node” of the subroutine node fsub3.
以上のような処理を最終行まで実行することにより、図9のような生成データが得られる。図9は、図4に示すプリプロセッサ部40の出力イメージに対してコンフィグレーション項目解析部50が解析処理を行った結果として得られるツリー状のデータ構造を模式的に示すイメージ図である。実際は、図9のようなグラフィックデータを生成する訳ではなく、上記説明したように各種情報が付与されたノードの集合データが生成され、レポート作成部60は、この集合データを参照することにより図9のようのツリー状のデータ構造を認識することができる。なお、レポートとして、図9に示すようなグラフィックデータを出力しても構わない。
By executing the above processing up to the last line, generated data as shown in FIG. 9 is obtained. FIG. 9 is an image diagram schematically showing a tree-like data structure obtained as a result of the configuration
コンフィグレーション項目解析部50が出力するツリー状のデータ構造は、コンフィグデータベース12に格納される。
The tree-like data structure output from the configuration
[レポート作成]
レポート作成部60は、コンフィグレーション項目解析部50が出力するツリー状のデータ構造に基づいて、コンフィグレーション項目に関するレポートを作成する。レポートの内容としては、例えば、(1)コンフィグレーション項目の一覧(コンフィグレーション開始ノードを検索して得られる)、(2)コンフィグレーション項目毎のソースコード内での参照位置(startノードからのリンク数等で表現される)、(3)コンフィグレーション項目間の関係(リンクの有無、距離(リンク数)、間に存在するコンフィグレーション項目の数等)、(4)コンフィグレーション項目と関数の関係等を含むように作成する。
[Create Report]
The
より具体的には、コンフィグレーション項目が条件式の中で現れる場合、条件成立時に参照される関数やサブルーチン、条件不成立時に参照される関数やサブルーチン等を一覧できるようにすると、好適である。 More specifically, when a configuration item appears in a conditional expression, it is preferable to be able to list functions and subroutines that are referenced when the condition is satisfied, functions and subroutines that are referenced when the condition is not satisfied, and the like.
例えば、図9のデータ構造の場合、コンフィグレーション項目TypeAについては、(A)startノードから3リンク目に出現、(B)項目の開始から終端までの期間に他のコンフィグレーション項目TypeBが出現、(C)条件成立時にはfsub2、gsub1、gsub2が参照され、非成立時にはfsub3が参照される、等の情報を提供することができる。このような情報は、ソフトウエア開発において非常に有用なものであるため、係る情報が自動的に取得されることにより、ソフトウエア開発を容易にすることができる。 For example, in the case of the data structure of FIG. 9, for the configuration item TypeA, (A) Appears at the third link from the start node, (B) Other configuration item TypeB appears in the period from the start to the end of the item, (C) It is possible to provide information such as fsub2, gsub1, and gsub2 being referred to when the condition is satisfied, and fsub3 being referred to when the condition is not satisfied. Since such information is very useful in software development, the software development can be facilitated by automatically acquiring such information.
以上説明した本実施例のコンフィグレーションレポート作成装置1、及びこれを実現するためのプログラムによれば、コンフィグレーション項目の解析を自動的に行い、ソフトウエア開発を容易にすることができる。
According to the configuration
以上、本発明を実施するための最良の形態について実施例を用いて説明したが、本発明はこうした実施例に何等限定されるものではなく、本発明の要旨を逸脱しない範囲内において種々の変形及び置換を加えることができる。 The best mode for carrying out the present invention has been described above with reference to the embodiments. However, the present invention is not limited to these embodiments, and various modifications can be made without departing from the scope of the present invention. And substitutions can be added.
例えば、ソースファイル72とヘッダファイル74が入力され、これに対してインクルード関係のみを解釈して、解析対象となるコンフィグレーション項目消去前のソースコードを取得するものとしたが、コンフィグレーション項目消去前のソースコードが直接、コンフィグレーションレポート作成装置1に入力されてもよい。この場合、プリプロセッサ部40は必須の構成でない。
For example, the
1 コンフィグレーションレポート作成装置
10 RAM
12 コンフィグデータベース
20 プログラムメモリ
22 プログラム
30 入力ポート
40 プリプロセッサ部
50 コンフィグレーション項目解析部
60 レポート作成部
70 ソフトウエア
72 ソースファイル
74 ヘッダファイル
1 Configuration
12
Claims (9)
前記ソフトウエアのコンフィグレーション項目消去前のソースコードを取得するソースコード取得手段と、
該ソースコード取得手段により取得されたコンフィグレーション項目消去前のソースコードを解析して、少なくとも前記コンフィグレーション項目と、関数その他のプログラム要素との関係を認識可能なデータを出力するコンフィグレーション項目解析手段と、
前記コンフィグレーション項目解析手段の出力に基づいて、少なくとも前記コンフィグレーション項目と、関数その他のプログラム要素との関係を記述したレポートを作成するレポート作成手段と、
を備えるコンフィグレーションレポート作成装置。 A configuration report creation device that analyzes a software structure and creates a report on a configuration item that appears in a source program of the software and can be substituted with a numerical value, a character string, and other data structures,
Source code acquisition means for acquiring source code before erasing configuration items of the software;
Configuration item analysis means for analyzing the source code before erasing the configuration item acquired by the source code acquisition means and outputting at least data capable of recognizing the relationship between the configuration item and a function or other program element When,
Based on the output of the configuration item analysis means, a report creation means for creating a report describing at least the relationship between the configuration items and functions and other program elements;
A configuration report creation device comprising:
前記コンフィグレーション項目解析手段は、前記ソースコード取得手段により取得されたコンフィグレーション項目消去前のソースコードを解析して、前記コンフィグレーション項目を含むプログラム要素を複数のノードとし、該複数のノードが連結されたツリー状のデータ構造を出力する手段である、
コンフィグレーションレポート作成装置。 A configuration report creation device according to claim 1,
The configuration item analysis means analyzes the source code before erasing the configuration item acquired by the source code acquisition means, and sets the program element including the configuration item as a plurality of nodes, and the plurality of nodes are connected. Means for outputting a structured tree-like data structure,
Configuration report creation device.
前記コンフィグレーション項目解析手段は、前記コンフィグレーション項目消去前のソースコードにおける「#ifdef」、「#endif」、「#else」の存在に基づいて、前記ツリー状のデータ構造における分岐箇所、及び合流箇所を決定する手段である、
コンフィグレーションレポート作成装置。 A configuration report creation device according to claim 2,
The configuration item analysis means, based on the presence of “#ifdef”, “#endif”, “#else” in the source code before erasing the configuration item, branch points in the tree-like data structure, and merge A means of determining the location,
Configuration report creation device.
前記ソースコード取得手段は、前記ソフトウエアを構成するソースファイルとヘッダファイルが入力されると、該ソースファイルとヘッダファイル内で定義されたインクルード関係のみを解釈して前記コンフィグレーション項目消去前のソースコードを取得する手段である、
コンフィグレーションレポート作成装置。 A configuration report creation device according to any one of claims 1 to 3,
When the source file and the header file constituting the software are input, the source code acquisition means interprets only the include relation defined in the source file and the header file, and the source before the configuration item is deleted. A means of obtaining the code,
Configuration report creation device.
該コンピュータを、
前記ソフトウエアのコンフィグレーション項目消去前のソースコードを取得するソースコード取得手段と、
該ソースコード取得手段により取得されたコンフィグレーション項目消去前のソースコードを解析して、少なくとも前記コンフィグレーション項目と、関数その他のプログラム要素との関係を認識可能なデータを出力するコンフィグレーション項目解析手段と、
前記コンフィグレーション項目解析手段の出力に基づいて、少なくとも前記コンフィグレーション項目と、関数その他のプログラム要素との関係を記述したレポートを作成するレポート作成手段と、
として機能させるためのコンピュータ読み取り可能なプログラム。 Analyzing the software structure and causing the computer to function as a configuration report creation device that creates reports on configuration items that appear in the software source program and that can be substituted with numerical data, character strings, and other data structures A computer readable program for
The computer
Source code acquisition means for acquiring source code before erasing configuration items of the software;
Configuration item analysis means for analyzing the source code before erasing the configuration item acquired by the source code acquisition means and outputting at least data capable of recognizing the relationship between the configuration item and a function or other program element When,
Based on the output of the configuration item analysis means, a report creation means for creating a report describing at least the relationship between the configuration items and functions and other program elements;
A computer readable program to function as a computer.
前記コンフィグレーション項目解析手段は、前記ソースコード取得手段により取得されたコンフィグレーション項目消去前のソースコードを解析して、前記コンフィグレーション項目を含むプログラム要素を複数のノードとし、該複数のノードが連結されたツリー状のデータ構造を出力する手段である、
プログラム。 The program according to claim 5,
The configuration item analysis means analyzes the source code before erasing the configuration item acquired by the source code acquisition means, and sets the program element including the configuration item as a plurality of nodes, and the plurality of nodes are connected. Means for outputting a structured tree-like data structure,
program.
前記コンフィグレーション項目解析手段は、前記コンフィグレーション項目消去前のソースコードにおける「#ifdef」、「#endif」、「#else」の存在に基づいて、前記ツリー状のデータ構造における分岐箇所、及び合流箇所を決定する手段である、
プログラム。 The program according to claim 6,
The configuration item analysis means, based on the presence of “#ifdef”, “#endif”, “#else” in the source code before erasing the configuration item, branch points in the tree-like data structure, and merge A means of determining the location,
program.
前記ソースコード取得手段は、前記ソフトウエアを構成するソースファイルとヘッダファイルが入力されると、該ソースファイルとヘッダファイル内で定義されたインクルード関係のみを解釈して前記コンフィグレーション項目消去前のソースコードを取得する手段である、
プログラム。 A program according to any one of claims 5 to 7,
When the source file and the header file constituting the software are input, the source code acquisition means interprets only the include relation defined in the source file and the header file, and the source before the configuration item is deleted. A means of obtaining the code,
program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011057840A JP2012194748A (en) | 2011-03-16 | 2011-03-16 | Configuration report generation device, program and recording medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011057840A JP2012194748A (en) | 2011-03-16 | 2011-03-16 | Configuration report generation device, program and recording medium |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2012194748A true JP2012194748A (en) | 2012-10-11 |
Family
ID=47086582
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2011057840A Withdrawn JP2012194748A (en) | 2011-03-16 | 2011-03-16 | Configuration report generation device, program and recording medium |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2012194748A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111782553A (en) * | 2020-08-08 | 2020-10-16 | 中国人民解放军国防科技大学 | Software reaction defect analysis method based on fault injection |
-
2011
- 2011-03-16 JP JP2011057840A patent/JP2012194748A/en not_active Withdrawn
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111782553A (en) * | 2020-08-08 | 2020-10-16 | 中国人民解放军国防科技大学 | Software reaction defect analysis method based on fault injection |
CN111782553B (en) * | 2020-08-08 | 2022-09-23 | 中国人民解放军国防科技大学 | Software reaction defect analysis method based on fault injection |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8972933B2 (en) | Non-literal representation of programming language code | |
Krahn et al. | Efficient editor generation for compositional DSLs in Eclipse | |
KR101314949B1 (en) | Integration environment generator | |
Blouin et al. | Kompren: modeling and generating model slicers | |
Blouin et al. | Modeling model slicers | |
US10269087B2 (en) | Language translation using preprocessor macros | |
KR101628314B1 (en) | The Visual Spring Development Environment System for Visualizing Application Architecture and Method Call Sequence | |
US9734596B2 (en) | Method for generating executable applications with dynamic scalable vector graphics and compiler for carrying out the method | |
JPWO2009098739A1 (en) | Program optimization apparatus and program optimization method | |
US11126527B2 (en) | Software engineering method including tracing and visualizing | |
Guana et al. | Chaintracker, a model-transformation trace analysis tool for code-generation environments | |
Boucher et al. | Towards more reliable configurators: A re-engineering perspective | |
KR20150092880A (en) | Method and Apparatus for Re-Configuring Design Decisions after Developing Graphic User Interface | |
Kirchmayr et al. | Integration of static and dynamic code analysis for understanding legacy source code | |
CN111078217A (en) | Brain graph generation method, apparatus and computer-readable storage medium | |
JP2015028763A (en) | Language conversion apparatus, language conversion method and language conversion program | |
JP5875961B2 (en) | Source code similarity evaluation program, source code similarity evaluation apparatus, and computer-readable storage medium | |
JP2012194748A (en) | Configuration report generation device, program and recording medium | |
Pereira et al. | An IOPT-net state-space generator tool | |
JP2008198103A (en) | State transition diagram preparing device and state transition diagram preparing method | |
Alsarraj et al. | Designing and implementing a tool to transform source code to UML diagrams | |
Mohamed et al. | Reverse engineering state and strategy design patterns using static code analysis | |
Rástočný et al. | Automated change propagation from source code to sequence diagrams | |
KR101585048B1 (en) | Algorithm simulation system based on diagram | |
JP2019139675A (en) | Source code optimization device, program, and method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A300 | Withdrawal of application because of no request for examination |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20140603 |