JP2016164727A - Test case selection device - Google Patents

Test case selection device Download PDF

Info

Publication number
JP2016164727A
JP2016164727A JP2015044697A JP2015044697A JP2016164727A JP 2016164727 A JP2016164727 A JP 2016164727A JP 2015044697 A JP2015044697 A JP 2015044697A JP 2015044697 A JP2015044697 A JP 2015044697A JP 2016164727 A JP2016164727 A JP 2016164727A
Authority
JP
Japan
Prior art keywords
test case
statement
program
expected value
test
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
JP2015044697A
Other languages
Japanese (ja)
Inventor
毅 福田
Takeshi Fukuda
毅 福田
北斗 篠田
Hokuto Shinoda
北斗 篠田
成沢 文雄
Fumio Narisawa
文雄 成沢
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 Industry and Control Solutions Co Ltd
Original Assignee
Hitachi Industry and Control Solutions Co 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 Industry and Control Solutions Co Ltd filed Critical Hitachi Industry and Control Solutions Co Ltd
Priority to JP2015044697A priority Critical patent/JP2016164727A/en
Publication of JP2016164727A publication Critical patent/JP2016164727A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a test case selection device with which it is possible to reduce the number of test cases selected as necessary to reexecute in a regression test and improve the efficiency of a process for testing a program.SOLUTION: The test case selection device comprises: storage units 102, 103 for storing a program before and after alteration; a storage unit 104 for storing a test case and a statement executed in a program before alteration as execution information; a storage unit 105 for storing an expected value that is a variable outputted in a test case; an acquisition unit 106 for obtaining different statements in the program and after alternation as a difference statement; an analysis unit 107 for obtaining a statement affected from the difference statement as a dependency analysis result; and a selection unit 109 for selecting a test case that has the possibility of the value of an expected value being changed in the program and after alteration, as a test case executed in a regression test, using the statement of execution information, the expected value, the difference statement, and the dependency analysis result.SELECTED DRAWING: Figure 1

Description

本発明は、プログラムの回帰テストの際に再実行が必要なテストケースを選択することができるテストケース選択装置に関する。   The present invention relates to a test case selection device that can select a test case that needs to be re-executed in a regression test of a program.

プログラムを修正した際、修正箇所以外に意図しない影響が波及していないか、すなわち、修正によりプログラムに不具合が生じていないかを確認するテストを回帰テストと呼ぶ。回帰テストの最も単純な実施形態では、事前に用意したテストケースを全て再テストする。しかし、この場合には、ソフトウェアの規模が大きくなるほど、テストケースを全て再テストするのに大きな工数が必要となり、回帰テストの効率が低下するという課題がある。また、テスト工数が大きいという理由で、製品リリースまでに繰り返される個々の修正についての再テストを先延ばしにすると、重要な不具合を開発後期まで見落とす可能性が高い。このため、既存のテストケースのうち再テストが必要なもののみを選択して実行することで回帰テストの工数を削減する回帰テスト選択が一般に行われている。   When the program is modified, a test for confirming whether an unintended influence other than the modified portion has spread, that is, whether the program is not defective due to the modification is called a regression test. In the simplest embodiment of regression testing, all prepared test cases are retested. However, in this case, the larger the software scale, the more man-hours are required to retest all the test cases, and the efficiency of the regression test decreases. Also, if you postpone retesting for individual corrections that are repeated until product release because of the large number of test steps, it is likely that important defects will be overlooked until late in development. For this reason, regression test selection is generally performed that reduces the number of regression test steps by selecting and executing only existing test cases that require retesting.

回帰テスト選択手法の一例として、テストケースがプログラムのどのステートメントを実行するかを予め記録しておき、修正箇所を実行するテストケースを自動的に選択する方法がある。特許文献1には、これと同様の方法を用いた回帰テスト選択手法の例が記載されている。特許文献1に記載されたシステムと方法では、修正した箇所に関連のあるステートメントを優先度(依存関係の強さ)に応じて抽出し、抽出したステートメントと関連付けられたテストケースを実行することで、回帰テストを効率化している。   As an example of the regression test selection method, there is a method of recording in advance which statement of a program is executed by a test case and automatically selecting a test case for executing a corrected portion. Patent Document 1 describes an example of a regression test selection method using a similar method. In the system and method described in Patent Document 1, a statement related to the corrected location is extracted according to priority (strength of dependency), and a test case associated with the extracted statement is executed. , Streamlining regression testing.

特開2008−204405号公報JP 2008-204405 A

大規模なソフトウェア開発においては回帰テストの工数が非常に大きくなる傾向があることを鑑みると、回帰テスト選択手法では、再テストするテストケースの数をできる限り削減することが望ましい。とりわけ、ソフトウェアの最終的な品質を確認するテストとは別にプログラムの修正毎に回帰テストを実施する際には、テストケースの数の削減が必須である。   In view of the fact that regression testing tends to be very large in large-scale software development, it is desirable that the regression test selection method reduce the number of test cases to be retested as much as possible. In particular, it is essential to reduce the number of test cases when performing regression tests for each program modification separately from tests for checking the final quality of software.

しかしながら、特許文献1に記載の技術のように修正箇所や修正に関連のある箇所(修正の影響を受ける箇所)を実行するテストケースを選択する方法には、プログラムの不具合を発見できないテストケースを多数選択してしまうという課題がある。例えば、プログラムの初期化処理のように多くのテストケースが共通して実行する箇所に修正があった場合には、回帰テストで実行するテストケースの数をほとんど削減することができない。そのうえ、このような修正箇所を実行するテストケースのうち、初期化処理そのものや修正した初期化処理に影響を受ける箇所をテストしているものを除けば、大半のテストケースは、実行してもプログラムの不具合を発見できないテストケースである。   However, in the method of selecting a test case that executes a correction part or a part related to the correction (a part affected by the correction) as in the technique described in Patent Document 1, a test case that cannot find a defect in the program is used. There is a problem of selecting a large number. For example, when there is a correction at a location where many test cases are executed in common, such as in the initialization processing of a program, the number of test cases executed in the regression test can hardly be reduced. In addition, most of the test cases can be executed, except for those testing cases that execute such modified parts, except those that test the initialization process itself or parts that are affected by the modified initialization process. This is a test case in which a bug in the program cannot be found.

このように、従来の回帰テスト選択手法では、回帰テストで実行するテストケースの数を削減できない場合があり、このような場合にプログラムのテスト工程の効率が低下するという課題がある。   As described above, in the conventional regression test selection method, the number of test cases executed in the regression test may not be reduced. In such a case, there is a problem that the efficiency of the test process of the program is lowered.

本発明は、回帰テストの際に再実行が必要として選択するテストケースの数を削減することができ、プログラムのテスト工程の効率を向上させることができるテストケース選択装置を提供することを目的とする。   An object of the present invention is to provide a test case selection device capable of reducing the number of test cases to be selected as being necessary for re-execution during a regression test and improving the efficiency of a program test process. To do.

本発明によるテストケース選択装置は、次のような特徴を備える。テストケースを実行した際に出力される変数とこの変数の値を期待値とし、前記期待値は前記テストケース毎に定められており、変更前プログラムと、前記変更前プログラムに変更がされた変更後プログラムとを格納する格納部と、前記変更前プログラムに対して実行した前記テストケースと、実行したこのテストケースで実行したステートメントとを、テストケース実行情報として格納するテストケース実行情報格納部と、前記テストケース毎に、前記期待値の変数をテストケース期待値情報として格納するテストケース期待値情報格納部と、前記変更前プログラムと前記変更後プログラムとで異なるステートメントを差異ステートメントとして求めるプログラム差異取得部と、前記差異ステートメントから影響を受けるステートメントを依存関係分析結果として求めるプログラム依存関係分析部と、前記変更後プログラムの回帰テストの際に実行する前記テストケースを選択するテストケース選択部とを備える。前記テストケース選択部は、前記テストケース実行情報の前記ステートメントと、前記テストケース期待値情報の前記期待値と、前記差異ステートメントとから、前記依存関係分析結果を利用して、前記変更前プログラムと前記変更後プログラムとで前記期待値の変数の値を変える可能性のあるテストケースを求め、求めたこのテストケースを前記回帰テストの際に実行する前記テストケースとして選択する。   The test case selection apparatus according to the present invention has the following features. The variable that is output when the test case is executed and the value of this variable is the expected value, the expected value is determined for each test case, and the program before the change and the change that has been changed to the program before the change A storage unit for storing a post-program, a test case execution information storage unit for storing the test case executed for the pre-change program and a statement executed in the executed test case as test case execution information; , A test case expected value information storage unit for storing the expected value variable as test case expected value information for each test case, and a program difference for obtaining a different statement as a difference statement in the pre-change program and the post-change program The acquisition section and the statement affected by the difference statement Comprising a program dependency analysis unit for determining the presence relationship analysis, and a test case selector which selects the test case to be executed during regression testing of the post-change program. The test case selection unit uses the dependency analysis result from the statement of the test case execution information, the expected value of the test case expected value information, and the difference statement, and the program before change A test case that may change the value of the expected value variable with the changed program is obtained, and the obtained test case is selected as the test case to be executed in the regression test.

