JP2012212281A - Range of influence setting device for program and range of influence specification method using the same and extraction method for program with ripple of influence - Google Patents

Range of influence setting device for program and range of influence specification method using the same and extraction method for program with ripple of influence Download PDF

Info

Publication number
JP2012212281A
JP2012212281A JP2011077018A JP2011077018A JP2012212281A JP 2012212281 A JP2012212281 A JP 2012212281A JP 2011077018 A JP2011077018 A JP 2011077018A JP 2011077018 A JP2011077018 A JP 2011077018A JP 2012212281 A JP2012212281 A JP 2012212281A
Authority
JP
Japan
Prior art keywords
influence
program
command
statement
range
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
JP2011077018A
Other languages
Japanese (ja)
Inventor
Koichi Yoshida
浩一 吉田
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 Social Information Services Ltd
Original Assignee
Hitachi Government and Public Sector System Engineering 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 Government and Public Sector System Engineering Ltd filed Critical Hitachi Government and Public Sector System Engineering Ltd
Priority to JP2011077018A priority Critical patent/JP2012212281A/en
Priority to PCT/JP2012/058288 priority patent/WO2012133606A1/en
Priority to CN201280016907.6A priority patent/CN103443766B/en
Publication of JP2012212281A publication Critical patent/JP2012212281A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/75Structural analysis for program understanding

Abstract

PROBLEM TO BE SOLVED: To mechanically set the range of the ripple of influence without extracting any class or method with no ripple of influence, and to achieve the improvement of the investigating accuracy of the ripple of influence and the improvement of working efficiency in the case of modifying a largely scaled system.SOLUTION: The source code of a program is subject to syntax analysis so as to be analyzed to an abstract syntax tree, and instruction sentences forming the abstract syntax tree are retrieved from instruction terms, and the connection of the instruction sentences is formed in accordance with the dependency of the instruction sentences from the retrieved instruction sentences, and a dependency graph is formed on the basis of the instruction sentences about the source code and the connection of the instruction sentences so that the range of the ripple of influence having dependency can be set.

Description

本発明は、プログラムの影響範囲設定装置、並びにこれを用いた影響範囲特定方法及び影響波及のあるプログラム抽出方法に関する。   The present invention relates to an influence range setting device for a program, an influence range specifying method using the same, and a program extraction method having influence influence.

大規模システムの改修の時にプログラムの改修に伴なって他のプログラムへの影響波及調査の精度向上と作業効率向上が求められる。   When renovating a large-scale system, it is necessary to improve the accuracy and work efficiency of the investigation to influence other programs as the program is renovated.

従来、影響波及調査のために「メソッドの呼出関係」を中心とした影響波及洗い出し方法が用いられて来た。   Conventionally, for the influence spread investigation, the influence ripple identification method centering on "method call relation" has been used.

特許文献1には、設計上の論理構造であるモジュール、ファイル、関数、ソースコードの階層構造ごとに比較すべき項目を定義し、比較を行うことが記載されている。   Patent Document 1 describes that items to be compared are defined and compared for each hierarchical structure of modules, files, functions, and source codes, which are logical structures in design.

特許文献2には、従来、分析ルールを規定し、これに基づいて変更の影響度分析を行うこと、この方法ではルールの作成に時間がかかるので、ソースコードの変更対象項目毎にその変更で想定されるすべての検証方法が記載された影響度分析図を記憶することが記載されている。   In Patent Document 2, conventionally, an analysis rule is defined, and the impact analysis of the change is performed based on the rule. In this method, it takes time to create the rule. It is described to store an influence analysis chart in which all possible verification methods are described.

特開2006−277127号JP 2006-277127 A 特開2009−157505号JP 2009-157505 A

従来のメソッドの呼出関係による影響波及の洗い出しでは、影響のないクラス/メソッド大量に抽出される、呼出関係を辿る階層を指定する必要があるなどの問題がある。   In the conventional method of determining the influence spread by the method call relationship, there is a problem that a large number of classes / methods that are not affected are extracted, and it is necessary to specify a hierarchy that traces the call relationship.

また、影響度分析図を記憶する方法では、この影響度分析図の構成に多大な時間を要するなどの問題がある。   Further, the method for storing the influence analysis chart has a problem that it takes a lot of time to construct the influence analysis chart.

本発明は、かかる点に鑑みて影響波及のないクラス及びメソッドは抽出することがなく、影響波及の範囲を機械的に設定することができ、大規模システムの改修の時に、影響波及調査の精度向上を図り、作業効率向上を図ることができるようにすることを目的とする。   In view of this point, the present invention does not extract classes and methods that do not have an influence spread, and can set the range of the influence spread mechanically. The purpose is to improve the work efficiency.

