JP2008293486A - Source code analysis device, analysis program, and analysis method - Google Patents

Source code analysis device, analysis program, and analysis method Download PDF

Info

Publication number
JP2008293486A
JP2008293486A JP2008110841A JP2008110841A JP2008293486A JP 2008293486 A JP2008293486 A JP 2008293486A JP 2008110841 A JP2008110841 A JP 2008110841A JP 2008110841 A JP2008110841 A JP 2008110841A JP 2008293486 A JP2008293486 A JP 2008293486A
Authority
JP
Japan
Prior art keywords
module
function
extraction
modules
information
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
JP2008110841A
Other languages
Japanese (ja)
Inventor
Chikayuki Okamoto
周之 岡本
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.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2008110841A priority Critical patent/JP2008293486A/en
Publication of JP2008293486A publication Critical patent/JP2008293486A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To analyze source codes of a program and to effectively display its result according to the purpose. <P>SOLUTION: The source codes are analyzed to obtain a function call relationship and an inclusion relationship between the functions and modules to prepare a inter-module call relationship diagram displayed in set module units. The module having the inclusion relationship with an object to be extracted from the inter-module call relationship diagram, the module calling only the module in the inclusion relationship, and the module called only from the module in the inclusion relationship, are extracted to prepare the inter-module call relationship diagram showing the extracted modules and connection symbols between the extracted modules in a set display form. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、プログラムのソースコードを解析し、またその結果を表示する技術に関する。   The present invention relates to a technique for analyzing a source code of a program and displaying the result.

近年、ディジタルテレビやハードディスクレコーダ等のプログラム組み込み型システム、パーソナルコンピュータ、業務用サーバシステム等において高機能化が進んでおり、プログラムの規模が巨大化している。それに合わせてプログラムの不具合が増加している。また、プログラム仕様を頻繁に変更することが増えて仕様書への反映が不完全となりがちなため、現状のプログラム動作を正確に理解するために、仕様書ではなくソースコードを読み取る必要が生じている。   2. Description of the Related Art In recent years, higher functions have been advanced in program embedded systems such as digital televisions and hard disk recorders, personal computers, and business server systems, and the scale of programs has become enormous. Along with that, program defects are increasing. In addition, frequent changes to program specifications tend to be incompletely reflected in the specifications, so it is necessary to read the source code instead of the specifications in order to accurately understand the current program operation. Yes.

この課題を解決する従来の技術として、例えば、特許文献1にソースコード解析支援装置の開示がある。この技術を利用すれば、プログラムのソースコード作成段階で解析を行いプログラムの動作を検証することで、動作環境構築前や動作試験前に不具合を見つけ出して修正することができる。また、解析対象ソースコードにおける、関数間の呼び出し関係や関連する引数・変数の情報を図式的に表示することで、ソースコードを文字情報のみで読み解くよりも効率良くプログラム動作を理解できる。   As a conventional technique for solving this problem, for example, Patent Document 1 discloses a source code analysis support apparatus. If this technology is used, analysis can be performed at the source code creation stage of the program to verify the operation of the program, so that a defect can be found and corrected before the operating environment is constructed or before the operation test. Moreover, by displaying graphically the call relationship between functions and related argument / variable information in the analysis target source code, it is possible to understand the program operation more efficiently than reading the source code only with character information.

特開2006−277206号公報 (第1頁、図2)JP 2006-277206 A (first page, FIG. 2)

しかし上記のような従来技術では、検討が不要な関数も含めた全関数を表示するため、プログラム規模、すなわち解析対象であるソースコードの規模が大きい場合に、関数間の呼び出し関係図が巨大かつ複雑になり、プログラム動作を理解することが困難となる。   However, in the conventional technology as described above, since all functions including functions that need not be examined are displayed, when the program size, that is, the size of the source code to be analyzed is large, the call relationship diagram between functions is huge and It becomes complicated and it becomes difficult to understand the program operation.

本発明は、上記事情に鑑みてなされたものであり、本発明の目的は、プログラムのソースコードを解析し、その結果を解析目的に応じて効果的に表示することにある。   The present invention has been made in view of the above circumstances, and an object of the present invention is to analyze a source code of a program and to display the result effectively according to the analysis purpose.

上記の課題を解決するため、本発明のソースコード解析機器、解析プログラムおよび解析方法は、ソースコードを解析して、関数間の呼び出しに関する情報と、変数の定義および使用箇所に関する情報を得て、解析結果を表示する粒度であるモジュール単位を設定し、ソースコードまたは設定データを解析してモジュールと関数との包含関係に関する情報を得て、モジュール間の呼び出し関係を解析し、モジュール間の呼び出し関連図を作成する。   In order to solve the above problems, the source code analysis device, the analysis program, and the analysis method of the present invention analyze the source code, obtain information on the call between functions, and information on the definition and use location of the variable. Set the module unit, which is the granularity to display the analysis results, analyze the source code or setting data to obtain information about the inclusion relationship between the module and function, analyze the calling relationship between modules, and call related between modules Create a diagram.

さらに、前記モジュール単位は、関数と、前記関数が属するグループと、前記関数を実装したファイルと、前記ファイルが格納されているディレクトリと、前記ファイル内のプログラム情報が含まれるクラス、コンポーネント、オブジェクトおよびライブラリの内で、少なくとも1つを含むことを特徴とする。さらに、モジュールと、当該モジュールに実装、格納、または含まれている関数との包含関係を解析することを特徴とする。さらに、前記関数間の呼び出しに関する情報と前記モジュールと関数との包含関係に関する情報とから、前記設定されたモジュール単位で表されるモジュール間の呼び出し関係に関する情報を得ることを特徴とする。   Further, the module unit includes a function, a group to which the function belongs, a file in which the function is implemented, a directory in which the file is stored, a class, a component, an object including program information in the file, and It includes at least one of the libraries. Further, the present invention is characterized in that an inclusive relationship between a module and a function mounted, stored, or included in the module is analyzed. Furthermore, information on a call relationship between modules represented by the set module unit is obtained from information on a call between the functions and information on an inclusion relationship between the module and the function.

また、本発明のソースコード解析機器、解析プログラムおよび解析方法は、前記モジュール間の呼び出し関連図からの抽出対象と、前記抽出対象と関連するモジュールの表示形態とを含む抽出情報を設定し、前記抽出対象と関連するモジュールを抽出する。さらに、前記抽出対象は、変数と、関数と、グループと、ファイルと、ディレクトリと、クラスと、コンポーネントと、オブジェクトと、ライブラリの内少なくとも1つを含むことを特徴とする。   Further, the source code analysis device, the analysis program, and the analysis method of the present invention set the extraction information including the extraction target from the call relation diagram between the modules and the display form of the module related to the extraction target, Extract the modules related to the extraction target. Further, the extraction target includes at least one of a variable, a function, a group, a file, a directory, a class, a component, an object, and a library.

さらに、前記設定されたモジュール単位と、前記包含関係と、前記モジュール間の呼び出し関係と、前記設定された抽出対象とから、前記設定された抽出対象と包含関係にあるモジュールと、前記包含関係にあるモジュールを呼び出すモジュールと、前記包含関係にあるモジュールから呼び出されるモジュールとを抽出することを特徴とする。さらに、抽出された前記抽出モジュールと、前記抽出モジュール間の連結記号とを、前記設定された表示形態にて表示したモジュール間の呼び出し関連図を作成することを特徴とする。   Further, from the set module unit, the inclusion relationship, the calling relationship between the modules, and the set extraction target, the module in the inclusion relationship with the set extraction target is changed to the inclusion relationship. A module that calls a module and a module that is called from a module in the inclusion relationship are extracted. Furthermore, a call relation diagram between modules is created in which the extracted extraction modules and the connection symbols between the extraction modules are displayed in the set display form.

上述の技術によれば、関数間の呼び出し関係を、クラスやライブラリ等の単位で表したモジュール間の呼び出し関係に変換するため、解析目的に合わせた適切な粒度でプログラムモジュールの呼び出し関係を表示することができる。 また、設定した変数やファイル等に関連するモジュールの表示形態を変更するため、解析目的に合わせて必要なモジュールを強調表示したり、不要なモジュールを消去したり、特定変数に関連するモジュールを変数値や分岐条件とともに表示したりすることができる。   According to the technique described above, the calling relationship between functions is displayed at an appropriate granularity according to the analysis purpose in order to convert the calling relationship between functions into the calling relationship between modules expressed in units such as classes and libraries. be able to. In addition, in order to change the display form of the module related to the set variable or file, etc., the necessary module is highlighted for the purpose of analysis, the unnecessary module is deleted, the module related to the specific variable is changed to the variable Can be displayed along with values and branch conditions.