本発明によると、回帰テストの際に再実行が必要として選択するテストケースの数を削減することができ、プログラムのテスト工程の効率を向上させることができるテストケース選択装置を提供することができる。   According to the present invention, it is possible to provide a test case selection device that can reduce the number of test cases that are selected as needing re-execution during a regression test, and can improve the efficiency of the test process of the program. .

本発明の実施例によるテストケース選択装置の構成の一例を示す図。The figure which shows an example of a structure of the test case selection apparatus by the Example of this invention. 変更前プログラム格納部に格納された変更前プログラムの一例を示す図。The figure which shows an example of the program before a change stored in the program storage part before a change. 変更後プログラム格納部に格納された変更後プログラムの一例を示す図。The figure which shows an example of the program after a change stored in the program storage part after a change. テストケース実行情報格納部に格納されたテストケース実行情報の一例を示す図。The figure which shows an example of the test case execution information stored in the test case execution information storage part. テストケース期待値情報格納部に格納されたテストケース期待値情報の一例を示す図。The figure which shows an example of the test case expected value information stored in the test case expected value information storage part. プログラム差異取得部が実行する処理手順の一例を示す図。The figure which shows an example of the process sequence which a program difference acquisition part performs. プログラム依存関係分析部が実行する処理手順の一例を示す図。The figure which shows an example of the process sequence which a program dependence analysis part performs. 依存分析結果格納部に格納された依存関係分析結果の一例を示す図。The figure which shows an example of the dependence relationship analysis result stored in the dependence analysis result storage part. 図8に示した依存関係を可視化した依存解析結果グラフ。The dependence analysis result graph which visualized the dependence shown in FIG. テストケース選択部が実行する処理手順の一例を示す図。The figure which shows an example of the process sequence which a test case selection part performs. テストケース選択装置のハードウェア構成の一例を示す図。The figure which shows an example of the hardware constitutions of a test case selection apparatus.

本発明によるテストケース選択装置は、プログラムの回帰テストの際に、プログラムの修正によって生じた不具合を発見できないテストケースを再実行が必要なテストケースとして選択しないようにすることで、再実行が必要として選択するテストケースの数を減らし、回帰テストの効率を高めることができる。   The test case selection device according to the present invention needs to be re-executed by preventing a test case in which a defect caused by the correction of the program cannot be found from being selected as a test case that needs to be re-executed during the regression test of the program. Reduce the number of test cases to choose as and increase the efficiency of regression testing.

ここで、再実行する価値があるテストケース、つまり、プログラムの修正によって生じた不具合を発見可能なテストケースとは何かについて詳細を述べる。   Here, we will describe in detail what is a test case worth re-execution, that is, a test case that can detect defects caused by program modifications.

テストケースは、プログラムが期待されている動作を実行するか否かを調べるために実行され、プログラムを実行する手順(テストケースで実行するステートメントとその実行する順序)と、その手順を実行する際に必要な入力変数とその値と、その手順を実行した際に得られる出力変数とその値(期待値)で定義される。「テストケースを実行する」とは、テストケースで定義されているステートメントを実行することである。通常は、複数のテストケースが予め定義される。   The test case is executed to check whether the program performs the expected operation, the procedure for executing the program (statements executed in the test case and the order in which they are executed), and when executing the procedure Is defined by the input variables and their values necessary for the output, and the output variables and their values (expected values) obtained when the procedure is executed. “Execute a test case” means to execute a statement defined in the test case. Usually, a plurality of test cases are defined in advance.

テストケースを実行した際に出力される変数とその値は、「期待値」と呼ばれる。期待値は、テストケース毎に定められる。すなわち、テストケースに応じて、期待値が設定される。   The variables and their values that are output when the test case is executed are called “expected values”. Expected values are determined for each test case. That is, an expected value is set according to the test case.

従って、プログラムの修正によって生じた不具合は、テストケースの実行結果すなわち特定のプログラム出力と、そのテストケースに定められた期待値との間に差異があった場合に発見される。このことから、不具合を発見可能なテストケースとは、修正の影響がプログラム出力に及び、その結果、プログラム出力とこれに対応する期待値との間に差異が生じるテストケースである。   Therefore, a malfunction caused by the modification of the program is found when there is a difference between the execution result of the test case, that is, the specific program output and the expected value determined for the test case. From this, a test case in which a defect can be found is a test case in which the effect of correction affects the program output, and as a result, a difference occurs between the program output and the expected value corresponding thereto.

従来の方法で不具合を発見できないテストケースを多数選択してしまう理由として、上述した、テストケースに定められた期待値についての情報を利用していないことが挙げられる。   One reason for selecting a large number of test cases in which a defect cannot be found by the conventional method is that the information about the expected value defined for the test case is not used.

本発明によるテストケース選択装置では、テストケースに定められた期待値についての情報を利用し、プログラムの修正の影響が期待値に対応するプログラム出力に及ぶか否か(プログラムの修正によりプログラム出力が期待値と異なる可能性があるか否か)をテストケース選択時の判断基準として用いる。このようにして、本発明によるテストケース選択装置では、プログラムの回帰テストの際に、プログラムの修正によって生じた不具合を発見できないテストケースを再実行が必要なテストケースとして選択しないようにし、回帰テストの効率を高める。   In the test case selection device according to the present invention, information on the expected value determined in the test case is used, and whether or not the influence of the modification of the program reaches the program output corresponding to the expected value (the program output is changed by the modification of the program). Whether or not there is a possibility that it is different from the expected value) is used as a judgment criterion when selecting a test case. Thus, in the test case selection apparatus according to the present invention, during the regression test of a program, a test case in which a defect caused by the modification of the program cannot be found is not selected as a test case that needs to be re-executed. Increase efficiency.

以下、図面を参照し、本発明の実施例によるテストケース選択装置を説明する。   Hereinafter, a test case selection apparatus according to an embodiment of the present invention will be described with reference to the drawings.

図1は、本発明の実施例によるテストケース選択装置101の構成の一例を示す図である。テストケース選択装置101は、変更前プログラム格納部102、変更後プログラム格納部103、テストケース実行情報格納部104、テストケース期待値情報格納部105、プログラム差異取得部106、プログラム依存関係分析部107、依存分析結果格納部108、テストケース選択部109、及びユーザインターフェイス(I/F)部110を備える。テストケース選択装置101は、例えば、コンピュータで構成することができる。   FIG. 1 is a diagram illustrating an example of a configuration of a test case selection apparatus 101 according to an embodiment of the present invention. The test case selection apparatus 101 includes a pre-change program storage unit 102, a post-change program storage unit 103, a test case execution information storage unit 104, a test case expected value information storage unit 105, a program difference acquisition unit 106, and a program dependence analysis unit 107. , A dependency analysis result storage unit 108, a test case selection unit 109, and a user interface (I / F) unit 110. The test case selection apparatus 101 can be configured by a computer, for example.

変更前プログラム格納部102は、変更(修正)される前のプログラムソースコード(変更前プログラム)を格納する。変更後プログラム格納部103は、変更前プログラムの一部に変更がされたプログラムソースコード(変更後プログラム)を格納する。テストケース選択装置101は、変更前プログラムと変更後プログラムを入力し、変更前プログラムを変更前プログラム格納部102に、変更後プログラムを変更後プログラム格納部103に、それぞれ格納する。   The pre-change program storage unit 102 stores program source code (pre-change program) before being changed (corrected). The post-change program storage unit 103 stores the program source code (the post-change program) that has been changed as part of the pre-change program. The test case selection apparatus 101 inputs the pre-change program and the post-change program, and stores the pre-change program in the pre-change program storage unit 102 and the post-change program in the post-change program storage unit 103, respectively.

テストケース実行情報格納部104は、変更前プログラムに対して実行したテストケースと、各テストケースで実行したステートメントとを、テストケース実行情報Tとして格納する。テストケース実行情報Tは、事前に変更前プログラムに対して各テストケースを実行することで得られ、テストケース実行情報格納部104に予め格納される。   The test case execution information storage unit 104 stores test cases executed for the pre-change program and statements executed in the test cases as test case execution information T. The test case execution information T is obtained by executing each test case on the pre-change program in advance and is stored in advance in the test case execution information storage unit 104.