本発明は、プログラムのソースコードが構文解析されて抽象構文木に分析され、該抽象構文木を形成する命令文が検索され、
検索された命令文から命令文の依存関係に従って命令文の繋がりが形成され、
ソースコードについての命令文と命令文の繋がりとによる依存関係グラフが形成されて、依存関係にある影響波及範囲が設定されること
を特徴とするプログラムの影響波及範囲設定装置を提供する。
In the present invention, the source code of a program is parsed and analyzed into an abstract syntax tree, and the statements that form the abstract syntax tree are retrieved,
A connection of command statements is formed from the retrieved command statements according to the dependency relationship of the command statements,
Provided is an influence spread range setting device for a program characterized in that a dependency relation graph based on a sentence and a connection between instruction sentences for a source code is formed, and an influence spread range in dependency relation is set.

本発明は、プログラムのソースコードが構文解析されて抽象構文木に分析され、
該抽象構文木を形成する命令文が検索され、
検索された命令文から命令文の依存関係に従って命令文の繋がりが形成され、
複数のソースコードについて、それぞれ検索された命令文の繋がりが形成され、
複数のソースコードの有する検索された命令文が、同一であるときに当該命令文はそれぞれのソースコードに共有された命令文とされ、
該共有された命令文と命令文の繋がりとの組み合わせを含んで複数のソースコードについての命令文と命令文の繋がりとによる依存関係グラフが形成されて共有して、依存関係にある影響波及範囲が設定されること
を特徴とするプログラムの影響波及範囲設定装置を提供する。
The present invention parses the program source code into an abstract syntax tree,
The statements that form the abstract syntax tree are retrieved,
A connection of command statements is formed from the retrieved command statements according to the dependency relationship of the command statements,
For multiple source codes, a sequence of retrieved statements is formed,
When the searched command statements of a plurality of source codes are the same, the command statement is a command statement shared by each source code,
A dependency graph including a combination of the shared instruction sentence and the connection of the instruction sentence including a combination of the instruction sentence and the connection of the instruction sentence for a plurality of source codes is formed and shared, and the influence spreading range in the dependency relation An influence spread range setting device for a program, characterized in that is set.

本発明は、また、前記プログラムの影響波及範囲設定装置による影響範囲の特定方法において、
前記依存関係グラフ上で、基点となる命令文が指定されると、基点となる命令文からの依存関係を辿ることで影響波及範囲が特定されることを特徴とするプログラムの影響範囲波及範囲の特定方法を提供する。
The present invention also provides a method for identifying an influence range by an influence spread range setting device of the program,
When a base statement is specified on the dependency graph, the influence spread range is specified by tracing the dependency from the base statement. Provide a specific method.

本発明は、また、前記プログラムの影響波及範囲設定装置による影響波及のあるプログラムの抽出方法において、
前記依存関係グラフ上で、基点となる命令文が特定されたときに、基点となる命令文からの依存関係を辿ることで命令文及び命令文の繋がりを備えたプログラムを影響波及のあるプログラムとして抽出することを特徴とする影響波及のあるプログラム抽出方法を提供する。
The present invention also provides a method for extracting a program having an influence spread by the influence spread range setting device of the program,
When a command statement as a base point is specified on the dependency relationship graph, a program having a connection between the command statement and the command statement is traced as a program having an influence ripple effect by tracing the dependency relationship from the command statement as the base point. The present invention provides a program extraction method having an influence effect, characterized by extracting.

なお、本発明では、ソースコードをインプットすることとしているが、ここではバイトコードを含む概念で使用する。バイトコードとは、特定のOSやハードウェアに依存しないように定義された命令によって記述された実行形式のプログラムを意味し、人間の書いた設計図であるソースコードと実際にコンピュータで実行可能なネイティブコードの中間に当たる形式のものであり、ここではソースコードとして取り扱って差しつかえない。   In the present invention, source code is input, but here it is used in a concept including byte code. Byte code means an executable program described by instructions defined so as not to depend on a specific OS or hardware, and can be executed by a computer and source code that is a design drawing written by a human. It is in the middle of native code and can be handled as source code here.

本発明によれば、上述したようにソースコードの構文解析によって命令文同士の依存関係を付与し、影響波及範囲の設定及び特定を行うようにしているので、影響のないクラス/メソッドを抽出することがなく、影響波及の範囲を命令文から機械的に設定でき、大規模システムの改修の時に、影響調査の精度向上を図り、作業効率の向上を図ることができる。   According to the present invention, as described above, the dependency relationship between the statements is given by the syntax analysis of the source code, and the influence spread range is set and specified, so that the class / method having no influence is extracted. Therefore, the range of influence spread can be set mechanically from the command statement, and when revising a large-scale system, the accuracy of the impact investigation can be improved and the work efficiency can be improved.