また、適切な粒度でのグループ間の依存度合い(呼び出し数の多さ)が可視化できる。   In addition, it is possible to visualize the degree of dependence between groups (the number of calls) with an appropriate granularity.

以上のように、本発明によれば、プログラムのソースコードを解析し、その結果を解析目的に応じて効果的に表示することが可能となる。   As described above, according to the present invention, it is possible to analyze the source code of a program and display the result effectively according to the purpose of analysis.

本発明によれば、プログラムのソースコードを解析し、その結果を解析目的に応じて効果的に表示することが可能となる。これにより、ソースコードからのプログラム動作の理解が容易になる、動作環境構築前や動作試験前に不具合を見つけ出して修正し易くなる、プログラムを部品化する際の分割場所の検討が容易になる等、プログラムの開発効率が向上し、コスト低減や開発期間短縮が実現できる。   According to the present invention, it is possible to analyze the source code of a program and display the result effectively according to the purpose of analysis. This makes it easy to understand the program operation from the source code, makes it easy to find and correct problems before building the operating environment and before the operation test, and makes it easy to examine the division location when making a program into parts, etc. Program development efficiency can be improved, and cost reduction and development time can be shortened.

以下、本発明を実施するための形態について説明する。   Hereinafter, modes for carrying out the present invention will be described.

まず、本実施例におけるソースコード解析機器1の概略構成について図1を用いて説明する。   First, a schematic configuration of the source code analysis device 1 in the present embodiment will be described with reference to FIG.

図1に示す様に本実施例のソースコード解析機器1は、制御装置11と、記録装置12と、入出力装置13とを有している。   As shown in FIG. 1, the source code analysis device 1 of this embodiment includes a control device 11, a recording device 12, and an input / output device 13.

制御装置11は、記録装置12が保持している処理プログラムを実行し、機器全体の動作を制御する装置である。   The control device 11 is a device that executes the processing program held by the recording device 12 and controls the operation of the entire device.

記録装置12は、ソースコード解析機器1の動作を制御する処理プログラムが格納された処理部と、処理プログラムが読み書きを行うデータが格納された記録部とから構成される装置である。記録装置12の処理部は、機器制御処理部121と、モジュール単位設定処理部122と、抽出情報設定処理部123と、グループ情報設定処理部129と、関数解析処理部124と、包含関係解析処理部125と、モジュール解析処理部126と、モジュール抽出処理部127と、関連図作成処理部128とを有している。記録装置12の記録部は、ソースコード記録部1201と、設定情報記録部1202と、解析結果記録部1203と、図面情報記録部1204とを有している。記録装置12の例としては、ディスク、テープ、半導体などがある。   The recording device 12 is a device that includes a processing unit that stores a processing program that controls the operation of the source code analysis device 1 and a recording unit that stores data read and written by the processing program. The processing unit of the recording device 12 includes a device control processing unit 121, a module unit setting processing unit 122, an extraction information setting processing unit 123, a group information setting processing unit 129, a function analysis processing unit 124, and an inclusion relationship analysis process. Section 125, module analysis processing section 126, module extraction processing section 127, and related diagram creation processing section 128. The recording unit of the recording device 12 includes a source code recording unit 1201, a setting information recording unit 1202, an analysis result recording unit 1203, and a drawing information recording unit 1204. Examples of the recording device 12 include a disk, a tape, and a semiconductor.

機器制御処理部121は、ソースコード解析機器1の各装置を連携させ、ソースコード解析機器として動作させる処理部である。モジュール単位設定処理部122は、解析結果を表示する際の粒度であるモジュール単位を設定する処理部である。   The device control processing unit 121 is a processing unit that causes each device of the source code analysis device 1 to cooperate and operate as a source code analysis device. The module unit setting processing unit 122 is a processing unit that sets a module unit, which is a granularity when displaying the analysis result.

抽出情報設定処理部123は、モジュール間の呼び出し関連図からの抽出対象と、その抽出対象と関連するモジュールの表示形態とを含む抽出情報を設定する処理部である。関数解析処理部124は、ソースコードを解析して、関数間の呼び出し関係と、変数の定義および使用箇所を得る処理部である。グループ情報設定処理部129は、関数とグループの包含関係を含むグループ情報を設定する処理部である。   The extraction information setting processing unit 123 is a processing unit that sets extraction information including an extraction target from the inter-module call relation diagram and a display form of a module related to the extraction target. The function analysis processing unit 124 is a processing unit that analyzes the source code and obtains the calling relationship between functions, the definition of variables, and the use location. The group information setting processing unit 129 is a processing unit that sets group information including an inclusion relationship between a function and a group.

包含関係解析処理部125は、ソースコードを解析してモジュールと関数との包含関係を得る処理部である。モジュール解析処理部126は、モジュール間の呼び出し関係を解析する処理部である。モジュール抽出処理部127は、抽出対象と関連するモジュールを抽出する処理部である。関連図作成処理部128は、モジュール間の呼び出し関連図を作成する処理部である。   The inclusion relationship analysis processing unit 125 is a processing unit that analyzes the source code to obtain the inclusion relationship between the module and the function. The module analysis processing unit 126 is a processing unit that analyzes the calling relationship between modules. The module extraction processing unit 127 is a processing unit that extracts modules related to the extraction target. The related diagram creation processing unit 128 is a processing unit that creates a call related diagram between modules.

ソースコード記録部1201には、ソースコードファイルデータと、ソースコードファイルの格納場所やビルド用設定ファイル等のビルド情報データが記録される。設定情報記録部1202には、モジュール単位データと、抽出情報データと、グループ情報データが記録される。解析結果記録部1203には、関数間の呼び出し関係と変数の定義および使用箇所から成る関数呼出関係データと、モジュールと関数との包含関係の情報である包含関係データと、モジュール間の呼び出し関係の情報であるモジュール呼出関係データと、抽出対象と関連するモジュールの情報である抽出モジュールデータが記録される。図面情報記録部1204には、モジュール間の呼び出し関係を表した図の情報であるモジュール関連図データが記録される。   The source code recording unit 1201 records source code file data and build information data such as a storage location of the source code file and a build setting file. The setting information recording unit 1202 records module unit data, extraction information data, and group information data. In the analysis result recording unit 1203, the calling relationship between functions, the function calling relationship data including the definition and usage of variables, the inclusion relationship data that is the information on the inclusion relationship between the module and the function, and the calling relationship between modules are displayed. Module call relation data, which is information, and extraction module data, which is module information related to the extraction target, are recorded. In the drawing information recording unit 1204, module related diagram data which is information of a diagram representing the calling relationship between modules is recorded.

ここで、モジュール単位とは、関数と、その関数が属するグループと、その関数を実装したファイルと、そのファイルが格納されているディレクトリと、そのファイル内のプログラム情報が含まれるクラス、コンポーネント、オブジェクトおよびライブラリを示す。   Here, the module unit means a function, a group to which the function belongs, a file in which the function is implemented, a directory in which the file is stored, and a class, component, or object that includes program information in the file. And show the library.

また、抽出対象とは、変数と、関数と、グループと、ファイルと、ディレクトリと、クラスと、コンポーネントと、オブジェクトおよびライブラリを示す。   The extraction target indicates a variable, a function, a group, a file, a directory, a class, a component, an object, and a library.

入出力装置13は、利用者が、ソースコード解析機器1を操作したり、ソースコード解析機器1から情報を得たりするインタフェイス装置である。入出力装置13の例としては、キーボード、タッチパッド、マウス、タッチパネル、モニタなどがある。但し、これらに限定されるものではなく、利用者からの指示、操作として発せられるもの、音声、体の動き等を検出して、ソースコード解析機器1に対して、信号、情報を出力するインタフェイス装置であれば良い。例えば、眼球の動きなどを検出するものであっても良い。   The input / output device 13 is an interface device that allows a user to operate the source code analysis device 1 and obtain information from the source code analysis device 1. Examples of the input / output device 13 include a keyboard, a touch pad, a mouse, a touch panel, and a monitor. However, the present invention is not limited to these. An interface that outputs a signal or information to the source code analysis device 1 by detecting an instruction, an operation issued from the user, a voice, a body movement, or the like. Any face device may be used. For example, an eyeball movement may be detected.