テストケース期待値情報格納部105は、各テストケースに定められた期待値とこの期待値に関連するプログラム出力の情報とを、テストケース期待値情報Eとして格納する。テストケース期待値情報Eは、各テストケースを定義したときに得られる情報であり、テストケース期待値情報格納部105に予め格納される。
プログラム差異取得部106は、変更前プログラムと変更後プログラムを入力し、これらのプログラムを比較、分析して差異ステートメントを求める。差異ステートメントについては、図6を用いて後述する。
The test case expected value information storage unit 105 stores, as test case expected value information E, the expected value determined for each test case and the program output information related to this expected value. The test case expected value information E is information obtained when each test case is defined, and is stored in the test case expected value information storage unit 105 in advance.
The program difference acquisition unit 106 inputs a pre-change program and a post-change program, and compares and analyzes these programs to obtain a difference statement. The difference statement will be described later with reference to FIG.

プログラム依存関係分析部107は、差異ステートメントを入力し、差異ステートメントに対して依存関係を持つステートメントを求めて、依存関係を分析する。依存関係を持つステートメントとその分析結果は、依存関係分析結果Gとして、依存分析結果格納部108に格納される。依存関係については、図7を用いて後述する。   The program dependency relationship analysis unit 107 inputs a difference statement, obtains a statement having a dependency relationship with the difference statement, and analyzes the dependency relationship. A statement having a dependency relationship and an analysis result thereof are stored as a dependency relationship analysis result G in the dependency analysis result storage unit 108. The dependency relationship will be described later with reference to FIG.

テストケース選択部109は、変更前プログラムと変更後プログラムとで期待値の変数の値を変える可能性のあるテストケースを、変更後プログラムの回帰テストの際に実行するテストケースとして選択する。具体的には、テストケース選択部109は、テストケース実行情報T、テストケース期待値情報E、及び依存関係分析結果Gを入力し、プログラムの修正の影響が期待値に対応するプログラム出力に及ぶか否か(プログラムの修正によりプログラム出力が期待値と異なる可能性があるか否か)の判断に基づき、再実行が必要なテストケースを選択する。   The test case selection unit 109 selects a test case that may change the value of the expected value variable between the pre-change program and the post-change program as a test case to be executed during the regression test of the post-change program. Specifically, the test case selection unit 109 receives the test case execution information T, the test case expected value information E, and the dependency relationship analysis result G, and the influence of the program modification reaches the program output corresponding to the expected value. A test case that needs to be re-executed is selected based on the determination of whether or not the program output may be different from the expected value due to the modification of the program.

ユーザインターフェイス部110は、テストケース選択装置101の処理結果やユーザ111からの指示を伝達するための手段を提供する。ユーザインターフェイス部110は、例えば、コンピュータのマウスやキーボードなどの入力装置、ディスプレイやプリンタなどの出力装置、及びこれらを制御するプログラムで構成することができる。   The user interface unit 110 provides a means for transmitting processing results of the test case selection apparatus 101 and instructions from the user 111. The user interface unit 110 can be configured by, for example, an input device such as a computer mouse or keyboard, an output device such as a display or a printer, and a program for controlling them.

図2は、変更前プログラム格納部102に格納された変更前プログラムの一例を示す図である。図2では、一例として、C言語で書かれたプログラムソースコードの一部を示している。本実施例では、プログラムソースコードの各行のことを「ステートメント」と称する。各ステートメントには、(1)〜(13)のステートメント番号が付けられている。   FIG. 2 is a diagram illustrating an example of the pre-change program stored in the pre-change program storage unit 102. FIG. 2 shows a part of a program source code written in C language as an example. In this embodiment, each line of the program source code is referred to as a “statement”. Each statement is assigned a statement number (1) to (13).

図3は、変更後プログラム格納部103に格納された変更後プログラムの一例を示す図である。変更後プログラムは、図2に示した変更前プログラムと同じ形式で変更後プログラム格納部103に格納されるが、変更前プログラムの一部に変更が加えられている。ステートメント番号(1)のステートメントは変更され、ステートメント番号(5a)のステートメントは追加され、変更前プログラムのステートメント番号(12)のステートメントは削除されている。以下では、「ステートメント番号(1)のステートメント」のことを「ステートメント(1)」と略称し、他のステートメント番号のステートメントも同様に略称する。   FIG. 3 is a diagram illustrating an example of the changed program stored in the changed program storage unit 103. The post-change program is stored in the post-change program storage unit 103 in the same format as the pre-change program shown in FIG. 2, but a part of the pre-change program is changed. The statement with the statement number (1) is changed, the statement with the statement number (5a) is added, and the statement with the statement number (12) in the pre-change program is deleted. Hereinafter, “statement with statement number (1)” is abbreviated as “statement (1)”, and statements with other statement numbers are also abbreviated in the same manner.

図2、図3において、プログラムソースコードの変更箇所には、記号「*」が付けられている。すなわち、ステートメント(1)、(5a)、及び(12)には、記号「*」が付けられている。   In FIG. 2 and FIG. 3, the symbol “*” is added to the changed part of the program source code. That is, the symbols “*” are attached to the statements (1), (5a), and (12).

図4は、テストケース実行情報格納部104に格納されたテストケース実行情報Tの一例を示す図である。テストケース実行情報Tは、変更前プログラムに対して各テストケースを実行した際に実行したステートメントのステートメント番号についての情報である。図4に示すように、各々のテストケースには、一意に特定可能なように「テストケースNo.」が付けられているとともに、そのテストケースで実行したステートメント番号(「実行ステートメント情報」)が対応付けられている。すなわち、テストケース実行情報Tは、変更前プログラムに対して実行したテストケースと、そのテストケースで実行したステートメントとを対応付けた情報である。   FIG. 4 is a diagram illustrating an example of the test case execution information T stored in the test case execution information storage unit 104. The test case execution information T is information on the statement number of the statement executed when each test case is executed for the pre-change program. As shown in FIG. 4, each test case is given a “test case No.” so as to be uniquely identifiable, and a statement number (“executed statement information”) executed in the test case is assigned. It is associated. That is, the test case execution information T is information in which a test case executed for the pre-change program is associated with a statement executed in the test case.

図5は、テストケース期待値情報格納部105に格納されたテストケース期待値情報Eの一例を示す図である。テストケース期待値情報Eは、各テストケースに定められた期待値に対応するプログラム出力(期待値の変数)についての情報である。図5に示すように、各々のテストケースには、そのテストケースの期待値に対応するプログラム出力(期待値の変数)が対応付けられている。このプログラム出力は、各テストケースを定義したときに設定された期待値に基づいて、予め得ることができる。プログラム出力としては、変数の他に、プログラムのRAM領域のアドレス、関数へ与えるパラメータ、及び関数の戻り値等を含めることもできる。   FIG. 5 is a diagram illustrating an example of the test case expected value information E stored in the test case expected value information storage unit 105. The test case expected value information E is information on the program output (expected value variable) corresponding to the expected value determined for each test case. As shown in FIG. 5, each test case is associated with a program output (expected value variable) corresponding to the expected value of the test case. This program output can be obtained in advance based on the expected value set when each test case is defined. In addition to variables, the program output can include the RAM area address of the program, parameters to be given to the function, the return value of the function, and the like.

なお、図5に示したテストケース期待値情報Eのうち、図2と図3に示したプログラムに関連する変数はzとhの2つである。これら2つの変数についてのみ勘案すると、テストケースNo.1〜3は変数zの出力を、テストケースNo.4〜6は変数hの出力を、それぞれ調べるテストケースと言うことができる。   In the test case expected value information E shown in FIG. 5, there are two variables z and h related to the program shown in FIGS. Considering only these two variables, test case no. 1-3 show the output of the variable z, the test case no. 4 to 6 can be said to be test cases for examining the output of the variable h.

図6は、プログラム差異取得部106が実行する処理手順の一例を示す図である。   FIG. 6 is a diagram illustrating an example of a processing procedure executed by the program difference acquisition unit 106.

処理601では、変更前プログラムPを変更前プログラム格納部102から入力し、変更後プログラムP’を変更後プログラム格納部103から入力する。   In process 601, the pre-change program P is input from the pre-change program storage unit 102, and the post-change program P ′ is input from the post-change program storage unit 103.