本発明の実施例の構成をブロックで示す図。The figure which shows the structure of the Example of this invention with a block. 本実施例で採用されるエンジンの構成を示す図。The figure which shows the structure of the engine employ | adopted by a present Example. 本実施例の処理の流れを示す図。The figure which shows the flow of a process of a present Example. 構文の解析例を示す図。The figure which shows the example of a syntax analysis. 命令文同士の依存関係の付与の例を示す図。The figure which shows the example of assignment | providing of the dependency relation between command statements. 影響波及範囲の設定による依存関係グラフを示す図。The figure which shows the dependence relationship graph by the setting of an influence influence range. 図6にクラス及びメソッド関係を加えた図。The figure which added the class and method relation to FIG. 図6に示す命令文と命令文の繋がりの具体例を示す図。The figure which shows the specific example of the connection of the command sentence shown in FIG. 6, and a command sentence. 依存関係を辿った影響波及調査の例を示す図。The figure which shows the example of the influence propagation investigation which followed the dependence relationship. 影響波及範囲の結果を示す図。The figure which shows the result of an influence spread range. 従来例による影響波及の結果を示す図。The figure which shows the result of the influence spread by a prior art example. 従来例による影響波及の結果を示す図。The figure which shows the result of the influence spread by a prior art example. 従来例による影響波及の結果を示す図。The figure which shows the result of the influence spread by a prior art example. 本実施例による影響波及の結果を示す図。The figure which shows the result of the influence spread by a present Example.

以下、本発明の実施例を図面に基づいて説明する。   Embodiments of the present invention will be described below with reference to the drawings.

図1は、本発明の実施例のプログラムの影響範囲設定装置の構成をブロックで示す図である。
図1において、プログラムの影響範囲設定装置100は、入力手段1、演算処理手段2、出力手段3及びデータベース4から構成される。
FIG. 1 is a block diagram showing the configuration of a program influence range setting apparatus according to an embodiment of the present invention.
In FIG. 1, a program influence range setting device 100 includes an input unit 1, an arithmetic processing unit 2, an output unit 3, and a database 4.

入力手段1には、外部から大規模システムの時に改修対象となるプログラム5及び基点となる命令文6が入力される。   A program 5 to be repaired and a command statement 6 to be a base point are input to the input means 1 from the outside in the case of a large-scale system.

演算処理手段2は次のような処理手段(機能)を備える。   The arithmetic processing means 2 includes the following processing means (functions).

・ソースコードの構文解析(すなわち文法解析)
・抽出構文木分析
・命令文検索
・命令文繋がりの形成
・共有命令文の抽出
・命令文による依存関係
・グラフの形成
・影響範囲の設定
・影響範囲の特定
出力手段3は、
・依存関係の辿り
・設定された影響範囲
・特定された影響範囲
を出力し、画面表示装置7の画面8に表示する。
・ Syntax analysis of source code (ie grammar analysis)
・ Extract syntax tree analysis ・ Command statement search ・ Formation of command statement connection ・ Extraction of shared command statement ・ Dependence by command statement ・ Formation of graph ・ Setting of influence range ・ Identification of influence range Output means 3
-Tracing the dependency relationship-The set influence range-The specified influence range is output and displayed on the screen 8 of the screen display device 7.

データベース4は、演算処理手段2で演算処理されることで生成された命令文による依存関係グラフ(すなわちデータ)を格納する。   The database 4 stores a dependency relationship graph (that is, data) based on a command sentence generated by arithmetic processing by the arithmetic processing means 2.

演算処理手段2について説明する。
ソースコードの構文解析手段は、プログラムのソースコードを構文解析する。
抽象構文木分析手段は、構文解析に基づいて階層構造としての抽象構文木に分析する。
The arithmetic processing means 2 will be described.
The source code syntax analysis means parses the source code of the program.
The abstract syntax tree analyzing means analyzes the abstract syntax tree as a hierarchical structure based on the syntax analysis.

命令文検索手段は、抽象構文木を形成する命令文を検索する。抽象構文木に表現されている全てのノード(行、命令文)について依存関係を分析し、命令文を検索する。   The imperative sentence search means searches for an imperative sentence that forms an abstract syntax tree. Dependencies are analyzed for all nodes (lines, command statements) expressed in the abstract syntax tree, and command statements are searched.

命令文繋がり作成手段は、検索された命令文から命令文の依存関係に従って命令文の繋がりを形成する。命令文の繋がりは複数のソースコードについて形成される。   The command statement connection creating means forms a command statement link from the retrieved command statements according to the dependency relationship of the command statements. A sequence of statements is formed for a plurality of source codes.

共有命令文の抽出手段は、同一であるときに当該命令文はそれぞれのソースコードに共有された命令文として抽出する。   The shared command sentence extraction means extracts the command text as a command text shared by the respective source codes when they are the same.