次に、本実施例におけるソースコード解析機器1の概略動作について、図2を用いて説明する。   Next, a schematic operation of the source code analyzing apparatus 1 in the present embodiment will be described with reference to FIG.

機器制御処理部121が、入出力装置13経由で利用者からの指示を受けるまで待ち、指示を受けたならばその指示を解析する(ステップ1001)。
ステップ1001で解析した指示が「設定指示」の場合(ステップ1002にて「設定指示」に分岐)、後述の設定処理を行い(ステップ1008)、ステップ1001に戻る。
The device control processing unit 121 waits until receiving an instruction from the user via the input / output device 13, and if the instruction is received, the instruction is analyzed (step 1001).
If the instruction analyzed in step 1001 is “setting instruction” (branch to “setting instruction” in step 1002), the setting process described later is performed (step 1008), and the process returns to step 1001.

ステップ1001で解析した指示が「解析開始指示」の場合(ステップ1002にて「解析開始指示」に分岐)、後述の解析処理を行い(ステップ1005)、後述の関連図作成処理を行う(ステップ1006)。   If the instruction analyzed in step 1001 is an “analysis start instruction” (branch to “analysis start instruction” in step 1002), an analysis process described later is performed (step 1005), and a related chart generation process described later is performed (step 1006). ).

次に、機器制御処理部121が、図面情報記録部1204に記録されたモジュール関連図データを読み取り、入出力装置13で表示し(ステップ1007)、ステップ1001に戻る。   Next, the device control processing unit 121 reads the module-related diagram data recorded in the drawing information recording unit 1204, displays it on the input / output device 13 (step 1007), and returns to step 1001.

ステップ1001で解析した指示が「終了指示」の場合(ステップ1002にて「終了指示」に分岐)、処理を終了する。   If the instruction analyzed in step 1001 is an “end instruction” (branch to “end instruction” in step 1002), the process ends.

次に、本実施例におけるソースコード解析機器1の設定処(ステップ1008)の動作について、図10を用いて説明する。なお、図10での処理が終了すると、図2のステップ1001に戻るものとする。   Next, the operation of the setting process (step 1008) of the source code analysis device 1 in this embodiment will be described with reference to FIG. When the process in FIG. 10 is completed, the process returns to step 1001 in FIG.

機器制御処理部121が、利用者から受けた設定指示の内容を解析する(ステップ4001)。   The device control processing unit 121 analyzes the contents of the setting instruction received from the user (step 4001).

ステップ4001で解析した指示が「モジュール単位設定指示」の場合(ステップ4001にて「モジュール単位設定指示」に分岐)、モジュール単位設定処理部122が、設定を指示されたモジュール単位の情報をモジュール単位データとして設定情報記録部1202に記録し(ステップ4002)、終了する。   When the instruction analyzed in step 4001 is “module unit setting instruction” (branch to “module unit setting instruction” in step 4001), the module unit setting processing unit 122 displays the module unit information instructed to set the module unit. Data is recorded in the setting information recording unit 1202 (step 4002), and the process ends.

ステップ4001で解析した指示が「抽出情報設定指示」の場合(ステップ4001にて「抽出情報設定指示」に分岐)、抽出情報設定処理部123が、設定を指示された抽出対象と表示形態とを含む抽出情報を、抽出情報データとして設定情報記録部1202に記録し(ステップ4003)、終了する。   When the instruction analyzed in step 4001 is “extraction information setting instruction” (branch to “extraction information setting instruction” in step 4001), the extraction information setting processing unit 123 displays the extraction target and the display form for which setting is instructed. The included extraction information is recorded as extraction information data in the setting information recording unit 1202 (step 4003), and the process ends.

ステップ4001で解析した指示が「グループ情報設定指示」の場合(ステップ4001にて「グループ情報設定指示」に分岐)、グループ情報設定処理部129が、設定を指示された関数とグループの包含関係を含むグループ情報を、グループ情報データとして設定情報記録部1202に記録し(ステップ4004)、終了する。   When the instruction analyzed in step 4001 is “group information setting instruction” (branch to “group information setting instruction” in step 4001), the group information setting processing unit 129 determines the inclusion relation between the function instructed to set and the group. The included group information is recorded in the setting information recording unit 1202 as group information data (step 4004), and the process ends.

次に、本実施例におけるソースコード解析機器1の解析処理(ステップ1005)の動作について、図3を用いて説明する。   Next, the operation of the analysis process (step 1005) of the source code analysis device 1 in the present embodiment will be described with reference to FIG.

機器制御処理部121が、解析結果記録部1203における関数呼出関係データの有無から関数解析が済んでいるかどうかを判断する(ステップ2001)。   The device control processing unit 121 determines whether the function analysis has been completed based on the presence / absence of function call relation data in the analysis result recording unit 1203 (step 2001).

関数解析が済んでいない場合(ステップ2001にて「No」に分岐)、関数解析処理部124が、ソースコード記録部1201からソースコードファイルデータを読み取り、解析を行なって、関数間の呼び出し関係と、変数の定義および使用箇所を得、関数呼出関係データとして解析結果記録部1203に記録する(ステップ2002)。   If the function analysis has not been completed (branch to “No” in step 2001), the function analysis processing unit 124 reads the source code file data from the source code recording unit 1201, performs analysis, and determines the call relationship between the functions. Then, the definition and use location of the variable are obtained and recorded in the analysis result recording unit 1203 as function call relation data (step 2002).

関数解析が済んでいる場合(ステップ2001にて「Yes」に分岐)、または、関数呼出関係の解析(ステップ2002)が終わった後、機器制御処理部121が、解析結果記録部1203における包含関係データの有無から包含関係解析が済んでいるかどうかを判断する(ステップ2003)。   When the function analysis has been completed (branch to “Yes” in step 2001), or after the function call relationship analysis (step 2002) is completed, the device control processing unit 121 includes the inclusion relationship in the analysis result recording unit 1203. It is determined whether or not the inclusion relation analysis has been completed based on the presence or absence of data (step 2003).

包含解析が済んでいない場合(ステップ2003にて「No」に分岐)、包含関係解析処理部125が、ソースコード記録部1201からソースコードファイルデータおよびビルド情報データを読み取り、また、設定情報記録部1202からグループ情報データを読み取り、解析を行なって、モジュールと、当該モジュールに実装、格納、または含まれている関数との包含関係を得、包含関係データとして解析結果記録部1203に記録する(ステップ2004)。ビルド情報データから、あるファイルがどのディレクトリに格納されているのか、あるファイル内のプログラム情報がビルド後にどのクラス・コンポーネント・オブジェクト・ライブラリに含まれるのか、という包含関係が得られる。このため、ソースコードファイルデータの解析から判明した関数とファイルの包含関係と、グループ情報データから得られる関数とグループの包含関係とを更に合わせて、各モジュール単位間の包含関係が導き出される。 包含解析が済んでいる場合(ステップ2003にて「Yes」に分岐)、または、包含関係の解析(ステップ2004)が終わった後、モジュール解析処理部126が、設定情報記録部1202からモジュール単位データを読み取り、解析結果記録部1203の関数呼出関係データと包含関係データを読み取り、解析を行なって、設定されたモジュール単位で表されるモジュール間の呼び出し関係を得、モジュール呼出関係データとして解析結果記録部1203に記録する(ステップ2005)。   If the inclusion analysis has not been completed (branch to “No” in step 2003), the inclusion relationship analysis processing unit 125 reads the source code file data and the build information data from the source code recording unit 1201, and the setting information recording unit The group information data is read from 1202 and analyzed to obtain an inclusion relationship between the module and a function implemented, stored, or included in the module, and recorded as inclusion relationship data in the analysis result recording unit 1203 (step S1203). 2004). From the build information data, it is possible to obtain an inclusive relationship in which directory a certain file is stored and in which class, component, and object library the program information in the certain file is included after the build. For this reason, the inclusion relationship between each module unit is derived by further combining the inclusion relationship between the function and the file found from the analysis of the source code file data and the inclusion relationship between the function and the group obtained from the group information data. When the inclusion analysis has been completed (branch to “Yes” in step 2003), or after the analysis of the inclusion relationship (step 2004) is finished, the module analysis processing unit 126 reads the module unit data from the setting information recording unit 1202 , The function call relation data and the inclusion relation data of the analysis result recording unit 1203 are read and analyzed to obtain a call relation between modules expressed in units of set modules, and the analysis result is recorded as module call relation data. The information is recorded in the unit 1203 (step 2005).