処理602では、変更前プログラムPと変更後プログラムP’とを比較し、これらの間で異なるステートメントを差異ステートメントとして求めて、差異ステートメントの集合である差異ステートメント集合Sを得る。差異ステートメントとは、変更前プログラムPと変更後プログラムP’との間で異なるステートメントであるので、変更前プログラムPで変更又は削除されたステートメントと、変更後プログラムP’に追加されたステートメントのことである。本実施例の場合では、図2と図3に示した変更されたステートメント(1)、図2に示した削除されたステートメント(12)、及び図3に示した追加されたステートメント(5a)が差異ステートメントである。すなわち、図2、図3において記号「*」が付けられたステートメントの集合が、差異ステートメント集合Sである。   In the process 602, the pre-change program P and the post-change program P ′ are compared, and different statements between them are obtained as difference statements to obtain a difference statement set S that is a set of difference statements. The difference statement is a statement that is different between the pre-change program P and the post-change program P ′, and thus is a statement that has been changed or deleted in the pre-change program P and a statement that has been added to the post-change program P ′. It is. In the present embodiment, the modified statement (1) shown in FIGS. 2 and 3, the deleted statement (12) shown in FIG. 2, and the added statement (5a) shown in FIG. It is a difference statement. That is, the set of statements with the symbol “*” in FIGS. 2 and 3 is the difference statement set S.

なお、処理602を実施した際に得られた変更前プログラムPと変更後プログラムP’との間で対応するステートメントは、後から調べられるようにしておく。本実施例では、ステートメントのこの対応関係は、ステートメント番号からわかる。図2と図3において、同じステートメント番号を持つステートメントは、対応するステートメントである。また、変更後プログラムP’(図3)に追加されたステートメントの番号は、「5a」のように、変更前プログラムP(図2)のステートメントのうち、追加されたステートメントに対応するステートメント(追加されたステートメントの1行前のステートメント)の番号「5」の後にアルファベット「a」を付与し、対応がわかるようにしている。   It should be noted that a statement corresponding to the before-change program P and the after-change program P ′ obtained when the processing 602 is executed is checked later. In this embodiment, this correspondence between statements can be seen from the statement number. In FIG. 2 and FIG. 3, statements having the same statement number are corresponding statements. Further, the number of the statement added to the post-change program P ′ (FIG. 3) is a statement (addition) corresponding to the added statement among the statements of the pre-change program P (FIG. 2), such as “5a”. The letter “a” is added after the number “5” of the statement one line before the generated statement so that the correspondence can be understood.

処理603は、処理602で得られた差異ステートメント集合Sを、続く処理の入力として返す。   The process 603 returns the difference statement set S obtained in the process 602 as an input of the subsequent process.

図7は、プログラム依存関係分析部107が実行する処理手順の一例を示す図である。   FIG. 7 is a diagram illustrating an example of a processing procedure executed by the program dependency analysis unit 107.

処理701では、変更前プログラムP、変更後プログラムP’、及び差異ステートメント集合Sを、プログラム差異取得部106から入力する。   In process 701, the pre-change program P, the post-change program P ′, and the difference statement set S are input from the program difference acquisition unit 106.

処理702では、変更前プログラムPと変更後プログラムP’のステートメントを分析し、差異ステートメント集合Sのステートメント(差異ステートメント)に対して依存関係にあるステートメントを求める。求めた依存関係にあるステートメント(依存元ステートメントと依存先ステートメント)は、依存の種類と併せて、依存関係分析結果Gとして出力される。ステートメントの依存の種類は、後述するように、少なくとも「データ依存」と「制御依存」とする。すなわち、プログラム依存関係分析部107は、少なくとも「データ依存」と「制御依存」とを調べることで、依存関係分析結果Gを求める。   In the process 702, the statements of the pre-change program P and the post-change program P ′ are analyzed, and a statement that is dependent on the statements (difference statements) of the difference statement set S is obtained. The statements (dependency source statement and dependency destination statement) in the obtained dependency relationship are output as the dependency relationship analysis result G together with the dependency type. As will be described later, the types of statement dependency are at least “data dependency” and “control dependency”. That is, the program dependence analysis unit 107 obtains the dependence analysis result G by examining at least “data dependence” and “control dependence”.

依存関係とは、2つのステートメントにおいて、一方が変更、削除、又は追加されたことにより、もう一方がその影響を受ける関係のことである。依存関係には、差異ステートメントからの直接的な依存関係だけでなく、他のステートメントを介した間接的な依存関係も含まれる。すなわち、依存関係にあるステートメントとして、例えば、差異ステートメントに記載された変数を含むステートメント(直接的な依存関係にあるステートメント)だけでなく、差異ステートメントに記載された変数を含まなくても差異ステートメントから影響を受けるステートメント(間接的な依存関係にあるステートメント)も求める。依存関係分析結果Gには、プログラムでのステートメントの実行の流れにおいて、差異ステートメントから辿ることのできる依存関係のみが含まれる。   A dependency is a relationship in which, in two statements, one is changed, deleted, or added, and the other is affected. Dependencies include not only direct dependencies from difference statements, but also indirect dependencies through other statements. That is, as a statement having a dependency relationship, for example, not only a statement including a variable described in a difference statement (a statement having a direct dependency relationship) but also from a difference statement without including a variable described in a difference statement Also ask for affected statements (statements with indirect dependencies). The dependency relationship analysis result G includes only the dependency relationship that can be traced from the difference statement in the flow of statement execution in the program.

処理703では、処理702で得られた依存関係分析結果Gを依存分析結果格納部108に格納する。さらに、プログラム差異取得部106から入力した差異ステートメント集合Sを依存分析結果格納部108に格納する。   In process 703, the dependency relationship analysis result G obtained in process 702 is stored in the dependency analysis result storage unit 108. Further, the difference statement set S input from the program difference acquisition unit 106 is stored in the dependency analysis result storage unit 108.

図8は、依存分析結果格納部108に格納された依存関係分析結果Gの一例を示す図である。図8に示すように、依存関係分析結果Gでは、依存元ステートメント、依存先ステートメント、及び依存の種類が、依存関係として対応付けられている。   FIG. 8 is a diagram illustrating an example of the dependency relationship analysis result G stored in the dependency analysis result storage unit 108. As shown in FIG. 8, in the dependency relationship analysis result G, the dependency source statement, the dependency destination statement, and the type of dependency are associated with each other as a dependency relationship.

依存の種類において、「データ依存」とは、変数による影響(依存関係)があることを意味する。例えば、図2に示した変更前プログラムにおいて、ステートメント(1)での変数xに対しての変更は、変数xを利用しているステートメント(3)に影響するため、これらのステートメント間にはデータ依存の関係がある。   In the dependency type, “data dependency” means that there is an influence (dependency relationship) due to a variable. For example, in the pre-change program shown in FIG. 2, since the change to the variable x in the statement (1) affects the statement (3) using the variable x, there is no data between these statements. There is a dependency relationship.

依存の種類において、「制御依存」とは、if文などの条件分岐による影響(依存関係)があることを意味する。例えば、図2に示した変更前プログラムにおいて、ステートメント(8)は、ステートメント(9)を実行するか否かを制御するため、これらのステートメント間には制御依存の関係がある。   In the type of dependency, “control dependency” means that there is an influence (dependency relationship) due to a conditional branch such as an if statement. For example, in the pre-change program shown in FIG. 2, since the statement (8) controls whether or not the statement (9) is executed, there is a control-dependent relationship between these statements.

依存分析結果格納部108には、変更前プログラムPと変更後プログラムP’とで重複する依存関係を省いて、依存関係分析結果Gを格納する。例えば、図2と図3に示すように、ステートメント(1)からステートメント(3)への依存関係は、変更前プログラムPと変更後プログラムP’とで重複するため、一方を省いている。   The dependency analysis result storage unit 108 stores the dependency analysis result G by omitting the redundant dependency relationship between the pre-change program P and the post-change program P ′. For example, as shown in FIGS. 2 and 3, the dependency relationship from the statement (1) to the statement (3) is duplicated between the pre-change program P and the post-change program P ′, and thus one of them is omitted.

図9は、図8に示した依存関係をグラフで可視化し、わかりやすく示した依存解析結果グラフである。図9において、角の丸い四角い枠はステートメントを示し、矢印は依存関係を示している。矢印の根元側(tail)のステートメントが依存元ステートメントであり、矢印の先端側(head)のステートメントが依存先ステートメントである。ステートメントには、ステートメント番号が付けられている。矢印の脇に示された文字は、依存の種類を表し、「D」はデータ依存を、「C」は制御依存を示している。ステートメント番号に記号「*」が付与されたステートメントは、差異ステートメントである。   FIG. 9 is a dependency analysis result graph in which the dependency relationship shown in FIG. 8 is visualized and shown in an easy-to-understand manner. In FIG. 9, square boxes with rounded corners indicate statements, and arrows indicate dependency relationships. The statement at the tail side (tail) of the arrow is the dependency source statement, and the statement at the head side (head) of the arrow is the dependency destination statement. Statements have a statement number. The characters shown beside the arrow indicate the type of dependence, “D” indicates data dependence, and “C” indicates control dependence. A statement with the symbol “*” added to the statement number is a difference statement.