命令文による依存関係グラフの形成手段は、他のプログラムとの関係で、共有された命令文と依存関係で繋がった命令文との組み合わせを含んで複数のソースコードについて命令文による依存関係グラフを形成する。   Dependency graph formation means by command statements is a graph of command dependency graphs for multiple source codes including combinations of shared command statements and command statements connected by dependency relationships with other programs. Form.

影響波及範囲設定手段は、依存関係グラフを基にして、依存関係にある影響波及範囲を設定する。   The influence spread range setting means sets the influence spread range in the dependency relationship based on the dependency relationship graph.

影響波及範囲特定手段は、設定された影響波及範囲を基に、影響波及範囲を特定する。   The influence influence range specifying means specifies the influence influence range based on the set influence influence range.

図2は、本実施例を用いるエンジンの構成を示す。
エンジンは、言語依存部分と言語非依存部分とから構成される。(1)構文解析に際しては、各種のプラグイン、例えばA分析プラグイン、B分析プラグイン、C分析プラグインが用いられる。1つのプラグインでもよい。
FIG. 2 shows the configuration of an engine using this embodiment.
The engine is composed of a language dependent part and a language independent part. (1) For syntax analysis, various plug-ins, for example, an A analysis plug-in, a B analysis plug-in, and a C analysis plug-in are used. One plug-in may be used.

図2に示すように、構文解析がなされ、抽出構文木が解析され、(2)依存関係分析がなされる。この分析によって依存関係が形成され、次いで(3)影響波及分析がなされる。この分析によって影響波及結果が生成される。   As shown in FIG. 2, syntax analysis is performed, the extracted syntax tree is analyzed, and (2) dependency relationship analysis is performed. A dependency is formed by this analysis, and then (3) an influence spread analysis is performed. This analysis generates an influence ripple result.

図3は、処理の流れを示す。
ソースコードについて(1)文法解析を行う(S1)。ソースコードだけでは不足する型情報等をバイトコードなどの補完情報で補完するようにしてもよい。ここで補完するとは、ソースコードだけでは不足する情報を補うための補足情報をいう。例えばJava(登録商標)言語におけるclassやjarファイルの情報を指す。
(1)構文解析に基づいて抽象構文木を形成し(S2)、(2)依存関係分析を行う(S3)。この分析結果により依存関係を形成し(S4)、影響の基点を基に、(3)影響波及分析を行う(S5)。この分析結果により影響波及結果を生成する(S6)。
FIG. 3 shows the flow of processing.
(1) Grammar analysis is performed on the source code (S1). You may make it complement the type information etc. which are insufficient only with a source code with supplement information, such as a byte code. Here, “complement” means supplementary information for supplementing information that is insufficient only by the source code. For example, it refers to class and jar file information in Java (registered trademark) language.
(1) An abstract syntax tree is formed based on syntax analysis (S2), and (2) dependency analysis is performed (S3). Based on the analysis result, a dependency relationship is formed (S4), and (3) influence spread analysis is performed based on the base point of influence (S5). An influence spread result is generated based on the analysis result (S6).

図4は、ソースコードの構文解析手段及び抽象構文木分析手段によってソースコードの文法を解析し、抽象構文木を分析し形成することを示す。ここでは、人間の目で追うことに近付けるために、ソースコードの各命令文の意味を解析し、その結果を抽象構文木に変換する。抽象構文木を分析し、命令用語から命令文を検索する。   FIG. 4 shows that the syntax of the source code is analyzed by the source code syntax analysis means and the abstract syntax tree analysis means, and the abstract syntax tree is analyzed and formed. Here, in order to approach the pursuit with human eyes, the meaning of each statement in the source code is analyzed, and the result is converted into an abstract syntax tree. Analyzes the abstract syntax tree and retrieves imperative sentences from imperative terms.

図5は、命令文同士の繋がりを分析することを示す。   FIG. 5 shows analyzing the connection between statements.

例えば、メソッド呼出し文は、呼出先のメソッド宣言に繋がる。このように、メソッド呼出しだけでなく、変数の利用と宣言など、全ての命令文について繋がりを付与する。これを依存関係と呼ぶ。   For example, a method call statement leads to a method declaration at the call destination. In this way, not only the method call but also the connection is given to all command statements such as the use and declaration of variables. This is called dependency.

依存関係は影響波及を辿る道筋として用いる。   Dependency is used as a path to follow the influence spread.

図6は、影響波及範囲の設定及び影響波及範囲の特定を示す。
図6には、命令文1及び命令文2を基点とするソースコードの一連の命令文の繋がりが記載されている。
FIG. 6 shows setting of the influence spread range and identification of the influence spread range.
FIG. 6 shows a series of command statement connections in the source code starting from the command statement 1 and the command statement 2.