なお、ステップ2003およびステップ2004を、ステップ2001およびステップ2002の前に行なってもよい。   Note that step 2003 and step 2004 may be performed before step 2001 and step 2002.

次に、本実施例におけるソースコード解析機器1の関連図作成処理(ステップ1006)の動作について、図4を用いて説明する。   Next, the operation of the related diagram creation process (step 1006) of the source code analysis device 1 in this embodiment will be described with reference to FIG.

機器制御処理部121が、設定情報記録部1202における抽出情報データの有無から抽出情報が設定されているかどうかを判断する(ステップ3001)。   The device control processing unit 121 determines whether extraction information is set based on the presence or absence of extraction information data in the setting information recording unit 1202 (step 3001).

抽出情報が設定されていない場合(ステップ3001にて「No」に分岐)、関連図作成処理部128が、解析結果記録部1203のモジュール呼出関係データを読み取り、モジュール間の呼び出し関連図を作成し、モジュール関連図データとして図面情報記録部1204に記録する(ステップ3002)。   If the extraction information is not set (branch to “No” in step 3001), the related diagram creation processing unit 128 reads the module call related data in the analysis result recording unit 1203 and creates a call related diagram between modules. Then, it is recorded in the drawing information recording unit 1204 as module related diagram data (step 3002).

抽出情報が設定されている場合(ステップ3001にて「Yes」に分岐)、モジュール抽出処理部127が、設定情報記録部1202からモジュール単位データと抽出対象データを読み取り、解析結果記録部1203の包含関係データとモジュール呼出関係データを読み取り、抽出対象と包含関係にあるモジュールと、その包含関係にあるモジュールのみを呼び出すモジュールと、その包含関係にあるモジュールのみから呼び出されるモジュールとを抽出し、抽出モジュールデータとして解析結果記録部1203に記録する(ステップ3003)。   When extraction information is set (branch to “Yes” in step 3001), the module extraction processing unit 127 reads module unit data and extraction target data from the setting information recording unit 1202, and includes the analysis result recording unit 1203. Reads relation data and module call relation data, extracts modules that are in inclusion relation with the extraction target, modules that call only modules that are in the inclusion relation, and modules that are called only from modules that are in the inclusion relation, and extracts modules The data is recorded in the analysis result recording unit 1203 (step 3003).

次に、関連図作成処理部128が、設定情報記録部1202から表示形態データを読み取り、解析結果記録部1203の抽出モジュールデータとモジュール呼出関係データを読み取り、抽出モジュールと、抽出モジュール間の連結記号とを設定された表示形態にて表示したモジュール間の呼び出し関連図を作成し、モジュール関連図データとして図面情報記録部1204に記録する(ステップ3004)。   Next, the related diagram creation processing unit 128 reads the display form data from the setting information recording unit 1202, reads the extraction module data and module call relation data of the analysis result recording unit 1203, and extracts the extraction module and the connection symbol between the extraction modules. Is created in the display format set, and a call related diagram between modules is created and recorded in the drawing information recording unit 1204 as module related diagram data (step 3004).

次に、本実施例における、記録装置12の設定情報記録部1202の例について、図5を用いて説明する。   Next, an example of the setting information recording unit 1202 of the recording device 12 in this embodiment will be described with reference to FIG.

図5に示すように、設定情報記録部1202には、モジュール単位12021から成るモジュール単位データと、抽出対象12022と表示形態12023とから成る抽出情報データと、関数12026とグループ12027とから成るグループ情報データが記録されている。表示形態12023は、抽出対象に該当するモジュール12024と、抽出対象に該当しないモジュール12025とで、表示形態を分けて設定している。   As shown in FIG. 5, the setting information recording unit 1202 includes module unit data composed of module units 12021, extraction information data composed of extraction targets 12022 and display forms 12023, group information composed of functions 12026 and groups 12027. Data is recorded. In the display form 12023, the display form is set separately for the module 12024 corresponding to the extraction target and the module 12025 not corresponding to the extraction target.

ここで抽出対象に該当するモジュールとは、設定されたモジュール単位12021で表されるモジュールの内、設定された抽出対象12022と包含関係にあるモジュールのことを指す。図5の例では、関数Bと包含関係にあるクラスについて、この該当クラスの枠は赤色で表し、該当クラス同士を連結する矢印は黒色の実線で表す設定となっている。また、非該当クラスの枠は灰色で表し、非該当クラスとの連結に用いる矢印は灰色の点線で表す設定になっている。   Here, the module corresponding to the extraction target refers to a module that is included in the set extraction target 12022 among the modules represented by the set module unit 12021. In the example of FIG. 5, for a class that is in an inclusive relationship with the function B, the frame of the corresponding class is represented in red, and an arrow that connects the classes is represented by a solid black line. In addition, the frame of the non-corresponding class is represented in gray, and the arrow used for connection with the non-corresponding class is represented by a gray dotted line.

また、図5の例では、関数Bと関数CがグループPに、関数DがグループQに含まれる関係にあることを示している。   In the example of FIG. 5, the functions B and C are included in the group P and the function D is included in the group Q.

次に、本実施例における、記録装置12の解析結果記録部1203の例について、図6を用いて説明する。   Next, an example of the analysis result recording unit 1203 of the recording device 12 in this embodiment will be described with reference to FIG.

図6に示すように、解析結果記録部1203には、呼元関数12031と呼先関数12032とから成る関数呼出関係データと、関数12033とグループ12030とファイル12034とクラス12035とライブラリ12036とから成る包含関係データと、呼元モジュール12037と呼先モジュール12038とから成るモジュール呼出関係データと、抽出モジュール1203から成る抽出モジュールデータが記録されている。   As shown in FIG. 6, the analysis result recording unit 1203 includes function call relation data including a caller function 12031 and a callee function 12032, a function 12033, a group 12030, a file 12034, a class 12035, and a library 12036. Inclusion relationship data, module call relationship data consisting of the caller module 12037 and callee module 12038, and extraction module data consisting of the extraction module 1203 are recorded.

図6の例では、関数呼出関係データにおいて、関数Aが関数Bと関数Cを、関数Bが関数Dを、関数Cが関数Eを呼び出す関係にあることを示している。また、包含関係データにおいて、関数Aと関数Bと関数CがグループPに、関数Dと関数EがグループQに含まれ、関数Aと関数CはクラスXに、関数BはクラスYに含まれ、クラスXとクラスYはファイルLに含まれ、ファイルLとファイルMはライブラリSに含まれる関係にあること等を示している。   In the example of FIG. 6, the function call relationship data indicates that the function A is in a relationship of calling the function B and the function C, the function B is calling the function D, and the function C is calling the function E. In the inclusion relation data, function A, function B, and function C are included in group P, function D and function E are included in group Q, function A and function C are included in class X, and function B is included in class Y. Class X and class Y are included in file L, and file L and file M are included in library S.

また、図5と同様に、モジュール単位がクラスであり、抽出対象が関数Bである場合を例に取ってあり、モジュール呼出関係データにおいて、呼元モジュールとしてクラスXが、呼先モジュールとしてのクラスYを呼び出す関係にあること等を示している。また、抽出モジュールデータにおいて、抽出モジュールが、抽出対象である関数Bを含むクラスYと、クラスYの呼元モジュールであるクラスXと、クラスYの呼先モジュールであるクラスZであることを示している。   Similarly to FIG. 5, the case where the module unit is a class and the extraction target is a function B is taken as an example. In the module call relation data, the class X is the call source module and the class is the call destination module. This indicates that there is a relationship to call Y. In addition, in the extraction module data, it is indicated that the extraction module is a class Y including the function B to be extracted, a class X that is a class Y caller module, and a class Z that is a class Y callee module. ing.