図10は、テストケース選択部109が実行する処理手順の一例を示す図である。   FIG. 10 is a diagram illustrating an example of a processing procedure executed by the test case selection unit 109.

処理1001では、差異ステートメント集合Sと依存関係分析結果Gを依存分析結果格納部108から入力し、テストケース実行情報Tをテストケース実行情報格納部104から入力し、テストケース期待値情報Eをテストケース期待値情報格納部105から入力する。   In process 1001, the difference statement set S and the dependency analysis result G are input from the dependency analysis result storage unit 108, the test case execution information T is input from the test case execution information storage unit 104, and the test case expected value information E is tested. Input from the case expected value information storage unit 105.

処理1002では、テストケース実行情報T(図4)から1件のテストケースtを選び出す。テストケース実行情報Tに含まれる全てのテストケースは、重複なく選び出せるものとする。なお、以下では、テストケースtとしてテストケースNo.1(図4を参照)が選択された場合を例に挙げて説明する。   In process 1002, one test case t is selected from the test case execution information T (FIG. 4). It is assumed that all test cases included in the test case execution information T can be selected without duplication. In the following description, test case No. A case where 1 (see FIG. 4) is selected will be described as an example.

処理1003では、ステートメント集合S’を得る。ステートメント集合S’は、テストケースtで実行した、差異ステートメント集合Sに含まれるステートメントの集合である。すなわち、ステートメント集合S’は、テストケースtに含まれる差異ステートメントである。   In process 1003, a statement set S 'is obtained. The statement set S ′ is a set of statements included in the difference statement set S executed in the test case t. That is, the statement set S ′ is a difference statement included in the test case t.

例えば、テストケースtがテストケースNo.1の場合には、テストケースNo.1が実行するステートメントは、図4に示すように、ステートメント(1)、(2)、(3)、(6)、(7)、(8)、(9)及び(13)である。図2、図3において記号「*」が付けられたステートメントの集合が差異ステートメント集合Sであるので、差異ステートメント集合Sには、ステートメント(1)、(5a)、(12)が含まれる。従って、ステートメント集合S’は、ステートメント(1)から成る。なお、変更後プログラムP’(図3)に追加されたステートメント(5a)は、変更前プログラムP(図2)のステートメントのうち、ステートメント(5a)に対応するステートメント(5)が実行される場合には、実行されるものとする。   For example, the test case t is a test case No. In the case of 1, the test case no. The statements executed by 1 are statements (1), (2), (3), (6), (7), (8), (9) and (13) as shown in FIG. Since the set of statements with the symbol “*” in FIGS. 2 and 3 is the difference statement set S, the difference statement set S includes statements (1), (5a), and (12). Therefore, the statement set S ′ consists of the statement (1). The statement (5a) added to the post-change program P ′ (FIG. 3) is a case where the statement (5) corresponding to the statement (5a) is executed among the statements of the pre-change program P (FIG. 2). It shall be executed.

処理1004では、ステートメント集合S’が空か否かを判断する。ステートメント集合S’が空である場合は、テストケースtが差異ステートメントを実行しないので、処理1010に遷移する。ステートメント集合S’が空でない場合は、処理1005に遷移する。   In process 1004, it is determined whether or not the statement set S 'is empty. If the statement set S ′ is empty, the test case t does not execute the difference statement, and the process proceeds to process 1010. If the statement set S ′ is not empty, the process proceeds to processing 1005.

処理1005では、テストケース期待値情報E(図5)から、テストケースtにおけるプログラム出力(変数)を取り出し、期待値情報集合eを作成する。テストケースtがテストケースNo.1の場合には、テストケース期待値情報Eから変数zが取り出される。従って、期待値情報集合eは、変数zから成る。   In process 1005, a program output (variable) in the test case t is extracted from the test case expected value information E (FIG. 5), and an expected value information set e is created. Test case t is test case no. In the case of 1, the variable z is extracted from the test case expected value information E. Therefore, the expected value information set e consists of the variable z.

処理1006では、ステートメント集合S’に含まれるステートメントとステートメント集合S’に含まれるステートメントから影響を受けるステートメントとから成る集合S’を得る。ステートメント集合S’に含まれるステートメントから影響を受けるステートメントとは、ステートメント集合S’に含まれるステートメントに直接的又は間接的に依存するステートメントであり、依存関係解析結果G(図8)と依存解析結果グラフ(図9)を利用して得られる。テストケースtがテストケースNo.1の場合には、ステートメント集合S’はステートメント(1)から成るので、集合S’は、ステートメント(1)、(3)、(8)、(9)、(11)、及び(12)から成る。これは、図9に示した依存解析結果グラフにおいて、ステートメント(1)から依存関係を示す矢印を辿っていくことで容易に得られる。 In process 1006, obtain a set S '2 comprising a statement affected by the statements contained in the' statement and the statement set S contained in the 'statement set S. The statement affected by the statement included in the statement set S ′ is a statement that depends directly or indirectly on the statement included in the statement set S ′, and the dependency analysis result G (FIG. 8) and the dependency analysis result. It is obtained using the graph (FIG. 9). Test case t is test case no. In the case of 1, the statement set S ′ consists of statements (1), so the set S ′ 2 contains statements (1), (3), (8), (9), (11), and (12). Consists of. This can be easily obtained by following the arrow indicating the dependency relationship from the statement (1) in the dependency analysis result graph shown in FIG.

処理1007では、集合S’の中で、期待値情報集合eに含まれる変数の値を変えるステートメントの集合S’’を得る。変数の値を変えるステートメントとは、例えばC言語でいう代入演算子「=」及びインクリメント演算子「++」等の演算子によって、期待値情報集合eに含まれる変数の値が直接変わるステートメントのことである。テストケースtがテストケースNo.1の場合には、集合S’にステートメント(1)、(3)、(8)、(9)、(11)、及び(12)が含まれ、期待値情報集合eに含まれる変数はzである。ステートメント(1)、(3)、(8)、(9)、(11)、及び(12)のうち、ステートメント(9)が変数zの値を変えるので、ステートメントの集合S’’は、ステートメント(9)から成る。 In process 1007, 'in the 2, a set of statements S for changing the value of a variable included in the expected value information set e' set S get '. A statement that changes the value of a variable is a statement that directly changes the value of a variable included in the expected value information set e by an operator such as an assignment operator “=” and an increment operator “++” in C language. It is. Test case t is test case no. In the case of 1, the set S ′ 2 includes statements (1), (3), (8), (9), (11), and (12), and the variable included in the expected value information set e is z. Of the statements (1), (3), (8), (9), (11), and (12), the statement (9) changes the value of the variable z. (9).

処理1008では、テストケースtを実行した際に、ステートメント集合S’’に含まれるステートメントのいずれか1つが、ステートメント集合S’(テストケースtに含まれる差異ステートメントの集合)に含まれるステートメントから影響を受けるか否かを調べる。すなわち、テストケースtを実行した際に、ステートメント集合S’’のいずれか1つのステートメントが、テストケースtが実行する差異ステートメントに直接的又は間接的に依存する(すなわち、影響を受ける)か否かを調べる。このとき、依存関係解析結果G(図8)と依存解析結果グラフ(図9)を利用して、影響を受けるか否か(依存するか否か)を調べることができる。   In process 1008, when the test case t is executed, any one of the statements included in the statement set S ″ is affected by the statements included in the statement set S ′ (a set of difference statements included in the test case t). Find out whether or not to receive. That is, whether or not any one statement in the statement set S ″ directly or indirectly depends on (ie, is affected by) the difference statement executed by the test case t when the test case t is executed. Find out. At this time, it is possible to examine whether or not it is affected (whether or not it depends) using the dependency relationship analysis result G (FIG. 8) and the dependency analysis result graph (FIG. 9).

テストケースtがテストケースNo.1の場合には、ステートメント集合S’’にはステートメント(9)が含まれ、ステートメント集合S’にはステートメント(1)が含まれる。例えば依存解析結果グラフ(図9)を利用すると、ステートメント(1)からステートメント(3)と(8)を経由してステートメント(9)に辿ることができるので、ステートメント(9)は、ステートメント(1)からステートメント(3)と(8)を介して影響を受ける(ステートメント(9)は、ステートメント(3)と(8)を介してステートメント(1)に間接的に依存する)ことがわかる。テストケースtがテストケースNo.1の場合には、ステートメント(1)、(2)、(3)、(6)、(7)、(8)、(9)及び(13)が実行される(図4)。従って、テストケースNo.1を実行すると、ステートメント(1)からステートメント(9)に辿ることができる、すなわち、ステートメント(9)は、ステートメント(1)から影響を受ける(ステートメント(1)に依存する)ことがわかる。   Test case t is test case no. In the case of 1, the statement set S ″ includes the statement (9), and the statement set S ′ includes the statement (1). For example, when the dependency analysis result graph (FIG. 9) is used, the statement (9) can be traced from the statement (1) via the statements (3) and (8) to the statement (9). ) To be affected via statements (3) and (8) (statement (9) depends indirectly on statement (1) via statements (3) and (8)). Test case t is test case no. In the case of 1, statements (1), (2), (3), (6), (7), (8), (9) and (13) are executed (FIG. 4). Therefore, test case No. Executing 1 makes it possible to trace from statement (1) to statement (9), ie, statement (9) is affected by statement (1) (depending on statement (1)).