命令文1を起点とするソースコードと命令文2を起点とするソースコードは、命令文5は同一であると、それぞれのソースコードに共有された命令文となっていることを示す。   The source code starting from the command statement 1 and the source code starting from the command statement 2 indicate that the command statement 5 is the same as the command statement shared by the source code if the command statement 5 is the same.

命令文5は命令文7、命令文8が繋がり、命令文7には命令文9が繋がる。   The command statement 5 is connected to the command statement 7 and the command statement 8, and the command statement 7 is connected to the command statement 9.

図に示すように命令文5、命令文7、命令文9は、他のプログラムとの関係で、それぞれのソースコードに共有された命令文の繋がりを形成している。   As shown in the figure, the imperative sentence 5, the imperative sentence 7, and the imperative sentence 9 form a connection of the imperative sentences shared by the respective source codes in relation to other programs.

共有された命令文と依存関係で繋がった命令文との組み合わせを含んで複数のソースコードについての命令文による依存関係グラフが形成され、影響波及範囲が設定される。影響波及の調査は、命令文同士の依存関係を辿ることで行う。今、起点とされたソースコードの内、命令文2についてのソースコードを基点のソースコードとする。基点となる命令文2を指定し、基点となる命令文の依存関係を辿ることで設定された影響波及範囲が特定される。   A dependency graph based on the command statements for a plurality of source codes including a combination of the shared command statement and the command statement connected by the dependency relationship is formed, and the influence spread range is set. The influence spread is investigated by following the dependency between statements. Now, the source code for the statement 2 in the source code that is the starting point is used as the source code of the base point. The influence spread range set by specifying the command statement 2 as the base point and following the dependency relationship of the command statement as the base point is specified.

図7は、図6に示す状態でクラスやメソッドとの関係を示す。
図7において、命令文はクラスやメソッドに所属している。
FIG. 7 shows the relationship with classes and methods in the state shown in FIG.
In FIG. 7, the command statement belongs to a class or a method.

よって命令文を辿ることで、所属しているクラスやメソッドを特定することができる。例えば、命令文1はクラスAのメソッドαに所属している。   Therefore, the class or method to which the user belongs can be specified by tracing the statement. For example, the statement 1 belongs to the method α of class A.

図8は、図6に示す命令文と命令文の繋がりを具体例で示す。
図8において、ソースコードの命令文単位で影響波及のルートが示され、影響波及対象の命令文は命令用語から自動的に抽出される。
FIG. 8 shows the connection between the command statement shown in FIG. 6 and the command statement as a specific example.
In FIG. 8, the influence propagation route is shown for each instruction sentence of the source code, and the instruction sentence subject to the influence influence is automatically extracted from the instruction terms.

図9は、依存関係を辿った影響波及調査の例を示す。
図9は、UseInfoクラスに定義されたnameプロパティが及ぼす影響範囲を特定する例を示す。この例では、nameプロパティが持つ値の変更に伴なって、改修またはテストが必要となる範囲を特定する。例えば、従来3桁で表現していた値を、10桁で表現するように修正する場合である。
FIG. 9 shows an example of influence spread investigation that traces the dependency relationship.
FIG. 9 shows an example of specifying the influence range of the name property defined in the UseInfo class. In this example, the range that needs to be modified or tested as the value of the name property changes is specified. For example, this is a case where a value conventionally expressed with 3 digits is corrected to be expressed with 10 digits.

図9の説明は次の通りである。
UserInfoクラスのフィールドに定義されたnameプロパティの変更に対する影響波及を調査する。
The description of FIG. 9 is as follows.
Investigate the impact on the change of the name property defined in the field of UserInfo class.

〔UserInfoクラスの影響波及〕
1.nameプロパティは、getName()メソッドおよびsetName(String)メソッドで用いられている。
getName()メソッドのreturn文でnameプロパティが返却されるため、getName()メソッドの呼出元に影響が波及する。
⇒UtilityクラスのmakeKey(Date, String)メソッドへ。
2.setName(String)メソッドでは、setName(String)メソッドの引数の値をnameプロパティに上書きするため、nameプロパティの変更に対する影響はなく、これ以上の波及はしない。
[Influence of UserInfo class]
1. The name property is used in the getName () and setName (String) methods.
Since the name property is returned by the return statement of the getName () method, the influence is affected to the caller of the getName () method.
⇒To makeKey (Date, String) method of Utility class.
2. In the setName (String) method, the value of the argument of the setName (String) method is overwritten in the name property, so there is no effect on the change of the name property, and no further ripple occurs.