なお、図6では、関数呼出関係データの構成要素として、呼元関数と呼先関数とを挙げて説明したが、関数呼出関係データの構成要素は、これらに限らず、変数およびその変数の定義および使用箇所が含まれていてもよい。   In FIG. 6, the caller function and the callee function are described as the constituent elements of the function call relation data. However, the constituent elements of the function call relation data are not limited to these, and a variable and the definition of the variable And use points may be included.

また、図6では、包含関係データの構成要素として、関数とグループとファイルとクラスとライブラリとを挙げて説明したが、包含関係データの構成要素は、これらに限らず、変数およびモジュール単位の内の任意の2つ以上の要素であればよい。   In FIG. 6, functions, groups, files, classes, and libraries have been described as the constituent elements of inclusion relation data. However, the constituent elements of inclusion relation data are not limited to these and include variables and modules. Any two or more elements may be used.

次に、本実施例における、入出力装置13が出力するモジュール関連図の例について、図7と図8と図9と図11を用いて説明する。   Next, an example of a module relation diagram output by the input / output device 13 in this embodiment will be described with reference to FIGS. 7, 8, 9, and 11. FIG.

図7には、同じプログラムについて、例1として、モジュール単位が関数で抽出情報の設定がない場合と、例2として、モジュール単位がクラスで抽出情報の設定がない場合と、例3として、モジュール単位がクラスで抽出情報の設定がある場合について、それぞれのモジュール関連図の例を示している。   FIG. 7 shows a case where the module is a function and no extraction information is set as an example 1, a case where the module unit is a class and no extraction information is set, and an example 3 In the case where the unit is class and extraction information is set, an example of each module relation diagram is shown.

ここで例1、例2、例3では、図5が示す設定情報記録部1202の内容と、図6が示す解析結果記録部1203の内容に沿ったモジュール関連図を示している。ただし色情報は表現していない。   Here, Example 1, Example 2, and Example 3 show module-related diagrams along the contents of the setting information recording unit 1202 shown in FIG. 5 and the contents of the analysis result recording unit 1203 shown in FIG. However, color information is not expressed.

図8には、同じプログラムについて、例4として、モジュール単位が関数で抽出情報の設定がない場合と、例5として、モジュール単位が関数で抽出情報の設定がある場合について、それぞれのモジュール関連図の例を示している。例5では、抽出対象は関数Bと関数Gとの間の関数呼出経路であり、該当モジュールを省略して表示した場合を示している。   FIG. 8 shows the module related diagrams for the same program when the module unit is a function and the extraction information is not set as Example 4, and when the module unit is the function and the extraction information is set as Example 5. An example is shown. In Example 5, the extraction target is a function call path between the function B and the function G, and the case where the corresponding module is omitted is shown.

図9には、同じプログラムについて、例6として、モジュール単位が関数で抽出情報の設定がない場合と、例7として、モジュール単位が関数で抽出情報の設定がある場合と、例8として、モジュール単位が関数で抽出情報の設定があり変数値の設定がある場合について、それぞれのモジュール関連図の例を示している。   In FIG. 9, for the same program, as Example 6, the module unit is a function and no extraction information is set, and as Example 7, the module unit is a function and the extraction information is set, and as Example 8, the module is In the case where the unit is a function, the extraction information is set, and the variable value is set, an example of each module related diagram is shown.

図9には想定プログラムのソースコードを示してある。関数Aは、変数Zが0でない場合に変数Xを1に設定し、それ以外の場合に変数Xを2に設定して、関数Cを呼び出す。関数Bは、関数Cを呼び出す。関数Cは、変数Xと4の加算結果で変数Yを設定し、関数Dを呼び出す。関数Dは、変数Yが5の場合に関数Eを呼び出し、変数Yが6の場合に関数Fを呼び出す。関数Eは、変数Yと3の乗算結果を出力する。関数Fは、変数Yと2の乗算結果を出力する。   FIG. 9 shows the source code of the assumed program. The function A calls the function C by setting the variable X to 1 when the variable Z is not 0, and setting the variable X to 2 otherwise. Function B calls function C. The function C sets the variable Y by the addition result of the variables X and 4, and calls the function D. Function D calls function E when variable Y is 5, and calls function F when variable Y is 6. The function E outputs the multiplication result of the variable Y and 3. The function F outputs the multiplication result of the variable Y and 2.

例6では、分岐矢印によって、関数Dが、関数Eまたは関数Fのいずれか片方のみを呼び出す関係にあることを示している。   In Example 6, the branch arrow indicates that the function D is in a relationship of calling only one of the function E and the function F.

例7では、抽出対象が変数Yであり、非該当モジュールの表示形態は消去である場合を示している。関数Cにおいて変数Yが定義されており、変数Yの定義に含まれる変数Xも抽出対象となるが、変数Xと変数Yのいずれもが定義されておらず使われていない関数Bは非該当モジュールとなるため、例7の図示では、関数Bと、関数Bからの連結矢印は消去されている。   In Example 7, the extraction target is the variable Y, and the display form of the non-corresponding module is erased. The variable Y is defined in the function C, and the variable X included in the definition of the variable Y is also extracted, but the function B that is not used because neither the variable X nor the variable Y is defined is not applicable Since it is a module, in the illustration of Example 7, the function B and the connecting arrow from the function B are deleted.

関数Aの横には、当該関数内で変数Xが使われ値が1または2に限られることを示す表示がある。また、関数Cの横には、当該関数内で変数Xと4の加算結果で変数Yが設定されることを示す表示がある。また、分岐矢印の途中には、変数Yが5の場合に関数Eが呼び出され、変数Yが6の場合に関数Fが呼び出されることを示す表示がある。   Next to the function A, there is an indication that the variable X is used in the function and the value is limited to 1 or 2. Next to the function C, there is a display indicating that the variable Y is set by the addition result of the variables X and 4 in the function. In the middle of the branch arrow, there is a display indicating that the function E is called when the variable Y is 5, and the function F is called when the variable Y is 6.

例8では、例7の状態からさらに、利用者が変数Xの値を2に設定した状態を示している。関数Aの横では変数Xが2に確定されており、関数Cの横では変数Yが6に確定されている。変数Yが5である可能性がなくなったため、例8の図示では、関数Eおよび関数Eへの連結矢印は消去されている。   Example 8 shows a state in which the user sets the value of variable X to 2 from the state of Example 7. Next to function A, variable X is fixed at 2, and next to function C, variable Y is fixed at 6. Since there is no longer a possibility that the variable Y is 5, in the illustration of Example 8, the function E and the connection arrow to the function E are deleted.

図11には、同じプログラムについて、設定されたモジュール単位がグループで抽出情報の設定がある場合の例を示している。例9として、抽出対象がグループPであり、グループ間の関数呼出箇所の数を示す依存関係を数値で表示する場合と、例10として、抽出対象が関数Bであり依存関係を矢印の本数で表示する場合と、例11として、抽出対象が全てで関数を重複表示する場合について、それぞれのモジュール関連図の例を示している。   FIG. 11 shows an example in which extraction information is set in a group of set modules for the same program. As an example 9, when the extraction target is the group P and the dependency indicating the number of function call locations between the groups is displayed numerically, and as the example 10, the extraction target is the function B and the dependency is indicated by the number of arrows. In the case of displaying and as an example 11, the example of each module relation diagram is shown for the case where all the extraction targets are the function to be displayed in duplicate.

例11では、グループと関数を重複して表示することで、グループと関数の包含関係、および、グループ間の依存関係を同時に示している。   In Example 11, the group and function are displayed in duplicate, thereby simultaneously showing the inclusion relationship between the group and the function and the dependency relationship between the groups.

ここでは、設定されたモジュール単位がグループで、重複表示するモジュール単位が関数である場合の例を示したが、設定されたモジュール単位がライブラリで、重複表示するモジュール単位がファイルである場合など、他のモジュール単位の組み合わせでも良い。   In this example, the module unit set is a group and the module unit to be displayed in duplicate is a function, but the module unit set is a library and the module unit to be displayed in duplicate is a file. Other module units may be combined.

ここで例9、例10、例11では、図5が示す設定情報記録部1202の内容と、図6が示す解析結果記録部1203の内容に沿ったモジュール関連図を示している。ただし色情報は表現していない。   Here, Example 9, Example 10, and Example 11 show module-related diagrams along the contents of the setting information recording unit 1202 shown in FIG. 5 and the contents of the analysis result recording unit 1203 shown in FIG. However, color information is not expressed.