処理1008で、テストケースtを実行した際に、ステートメント集合S’’に含まれるステートメントのいずれか1つが、ステートメント集合S’に含まれるステートメントから影響を受けると判定された場合は、処理1009に遷移し、影響を受けないと判定された場合は、処理1010に遷移する。   When it is determined in process 1008 that any one of the statements included in the statement set S ″ is affected by the statement included in the statement set S ′ when the test case t is executed, the process 1009 is performed. If it is determined that there is no influence, the process proceeds to the process 1010.

なお、処理1008で、依存関係解析結果G(図8)と依存解析結果グラフ(図9)を利用して影響を受けるか否か(依存するか否か)を調べる際には、ステートメントの依存の種類が「制御依存」の場合は、依存元のステートメントを実行したら、依存先ステートメントを無条件で実行したものと見なす。これは、プログラムの修正の影響により、条件分岐の遷移先が変化する可能性を考慮するためである。例えば、ステートメント(8)を実行したら、ステートメント(8)の制御依存の依存先であるステートメント(9)、(11)及び(12)も実行したものと見なす。   In the processing 1008, when the dependency relationship analysis result G (FIG. 8) and the dependency analysis result graph (FIG. 9) are used to determine whether or not they are affected (whether they depend), the dependency of the statement If the type of is "control dependent", it is considered that the dependency destination statement is executed unconditionally after executing the dependency source statement. This is for considering the possibility that the transition destination of the conditional branch changes due to the influence of the modification of the program. For example, if the statement (8) is executed, it is considered that the statements (9), (11), and (12), which are the control-dependent dependencies of the statement (8), are also executed.

処理1009では、テストケースtを、再実行が必要なテストケースとして選択する。上記の例では、テストケースNo.1が、再実行が必要なテストケースと選択される。   In process 1009, the test case t is selected as a test case that needs to be re-executed. In the above example, the test case No. 1 is selected as a test case that needs to be re-executed.

処理1010では、テストケース実行情報Tに含まれる全てのテストケースを調べた否かを判定する。全てのテストケースを調べた場合は、処理1011に遷移し、調べていない場合は、処理1002に遷移する。   In process 1010, it is determined whether or not all test cases included in the test case execution information T have been examined. If all the test cases have been examined, the process proceeds to process 1011. If not, the process proceeds to process 1002.

処理1011では、処理1009で選択したテストケースを選択結果として、ユーザインターフェイス部110に出力する。ユーザインターフェイス部110は、例えばディスプレイやプリンタなどの出力装置に、選択結果を表示することができる。   In process 1011, the test case selected in process 1009 is output to the user interface unit 110 as a selection result. The user interface unit 110 can display the selection result on an output device such as a display or a printer.

以上の例では、処理1002で、テストケースtとしてテストケースNo.1が選択された場合を説明した。次に、処理1002で、テストケースtとしてテストケースNo.2が選択された場合とテストケースNo.5が選択された場合を簡単に説明する。   In the above example, in process 1002, the test case No. The case where 1 is selected has been described. Next, in process 1002, the test case No. No. 2 is selected and test case no. The case where 5 is selected will be briefly described.

処理1002で、テストケースtとしてテストケースNo.2が選択された場合は、下記の通りである。   In the process 1002, the test case No. When 2 is selected, it is as follows.

テストケースNo.2が実行するステートメントは、図4に示すように、ステートメント(1)、(2)、(4)、(5)、(6)、(7)、(8)、(9)及び(13)である。処理1003では、差異ステートメント(1)及び(5a)から成るステートメント集合S’が得られる。ステートメント集合S’が空でないので、処理1005に遷移し、変数zから成る期待値情報集合eを得る。処理1006では、ステートメント集合S’に含まれるステートメントとステートメント集合S’に含まれるステートメントから影響を受けるステートメントとから成る集合S’として、ステートメント(1)、(3)、(5a)、(8)、(9)、(11)及び(12)から成る集合を得る。処理1007では、集合S’の中で、期待値情報集合eに含まれる変数zの値を変えるステートメントの集合S’’として、ステートメント(9)から成る集合を得る。 Test case No. As shown in FIG. 4, the statements executed by 2 are statements (1), (2), (4), (5), (6), (7), (8), (9) and (13). It is. In the process 1003, a statement set S ′ composed of difference statements (1) and (5a) is obtained. Since the statement set S ′ is not empty, the process proceeds to processing 1005 to obtain an expected value information set e including the variable z. In the process 1006, statements (1), (3), (5a), (8) are set as a set S ′ 2 composed of statements included in the statement set S ′ and statements affected by the statements included in the statement set S ′. ), (9), (11) and (12). In process 1007, 'among 2, a set of statements S changing the value of the variable z included in the expected value information set e' set S as' to obtain a set consisting of the statement (9).

処理1008では、テストケースtとしてテストケースNo.2を実行した際に、ステートメント集合S’’に含まれるステートメント(9)が、ステートメント集合S’に含まれるステートメント(1)又は(5a)から影響を受けるか否かを調べる。図9に示した依存解析結果グラフから、ステートメント(9)は、ステートメント(5a)から影響を受けないことと、ステートメント(9)は、ステートメント(3)と(8)を介してステートメント(1)から影響を受けることがわかる。図4に示すように、テストケースNo.2はステートメント(3)を実行しないので、ステートメント(9)は、ステートメント(1)から影響を受けない。従って、テストケースNo.2を実行すると、ステートメント(9)は、ステートメント(1)と(5a)のどちらからも影響を受けない。このため、処理1009を実行せず(テストケースNo.2を、再実行が必要なテストケースとして選択せず)、処理1010に遷移する。   In the process 1008, the test case No. When 2 is executed, it is checked whether the statement (9) included in the statement set S ″ is affected by the statement (1) or (5a) included in the statement set S ′. From the dependency analysis result graph shown in FIG. 9, the statement (9) is not affected by the statement (5a), and the statement (9) is transferred to the statement (1) via the statements (3) and (8). It can be seen that it is affected. As shown in FIG. Since 2 does not execute statement (3), statement (9) is not affected by statement (1). Therefore, test case No. When executing 2, statement (9) is not affected by either statement (1) or (5a). Therefore, the process 1009 is not executed (the test case No. 2 is not selected as a test case that needs to be re-executed), and the process transitions to the process 1010.

処理1002で、テストケースtとしてテストケースNo.5が選択された場合は、下記の通りである。   In the process 1002, the test case No. When 5 is selected, it is as follows.

テストケースNo.5が実行するステートメントは、図4に示すように、ステートメント(1)、(2)、(4)、(5)、(6)、(7)、(8)、(11)、(12)及び(13)である。処理1003では、差異ステートメント(1)、(5a)及び(12)から成るステートメント集合S’が得られる。ステートメント集合S’が空でないので、処理1005に遷移し、変数hから成る期待値情報集合eを得る。処理1006では、ステートメント集合S’に含まれるステートメントとステートメント集合S’に含まれるステートメントから影響を受けるステートメントとから成る集合S’として、ステートメント(1)、(3)、(5a)、(8)、(9)、(11)及び(12)から成る集合を得る。処理1007では、集合S’の中で、期待値情報集合eに含まれる変数hの値を変えるステートメントの集合S’’として、ステートメント(11)から成る集合を得る。 Test case No. As shown in FIG. 4, the statements executed by 5 are statements (1), (2), (4), (5), (6), (7), (8), (11), (12) And (13). In the process 1003, a statement set S ′ composed of difference statements (1), (5a) and (12) is obtained. Since the statement set S ′ is not empty, the process transits to a process 1005 to obtain an expected value information set e including the variable h. In the process 1006, statements (1), (3), (5a), (8) are set as a set S ′ 2 composed of statements included in the statement set S ′ and statements affected by the statements included in the statement set S ′. ), (9), (11) and (12). In process 1007, 'in the 2, a set of statements S for changing the value of the variable h included in the expected value information set e' set S as' to obtain a set consisting of the statement (11).