〔Utilityクラスの影響波及〕
1.userInfo.getName()の値に影響があるため、その値を用いた計算結果を格納するstring変数に影響が波及する。
2.string変数は、encryption.encrypt(String)メソッドに渡されるため、その計算結果であるencryptedString変数、およびencrypt(String)メソッドに影響が波及する
⇒Encryptionクラスのencrypt(String)メソッドへ。
3.encryptedString変数はmakeKey(Date, String)メソッドの戻り値となるため、makeKey(Date, String)メソッドの呼出元へ影響が波及する。
⇒Logicクラスのlogic()メソッドへ。
[Effect of the Utility class]
1. Since it affects the value of userInfo.getName (), it affects the string variable that stores the calculation result using that value.
2. Since the string variable is passed to the encryption.encrypt (String) method, the effect affects the encryptedString variable and the encrypted (String) method.
⇒To encryption (String) method of Encryption class.
3. Since the encryptedString variable becomes the return value of the makeKey (Date, String) method, the influence affects the caller of the makeKey (Date, String) method.
⇒To logic () method of Logic class.

〔Encryptionクラスの影響波及〕
1.encrypt(String)メソッドのstring引数に影響があるため、その値を用いた命令文「process(string)」の引数に影響がある。
2.process(String)メソッドの引数のstring変数に影響があるため、その値を用いている「return string」命令文に影響がある。return文に影響があるため、process(String)メソッドの戻り値に影響するため、process(String)メソッドの呼出元に影響が波及する。
⇒Encryptionクラスのencrypt(String)メソッド(3)へ。
3.encryptedString変数をreturn文で返却しているため、encrypt(String)メソッドの呼出元に影響が波及する。
⇒UtilityクラスのmakeKey(Date, String)メソッドへ。
[Influence of the Encryption class]
1. Since it affects the string argument of the encrypt (String) method, it affects the argument of the statement "process (string)" using that value.
2. Since it affects the string variable of the argument of process (String) method, it affects the "return string" statement that uses that value. Since the return statement is affected, the return value of the process (String) method is affected, so the influence is spread to the caller of the process (String) method.
⇒To the encryption (String) method (3) of the Encryption class.
3. Since the encryptedString variable is returned by the return statement, the influence is spread to the caller of the encrypt (String) method.
⇒To makeKey (Date, String) method of Utility class.

〔Logicクラスの影響波及〕
UtilityクラスのmakeKey(Date, String)の戻り値に影響があるため、その値をセットしているkey変数に影響がある。
key変数はその後に用いられていないため、ここで影響波及は終了となる。
[Influence of Logic class]
Since it affects the return value of makeKey (Date, String) of Utility class, it affects the key variable that sets the value.
Since the key variable is not used after that, the influence spread ends here.

図10は、本実施例による影響波及範囲調査による結果を呼出関係による影響波及調査との比較によって示す。呼出関係による影響波及調査方法では、影響のないクラス/メソッドが大量に抽出されるため、どこまで辿るかを人間が判断し、絞り込むことが必要となる。これに対して、本実施例では、影響波及調査された結果は、必要充分な結果であるため、どこまで辿るかという判断を必要としない。   FIG. 10 shows the result of the influence influence range investigation according to the present embodiment by comparison with the influence influence investigation by the calling relation. In the influence spread investigation method based on the call relation, a large number of classes / methods having no influence are extracted, and it is necessary for a human to judge and narrow down how far to go. On the other hand, in the present embodiment, the result of the influence spread investigation is a necessary and sufficient result, and therefore it is not necessary to determine how far to go.

本実施例によれば、文法を命令文単位に構文解析することで、
・命令文同士の依存関係を分析できる
・処理の流れを分析できる
という特徴を得ることができる。これにより、影響する命令文を辿ることができ、例えば「呼出関係」を中心とした影響波及調査の問題を解決できる。そして、図6、図7に示すように、影響の終着点を機械的に判断することができる。スパゲティコードのような場合にあっても必要な命令文関係を抽出することができる。
According to the present embodiment, by parsing the grammar for each imperative sentence,
・ Ability to analyze dependencies between statements ・ A feature of analyzing the flow of processing can be obtained. As a result, it is possible to trace the imperative statement, and for example, it is possible to solve the problem of the influence spread investigation centering on “call relation”. Then, as shown in FIGS. 6 and 7, the end point of the influence can be mechanically determined. Even in the case of a spaghetti code, a necessary command statement relationship can be extracted.

図11から図14は、本実施例による影響波及範囲調査による結果を呼出関係による影響波及調査との比較を具体的に示す。   FIG. 11 to FIG. 14 specifically show the comparison of the result of the influence spread range investigation according to this embodiment with the influence spread investigation by the calling relationship.

図11から図13は、従来の呼出関係による影響波及調査の結果を示す。詳細内容は、これらの図に記述した。   FIG. 11 to FIG. 13 show the results of the influence spread investigation by the conventional call relationship. Details are described in these figures.