以上、本発明の実施形態について説明した。   The embodiment of the present invention has been described above.

なお、本発明の実施形態では、各処理部と各記録部が同じ記録装置12に記録されているものとして説明したが、処理部と記録部が別の記録装置に記録されていても良い。   In the embodiment of the present invention, each processing unit and each recording unit are described as being recorded in the same recording device 12, but the processing unit and the recording unit may be recorded in different recording devices.

また、本発明の実施形態では、まずグループ情報データを生成し、そのデータを元に包含関係データを生成する場合の例を挙げて説明したが、包含関係データを生成した後に、グループ情報データを生成してもよい。例えば、ソースコードを解析して生成された包含関係データを利用者に提示し、利用者が関数が属するグループを設定してもよい。この時、図6の例で、ファイルLをグループPとして、ファイルMとファイルNをグループQとして設定する場合のように、関数以外に、ファイル、ライブラリ等の各モジュール単位を用いてグループを設定してもよい。   Further, in the embodiment of the present invention, the group information data is first generated and the inclusion relation data is generated based on the data. However, after the inclusion relation data is generated, the group information data is It may be generated. For example, the inclusion relationship data generated by analyzing the source code may be presented to the user, and the user may set a group to which the function belongs. At this time, in the example of FIG. 6, in the case of setting the file L as the group P and the file M and the file N as the group Q, in addition to the function, the group is set using each module unit such as a file and a library. May be.

また、本発明の実施形態では、モジュール間の依存関係を、モジュールが含む関数の呼出箇所の数で表す場合の例を示したが、呼出箇所の数でなくても、呼元と呼先の関数の組合せの数や、呼出回数や、関数以外の他のモジュール単位での呼出の数など、他の指標を用いて依存関係を表してもよい。   In the embodiment of the present invention, an example in which the dependency relationship between modules is represented by the number of call locations of the functions included in the module has been described. Dependencies may be expressed using other indices such as the number of function combinations, the number of calls, and the number of calls in units other than functions.

本発明の実施形態によれば、関数間の呼び出し関係を、クラスやライブラリ等の単位で表したモジュール間の呼び出し関係に変換するため、解析目的に合わせた適切な粒度でプログラムモジュールの呼び出し関係を表示することができる。 また、本発明の実施形態によれば、設定した変数やファイル等に関連するモジュールの表示形態を変更するため、解析目的に合わせて必要なモジュールを強調表示したり、不要なモジュールを消去したり、特定変数に関連するモジュールを変数値や分岐条件とともに表示したりすることができる。   According to the embodiment of the present invention, since the calling relationship between functions is converted into the calling relationship between modules expressed in units such as classes and libraries, the calling relationship of program modules is set with an appropriate granularity according to the analysis purpose. Can be displayed. Further, according to the embodiment of the present invention, in order to change the display form of the module related to the set variable, file, etc., the required module is highlighted or the unnecessary module is deleted according to the analysis purpose. Modules related to specific variables can be displayed together with variable values and branch conditions.

また、本発明の実施形態によれば、適切な粒度でのグループ間の依存度合い(呼び出し数の多さ)が可視化できる。   Further, according to the embodiment of the present invention, it is possible to visualize the degree of dependence between groups (the number of calls) with an appropriate granularity.

以上のように、本発明の実施形態によれば、プログラムのソースコードを解析し、その結果を解析目的に応じて効果的に表示することが可能となる。   As described above, according to the embodiment of the present invention, the source code of a program can be analyzed, and the result can be effectively displayed according to the analysis purpose.

本発明の実施形態におけるソースコード解析機器1の概略構成を示した図である。It is the figure which showed schematic structure of the source code analysis apparatus 1 in embodiment of this invention. 本発明の実施形態におけるソースコード解析機器1の概略動作を示したフローチャートである。It is the flowchart which showed schematic operation | movement of the source code analysis apparatus 1 in embodiment of this invention. 本発明の実施形態におけるソースコード解析機器1の解析処理(ステップ1005)の動作を示したフローチャートである。It is the flowchart which showed the operation | movement of the analysis process (step 1005) of the source code analysis apparatus 1 in embodiment of this invention. 本発明の実施形態におけるソースコード解析機器1の関連図作成処理(ステップ1006)の動作を示したフローチャートである。It is the flowchart which showed the operation | movement of the related figure creation process (step 1006) of the source code analysis apparatus 1 in embodiment of this invention. 本発明の実施形態における設定情報記録部1202の例を示した図である。It is the figure which showed the example of the setting information recording part 1202 in embodiment of this invention. 本発明の実施形態における解析結果記録部1203の例を示した図である。It is the figure which showed the example of the analysis result recording part 1203 in embodiment of this invention. 本発明の実施形態における入出力装置13が出力するモジュール関連図の例1、例2および例3である。It is Example 1, Example 2 and Example 3 of the module relation diagram output by the input / output device 13 in the embodiment of the present invention. 本発明の実施形態における入出力装置13が出力するモジュール関連図の例4および例5である。It is Example 4 and Example 5 of the module related figure which the input / output device 13 in embodiment of this invention outputs. 本発明の実施形態における入出力装置13が出力するモジュール関連図の例6、例7および例8である。It is Example 6, Example 7 and Example 8 of the module relation diagram output by the input / output device 13 in the embodiment of the present invention. 本発明の実施形態におけるソースコード解析機器1の設定処理(ステップ1008)の動作を示したフローチャートである。It is the flowchart which showed the operation | movement of the setting process (step 1008) of the source code analysis apparatus 1 in embodiment of this invention. 本発明の実施形態における入出力装置13が出力するモジュール関連図の例9、例10および例11である。It is Example 9, Example 10, and Example 11 of the module relation diagram output by the input / output device 13 in the embodiment of the present invention.

符号の説明Explanation of symbols

1…ソースコード解析機器、11…制御装置、12…記録装置、13…入出力装置。 DESCRIPTION OF SYMBOLS 1 ... Source code analysis apparatus, 11 ... Control apparatus, 12 ... Recording apparatus, 13 ... Input / output device.

Claims (6)