処理1008では、テストケースtとしてテストケースNo.5を実行した際に、ステートメント集合S’’に含まれるステートメント(11)が、ステートメント集合S’に含まれるステートメント(1)、(5a)又は(12)から影響を受けるか否かを調べる。図9に示した依存解析結果グラフから、ステートメント(11)は、ステートメント(1)からステートメント(3)と(8)を介して間接的に影響を受けることと、ステートメント(5a)から直接的に影響を受けることがわかる。図4に示すように、テストケースNo.5はステートメント(3)を実行しないので、テストケースNo.5を実行すると、ステートメント(11)は、ステートメント(1)から影響を受けない。しかし、テストケースNo.5はステートメント(5)を実行するので、テストケースNo.5を実行すると、ステートメント(5a)が実行されることになり、ステートメント(11)は、ステートメント(5a)から影響を受ける(上述したように、ステートメント(5a)は、変更前プログラムPのステートメント(5a)に対応するステートメント(5)が実行される場合には、実行されるものとする)。従って、テストケースNo.5を実行すると、ステートメント(11)は、ステートメント(5a)から影響を受ける。このため、処理1009では、テストケースNo.5を、再実行が必要なテストケースとして選択し、処理1010に遷移する。   In the process 1008, the test case No. 5 is executed, whether or not the statement (11) included in the statement set S ″ is affected by the statement (1), (5a), or (12) included in the statement set S ′. From the dependency analysis result graph shown in FIG. 9, the statement (11) is indirectly influenced from the statement (1) through the statements (3) and (8) and directly from the statement (5a). It turns out that it is influenced. As shown in FIG. 5 does not execute statement (3). When executing 5, statement (11) is not affected by statement (1). However, test case no. 5 executes statement (5), so test case no. 5 is executed, the statement (5a) is executed, and the statement (11) is affected by the statement (5a) (as described above, the statement (5a) is changed to the statement ( If statement (5) corresponding to 5a) is executed, it shall be executed). Therefore, test case No. When executing 5, statement (11) is affected by statement (5a). Therefore, in process 1009, the test case No. 5 is selected as a test case that needs to be re-executed, and the process proceeds to the process 1010.

本実施例によるテストケース選択装置は、以上に示したのと同じ処理を、図4に示したNo.1〜No.6のテストケースに対して実施し、テストケースNo.1、No.4、及びNo.5を再実行が必要なテストケースとして選択する。従って、本実施例によるテストケース選択装置では、回帰テストの際に再実行が必要として選択するテストケースの数を削減することができ、プログラムのテスト工程の効率を向上させることができる。一方、従来用いられてきた、プログラムの修正箇所を実行するテストケースを選択する手法の場合では、No.1〜No.6のテストケースの全ては修正したステートメント(1)を実行するため、再実行するテストケースの数を削減することができない。   The test case selection apparatus according to the present embodiment performs the same processing as described above with No. 1 shown in FIG. 1-No. No. 6 test case, test case no. 1, no. 4 and no. 5 is selected as a test case that needs to be re-executed. Therefore, the test case selection apparatus according to the present embodiment can reduce the number of test cases that are selected as needing re-execution in the regression test, and can improve the efficiency of the test process of the program. On the other hand, in the case of a method for selecting a test case for executing a modified part of a program, which has been conventionally used, No. 1-No. Since all of the six test cases execute the corrected statement (1), the number of test cases to be re-executed cannot be reduced.

図11は、テストケース選択装置101のハードウェア構成の一例を示す図である。テストケース選択装置101は、例えばコンピュータで構成することができ、CPU1102、主記憶装置1103、入力装置1104、出力装置1105、補助記憶装置1106、及び光学ドライブ1107を備え、これらはバス1101を介して互いに接続される。   FIG. 11 is a diagram illustrating an example of a hardware configuration of the test case selection apparatus 101. As illustrated in FIG. The test case selection apparatus 101 can be configured by a computer, for example, and includes a CPU 1102, a main storage device 1103, an input device 1104, an output device 1105, an auxiliary storage device 1106, and an optical drive 1107, which are connected via a bus 1101. Connected to each other.

入力装置1104には、例えば、マウスとキーボードの両方または一方を用いることができる。出力装置1105には、例えば、ディスプレイとプリンタの両方または一方を用いることができる。   As the input device 1104, for example, both or one of a mouse and a keyboard can be used. As the output device 1105, for example, a display and / or a printer can be used.

光学ドライブ1107は、光ディスク1111に記録されたテストケース選択プログラム1108を読み込む。テストケース選択プログラム1108は、テストケース選択装置101を動作させるプログラムであり、補助記憶装置1106に格納される。   The optical drive 1107 reads a test case selection program 1108 recorded on the optical disc 1111. The test case selection program 1108 is a program for operating the test case selection device 101 and is stored in the auxiliary storage device 1106.

補助記憶装置1106は、テストケース選択プログラム1108と、テストケース選択プログラム1108の動作環境であるオペレーションシステム(OS)1110と、変更前プログラムP、変更後プログラムP’、テストケース実行情報T、及びテストケース期待値情報Eなどの開発データ1109とを格納する。開発データ1109は、入力装置1104によって、入力することができる。   The auxiliary storage device 1106 includes a test case selection program 1108, an operation system (OS) 1110 that is an operating environment of the test case selection program 1108, a pre-change program P, a post-change program P ′, test case execution information T, and a test. Development data 1109 such as case expected value information E is stored. The development data 1109 can be input by the input device 1104.

CPU1102は、補助記憶装置1106に格納されたテストケース選択プログラム1108を主記憶装置1103にロードして実行する。CPU1102がテストケース選択プログラム1108を実行することにより、テストケース選択装置101が動作する。   The CPU 1102 loads the test case selection program 1108 stored in the auxiliary storage device 1106 to the main storage device 1103 and executes it. When the CPU 1102 executes the test case selection program 1108, the test case selection apparatus 101 operates.

テストケース選択プログラム1108を実行するための一連の操作は、入力装置1104によってユーザから入力される。テストケース選択プログラム1108が実行した一連の処理結果は、出力装置1105によって出力され、ユーザに伝えられる。   A series of operations for executing the test case selection program 1108 is input from the user by the input device 1104. A series of processing results executed by the test case selection program 1108 is output by the output device 1105 and transmitted to the user.

以上のように、本実施例によるテストケース選択装置は、プログラムの修正の影響がテストケースに定められた期待値に対応するプログラム出力に及ぶか否か(プログラムの修正によりプログラム出力が期待値と異なる可能性があるか否か)をテストケース選択時の判断基準として用いる。このため、本実施例によるテストケース選択装置は、回帰テストの際に再実行するテストケースの数を削減して、プログラムのテスト工程の効率を向上させることができる。   As described above, the test case selection apparatus according to the present embodiment determines whether or not the influence of the program modification reaches the program output corresponding to the expected value determined in the test case (the program output is changed to the expected value by the program modification). Whether or not there is a possibility of difference) is used as a criterion for selecting a test case. For this reason, the test case selection apparatus according to the present embodiment can reduce the number of test cases to be re-executed during the regression test and improve the efficiency of the test process of the program.

本発明によるテストケース選択装置は、任意のプログラムに対して、回帰テストの際に再実行が必要なテストケースを選択するときに用いることができ、例えば、自動車、鉄道、及びエレベータなどの制御システムのプログラムに対して用いることができる。   The test case selection device according to the present invention can be used for selecting a test case that needs to be re-executed in a regression test for an arbitrary program. For example, a control system for automobiles, railways, elevators, etc. It can be used for other programs.

なお、本発明は、上記の実施例に限定されるものではなく、様々な変形が可能である。例えば、上記の実施例は、本発明を分かりやすく説明するために詳細に説明したものであり、本発明は、必ずしも説明した全ての構成を備える態様に限定されるものではない。また、実施例の構成の一部について、削除したり、他の構成を追加・置換したりすることが可能である。   In addition, this invention is not limited to said Example, A various deformation | transformation is possible. For example, the above-described embodiments are described in detail for easy understanding of the present invention, and the present invention is not necessarily limited to an aspect including all the configurations described. Further, it is possible to delete a part of the configuration of the embodiment or to add or replace another configuration.