図14は、本実施例による影響波及調査の結果を示す。   FIG. 14 shows the results of an influence spread investigation according to this example.

したがって、これらの比較から本実施例によれば、影響のないクラス及びメソッドが大量に抽出されることはなく、命令文と命令文の繋ぎによる依存関係を辿ることで影響波及範囲を特定することができる。   Therefore, according to the present embodiment, a large number of unaffected classes and methods are not extracted from these comparisons, and the influence spillover range is specified by following the dependency relationship between the imperative sentence and imperative sentence. Can do.

このように、本実施例は、大規模なシステムの改修の時に実施する影響波及調査の制度を向上させ、作業効率を向上させることができる。   In this way, this embodiment can improve the system of the influence spread investigation that is performed at the time of renovation of a large-scale system, and can improve the work efficiency.

1…入力手段、2…演算処理手段、3…出力手段、4…データベース、5…プログラム、6…基点となる命令文、7…画面表示装置、8…画面、100…プログラムの影響波及範囲設定装置。   DESCRIPTION OF SYMBOLS 1 ... Input means, 2 ... Arithmetic processing means, 3 ... Output means, 4 ... Database, 5 ... Program, 6 ... Command sentence used as a base point, 7 ... Screen display apparatus, 8 ... Screen, 100 ... Setting of influence influence range of program apparatus.

Claims (4)