ソースコードから、関数間の呼び出しに関する情報と、変数の定義および使用箇所に関する情報を得る関数解析手段と、
解析結果を表示する粒度であるモジュール単位を設定するモジュール単位設定手段と、
ソースコードまたは設定データからモジュールと関数との包含関係に関する情報を得る包含関係解析手段と、
モジュール間の呼び出しに関する情報を解析するモジュール解析手段と、
モジュール間の呼び出し関連図を作成する関連図作成手段と
を有し、
前記モジュール単位は、関数と、前記関数が属するグループと、前記関数を実装したファイルと、前記ファイルが格納されているディレクトリと、前記ファイル内のプログラム情報が含まれるクラス、コンポーネント、オブジェクトおよびライブラリの内の少なくとも1つを含み、
前記包含関係解析手段は、モジュールと、当該モジュールに実装、格納、または含まれている関数との包含関係を解析し、
前記モジュール解析手段は、前記関数解析手段が得た関数間の呼び出しに関する情報と、前記包含関係解析手段が得たモジュールと関数との包含関係に関する情報とから、前記モジュール単位設定手段で設定されたモジュール単位で表されるモジュール間の呼び出し関係に関する情報を得ることを特徴とするソースコード解析機器。
Function analysis means for obtaining information about calls between functions and information on the definition and use of variables from source code,
Module unit setting means for setting a module unit, which is a granularity for displaying the analysis result,
Inclusion relationship analysis means for obtaining information on inclusion relationships between modules and functions from source code or configuration data;
Module analysis means for analyzing information about calls between modules,
A related diagram creating means for creating a call related diagram between modules;
The module unit includes a function, a group to which the function belongs, a file in which the function is implemented, a directory in which the file is stored, and classes, components, objects, and libraries that include program information in the file. Including at least one of
The inclusion relationship analyzing means analyzes the inclusion relationship between a module and a function implemented, stored, or included in the module,
The module analysis means is set by the module unit setting means based on the information on the call between functions obtained by the function analysis means and the information on the inclusion relation between the module and the function obtained by the inclusion relation analysis means. A source code analysis device characterized by obtaining information on a calling relationship between modules expressed in units of modules.
請求項1に記載のソースコード解析機器であって、
前記モジュール間の呼び出し関連図からの抽出対象と、前記抽出対象と関連するモジュールの表示形態とを含む抽出情報を設定する抽出情報設定手段と、
前記抽出対象と関連するモジュールを抽出するモジュール抽出手段とを有し、
前記抽出対象は、変数と、関数と、グループと、ファイルと、ディレクトリと、クラスと、コンポーネントと、オブジェクトと、ライブラリの内の少なくとも1つを含み、
前記モジュール抽出手段は、設定された前記モジュール単位と、前記包含関係と、前記モジュール間の呼び出し関係と、前記抽出情報設定手段で設定された抽出対象とから、前記設定された抽出対象と包含関係にあるモジュールと、前記包含関係にあるモジュールを呼び出すモジュールと、前記包含関係にあるモジュールから呼び出されるモジュールとを抽出し、
前記関連図作成手段は、前記モジュール抽出手段で抽出された抽出モジュールと、前記抽出モジュール間の連結記号とを、前記抽出情報設定手段で設定された表示形態にて表示したモジュール間の呼び出し関連図を作成することを特徴とするソースコード解析機器。
The source code analysis device according to claim 1,
Extraction information setting means for setting extraction information including an extraction target from the inter-module call relation diagram and a display form of a module related to the extraction target;
Module extraction means for extracting a module related to the extraction object;
The extraction target includes at least one of a variable, a function, a group, a file, a directory, a class, a component, an object, and a library,
The module extraction means includes the set extraction target and inclusion relation from the set module unit, the inclusion relation, the calling relation between the modules, and the extraction target set by the extraction information setting means. A module that calls a module that is in the inclusion relationship, a module that is called from the module that is in the inclusion relationship,
The relation diagram creating means is a call relation diagram between modules in which the extraction module extracted by the module extraction means and a connection symbol between the extraction modules are displayed in a display form set by the extraction information setting means. Source code analysis equipment characterized by creating.
ソースコードから、関数間の呼び出しに関する情報と、変数の定義および使用箇所に関する情報を得る関数解析ステップと、
解析結果を表示する粒度であるモジュール単位を設定するモジュール単位設定ステップと、
ソースコードまたは設定データから、モジュールと関数との包含関係に関する情報を得る包含関係解析ステップと、
モジュール間の呼び出しに関する情報を解析するモジュール解析ステップと、
モジュール間の呼び出し関連図を作成する関連図作成ステップとを、情報処理装置に実行させるソースコード解析プログラムであって、
前記モジュール単位は、関数と、前記関数が属するグループと、前記関数を実装したファイルと、前記ファイルが格納されているディレクトリと、前記ファイル内のプログラム情報が含まれるクラス、コンポーネント、オブジェクトおよびライブラリの内の少なくとも1つを含み、
前記包含関係解析ステップは、モジュールと、当該モジュールに実装、格納、または含まれている関数との包含関係を解析し、
前記モジュール解析ステップは、前記関数解析ステップが得た関数間の呼び出しに関する情報と、前記包含関係解析ステップが得たモジュールと関数との包含関係に関する情報とから、前記モジュール単位設定ステップで設定されたモジュール単位で表されるモジュール間の呼び出し関係を得ることを特徴とするソースコード解析プログラム。
A function analysis step that obtains information about the call between functions from the source code, information about the definition and use of variables,
A module unit setting step for setting a module unit which is a granularity for displaying the analysis result;
An inclusion relationship analysis step for obtaining information about the inclusion relationship between a module and a function from source code or setting data;
A module analysis step for analyzing information about calls between modules;
A source code analysis program for causing an information processing apparatus to execute a related diagram creating step for creating a call related diagram between modules,
The module unit includes a function, a group to which the function belongs, a file in which the function is implemented, a directory in which the file is stored, a class, a component, an object, and a library that include program information in the file. Including at least one of
The inclusion relationship analysis step analyzes the inclusion relationship between a module and a function implemented, stored, or included in the module,
The module analysis step is set in the module unit setting step based on the information on the call between functions obtained by the function analysis step and the information on the inclusion relationship between the module and the function obtained by the inclusion relationship analysis step. A source code analysis program characterized by obtaining a calling relationship between modules expressed in module units.
請求項3に記載のソースコード解析プログラムであって、
前記モジュール間の呼び出し関連図からの抽出対象と、前記抽出対象と関連するモジュールの表示形態とを含む抽出情報を設定する抽出情報設定ステップと、
前記抽出対象と関連するモジュールを抽出するモジュール抽出ステップとを有し、
前記抽出対象は、変数と、関数と、グループと、ファイルと、ディレクトリと、クラスと、コンポーネントと、オブジェクトと、ライブラリの内少なくとも1つを含み、
前記モジュール抽出ステップは、設定された前記モジュール単位と、前記包含関係と、前記モジュール間の呼び出し関係と、前記抽出情報設定ステップで設定された抽出対象とから、前記設定された抽出対象と包含関係にあるモジュールと、前記包含関係にあるモジュールを呼び出すモジュールと、前記包含関係にあるモジュールから呼び出されるモジュールとを抽出し、
前記関連図作成ステップは、前記モジュール抽出ステップで抽出された抽出モジュールと、前記抽出モジュール間の連結記号とを、前記抽出情報設定ステップで設定された表示形態にて表示したモジュール間の呼び出し関連図を作成することを特徴とするソースコード解析プログラム。
A source code analysis program according to claim 3,
An extraction information setting step for setting extraction information including an extraction target from the call relation diagram between the modules and a display form of a module related to the extraction target;
A module extraction step of extracting a module associated with the extraction target;
The extraction target includes at least one of a variable, a function, a group, a file, a directory, a class, a component, an object, and a library,
The module extraction step includes the set extraction target and the inclusion relation from the set module unit, the inclusion relation, the calling relation between the modules, and the extraction target set in the extraction information setting step. A module that calls a module that is in the inclusion relationship, a module that is called from the module that is in the inclusion relationship,
In the related diagram creating step, the inter-module call related diagram in which the extraction module extracted in the module extracting step and the connection symbol between the extracted modules are displayed in the display form set in the extraction information setting step. A source code analysis program characterized by creating
ソースコードから、関数間の呼び出しに関する情報と、変数の定義および使用箇所を得て、
解析結果を表示する粒度であるモジュール単位を設定し、
ソースコードまたは設定データを解析してモジュールと関数との包含関係を得て、
モジュール間の呼び出しに関する情報を解析し、
モジュール間の呼び出し関連図を作成するソースコード解析方法であって、
前記モジュール単位は、関数と、前記関数が属するグループと、前記関数を実装したファイルと、前記ファイルが格納されているディレクトリと、前記ファイル内のプログラム情報が含まれるクラス、コンポーネント、オブジェクトおよびライブラリ、の内少なくとも1つを含み、
モジュールと、当該モジュールに実装、格納、または含まれている関数との包含関係を解析し、
前記関数間の呼び出し関係と、前記包含関係とから、前記設定されたモジュール単位で表されるモジュール間の呼び出し関係を得ることを特徴とするソースコード解析方法。
From the source code, get information about calls between functions, define and use variables,
Set the module unit that is the granularity to display the analysis results,
Analyzing source code or configuration data to obtain the inclusion relationship between modules and functions,
Analyzes information about calls between modules,
A source code analysis method for creating a call relation diagram between modules,
The module unit includes a function, a group to which the function belongs, a file in which the function is implemented, a directory in which the file is stored, a class, a component, an object, and a library that include program information in the file, Including at least one of
Analyze the inclusive relationship between a module and the functions implemented, stored, or included in the module,
A source code analysis method, comprising: obtaining a calling relationship between modules expressed by the set module unit from the calling relationship between the functions and the inclusion relationship.
請求項5に記載のソースコード解析方法であって、
前記モジュール間の呼び出し関連図からの抽出対象と、前記抽出対象と関連するモジュールの表示形態とを含む抽出情報を設定し、
前記抽出対象と関連するモジュールを抽出するモジュール抽出し、
前記抽出対象は、変数と、関数と、グループと、ファイルと、ディレクトリと、クラスと、コンポーネントと、オブジェクトと、ライブラリの内少なくとも1つを含み、
設定された前記モジュール単位と、前記包含関係と、前記モジュール間の呼び出し関係と、前記設定された抽出対象とから、前記設定された抽出対象と包含関係にあるモジュールと、前記包含関係にあるモジュールを呼び出すモジュールと、前記包含関係にあるモジュールから呼び出されるモジュールとを抽出し、
抽出された前記抽出モジュールと、前記抽出モジュール間の連結記号とを、前記設定された表示形態にて表示したモジュール間の呼び出し関連図を作成することを特徴とするソースコード解析方法。
The source code analysis method according to claim 5,
Setting extraction information including an extraction target from the call relation diagram between the modules, and a display form of the module related to the extraction target;
Module extraction for extracting modules related to the extraction target;
The extraction target includes at least one of a variable, a function, a group, a file, a directory, a class, a component, an object, and a library,
Modules that are in the inclusion relationship with the set extraction target from the set module units, the inclusion relationship, the calling relationship between the modules, and the set extraction target And a module called from a module in the inclusion relationship,
A source code analysis method comprising: creating a call relation diagram between modules in which the extracted modules and the connection symbols between the extracted modules are displayed in the set display form.
JP2008110841A 2007-04-25 2008-04-22 Source code analysis device, analysis program, and analysis method Pending JP2008293486A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008110841A JP2008293486A (en) 2007-04-25 2008-04-22 Source code analysis device, analysis program, and analysis method

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2007115002 2007-04-25
JP2008110841A JP2008293486A (en) 2007-04-25 2008-04-22 Source code analysis device, analysis program, and analysis method