101…テストケース選択装置、102…変更前プログラム格納部、103…変更後プログラム格納部、104…テストケース実行情報格納部、105…テストケース期待値情報格納部、106…プログラム差異取得部、107…プログラム依存関係分析部、108…依存分析結果格納部、109…テストケース選択部、110…ユーザインターフェイス部、111…ユーザ、1101…バス、1102…CPU、1103…主記憶装置、1104…入力装置、1105…出力装置、1106…補助記憶装置、1107…光学ドライブ、1108…テストケース選択プログラム、1109…開発データ、1110…オペレーションシステム、1111…光ディスク。   DESCRIPTION OF SYMBOLS 101 ... Test case selection apparatus, 102 ... Program storage part before change, 103 ... Program storage part after change, 104 ... Test case execution information storage part, 105 ... Test case expected value information storage part, 106 ... Program difference acquisition part, 107 ... Program dependency analysis unit, 108 ... Dependence analysis result storage unit, 109 ... Test case selection unit, 110 ... User interface unit, 111 ... User, 1101 ... Bus, 1102 ... CPU, 1103 ... Main storage device, 1104 ... Input device DESCRIPTION OF SYMBOLS 1105 ... Output device, 1106 ... Auxiliary storage device, 1107 ... Optical drive, 1108 ... Test case selection program, 1109 ... Development data, 1110 ... Operation system, 1111 ... Optical disk.

Claims (4)

テストケースを実行した際に出力される変数とこの変数の値を期待値とし、前記期待値は前記テストケース毎に定められており、
変更前プログラムと、前記変更前プログラムに変更がされた変更後プログラムとを格納する格納部と、
前記変更前プログラムに対して実行した前記テストケースと、実行したこのテストケースで実行したステートメントとを、テストケース実行情報として格納するテストケース実行情報格納部と、
前記テストケース毎に、前記期待値の変数をテストケース期待値情報として格納するテストケース期待値情報格納部と、
前記変更前プログラムと前記変更後プログラムとで異なるステートメントを差異ステートメントとして求めるプログラム差異取得部と、
前記差異ステートメントから影響を受けるステートメントを依存関係分析結果として求めるプログラム依存関係分析部と、
前記変更後プログラムの回帰テストの際に実行する前記テストケースを選択するテストケース選択部とを備え、
前記テストケース選択部は、前記テストケース実行情報の前記ステートメントと、前記テストケース期待値情報の前記期待値と、前記差異ステートメントとから、前記依存関係分析結果を利用して、前記変更前プログラムと前記変更後プログラムとで前記期待値の変数の値を変える可能性のあるテストケースを求め、求めたこのテストケースを前記回帰テストの際に実行する前記テストケースとして選択する、
ことを特徴とするテストケース選択装置。
The expected value is the variable output when the test case is executed and the value of this variable. The expected value is determined for each test case.
A storage unit for storing a pre-change program and a post-change program changed to the pre-change program;
A test case execution information storage unit for storing the test case executed for the pre-change program and a statement executed in the executed test case as test case execution information;
For each test case, a test case expected value information storage unit that stores the expected value variable as test case expected value information;
A program difference acquisition unit for obtaining a different statement as a difference statement between the pre-change program and the post-change program;
A program dependency analysis unit that obtains a statement affected by the difference statement as a dependency analysis result;
A test case selection unit that selects the test case to be executed in the regression test of the changed program,
The test case selection unit uses the dependency analysis result from the statement of the test case execution information, the expected value of the test case expected value information, and the difference statement, and the program before change Obtain a test case that may change the value of the expected value variable with the changed program, and select the obtained test case as the test case to be executed during the regression test.
A test case selection device characterized by that.
前記テストケース選択部は、
前記テストケース実行情報の前記テストケースから1つのテストケースを選び、
選んだ前記テストケースで実行した前記ステートメントに含まれる前記差異ステートメントを求め、
前記テストケース期待値情報から、選んだ前記テストケースの前記期待値の変数を取り出し、
求めた前記差異ステートメントから影響を受ける前記ステートメントを、前記依存関係分析結果を利用して求め、
求めた前記差異ステートメントと前記依存関係分析結果を利用して求めた前記ステートメントとから、取り出した前記期待値の変数の値を変えるステートメントを求めることで、
前記期待値の変数の値を変える可能性のあるテストケースを求める請求項1に記載のテストケース選択装置。
The test case selector is
Select one test case from the test cases of the test case execution information,
Find the difference statement included in the statement executed in the selected test case,
Extracting the expected value variable of the selected test case from the test case expected value information,
Using the dependency analysis result, obtaining the statement affected by the obtained difference statement,
By obtaining a statement that changes the value of the extracted expected value variable from the obtained difference statement and the statement obtained using the dependency analysis result,
The test case selection device according to claim 1, wherein a test case that may change a value of the expected value variable is obtained.
前記テストケース選択部は、
取り出した前記期待値の変数の値を変えるステートメントとして求めた前記ステートメントが、選んだ前記テストケースを実行すると、求めた前記差異ステートメントから影響を受けるか否かを、前記依存関係分析結果を利用して求め、
取り出した前記期待値の変数の値を変えるステートメントとして求めた前記ステートメントが、求めた前記差異ステートメントから影響を受ける場合には、選んだ前記テストケースを、前記回帰テストの際に実行する前記テストケースとして選択する請求項2に記載のテストケース選択装置。
The test case selector is
Whether the statement obtained as a statement for changing the value of the extracted expected value variable is affected by the obtained difference statement when the selected test case is executed is used by using the dependency analysis result. Ask
When the statement obtained as a statement for changing the value of the extracted expected value variable is affected by the obtained difference statement, the selected test case is executed in the regression test. The test case selection device according to claim 2, which is selected as
前記プログラム依存関係分析部は、少なくとも変数による影響と条件分岐による影響とを調べることで、前記差異ステートメントから影響を受けるステートメントを求める請求項1に記載のテストケース選択装置。   The test case selection apparatus according to claim 1, wherein the program dependence analysis unit obtains a statement affected by the difference statement by examining at least an influence caused by a variable and an influence caused by a conditional branch.
JP2015044697A 2015-03-06 2015-03-06 Test case selection device Pending JP2016164727A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015044697A JP2016164727A (en) 2015-03-06 2015-03-06 Test case selection device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015044697A JP2016164727A (en) 2015-03-06 2015-03-06 Test case selection device

Publications (1)

Publication Number Publication Date
JP2016164727A true JP2016164727A (en) 2016-09-08

Family

ID=56876833

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015044697A Pending JP2016164727A (en) 2015-03-06 2015-03-06 Test case selection device

Country Status (1)

Country Link
JP (1) JP2016164727A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018097785A (en) * 2016-12-16 2018-06-21 株式会社東芝 Test support device and test support program
WO2018150507A1 (en) 2017-02-16 2018-08-23 三菱電機株式会社 Test case selection device and test case selection program
JP2019057118A (en) * 2017-09-21 2019-04-11 株式会社東芝 Debug support device and debug support program
WO2023058611A1 (en) * 2021-10-07 2023-04-13 株式会社日立製作所 Software failure analysis apparatus and software failure analysis method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018097785A (en) * 2016-12-16 2018-06-21 株式会社東芝 Test support device and test support program
WO2018150507A1 (en) 2017-02-16 2018-08-23 三菱電機株式会社 Test case selection device and test case selection program
JP2019057118A (en) * 2017-09-21 2019-04-11 株式会社東芝 Debug support device and debug support program
WO2023058611A1 (en) * 2021-10-07 2023-04-13 株式会社日立製作所 Software failure analysis apparatus and software failure analysis method

Similar Documents

Publication Publication Date Title
US7681180B2 (en) Parameterized test driven development
Yilmaz et al. Moving forward with combinatorial interaction testing
US9317399B2 (en) Policy evaluation based upon dynamic observation, static analysis and code change history
US9898387B2 (en) Development tools for logging and analyzing software bugs
US20120260132A1 (en) Test selection based on an n-wise combinations coverage
US20070006037A1 (en) Automated test case result analyzer
US8327191B2 (en) Automatically populating symptom databases for software applications
US8448147B2 (en) Heterogenic Coverage Analysis
JP2016164727A (en) Test case selection device
Kadry A new proposed technique to improve software regression testing cost
JP2015011372A (en) Debug support system, method, program, and recording medium
US8589898B2 (en) Method and apparatus for analyzing software including a calibrated value
JP7215501B2 (en) DEPENDENCY DETECTION DEVICE AND DEPENDENCY DETECTION METHOD
US20150007139A1 (en) Optimizing error parsing in an integrated development environment
Qu Testing of configurable systems
JP6320269B2 (en) Software test support apparatus and software test support program
JP4957521B2 (en) Software partial test system, method and program used therefor
JP2009104490A (en) Apparatus for testing program
JP6723483B2 (en) Test case generation device, test case generation method, and test case generation program
JPH11224211A (en) Software inspection support device
JP2009048291A (en) System analysis device and program
JP4853998B2 (en) Debugger device and debugging method using the debugger device
KR102519639B1 (en) Method for providing code inspection interface, and apparatus implementing the same method
Singh et al. The review: Lifecycle of object-oriented software testing
JP2009181180A (en) Inspection program, inspection method, and inspection device of program creating tool