プログラムのソースコードが構文解析されて抽象構文木に分析され、該抽象構文木を形成する命令文が検索され、
検索された命令文から命令文の依存関係に従って命令文の繋がりが形成され、
ソースコードについての命令文と命令文の繋がりとによる依存関係グラフが形成されて、依存関係にある影響波及範囲が設定されること
を特徴とするプログラムの影響波及範囲設定装置。
The program source code is parsed and analyzed into an abstract syntax tree, and the statements that form the abstract syntax tree are retrieved,
A connection of command statements is formed from the retrieved command statements according to the dependency relationship of the command statements,
An influence spread range setting device for a program characterized in that a dependency relation graph based on a statement and a connection between instruction sentences for a source code is formed, and an influence spread range in the dependency relation is set.
プログラムのソースコードが構文解析されて抽象構文木に分析され、
該抽象構文木を形成する命令文が命令文用語から検索され、
検索された命令文から命令文の依存関係に従って命令文の繋がりが形成され、
複数のソースコードについて、それぞれ検索された命令文の繋がりが形成され、
複数のソースコードの有する検索された命令文が、同一であるときに当該命令文はそれぞれのソースコードに共有された命令文とされ、
該共有された命令文と命令文の繋がりとの組み合わせを含んで複数のソースコードについての命令文と命令文の繋がりとによる依存関係グラフが形成されて共有して、依存関係にある影響波及範囲が設定されること
を特徴とするプログラムの影響波及範囲設定装置。
The program source code is parsed into an abstract syntax tree,
The imperative sentence forming the abstract syntax tree is searched from imperative sentence terms,
A connection of command statements is formed from the retrieved command statements according to the dependency relationship of the command statements,
For multiple source codes, a sequence of retrieved statements is formed,
When the searched command statements of a plurality of source codes are the same, the command statement is a command statement shared by each source code,
A dependency graph including a combination of the shared instruction sentence and the connection of the instruction sentence including a combination of the instruction sentence and the connection of the instruction sentence for a plurality of source codes is formed and shared, and the influence spreading range in the dependency relation An influence spread range setting device for a program, characterized in that is set.
請求項1または2に記載されたプログラムの影響波及範囲設定装置による影響範囲の特定方法において、
前記依存関係グラフ上で、基点となる命令文が指定されると、基点となる命令文からの依存関係を辿ることで影響波及範囲が特定されることを特徴とするプログラムの影響範囲波及範囲の特定方法。
In the method for identifying the influence range by the influence influence range setting device of the program according to claim 1 or 2,
When a base statement is specified on the dependency graph, the influence spread range is specified by tracing the dependency from the base statement. Identification method.
請求項1または2に記載されたプログラムの影響波及範囲設定装置による影響波及のあるプログラムの抽出方法において、
前記依存関係グラフ上で、基点となる命令文が特定されたときに、基点となる命令文からの依存関係を辿ることで命令文及び命令文の繋がりを備えたプログラムを影響波及のあるプログラムとして抽出することを特徴とする影響波及のあるプログラム抽出方法。
In the extraction method of the program with the influence influence by the influence influence range setting apparatus of the program described in Claim 1 or 2,
When a command statement as a base point is specified on the dependency relationship graph, a program having a connection between the command statement and the command statement is traced as a program having an influence ripple effect by tracing the dependency relationship from the command statement as the base point. A program extraction method with influence influence characterized by extracting.
JP2011077018A 2011-03-31 2011-03-31 Range of influence setting device for program and range of influence specification method using the same and extraction method for program with ripple of influence Pending JP2012212281A (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2011077018A JP2012212281A (en) 2011-03-31 2011-03-31 Range of influence setting device for program and range of influence specification method using the same and extraction method for program with ripple of influence
PCT/JP2012/058288 WO2012133606A1 (en) 2011-03-31 2012-03-29 Apparatus for setting affecting extent of program, and method of specifying affecting extent and method of extracting affecting program using same
CN201280016907.6A CN103443766B (en) 2011-03-31 2012-03-29 The coverage setting device of program, and using the device coverage ad hoc approach and the extracting method of impacted program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011077018A JP2012212281A (en) 2011-03-31 2011-03-31 Range of influence setting device for program and range of influence specification method using the same and extraction method for program with ripple of influence

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2015210674A Division JP6011988B2 (en) 2015-10-27 2015-10-27 Impact range survey method and impact range survey device

Publications (1)

Publication Number Publication Date
JP2012212281A true JP2012212281A (en) 2012-11-01

Family

ID=46931308

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011077018A Pending JP2012212281A (en) 2011-03-31 2011-03-31 Range of influence setting device for program and range of influence specification method using the same and extraction method for program with ripple of influence

Country Status (3)

Country Link
JP (1) JP2012212281A (en)
CN (1) CN103443766B (en)
WO (1) WO2012133606A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020021427A (en) * 2018-08-03 2020-02-06 三菱電機株式会社 Change influence analyzer

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106446163A (en) * 2016-09-26 2017-02-22 福建省知识产权信息公共服务中心 Retrieval method based on advanced assertion decision algorithm and LL recursive descent method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08328904A (en) * 1995-03-31 1996-12-13 Hitachi Software Eng Co Ltd Program development supporting device
JP2008191963A (en) * 2007-02-06 2008-08-21 Nec Corp Source code verification system, source code verification method and source code verification program
JP2009080681A (en) * 2007-09-26 2009-04-16 Hitachi Software Eng Co Ltd Program structure parsing method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101436128B (en) * 2007-11-16 2012-10-31 北京邮电大学 Software test case automatic generating method and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08328904A (en) * 1995-03-31 1996-12-13 Hitachi Software Eng Co Ltd Program development supporting device
JP2008191963A (en) * 2007-02-06 2008-08-21 Nec Corp Source code verification system, source code verification method and source code verification program
JP2009080681A (en) * 2007-09-26 2009-04-16 Hitachi Software Eng Co Ltd Program structure parsing method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020021427A (en) * 2018-08-03 2020-02-06 三菱電機株式会社 Change influence analyzer
JP7085938B2 (en) 2018-08-03 2022-06-17 三菱電機株式会社 Change impact analyzer

Also Published As

Publication number Publication date
WO2012133606A1 (en) 2012-10-04
CN103443766A (en) 2013-12-11
CN103443766B (en) 2017-04-05

Similar Documents

Publication Publication Date Title
US9389849B2 (en) Test case pattern matching
Thomas et al. Using automated fix generation to secure SQL statements
US20130179863A1 (en) Bug variant detection using program analysis and pattern identification
AU2015218520B2 (en) Service extraction and application composition
Androutsopoulos et al. State-based model slicing: A survey
US8806452B2 (en) Transformation of computer programs and eliminating errors
Nguyen et al. Cross-language program slicing for dynamic web applications
JP2015043198A (en) Analysis system, analysis method and analysis program
CN110059006B (en) Code auditing method and device
Guana et al. Chaintracker, a model-transformation trace analysis tool for code-generation environments
Rahimian et al. RESource: a framework for online matching of assembly with open source code
Dasgupta et al. A static analysis framework for database applications
US11119899B2 (en) Determining potential test actions
KR101583932B1 (en) Signature generation apparatus for generating signature of program and the method, malicious code detection apparatus for detecting malicious code of signature and the method
WO2012133606A1 (en) Apparatus for setting affecting extent of program, and method of specifying affecting extent and method of extracting affecting program using same
Anderson et al. Supporting analysis of SQL queries in PHP AiR
JP6011988B2 (en) Impact range survey method and impact range survey device
Kaur et al. Clone detection in software source code using operational similarity of statements
Pollock et al. Introducing natural language program analysis
JP6116983B2 (en) Entry point extraction device
Ali et al. An enhanced generic pipeline model for code clone detection
JP2016051367A (en) Data analysis device, data analysis method, and program
WO2018116522A1 (en) Determination device, determination method, and determination program
Bangare et al. Code parser for object Oriented software Modularization
US8825631B2 (en) System and method for improved processing of an SQL query made against a relational database

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140303

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20141104

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20141218

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150120

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150319

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20150728