Publications (1)

Publication Number Publication Date
JP2008293486A true JP2008293486A (en) 2008-12-04

Family

ID=40168098

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008110841A Pending JP2008293486A (en) 2007-04-25 2008-04-22 Source code analysis device, analysis program, and analysis method

Country Status (1)

Country Link
JP (1) JP2008293486A (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010152428A (en) * 2008-12-24 2010-07-08 Hitachi Ltd Program development support equipment, method, and program
JP2011107970A (en) * 2009-11-17 2011-06-02 Nippon Shoken Technology Kk Development support device, development support method and development support program
JP2011118520A (en) * 2009-12-01 2011-06-16 Nomura Research Institute Ltd Information management apparatus
JP2012164264A (en) * 2011-02-09 2012-08-30 Mitsubishi Electric Corp Program analysis device and program analysis program
JP2012194876A (en) * 2011-03-17 2012-10-11 Mizuho Information & Research Institute Inc Module analysis system, module analysis method, and module analysis program
JP2012203860A (en) * 2011-03-28 2012-10-22 Toshiba Corp Ontology updating device, method and system
JP2012230538A (en) * 2011-04-26 2012-11-22 Mitsubishi Electric Corp Software evaluation device, software evaluation method and system evaluation device
JP2013164879A (en) * 2013-05-30 2013-08-22 Ricoh Co Ltd Information processor, compatibility evaluation method and program
WO2015063954A1 (en) * 2013-11-01 2015-05-07 株式会社日立製作所 Program diagram creation device, program diagram creation method, and program diagram creation program
US9087151B2 (en) 2009-02-18 2015-07-21 Mitsubishi Electric Corporation Program analysis support device
CN105846863A (en) * 2016-05-31 2016-08-10 青岛海信电器股份有限公司 Bluetooth based operation method and device
KR101673151B1 (en) * 2016-05-19 2016-11-08 지티원 주식회사 Method and Apparatus for Analyzing Relationship Change of Program Source and DB Schema
KR20180129623A (en) * 2017-05-26 2018-12-05 충남대학교산학협력단 Apparatus for statically analyzing assembly code including assoxiated multi files
JP2019046052A (en) * 2017-08-31 2019-03-22 富士電機株式会社 Control system, development support device, and control method
CN112585547A (en) * 2019-03-13 2021-03-30 欧姆龙株式会社 Analysis device, analysis method, and analysis program

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010152428A (en) * 2008-12-24 2010-07-08 Hitachi Ltd Program development support equipment, method, and program
US9087151B2 (en) 2009-02-18 2015-07-21 Mitsubishi Electric Corporation Program analysis support device
JP2011107970A (en) * 2009-11-17 2011-06-02 Nippon Shoken Technology Kk Development support device, development support method and development support program
JP2011118520A (en) * 2009-12-01 2011-06-16 Nomura Research Institute Ltd Information management apparatus
JP2012164264A (en) * 2011-02-09 2012-08-30 Mitsubishi Electric Corp Program analysis device and program analysis program
JP2012194876A (en) * 2011-03-17 2012-10-11 Mizuho Information & Research Institute Inc Module analysis system, module analysis method, and module analysis program
JP2012203860A (en) * 2011-03-28 2012-10-22 Toshiba Corp Ontology updating device, method and system
US8782597B2 (en) 2011-03-28 2014-07-15 Kabushiki Kaisha Toshiba Ontology updating apparatus, method and system
JP2012230538A (en) * 2011-04-26 2012-11-22 Mitsubishi Electric Corp Software evaluation device, software evaluation method and system evaluation device
JP2013164879A (en) * 2013-05-30 2013-08-22 Ricoh Co Ltd Information processor, compatibility evaluation method and program
JPWO2015063954A1 (en) * 2013-11-01 2017-03-09 株式会社日立製作所 Program diagram creating apparatus, program diagram creating method, and program diagram creating program
WO2015063954A1 (en) * 2013-11-01 2015-05-07 株式会社日立製作所 Program diagram creation device, program diagram creation method, and program diagram creation program
KR101673151B1 (en) * 2016-05-19 2016-11-08 지티원 주식회사 Method and Apparatus for Analyzing Relationship Change of Program Source and DB Schema
CN105846863A (en) * 2016-05-31 2016-08-10 青岛海信电器股份有限公司 Bluetooth based operation method and device
CN105846863B (en) * 2016-05-31 2019-07-05 青岛海信电器股份有限公司 A kind of operating method and equipment based on bluetooth
KR20180129623A (en) * 2017-05-26 2018-12-05 충남대학교산학협력단 Apparatus for statically analyzing assembly code including assoxiated multi files
KR102013657B1 (en) 2017-05-26 2019-08-23 충남대학교산학협력단 Apparatus for statically analyzing assembly code including assoxiated multi files
JP2019046052A (en) * 2017-08-31 2019-03-22 富士電機株式会社 Control system, development support device, and control method
CN112585547A (en) * 2019-03-13 2021-03-30 欧姆龙株式会社 Analysis device, analysis method, and analysis program
CN112585547B (en) * 2019-03-13 2024-02-06 欧姆龙株式会社 Analysis device, analysis method, and recording medium

Similar Documents

Publication Publication Date Title
JP2008293486A (en) Source code analysis device, analysis program, and analysis method
CN107025174B (en) Method, device and readable storage medium for user interface anomaly test of equipment
JP4395761B2 (en) Program test support apparatus and method
US8797335B2 (en) Platform agnostic screen capture tool
CN111818123B (en) Network front-end remote playback method, device, equipment and storage medium
US10649634B2 (en) Indexing and annotating a usability test recording
Walkinshaw et al. Using compression algorithms to support the comprehension of program traces
US20150128048A1 (en) Automated multimedia content editing
WO2020209227A1 (en) Analysis device, analysis method, and program
CN111787188B (en) Video playing method and device, terminal equipment and storage medium
CN111435328B (en) Application testing method and device, electronic equipment and readable storage medium
CN111258875A (en) Interface test method and system, electronic device and storage medium
CN108021317B (en) Method and device for screen editing
US7689905B1 (en) Containment of terminal application run-time data for viewing when disconnected from a host server
CN116126697A (en) Test case generation method, device, equipment and computer readable storage medium
CN109948251B (en) CAD-based data processing method, device, equipment and storage medium
CN103778048A (en) Mobile terminal test method and system
JP5702265B2 (en) Program automatic generation apparatus and program automatic generation method
CN111124423A (en) Multi-platform-based compiling detection method, device, server and medium
JPH10301809A (en) Method for automatically generating gui operation procedure
JP5174648B2 (en) Program development support device, method and program
JP4641238B2 (en) Application operation tracking support device
JP2005115582A (en) System and method for generating test script component automatically
JP2001084136A (en) System and method for preparing test specification
WO2011070695A1 (en) Sequence conversion device