JP6205965B2 - Test data generation program, test data generation method, and test data generation apparatus - Google Patents

Test data generation program, test data generation method, and test data generation apparatus Download PDF

Info

Publication number
JP6205965B2
JP6205965B2 JP2013166860A JP2013166860A JP6205965B2 JP 6205965 B2 JP6205965 B2 JP 6205965B2 JP 2013166860 A JP2013166860 A JP 2013166860A JP 2013166860 A JP2013166860 A JP 2013166860A JP 6205965 B2 JP6205965 B2 JP 6205965B2
Authority
JP
Japan
Prior art keywords
program
test data
variable
data generation
change
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.)
Expired - Fee Related
Application number
JP2013166860A
Other languages
Japanese (ja)
Other versions
JP2015035185A (en
Inventor
スッパシット モンプラターンチャイ
スッパシット モンプラターンチャイ
晋 徳本
晋 徳本
一樹 宗像
一樹 宗像
翔一朗 藤原
翔一朗 藤原
朝子 片山
朝子 片山
前田 芳晴
芳晴 前田
忠弘 上原
忠弘 上原
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2013166860A priority Critical patent/JP6205965B2/en
Publication of JP2015035185A publication Critical patent/JP2015035185A/en
Application granted granted Critical
Publication of JP6205965B2 publication Critical patent/JP6205965B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Description

本発明は、テストデータ生成プログラム、テストデータ生成方法、およびテストデータ生成装置に関する。   The present invention relates to a test data generation program, a test data generation method, and a test data generation apparatus.

従来、プログラム開発において、テストケースを用いて、プログラムの動作をテストする技術がある。テストケースは、プログラムに与えられる入力変数の値を有する。また、プログラムに変更があったとき、プログラムの変更に起因して、変更後のプログラムに不具合が発生していないかどうか判定するリグレッションテストを行う技術がある。リグレッションテストでは、例えば、同一のテストケースを用いて、変更前後のプログラムの動作をテストして、変更前後のプログラムのテスト結果が一致するか否かに基づいて、不具合が発生していないかどうかを判定する。   Conventionally, in program development, there is a technique for testing a program operation using a test case. The test case has the value of the input variable that is given to the program. In addition, there is a technique for performing a regression test for determining whether a problem has occurred in a program after the change due to the change of the program when the program is changed. In the regression test, for example, the same test case is used to test the operation of the program before and after the change, and whether or not a defect has occurred based on whether the test results of the program before and after the change match. Determine.

関連する技術としては、例えば、テスト対象ソースコードを解析して、入出力インターフェースの変更を反映することができ、入力値と出力値を含む入力関係情報または変更後入出力関係情報を作成して、テストケースまたは変更後テストケースを作成するものがある。また、例えば、変更前のプログラムデータにより作成されたテストデータのうち、プログラムの変更にともなって変更された関数に関する箇所を書き換え、かつ、変更されなかった部分は流用して変更後プログラム用のテストデータを作成する技術がある。また、例えば、プログラム中で有効と考えられる箇所と無効と考えられる箇所を静的にかつ、機械的に算出し、調査結果のレポートによるプログラムの分析を支援し、および無効な命令を破棄する技術がある。   As related technologies, for example, the test source code can be analyzed to reflect changes in the input / output interface, and input relationship information including input values and output values or changed input / output relationship information can be created. , Create test cases or modified test cases. Also, for example, in the test data created from the program data before the change, the part related to the function that has been changed due to the program change is rewritten, and the part that has not been changed is diverted and the test for the program after the change is made There is technology to create data. In addition, for example, a technology that statically and mechanically calculates the locations that are considered valid and invalid in the program, supports the analysis of the program by reporting the survey results, and discards invalid instructions There is.

特開2009−205239号公報JP 2009-205239 A 特開2011−159008号公報JP 2011-159008 A 特開平10−63536号公報JP-A-10-63536

しかしながら、従来技術では、プログラムの変更時に、プログラムの中で用いられる変数が追加、削除あるいは名称変更されると、変更後のプログラムをテストする際に、変更前のプログラムのテストに使用したテストケースをそのまま流用できない場合がある。   However, in the conventional technology, when a variable used in the program is added, deleted, or renamed when the program is changed, the test case used for testing the program before the change when testing the changed program May not be used as is.

1つの側面では、本発明は、変更後のプログラムのリグレッションテストに用いるテストデータを生成することができるテストデータ生成プログラム、テストデータ生成方法、およびテストデータ生成装置を提供することを目的とする。   In one aspect, an object of the present invention is to provide a test data generation program, a test data generation method, and a test data generation apparatus that can generate test data used for a regression test of a program after change.

本発明の一側面によれば、テスト対象のメソッドが規定された第1プログラムにおける前記メソッドに用いられる変数と、前記第1プログラムから前記メソッドの内容が変更された第2プログラムにおける前記メソッドに用いられる変数とを比較した比較結果に基づいて、前記メソッドに用いられる変数の変更パターンを特定し、特定した前記変更パターンに基づいて、前記第1プログラムにおける前記メソッドに用いられる変数を変更した第3プログラムを作成し、作成した前記第3プログラムをシンボリック実行してテストデータを生成するテストデータ生成プログラム、テストデータ生成方法、およびテストデータ生成装置が提案される。   According to one aspect of the present invention, a variable used in the method in the first program in which a method to be tested is defined, and a method in the second program in which the content of the method is changed from the first program are used. A change pattern of a variable used for the method is specified based on a comparison result of comparing with a variable to be changed, and a variable used for the method in the first program is changed based on the specified change pattern. A test data generation program, a test data generation method, and a test data generation device that generate a program and generate test data by symbolically executing the generated third program are proposed.

本発明の一態様によれば、変更後のプログラムのリグレッションテストに用いるテストデータを生成することができるという効果を奏する。   According to one aspect of the present invention, it is possible to generate test data used for a regression test of a program after change.

図1は、実施の形態にかかるテストデータ生成装置100の動作例を示す説明図である。FIG. 1 is an explanatory diagram of an operation example of the test data generation device 100 according to the embodiment. 図2は、テストデータ生成装置100のハードウェア構成例を示すブロック図である。FIG. 2 is a block diagram illustrating a hardware configuration example of the test data generation apparatus 100. 図3は、テストデータ生成装置100の機能的構成例を示すブロック図である。FIG. 3 is a block diagram illustrating a functional configuration example of the test data generation apparatus 100. 図4は、プログラムの変更内容の一例を示す説明図である。FIG. 4 is an explanatory diagram showing an example of program change contents. 図5は、差異情報の特定処理の一例を示す説明図(その1)である。FIG. 5 is an explanatory diagram (part 1) illustrating an example of the difference information specifying process. 図6は、差異情報の特定処理の一例を示す説明図(その2)である。FIG. 6 is an explanatory diagram (part 2) of an example of the difference information specifying process. 図7は、差異情報の特定処理の一例を示す説明図(その3)である。FIG. 7 is an explanatory diagram (part 3) of an example of the difference information specifying process. 図8は、差異情報の特定処理の一例を示す説明図(その4)である。FIG. 8 is an explanatory diagram (part 4) of an example of the difference information specifying process. 図9は、差異情報の特定処理の一例を示す説明図(その5)である。FIG. 9 is an explanatory diagram (part 5) of an example of the difference information specifying process. 図10は、差異情報の特定処理の一例を示す説明図(その6)である。FIG. 10 is an explanatory diagram (part 6) of an example of the difference information specifying process. 図11は、差異情報の特定処理の一例を示す説明図(その7)である。FIG. 11 is an explanatory diagram (part 7) of an example of the difference information specifying process. 図12は、差異情報の特定処理の一例を示す説明図(その8)である。FIG. 12 is an explanatory diagram (part 8) of an example of the difference information specifying process. 図13は、差異情報の特定処理の一例を示す説明図(その9)である。FIG. 13 is an explanatory diagram (No. 9) illustrating an example of the difference information specifying process. 図14は、プログラムの加工処理の一例を示す説明図である。FIG. 14 is an explanatory diagram showing an example of processing of a program. 図15は、テストデータ生成処理の一例を示す説明図(その1)である。FIG. 15 is an explanatory diagram (part 1) of an example of the test data generation process. 図16は、テストデータ生成処理の一例を示す説明図(その2)である。FIG. 16 is an explanatory diagram (part 2) of an example of the test data generation process. 図17は、リファクタリング処理の一例を示す説明図(その1)である。FIG. 17 is an explanatory diagram (part 1) illustrating an example of the refactoring process. 図18は、リファクタリング処理の一例を示す説明図(その2)である。FIG. 18 is an explanatory diagram (part 2) of an example of the refactoring process. 図19は、リファクタリング処理の一例を示す説明図(その3)である。FIG. 19 is an explanatory diagram (part 3) of an example of the refactoring process. 図20は、リファクタリング処理の一例を示す説明図(その4)である。FIG. 20 is an explanatory diagram (part 4) of an example of the refactoring process. 図21は、リファクタリング処理の一例を示す説明図(その5)である。FIG. 21 is an explanatory diagram (part 5) of an example of the refactoring process. 図22は、リグレッションテストの一例を示す説明図である。FIG. 22 is an explanatory diagram showing an example of the regression test. 図23は、リグレッションテストの実行処理手順の一例を示すフローチャートである。FIG. 23 is a flowchart illustrating an example of a procedure for executing a regression test. 図24は、差異情報の特定処理手順の一例を示すフローチャートである。FIG. 24 is a flowchart illustrating an example of the difference information identification processing procedure. 図25は、プログラムの加工処理手順の一例を示すフローチャートである。FIG. 25 is a flowchart illustrating an example of a processing procedure of a program. 図26は、テストデータ生成処理手順の一例を示すフローチャートである。FIG. 26 is a flowchart illustrating an example of a test data generation processing procedure. 図27は、リファクタリング処理手順の一例を示すフローチャートである。FIG. 27 is a flowchart illustrating an example of a refactoring processing procedure.

以下に添付図面を参照して、本発明にかかるテストデータ生成プログラム、テストデータ生成方法、およびテストデータ生成装置の実施の形態を詳細に説明する。   Exemplary embodiments of a test data generation program, a test data generation method, and a test data generation apparatus according to the present invention will be explained below in detail with reference to the accompanying drawings.

(テストデータ生成装置100の動作例)
図1は、実施の形態にかかるテストデータ生成装置100の動作例を示す説明図である。
(Operation example of test data generation apparatus 100)
FIG. 1 is an explanatory diagram of an operation example of the test data generation device 100 according to the embodiment.

テストデータ生成装置100は、テスト対象のメソッドが規定された第1プログラムP1のメソッドの内容が変更された第2プログラムP2のテストケースを生成するコンピュータである。以下の説明では、第1プログラムを「変更前プログラムP1」と表記する場合がある。また、以下の説明では、第2プログラムを「変更後プログラムP2」と表記する場合がある。   The test data generation device 100 is a computer that generates a test case of the second program P2 in which the contents of the method of the first program P1 in which the test target method is defined. In the following description, the first program may be referred to as “pre-change program P1”. In the following description, the second program may be referred to as “changed program P2”.

メソッドの内容変更には、メソッドに用いられる変数の変更が含まれる。ここで、変数は、プログラムに含まれるメソッドの引数(メソッドパラメータ)として宣言された変数と、メソッドの引数以外としてプログラムに宣言された変数と、を含む。変数は、いわゆるプログラムインターフェースである。以下の説明では、プログラムに含まれるメソッドの引数として宣言された変数を「パラメータ変数」と表記する場合がある。以下の説明では、プログラムに宣言された変数を「プログラム変数」と表記する場合がある。   Changing the contents of a method includes changing a variable used in the method. Here, the variable includes a variable declared as an argument (method parameter) of a method included in the program and a variable declared in the program as a parameter other than the method argument. The variable is a so-called program interface. In the following description, a variable declared as an argument of a method included in a program may be referred to as a “parameter variable”. In the following description, a variable declared in a program may be referred to as a “program variable”.

(1)テストデータ生成装置100は、変更前プログラムP1と変更後プログラムP2とに基づいて、テスト対象のメソッドに用いられる変数の変更パターンを表す差異情報を特定する。差異情報の特定処理の詳細については、図5〜図13を用いて後述する。   (1) The test data generation device 100 specifies difference information indicating a change pattern of a variable used for a test target method based on the pre-change program P1 and the post-change program P2. Details of the difference information specifying process will be described later with reference to FIGS.

(2)テストデータ生成装置100は、差異情報に基づいて、変更前プログラムP1を加工して、変更後プログラムP2のテストデータ作成用のプログラムバリエーションを作成する。プログラムの加工処理の詳細については、図14を用いて後述する。これにより、テストデータ生成装置100は、変更後プログラムP2に対応しうるプログラムバリエーションを作成することができる。   (2) The test data generation apparatus 100 processes the pre-change program P1 based on the difference information, and creates a program variation for creating test data of the post-change program P2. Details of the program processing will be described later with reference to FIG. Thereby, the test data generation device 100 can create a program variation that can correspond to the changed program P2.

(3)テストデータ生成装置100は、加工後プログラムをシンボリック実行して、複数のテストデータを生成する。シンボリック実行は、記号実行とも呼ばれる。テストデータ生成処理の詳細については、図15および図16を用いて後述する。ここで、テストデータは、テストケースTC1と実行結果R1とのペアを含む。テストケースTC1とは、プログラムの実行条件になる入力変数の値である。実行結果R1とは、プログラムの実行結果になる出力変数の値である。これにより、テストデータ生成装置100は、変更後プログラムP2に対するリグレッションテストに用いうる複数のテストデータを生成することができる。   (3) The test data generation device 100 generates a plurality of test data by executing symbolically the post-processing program. Symbolic execution is also called symbol execution. Details of the test data generation process will be described later with reference to FIGS. 15 and 16. Here, the test data includes a pair of the test case TC1 and the execution result R1. The test case TC1 is a value of an input variable that becomes a program execution condition. The execution result R1 is the value of the output variable that becomes the execution result of the program. As a result, the test data generating apparatus 100 can generate a plurality of test data that can be used for the regression test on the post-change program P2.

(4)テストデータ生成装置100は、複数のテストデータをリファクタリングして、テストケース部分が重複する複数のペアを統合して、統合後のテストケースTC1*と実行結果R1*とのペアを有する新たなテストデータを生成する。リファクタリング処理の詳細については、図17〜図21を用いて後述する。これにより、テストデータ生成装置100は、複数のテストデータをまとめて、プログラム変数またはパラメータ変数の変更を含む変更後プログラムP2に対しても、リグレッションテストに用いるテストデータを生成することができる。   (4) The test data generation device 100 has a pair of the test case TC1 * and the execution result R1 * after integration by refactoring a plurality of test data, integrating a plurality of pairs having overlapping test case portions. Generate new test data. Details of the refactoring process will be described later with reference to FIGS. As a result, the test data generating apparatus 100 can generate a plurality of test data and generate test data used for the regression test even for the changed program P2 including the change of the program variable or the parameter variable.

このため、例えば、リグレッションテストの実行者が、変更前プログラムP1と変更後プログラムP2と、を参照して、変更後プログラムP2に対するテストデータを作成する場合に比べて、リグレッションテストの実行者の作業量を低減することができる。また、リグレッションテストの実行者によって誤ったテストデータが作成されることを防止することができる。   For this reason, for example, compared with a case where the execution person of the regression test refers to the program P1 before change and the program P2 after change and creates test data for the program P2 after change, the work of the person who executes the regression test The amount can be reduced. Further, it is possible to prevent erroneous test data from being created by a regression tester.

(5)テストデータ生成装置100は、さらに、リファクタリングした新たなテストデータを用いて、リグレッションテストを実行してもよい。リグレッションテストは、回帰テストとも呼ばれる。テストデータ生成装置100は、例えば、リグレッションテストにおいて、テストケースTC1*に対応する実行結果R1*と、テストケースTC1*を実行条件として変更後プログラムP2を実行した場合の実行結果R2とを比較する。テストデータ生成装置100は、比較結果に基づいて、変更後プログラムP2に不具合があるか否かを判定してもよい。リグレッションテストの詳細については、図22を用いて後述する。   (5) The test data generation device 100 may further execute a regression test using the retested new test data. The regression test is also called a regression test. For example, in the regression test, the test data generation device 100 compares the execution result R1 * corresponding to the test case TC1 * with the execution result R2 when the changed program P2 is executed using the test case TC1 * as an execution condition. . The test data generation device 100 may determine whether or not the changed program P2 has a problem based on the comparison result. Details of the regression test will be described later with reference to FIG.

これにより、テストデータ生成装置100は、プログラム変数またはパラメータ変数が変更された変更後プログラムP2に対しても、リグレッションテストを実行することができ、リグレッションテストのテスト結果を出力することができる。そして、テストデータ生成装置100の利用者は、リグレッションテストのテスト結果から、変更後プログラムP2に不具合があるか否かを把握することができる。   Thereby, the test data generation device 100 can execute the regression test on the program P2 after the change in which the program variable or the parameter variable is changed, and can output the test result of the regression test. Then, the user of the test data generation device 100 can grasp whether or not there is a problem in the changed program P2 from the test result of the regression test.

(テストデータ生成装置100のハードウェア構成例)
図2は、テストデータ生成装置100のハードウェア構成例を示すブロック図である。図2において、テストデータ生成装置100は、CPU(Central Processing Unit)201と、ROM(Read Only Memory)202と、RAM(Random Access Memory)203と、磁気ディスクドライブ(Hard Disk Drive)204と、磁気ディスク205と、光ディスクドライブ206と、光ディスク207と、ディスプレイ208と、インターフェース(I/F:Interface)209と、キーボード210と、マウス211と、スキャナ212と、プリンタ213と、を備えている。また、各構成部はバス200によってそれぞれ接続されている。
(Example of hardware configuration of test data generation apparatus 100)
FIG. 2 is a block diagram illustrating a hardware configuration example of the test data generation apparatus 100. In FIG. 2, a test data generation apparatus 100 includes a CPU (Central Processing Unit) 201, a ROM (Read Only Memory) 202, a RAM (Random Access Memory) 203, a magnetic disk drive (Hard Disk Drive) 204, and a magnetic disk. A disk 205, an optical disk drive 206, an optical disk 207, a display 208, an interface (I / F: Interface) 209, a keyboard 210, a mouse 211, a scanner 212, and a printer 213 are provided. Each component is connected by a bus 200.

ここで、CPU201は、テストデータ生成装置100の全体の制御を司る。ROM202は、ブートプログラムなどのプログラムを記憶している。RAM203は、CPU201のワークエリアとして使用される。磁気ディスクドライブ204は、CPU201の制御に従って磁気ディスク205に対するデータのリード/ライトを制御する。磁気ディスク205は、磁気ディスクドライブ204の制御で書き込まれたデータを記憶する。   Here, the CPU 201 governs overall control of the test data generation apparatus 100. The ROM 202 stores a program such as a boot program. The RAM 203 is used as a work area for the CPU 201. The magnetic disk drive 204 controls reading / writing of data with respect to the magnetic disk 205 according to the control of the CPU 201. The magnetic disk 205 stores data written under the control of the magnetic disk drive 204.

光ディスクドライブ206は、CPU201の制御に従って光ディスク207に対するデータのリード/ライトを制御する。光ディスク207は、光ディスクドライブ206の制御で書き込まれたデータを記憶したり、光ディスク207に記憶されたデータをコンピュータに読み取らせたりする。   The optical disk drive 206 controls reading / writing of data with respect to the optical disk 207 according to the control of the CPU 201. The optical disk 207 stores data written under the control of the optical disk drive 206, or causes the computer to read data stored on the optical disk 207.

ディスプレイ208は、カーソル、アイコンあるいはツールボックスをはじめ、文書、画像、機能情報などのデータを表示する。このディスプレイ208は、例えば、液晶ディスプレイ、プラズマディスプレイなどを採用することができる。   The display 208 displays data such as a document, an image, and function information as well as a cursor, an icon, or a tool box. As this display 208, for example, a liquid crystal display, a plasma display, or the like can be adopted.

I/F209は、通信回線を通じてLAN(Local Area Network)、WAN(Wide Area Network)、インターネットなどのネットワーク214に接続され、このネットワーク214を介して他の装置に接続される。そして、I/F209は、ネットワーク214と内部のインターフェースを司り、外部装置からのデータの入出力を制御する。I/F209には、例えば、モデムやLANアダプタなどを採用することができる。   The I / F 209 is connected to a network 214 such as a LAN (Local Area Network), a WAN (Wide Area Network), and the Internet through a communication line, and is connected to other devices via the network 214. The I / F 209 controls an internal interface with the network 214 and controls data input / output from an external device. For example, a modem or a LAN adapter may be employed as the I / F 209.

キーボード210は、文字、数字、各種指示などの入力のためのキーを備え、データの入力を行う。また、タッチパネル式の入力パッドやテンキーなどであってもよい。マウス211は、カーソルの移動や範囲選択、あるいはウィンドウの移動やサイズの変更などを行う。ポインティングデバイスとして同様に機能を備えるものであれば、トラックボールやジョイスティックなどであってもよい。   The keyboard 210 includes keys for inputting characters, numbers, various instructions, and the like, and inputs data. Moreover, a touch panel type input pad or a numeric keypad may be used. The mouse 211 performs cursor movement, range selection, window movement, size change, and the like. A trackball or a joystick may be used as long as they have the same function as a pointing device.

スキャナ212は、画像を光学的に読み取り、テストデータ生成装置100内に画像データを取り込む。なお、スキャナ212は、OCR(Optical Character Reader)機能を持たせてもよい。また、プリンタ213は、画像データや文書データを印刷する。プリンタ213には、例えば、レーザプリンタやインクジェットプリンタを採用することができる。また、光ディスクドライブ206、光ディスク207、ディスプレイ208、キーボード210、マウス211、スキャナ212、およびプリンタ213の少なくともいずれか1つは、なくてもよい。   The scanner 212 optically reads an image and takes in the image data into the test data generation apparatus 100. The scanner 212 may have an OCR (Optical Character Reader) function. The printer 213 prints image data and document data. As the printer 213, for example, a laser printer or an ink jet printer can be adopted. Further, at least one of the optical disk drive 206, the optical disk 207, the display 208, the keyboard 210, the mouse 211, the scanner 212, and the printer 213 may be omitted.

(テストデータ生成装置100の機能的構成例)
次に、図3を用いて、テストデータ生成装置100の機能的構成例について説明する。
(Functional configuration example of test data generation apparatus 100)
Next, a functional configuration example of the test data generation apparatus 100 will be described with reference to FIG.

図3は、テストデータ生成装置100の機能的構成例を示すブロック図である。テストデータ生成装置100は、特定部301と、作成部302と、生成部303と、判定部304と、を含む。特定部301と、作成部302と、生成部303と、判定部304とは、例えば、図2に示したROM202、RAM203、磁気ディスク205、光ディスク207などの記憶装置に記憶されたプログラムをCPU201に実行させることにより、または、I/F209により、その機能を実現する。   FIG. 3 is a block diagram illustrating a functional configuration example of the test data generation apparatus 100. The test data generation device 100 includes a specifying unit 301, a creation unit 302, a generation unit 303, and a determination unit 304. For example, the specifying unit 301, the creating unit 302, the generating unit 303, and the determining unit 304 store programs stored in a storage device such as the ROM 202, the RAM 203, the magnetic disk 205, and the optical disk 207 illustrated in FIG. The function is realized by executing or by the I / F 209.

特定部301は、テスト対象のメソッドが規定された第1プログラムにおけるメソッドに用いられる変数と、第1プログラムからメソッドの内容が変更された第2プログラムにおけるメソッドに用いられる変数とを比較する。次に、特定部301は、比較結果に基づいて、メソッドに用いられる変数の変更パターンを特定する。ここで、第1プログラムとは、例えば、上述した変更前プログラムP1である。第2プログラムとは、例えば、上述した変更後プログラムP2である。メソッドに用いられる変数は、メソッドの引数になるパラメータ変数またはメソッドの引数以外のプログラム変数である。   The specifying unit 301 compares a variable used for the method in the first program in which the test target method is defined with a variable used in the method in the second program in which the content of the method is changed from the first program. Next, the specifying unit 301 specifies a change pattern of a variable used for the method based on the comparison result. Here, the first program is, for example, the pre-change program P1 described above. The second program is, for example, the post-change program P2 described above. The variable used for the method is a parameter variable that becomes an argument of the method or a program variable other than the argument of the method.

特定部301は、例えば、メソッドに用いられる変数について、第1〜第3の変更パターンのうちの少なくともいずれかの変更パターンを特定する。第1の変更パターンとは、メソッドの内容の変更後に同一形式の他の変数に変更される変更パターンである。第2の変更パターンとは、メソッドの内容の変更後に削除される変更パターンである。第3の変更パターンとは、メソッドの内容の変更後に追加される変更パターンである。   For example, the identifying unit 301 identifies at least one of the first to third modification patterns for the variable used in the method. The first change pattern is a change pattern that is changed to another variable of the same format after the content of the method is changed. The second change pattern is a change pattern that is deleted after changing the contents of the method. The third change pattern is a change pattern that is added after changing the contents of the method.

ここで、変更前プログラムP1におけるプログラム変数が「x、b1」かつパラメータ変数が「a、b」、変更後プログラムP2におけるプログラム変数が「i、b2」かつパラメータ変数が「a、c」である場合を一例として挙げる。   Here, the program variables in the pre-change program P1 are “x, b1” and the parameter variables are “a, b”, the program variables in the post-change program P2 are “i, b2”, and the parameter variables are “a, c”. Take the case as an example.

この場合、特定部301は、変更パターンとして、{x→i,x→φ}と、{b1→b2,b1→φ}と、{b→c,b→φ}と、{φ→i,φ→b2,φ→c}と、を特定する。ここで、φは、ダミー変数である。上述した{x→i}は、xからiに変更される変更パターンを表す。上述した{x→φ}は、xが削除される変更パターンを表す。上述した{φ→i}は、iが追加される変更パターンを表す。   In this case, the specifying unit 301 uses {x → i, x → φ}, {b1 → b2, b1 → φ}, {b → c, b → φ}, {φ → i, Specify φ → b2, φ → c}. Here, φ is a dummy variable. The above-mentioned {x → i} represents a change pattern changed from x to i. The above-mentioned {x → φ} represents a change pattern in which x is deleted. The above-mentioned {φ → i} represents a change pattern in which i is added.

これにより、特定部301は、取り得る変更パターンを特定することができる。特定されたデータは、例えば、RAM203、磁気ディスク205、光ディスク207などの記憶領域に記憶される。   Thereby, the specific | specification part 301 can specify the change pattern which can be taken. The identified data is stored in a storage area such as the RAM 203, the magnetic disk 205, and the optical disk 207, for example.

作成部302は、特定した変更パターンに基づいて、第1プログラムにおけるメソッドに用いられる変数を変更した第3プログラムを作成する。第3プログラムとは、第2プログラムのテストデータ生成用のプログラムである。第3プログラムとは、例えば、上述したプログラムバリエーションである。   The creation unit 302 creates a third program in which variables used for the method in the first program are changed based on the specified change pattern. The third program is a test data generation program for the second program. The third program is, for example, the program variation described above.

作成部302は、例えば、メソッドに用いられる変数ごとに特定した変更パターンの組み合わせに基づいて、第3プログラムを作成する。作成部302は、具体的には、メソッドに用いられるそれぞれ異なる変数についての変更パターンの組み合わせに基づいて、第3プログラムを作成する。   For example, the creation unit 302 creates the third program based on a combination of change patterns specified for each variable used in the method. Specifically, the creating unit 302 creates the third program based on a combination of change patterns for different variables used in the method.

ここで、特定部301によって、変更パターンとして、{x→i,x→φ}と、{b1→b2,b1→φ}と、{b→c,b→φ}と、{φ→i,φ→b2,φ→c}と、が特定された場合を一例として挙げる。   Here, by the specifying unit 301, as change patterns, {x → i, x → φ}, {b1 → b2, b1 → φ}, {b → c, b → φ}, {φ → i, A case where φ → b2, φ → c} is specified will be described as an example.

この場合、作成部302は、{x→i}と、{b1→b2}と、{b→c}との組み合わせに基づいて、変更前プログラムP1のxをiに、b1をb2に、bをcに置換して、プログラムバリエーションを作成する。また、作成部302は、{x→φ}と、{b1→b2}と、{b→c}と、{φ→i}との組み合わせに基づいて、変更前プログラムP1のxをx_rに置換し、b1をb2に置換し、bをcに置換し、iを追加して、プログラムバリエーションを作成する。ここで、x_rは、xが削除されることを表す削除用の変数である。   In this case, based on the combination of {x → i}, {b1 → b2}, and {b → c}, the creation unit 302 sets x of the pre-change program P1 to i, b1 to b2, and b Replace c with c to create a program variation. Further, the creation unit 302 replaces x in the pre-change program P1 with x_r based on a combination of {x → φ}, {b1 → b2}, {b → c}, and {φ → i}. Then, b1 is replaced with b2, b is replaced with c, and i is added to create a program variation. Here, x_r is a variable for deletion indicating that x is deleted.

これにより、作成部302は、変更後プログラムP2のテストデータの生成用のプログラムバリエーションを作成することができる。作成されたデータは、例えば、RAM203、磁気ディスク205、光ディスク207などの記憶領域に記憶される。   Thereby, the creation unit 302 can create a program variation for generating test data of the changed program P2. The created data is stored in a storage area such as the RAM 203, the magnetic disk 205, and the optical disk 207, for example.

生成部303は、作成した第3プログラムをシンボリック実行してテストデータを生成する。ここで、シンボリック実行とは、記号実行と呼ばれる。シンボリック実行によるテストデータの生成は従来技術のため説明を省略する。   The generating unit 303 generates test data by symbolically executing the generated third program. Here, symbolic execution is called symbol execution. Since the test data generation by symbolic execution is a conventional technique, the description is omitted.

生成部303は、例えば、作成した第3プログラムにおける命令文の系列の実行条件になる入力変数の値と実行結果になる出力変数の値とを対応付けて有するテストデータを生成する。生成部303は、具体的には、実行条件「i=0、b2=false、a=0、c=0」と実行結果「{0,1}」を対応付けた第1のペアを有するテストデータを生成する。   The generation unit 303 generates, for example, test data having an input variable value that becomes an execution condition of a sequence of statements in the created third program and an output variable value that becomes an execution result in association with each other. Specifically, the generation unit 303 includes a test having a first pair in which the execution condition “i = 0, b2 = false, a = 0, c = 0” and the execution result “{0, 1}” are associated with each other. Generate data.

この場合、第1のペアは、実行条件「i=0、b2=false、a=0、c=0」を入力変数として変更前プログラムP1を実行した場合に、実行結果「{0,1}」のいずれかが出力変数の値となることを表す。また、第1のペアは、実行条件「i=0、b2=false、a=0、c=0」を入力変数として変更後プログラムP2を実行した場合に、実行結果「{0,1}」のいずれかが出力変数の期待値となることを表す。   In this case, when the pre-change program P1 is executed with the execution condition “i = 0, b2 = false, a = 0, c = 0” as input variables, the first pair has an execution result “{0, 1}”. "" Indicates that the value of the output variable. Further, the first pair has an execution result “{0, 1}” when the changed program P2 is executed with the execution condition “i = 0, b2 = false, a = 0, c = 0” as input variables. Indicates that one of the values is the expected value of the output variable.

また、テストデータは、さらに、実行条件「i=0、b2=true、a=−1、c=0」と実行結果「0」とを対応付けた第2のペアを有する場合がある。また、テストデータは、さらに、実行条件「i=0、b2=false、a=−1、c=0」と実行結果「0」を対応付けた第3のペアを有する場合がある。   The test data may further include a second pair in which the execution condition “i = 0, b2 = true, a = −1, c = 0” and the execution result “0” are associated with each other. Further, the test data may further include a third pair in which the execution condition “i = 0, b2 = false, a = −1, c = 0” and the execution result “0” are associated with each other.

これにより、生成部303は、変更後プログラムP2のテストデータを生成することができる。生成されたデータは、例えば、RAM203、磁気ディスク205、光ディスク207などの記憶領域に記憶される。   Thereby, the production | generation part 303 can produce | generate the test data of the program P2 after a change. The generated data is stored in a storage area such as the RAM 203, the magnetic disk 205, and the optical disk 207, for example.

判定部304は、生成したテストデータが有する入力変数の値を実行条件にして第2プログラムを実行した場合の出力変数の値が、テストデータが有する出力変数の値に一致するか否かを判定する。判定部304は、例えば、実行条件「i=0、b2=true、a=−1、c=0」を入力変数として変更後プログラムP2を実行した場合に実行結果が「−1」であって、出力変数の期待値となる実行結果「0」と一致するか否かを判定する。ここで、判定部304は、或る実行条件を入力変数とした場合の実行結果が、テストデータが有する当該実行条件に対応する実行結果と一致しない場合に、メソッドの内容の変更によりメソッドの機能が変更されたと判定してもよい。 The determination unit 304 determines whether or not the value of the output variable when the second program is executed using the value of the input variable included in the generated test data as an execution condition matches the value of the output variable included in the test data. To do. For example, when the changed program P2 is executed with the execution condition “i = 0, b2 = true, a = −1, c = 0” as input variables, the determination unit 304 has an execution result of “−1”. Then, it is determined whether or not it matches the execution result “0” that is the expected value of the output variable. Here, when the execution result when a certain execution condition is an input variable does not match the execution result corresponding to the execution condition included in the test data, the determination unit 304 changes the method function to change the function of the method. It may be determined that has been changed.

判定部304は、生成したテストデータが有する入力変数の値を実行条件にして第2プログラムを実行した場合の出力変数の値が、テストデータが有する出力変数の値に含まれるか否かを判定する。判定部304は、例えば、実行条件「i=0、b2=false、a=0、c=0」を入力変数として変更後プログラムP2を実行した場合の実行結果が「−1」であり、出力変数の期待値となる実行結果「{0,1}」のいずれかの値と一致するか否かを判定する。ここで、判定部304は、或る実行条件を入力変数とした場合の実行結果が、テストデータが有する当該実行条件に対応する実行結果に含まれない場合に、メソッドの内容の変更によりメソッドの機能が変更されたと判定してもよい。 The determination unit 304 determines whether or not the value of the output variable when the second program is executed using the value of the input variable included in the generated test data as an execution condition is included in the value of the output variable included in the test data. To do. For example, the determination unit 304 outputs “−1” as the execution result when the changed program P2 is executed with the execution condition “i = 0, b2 = false, a = 0, c = 0” as input variables. It is determined whether or not it matches any value of the execution result “{0, 1}” that is the expected value of the variable. Here, when the execution result when an execution condition is an input variable is not included in the execution result corresponding to the execution condition included in the test data, the determination unit 304 changes the method content to change the method. It may be determined that the function has been changed.

判定部304は、生成した前記テストデータが有する実行条件と実行結果とを対応付けたペアのうち、実行条件になる入力変数のうちの前記メソッドの変更前後で名称変更されない入力変数の値が同一になり、かつ実行結果が同一になるペアをグループ化する。そして、判定部304は、グループ化したペアのうち、いずれかのペアに含まれる入力変数の値を実行条件にして第2プログラムを実行した場合の出力変数の値が、前記いずれかのペアに含まれる出力変数の値に含まれるか否かを判定する。 The determination unit 304 has the same input variable value that is not renamed before and after the change of the method among the input variables that become the execution condition in the pair that associates the execution condition and the execution result of the generated test data. And pairs that have the same execution result. Then, the determination unit 304 sets the value of the output variable when the second program is executed using the value of the input variable included in any of the grouped pairs as an execution condition to the pair. It is determined whether it is included in the value of the included output variable.

判定部304は、例えば、実行条件「i=0、b2=true、a=−1、c=0」と実行結果「0」を対応付けたペアと、実行条件「i=0、b2=false、a=−1、c=0」と実行結果「0」を対応付けたペアとをグループ化する。次に、判定部304は、実行条件ごとに、当該実行条件を入力変数として変更後プログラムP2を実行した場合の実行結果が、当該実行条件に対応する実行結果に含まれるか否かを判定する。ここで、判定部304は、グループ化したペアに、或る実行条件を入力変数とした場合の実行結果が、テストデータが有する当該実行条件に対応する実行結果に含まれると判定されたペアがあるか否かを判定してもよい。そして、判定部304は、ペアがない場合に、メソッドの内容の変更によりメソッドの機能が変更されたと判定してもよい。   The determination unit 304, for example, includes a pair in which the execution condition “i = 0, b2 = true, a = −1, c = 0” and the execution result “0” are associated with each other, and the execution condition “i = 0, b2 = false”. , A = −1, c = 0 ”and a pair in which the execution result“ 0 ”is associated with each other. Next, the determination unit 304 determines, for each execution condition, whether or not the execution result when the changed program P2 is executed with the execution condition as an input variable is included in the execution result corresponding to the execution condition. . Here, the determination unit 304 includes a pair in which an execution result when an execution condition is an input variable is included in the execution result corresponding to the execution condition included in the test data in the grouped pair. It may be determined whether or not there is. Then, when there is no pair, the determination unit 304 may determine that the function of the method has been changed by changing the content of the method.

これにより、判定部304は、リグレッションテストを実行することができる。判定結果は、例えば、RAM203、磁気ディスク205、光ディスク207などの記憶領域に記憶される。また、判定部304は、判定結果を出力してもよい。出力形式としては、例えば、ディスプレイ208への表示、プリンタ213への印刷出力、I/F209による外部装置への送信がある。また、RAM203、磁気ディスク205、光ディスク207などの記憶領域に記憶することとしてもよい。これにより、テストデータ生成装置100の利用者は、判定結果から、メソッドの内容の変更によりメソッドの機能が変更されたか否かを判定することができる。   Thereby, the determination unit 304 can execute the regression test. The determination result is stored in a storage area such as the RAM 203, the magnetic disk 205, and the optical disk 207, for example. The determination unit 304 may output a determination result. Examples of the output format include display on the display 208, print output to the printer 213, and transmission to an external device by the I / F 209. Alternatively, the data may be stored in a storage area such as the RAM 203, the magnetic disk 205, and the optical disk 207. Thereby, the user of the test data generation device 100 can determine from the determination result whether or not the function of the method has been changed due to the change in the content of the method.

(プログラムの変更内容の一例)
次に、図4を用いて、プログラムの変更内容の一例について説明する。
(Example of program changes)
Next, an example of program change contents will be described with reference to FIG.

図4は、プログラムの変更内容の一例を示す説明図である。図4の例では、変更前プログラムP1には、int型のプログラム変数「x」と、boolean型のプログラム変数「b1」とが宣言されている。また、変更前プログラムP1には、maxメソッドが規定され、maxメソッドの引数としてint型のパラメータ変数「a」と、int型のパラメータ変数「b」とが宣言されている。   FIG. 4 is an explanatory diagram showing an example of program change contents. In the example of FIG. 4, an int type program variable “x” and a Boolean type program variable “b1” are declared in the pre-change program P1. The pre-change program P1 defines a max method, and declares an int type parameter variable “a” and an int type parameter variable “b” as arguments of the max method.

一方で、変更後プログラムP2には、int型のプログラム変数「x」と、boolean型のプログラム変数「b1」とがなく、int型のプログラム変数「i」と、boolean型のプログラム変数「b2」とが宣言されている。また、変更後プログラムP2には、maxメソッドの引数としてint型のパラメータ変数「a」と、int型のパラメータ変数「c」とが宣言されている。   On the other hand, the changed program P2 does not have the int type program variable “x” and the Boolean type program variable “b1”, but the int type program variable “i” and the Boolean type program variable “b2”. And are declared. In the changed program P2, an int type parameter variable “a” and an int type parameter variable “c” are declared as arguments of the max method.

(差異情報の特定処理の一例)
次に、図5〜図13を用いて、差異情報の特定処理の一例について説明する。
(An example of difference information identification processing)
Next, an example of the difference information specifying process will be described with reference to FIGS.

図5〜図13は、差異情報の特定処理の一例を示す説明図である。図5に示すように、テストデータ生成装置100は、変更前プログラムP1から、プログラム変数の集合V1={x,b1}と、パラメータ変数の集合P1={a,b}と、を抽出する。以下の説明では、抽出したプログラム変数の集合V1とパラメータ変数の集合P1とを合わせて「変更前変数データ500」と表記する場合がある。次に、図6の説明に移行する。   5 to 13 are explanatory diagrams illustrating an example of the difference information specifying process. As shown in FIG. 5, the test data generation device 100 extracts a set of program variables V1 = {x, b1} and a set of parameter variables P1 = {a, b} from the pre-change program P1. In the following description, the extracted set of program variables V1 and the set of parameter variables P1 may be collectively referred to as “pre-change variable data 500”. Next, the description shifts to the description of FIG.

図6に示すように、テストデータ生成装置100は、変更後プログラムP2から、プログラム変数の集合V2={i,b2}と、パラメータ変数の集合P2={a,c}と、を含む変更後変数データを抽出する。以下の説明では、抽出したプログラム変数の集合V2とパラメータ変数の集合P2とを合わせて「変更後変数データ600」と表記する場合がある。次に、図7の説明に移行する。   As illustrated in FIG. 6, the test data generation apparatus 100 includes a post-change program P2 including a set of program variables V2 = {i, b2} and a set of parameter variables P2 = {a, c}. Extract variable data. In the following description, the extracted set of program variables V2 and the set of parameter variables P2 may be collectively referred to as “changed variable data 600”. Next, the description proceeds to FIG.

図7に示すように、テストデータ生成装置100は、変更前変数データ500と変更後変数データ600とに基づいて、不変名称のプログラム変数の集合V_INV=V2∩V1={}を抽出する。また、テストデータ生成装置100は、変更前変数データ500と変更後変数データ600とに基づいて、不変名称のパラメータ変数の集合P_INV=P2∩P1={a}を抽出する。以下の説明では、抽出した不変名称のプログラム変数の集合V_INVと不変名称のパラメータ変数の集合P_INVとを合わせて「不変変数データ701」と表記する場合がある。   As illustrated in FIG. 7, the test data generation apparatus 100 extracts a set of invariant-named program variables V_INV = V2∩V1 = {} based on pre-change variable data 500 and post-change variable data 600. Further, the test data generating apparatus 100 extracts a set of parameter variables P_INV = P21P1 = {a} having invariant names based on the pre-change variable data 500 and the post-change variable data 600. In the following description, the extracted invariant name program variable set V_INV and the invariant name parameter variable set P_INV may be collectively referred to as “invariant variable data 701”.

また、テストデータ生成装置100は、変更前変数データ500と変更後変数データ600とに基づいて、追加候補のプログラム変数の集合V_ADD=V2−V1={i,b2}を抽出する。また、テストデータ生成装置100は、変更前変数データ500と変更後変数データ600とに基づいて、追加候補のパラメータ変数の集合P_ADD=P2−P1={c}を抽出する。以下の説明では、抽出した追加候補のプログラム変数の集合V_ADDと追加候補のパラメータ変数の集合P_ADDとを合わせて「追加候補変数データ702」と表記する場合がある。   Further, the test data generation apparatus 100 extracts a set of additional candidate program variables V_ADD = V2-V1 = {i, b2} based on the pre-change variable data 500 and the post-change variable data 600. Further, the test data generation apparatus 100 extracts a set of additional candidate parameter variables P_ADD = P2-P1 = {c} based on the pre-change variable data 500 and the post-change variable data 600. In the following description, the set of additional candidate program variables V_ADD and the set of additional candidate parameter variables P_ADD may be collectively referred to as “additional candidate variable data 702”.

また、テストデータ生成装置100は、変更前変数データ500と変更後変数データ600とに基づいて、削除候補のプログラム変数の集合V_REM=V1−V2={x,b1}を抽出する。また、テストデータ生成装置100は、変更前変数データ500と変更後変数データ600とに基づいて、削除候補のパラメータ変数の集合P_REM=P1−P2={b}を抽出する。以下の説明では、抽出した削除候補のプログラム変数の集合V_REMと削除候補のパラメータ変数の集合P_REMとを合わせて「削除候補変数データ703」と表記する場合がある。次に、図8の説明に移行する。   Further, the test data generation apparatus 100 extracts a set V_REM = V1-V2 = {x, b1} of deletion candidate program variables based on the pre-change variable data 500 and the post-change variable data 600. Further, the test data generation device 100 extracts a set of parameter variables P_REM = P1-P2 = {b} of deletion candidates based on the pre-change variable data 500 and the post-change variable data 600. In the following description, the extracted deletion candidate program variable set V_REM and the deletion candidate parameter variable set P_REM may be collectively referred to as “deletion candidate variable data 703”. Next, the description proceeds to FIG.

図8に示すように、テストデータ生成装置100は、追加候補変数データ702のプログラム変数の集合V_ADD={i,b2}にダミー変数を追加して、プログラム変数の集合V_ADD={i,b2,φ}にする。また、テストデータ生成装置100は、追加候補変数データ702のパラメータ変数の集合P_ADD={c}にダミー変数を追加して、パラメータ変数の集合P_ADD={c,φ}にする。   As illustrated in FIG. 8, the test data generation device 100 adds a dummy variable to the program variable set V_ADD = {i, b2} of the additional candidate variable data 702 and sets the program variable set V_ADD = {i, b2, φ}. Further, the test data generating apparatus 100 adds a dummy variable to the parameter variable set P_ADD = {c} of the additional candidate variable data 702 so as to obtain a parameter variable set P_ADD = {c, φ}.

また、テストデータ生成装置100は、削除候補変数データ703のプログラム変数の集合V_REM={x,b1}にダミー変数を追加して、プログラム変数の集合V_REM={x,b1,φ}にする。また、テストデータ生成装置100は、削除候補変数データ703のパラメータ変数の集合P_REM={b}にダミー変数を追加して、パラメータ変数の集合P_REM={b,φ}にする。   Further, the test data generating apparatus 100 adds a dummy variable to the program variable set V_REM = {x, b1} of the deletion candidate variable data 703 to make a program variable set V_REM = {x, b1, φ}. Further, the test data generating apparatus 100 adds a dummy variable to the parameter variable set P_REM = {b} of the deletion candidate variable data 703 to make the parameter variable set P_REM = {b, φ}.

そして、テストデータ生成装置100は、ダミー変数を追加した追加候補変数データ702と、ダミー変数を追加した削除候補変数データ703と、を結合する。以下の説明では、ダミー変数を追加した追加候補変数データ702とダミー変数を追加した削除候補変数データ703とを合わせて「結合後データ800」と表記する場合がある。次に、図9の説明に移行する。   Then, the test data generation device 100 combines the addition candidate variable data 702 to which the dummy variable is added and the deletion candidate variable data 703 to which the dummy variable is added. In the following description, the addition candidate variable data 702 to which dummy variables are added and the deletion candidate variable data 703 to which dummy variables are added may be collectively referred to as “combined data 800”. Next, the description shifts to the description of FIG.

図9に示すように、テストデータ生成装置100は、結合後データ800に基づいて、プログラム変数の変更パターンV_PATTERN=V_REM→V_ADD={x→i,x→b2,x→φ,b1→i,b1→b2,b1→φ,φ→i,φ→b2,φ→φ}を特定する。また、テストデータ生成装置100は、結合後データ800に基づいて、パラメータ変数の変更パターンP_PATTERN=P_REM→P_ADD={b→c,b→φ,φ→c,φ→φ}を特定する。以下の説明では、プログラム変数の変更パターンV_PATTERNとパラメータ変数の変更パターンP_PATTERNとを合わせて「組み合わせデータ901」と表記する場合がある。   As shown in FIG. 9, the test data generation apparatus 100 uses the program data change pattern V_PATTERN = V_REM → V_ADD = {x → i, x → b2, x → φ, b1 → i, b1 → b2, b1 → φ, φ → i, φ → b2, φ → φ} are specified. Further, the test data generation apparatus 100 specifies a parameter variable change pattern P_PATTERN = P_REM → P_ADD = {b → c, b → φ, φ → c, φ → φ} based on the combined data 800. In the following description, the program variable change pattern V_PATTERN and the parameter variable change pattern P_PATTERN may be collectively referred to as “combination data 901”.

次に、テストデータ生成装置100は、組み合わせデータ901のうちのプログラム変数の変更パターンV_PATTERNからφ→φのペアと、型の異なるペアとを除去して、プログラム変数の変更パターンV_PATTERN={x→i,x→φ,b1→b2,b1→φ,φ→i,φ→b2}にする。また、テストデータ生成装置100は、組み合わせデータ901のうちのパラメータ変数の変更パターンP_PATTERNからφ→φのペアと、型の異なるペアとを除去して、パラメータ変数の変更パターンP_PATTERN={b→c,b→φ,φ→c}にする。   Next, the test data generating apparatus 100 removes the φ → φ pair and the pair of different types from the program variable change pattern V_PATTERN in the combination data 901, and the program variable change pattern V_PATTERN = {x → i, x → φ, b1 → b2, b1 → φ, φ → i, φ → b2}. Further, the test data generating apparatus 100 removes the φ → φ pair and the pair of different types from the parameter variable change pattern P_PATTERN in the combination data 901, and changes the parameter variable change pattern P_PATTERN = {b → c , B → φ, φ → c}.

以下の説明では、ペアを除去したプログラム変数の変更パターンV_PATTERNとペアを除去したパラメータ変数の変更パターンP_PATTERNとを合わせて「除去後データ902」と表記する場合がある。次に、図10の説明に移行する。   In the following description, the program variable change pattern V_PATTERN from which the pair has been removed and the parameter variable change pattern P_PATTERN from which the pair has been removed may be collectively referred to as “post-removal data 902”. Next, the description proceeds to FIG.

図10に示すように、テストデータ生成装置100は、除去後データ902に基づいて、変更前プログラムP1のプログラム変数とパラメータ変数とについての変更パターンV_x={x→i,x→φ}と、V_b1={b1→b2,b1→φ}と、M_b={b→c,b→φ}とを抽出する。また、テストデータ生成装置100は、除去後データ900に基づいて、変更後プログラムP2のプログラム変数とパラメータ変数とについての追加パターンφ={φ→i,φ→b2,φ→c}を抽出する。以下の説明では、抽出した変更パターンV_xと、V_b1と、M_bと、追加パターンφとを合わせて「変更パターンデータ1000」と表記する場合がある。次に、図11の説明に移行する。   As shown in FIG. 10, the test data generation apparatus 100, based on the post-removal data 902, changes pattern V_x = {x → i, x → φ} for the program variables and parameter variables of the pre-change program P1; V_b1 = {b1 → b2, b1 → φ} and M_b = {b → c, b → φ} are extracted. Further, the test data generation apparatus 100 extracts an additional pattern φ = {φ → i, φ → b2, φ → c} for the program variable and parameter variable of the changed program P2 based on the post-removal data 900. . In the following description, the extracted change pattern V_x, V_b1, M_b, and the additional pattern φ may be collectively referred to as “change pattern data 1000”. Next, the description proceeds to FIG.

図11に示すように、テストデータ生成装置100は、変更パターンデータ1000に基づいて、変更バリエーションVARIATION=V_x→V_b1→M_b={{x→i,b1→b2,b→c},{x→i,b1→b2,b→φ},{x→i,b1→φ,b→c},{x→i,b1→φ,b→φ},{x→φ,b1→b2,b→c},{x→φ,b1→b2,b→φ},{x→φ,b1→φ,b→c},{x→φ,b1→φ,b→φ}}を抽出する。以下の説明では、抽出した変更バリエーションを「バリエーションデータ1100」と表記する場合がある。次に、図12の説明に移行する。   As shown in FIG. 11, the test data generation device 100, based on the change pattern data 1000, changes variation VARIATION = V_x → V_b1 → M_b = {{x → i, b1 → b2, b → c}, {x → i, b1 → b2, b → φ}, {x → i, b1 → φ, b → c}, {x → i, b1 → φ, b → φ}, {x → φ, b1 → b2, b → c}, {x → φ, b1 → b2, b → φ}, {x → φ, b1 → φ, b → c}, {x → φ, b1 → φ, b → φ}}. In the following description, the extracted change variation may be referred to as “variation data 1100”. Next, the description proceeds to FIG.

図12に示すように、テストデータ生成装置100は、バリエーションデータ1100に、変更後プログラムP2のプログラム変数とパラメータ変数とについての変更パターンφを追加して、変更バリエーションVARIATION=V_x→V_b1→M_b={{x→i,b1→b2,b→c},{x→i,b1→b2,b→φ,φ→c},{x→i,b1→φ,b→c,φ→b2},{x→i,b1→φ,b→φ,φ→b2,φ→c},{x→φ,b1→b2,b→c,φ→i},{x→φ,b1→b2,b→φ,φ→i,φ→c},{x→φ,b1→φ,b→c,φ→i,φ→b2},{x→φ,b1→φ,b→φ,φ→i,φ→b2,φ→c}}を作成する。以下の説明では、追加した変更バリエーションを「追加バリエーションデータ1200」と表記する場合がある。次に、図13の説明に移行する。   As shown in FIG. 12, the test data generation device 100 adds the change pattern φ for the program variable and the parameter variable of the changed program P2 to the variation data 1100, and changes variation VARIATION = V_x → V_b1 → M_b = {{X → i, b1 → b2, b → c}, {x → i, b1 → b2, b → φ, φ → c}, {x → i, b1 → φ, b → c, φ → b2} , {X → i, b1 → φ, b → φ, φ → b2, φ → c}, {x → φ, b1 → b2, b → c, φ → i}, {x → φ, b1 → b2, b → φ, φ → i, φ → c}, {x → φ, b1 → φ, b → c, φ → i, φ → b2}, {x → φ, b1 → φ, b → φ, φ → i, φ → b2, φ → c}}. In the following description, the added change variation may be referred to as “additional variation data 1200”. Next, the description proceeds to FIG.

図13に示すように、テストデータ生成装置100は、変更バリエーションから、プログラムの変更内容を特定する。図13の例では、テストデータ生成装置100は、変更バリエーションB1「{x→i,b1→b2,b→c}」から、プログラムの変更内容「xをiに、b1をb2に、bをcに名称変更」を特定する。   As illustrated in FIG. 13, the test data generation device 100 specifies the program change content from the change variation. In the example of FIG. 13, the test data generation apparatus 100 starts from the change variation B1 “{x → i, b1 → b2, b → c}”, and the program change content “x is i, b1 is b2, and b is “Name change to c” is specified.

また、テストデータ生成装置100は、変更バリエーションB2「{x→i,b1→b2,b→φ,φ→c}」から、プログラムの変更内容「xをiに、b1をb2に名称変更、bを削除、cを追加」を特定する。   Further, the test data generating apparatus 100 changes the program change contents “x to i, b1 to b2 from the change variation B2“ {x → i, b1 → b2, b → φ, φ → c} ”, “Delete b, add c” is specified.

また、テストデータ生成装置100は、変更バリエーションB3「{x→i,b1→φ,b→c,φ→b2}」から、プログラムの変更内容「xをiに、bをcに名称変更、b1を削除、b2を追加」を特定する。   Further, the test data generation apparatus 100 changes the program change contents “x to i, b to c from the change variation B3“ {x → i, b1 → φ, b → c, φ → b2} ”, “Delete b1, add b2” is specified.

また、テストデータ生成装置100は、変更バリエーションB4「{x→i,b1→φ,b→φ,φ→b2,φ→c}」から、プログラムの変更内容「xをiに名称変更、b1・bを削除、b2・cを追加」を特定する。   Further, the test data generating apparatus 100 changes the program change contents “x to i, b1” from the change variation B4 “{x → i, b1 → φ, b → φ, φ → b2, φ → c}”. “Delete b, add b2 and c”.

また、テストデータ生成装置100は、変更バリエーションB5「{x→φ,b1→b2,b→c,φ→i}」から、プログラムの変更内容「xを削除、iを追加、b1をb2に、bをcに名称変更」を特定する。   Further, the test data generation device 100 deletes the program change contents “x is deleted, i is added, and b1 is changed to b2 from the change variation B5“ {x → φ, b1 → b2, b → c, φ → i} ”. , B is renamed to c ”.

また、テストデータ生成装置100は、変更バリエーションB6「{x→φ,b1→b2,b→φ,φ→i,φ→c}」から、プログラムの変更内容「b1をb2に名称変更、x・bを削除、i・cを追加」を特定する。   Further, the test data generation device 100 changes the program change content “b1 to b2” from the change variation B6 “{x → φ, b1 → b2, b → φ, φ → i, φ → c}”, x Specify “Delete b, add i and c”.

また、テストデータ生成装置100は、変更バリエーションB7「{x→φ,b1→φ,b→c,φ→i,φ→b2}」から、プログラムの変更内容「bをcに名称変更、x・b1を削除、i・b2を追加」を特定する。   Further, the test data generating apparatus 100 changes the program change content “b to c, x from the change variation B7“ {x → φ, b1 → φ, b → c, φ → i, φ → b2} ”, x “Delete b1 and add i · b2”.

また、テストデータ生成装置100は、変更バリエーションB8「{x→φ,b1→φ,b→φ,φ→i,φ→b2,φ→c}」から、プログラムの変更内容「x・b1・bを削除、i・b2・cを追加」を特定する。   In addition, the test data generation apparatus 100 reads the program change contents “x · b1 · from the change variation B8“ {x → φ, b1 → φ, b → φ, φ → i, φ → b2, φ → c} ”. “Delete b, add i · b2 · c” ”is specified.

(プログラムの加工処理の一例)
次に、図14を用いて、プログラムの加工処理の一例について説明する。
(Example of program processing)
Next, an example of program processing will be described with reference to FIG.

図14は、プログラムの加工処理の一例を示す説明図である。図14に示すように、テストデータ生成装置100は、変更前プログラムP1を、変更バリエーションBから特定した変更内容に従って加工して、変更バリエーションB1〜B8に対応するプログラムバリエーションP1−1〜P1−8を作成する。   FIG. 14 is an explanatory diagram showing an example of processing of a program. As shown in FIG. 14, the test data generation device 100 processes the pre-change program P1 according to the change content specified from the change variation B, and program variations P1-1 to P1-8 corresponding to the change variations B1 to B8. Create

図14の例では、テストデータ生成装置100は、変更バリエーションB1に従って、変更前プログラムP1におけるxをiに、b1をb2に、bをcに置換して、変更バリエーションB1に対応するプログラムバリエーションP1−1を作成する。   In the example of FIG. 14, the test data generation device 100 replaces x in the pre-change program P1 with i, b1 with b2, and b with c according to the change variation B1, and the program variation P1 corresponding to the change variation B1. -1.

また、テストデータ生成装置100は、変更バリエーションB2に従って、変更前プログラムP1を加工する。テストデータ生成装置100は、例えば、変更前プログラムP1におけるxをiに、b1をb2に置換し、bを削除したことを表すb_rに置換し、cを追加し、変更バリエーションB2に対応するプログラムバリエーションP1−2を作成する。   Further, the test data generation device 100 processes the pre-change program P1 according to the change variation B2. For example, the test data generation apparatus 100 replaces x in the pre-change program P1 with i, replaces b1 with b2, replaces b with b_r indicating deletion, adds c, and corresponds to the change variation B2 A variation P1-2 is created.

また、テストデータ生成装置100は、変更バリエーションB3に従って、変更前プログラムP1を加工する。テストデータ生成装置100は、例えば、変更前プログラムP1におけるxをiに、bをcに置換し、b1を削除したことを表すb1_rに置換し、b2を追加し、変更バリエーションB3に対応するプログラムバリエーションP1−3を作成する。   Further, the test data generation device 100 processes the pre-change program P1 according to the change variation B3. For example, the test data generating apparatus 100 replaces x in the pre-change program P1 with i, replaces b with c, replaces b1 with b1_r indicating deletion, adds b2, and corresponds to the change variation B3. A variation P1-3 is created.

また、テストデータ生成装置100は、変更バリエーションB4に従って、変更前プログラムP1を加工する。テストデータ生成装置100は、例えば、変更前プログラムP1におけるxをiに置換し、b1・bを削除したことを表すb1_r・b_rに置換し、b2・cを追加し、変更バリエーションB4に対応するプログラムバリエーションP1−4を作成する。   Further, the test data generation device 100 processes the pre-change program P1 according to the change variation B4. For example, the test data generation device 100 replaces x in the pre-change program P1 with i, replaces b1 · b with b1_r · b_r indicating that b1 · b is deleted, adds b2 · c, and corresponds to the change variation B4. A program variation P1-4 is created.

また、テストデータ生成装置100は、変更バリエーションB5に従って、変更前プログラムP1を加工する。テストデータ生成装置100は、例えば、変更前プログラムP1におけるxを削除したことを表すx_rに置換し、iを追加し、b1をb2に、bをcに置換し、変更バリエーションB5に対応するプログラムバリエーションP1−5を作成する。   Further, the test data generation device 100 processes the pre-change program P1 according to the change variation B5. For example, the test data generating apparatus 100 replaces x in the pre-change program P1 with x_r indicating that it has been deleted, adds i, replaces b1 with b2, replaces b with c, and corresponds to the change variation B5. Variation P1-5 is created.

また、テストデータ生成装置100は、変更バリエーションB6に従って、変更前プログラムP1を加工する。テストデータ生成装置100は、例えば、変更前プログラムP1におけるb1をb2に置換し、x・bを削除したことを表すx_r・b_rに置換し、i・cを追加し、変更バリエーションB6に対応するプログラムバリエーションP1−6を作成する。   Moreover, the test data generation device 100 processes the pre-change program P1 according to the change variation B6. For example, the test data generating apparatus 100 replaces b1 in the pre-change program P1 with b2, replaces x · b with x_r · b_r indicating deletion, adds i · c, and corresponds to the change variation B6. Program variation P1-6 is created.

また、テストデータ生成装置100は、変更バリエーションB7に従って、変更前プログラムP1を加工する。テストデータ生成装置100は、例えば、変更前プログラムP1におけるbをcに置換し、x・b1を削除したことを表すx_r・b1_rに置換し、i・b2を追加し、変更バリエーションB7に対応するプログラムバリエーションP1−7を作成する。   Moreover, the test data generation device 100 processes the pre-change program P1 according to the change variation B7. For example, the test data generation device 100 replaces b in the pre-change program P1 with c, replaces x · b1 with x_r · b1_r indicating deletion, adds i · b2, and corresponds to the change variation B7. Program variation P1-7 is created.

また、テストデータ生成装置100は、変更バリエーションB8に従って、変更前プログラムP1を加工する。テストデータ生成装置100は、例えば、変更前プログラムP1におけるx・b1・bを削除したことを表すx_r・b1_r・b_rに置換し、i・b2・cを追加し、変更バリエーションB8に対応するプログラムバリエーションP1−8を作成する。   Further, the test data generation device 100 processes the pre-change program P1 according to the change variation B8. The test data generation device 100 replaces x · b1 · r · b_r indicating that x · b1 · b in the pre-change program P1 is deleted, adds i · b2 · c, and the program corresponding to the change variation B8. Variation P1-8 is created.

(テストデータ生成処理の一例)
次に、図15および図16を用いて、テストデータ生成処理の一例について説明する。
(Example of test data generation process)
Next, an example of test data generation processing will be described with reference to FIGS. 15 and 16.

図15および図16は、テストデータ生成処理の一例を示す説明図である。図15および図16に示すように、テストデータ生成装置100は、作成したプログラムバリエーションP1−1〜P1−8をシンボリック実行してテストデータを生成する。テストデータは、シンボリック実行により得られる命令文の系列におけるテストケースになる入力変数の値と実行結果になる出力変数の値とを含む。シンボリック実行によるテストデータの生成については従来技術のため詳細な説明は省略する。   15 and 16 are explanatory diagrams illustrating an example of the test data generation process. As shown in FIGS. 15 and 16, the test data generation apparatus 100 generates test data by performing symbolic execution of the created program variations P1-1 to P1-8. The test data includes the value of an input variable that becomes a test case and the value of an output variable that becomes an execution result in a sequence of statements obtained by symbolic execution. Since generation of test data by symbolic execution is a conventional technique, a detailed description thereof will be omitted.

図15の例では、テストデータ生成装置100は、プログラムバリエーションP1−1をシンボリック実行して得られる命令文の系列からテストデータT1を生成する。ここで、テストデータT1は、テストケース「i=0、b2=false、a=0、c=0」と実行結果「0」を対応付けたペアを有する。また、テストデータT1は、テストケース「i=0、b2=true、a=−1、c=0」と実行結果「0」を対応付けたペアを有する。また、テストデータT1は、テストケース「i=0、b2=false、a=0、c=1」と実行結果「−1」を対応付けたペアを有する。   In the example of FIG. 15, the test data generation device 100 generates test data T1 from a series of command statements obtained by symbolically executing the program variation P1-1. Here, the test data T1 has a pair in which the test case “i = 0, b2 = false, a = 0, c = 0” and the execution result “0” are associated with each other. The test data T1 has a pair in which the test case “i = 0, b2 = true, a = −1, c = 0” and the execution result “0” are associated with each other. The test data T1 has a pair in which the test case “i = 0, b2 = false, a = 0, c = 1” and the execution result “−1” are associated with each other.

また、テストデータ生成装置100は、プログラムバリエーションP1−2をシンボリック実行して得られる命令文の系列からテストデータT2を生成する。ここで、テストデータT2は、テストケース「i=0、b2=false、a=0、b_r=0、c=0」と実行結果「0」を対応付けたペアを有する。また、テストデータT2は、テストケース「i=0、b2=true、a=−1、b_r=0、c=0」と実行結果「0」を対応付けたペアを有する。また、テストデータT2は、テストケース「i=0、b2=false、a=0、b_r=1、c=0」と実行結果「−1」を対応付けたペアを有する。   In addition, the test data generation device 100 generates test data T2 from a series of command statements obtained by symbolically executing the program variation P1-2. Here, the test data T2 has a pair in which the test case “i = 0, b2 = false, a = 0, b_r = 0, c = 0” and the execution result “0” are associated with each other. The test data T2 has a pair in which the test case “i = 0, b2 = true, a = −1, b_r = 0, c = 0” and the execution result “0” are associated with each other. The test data T2 has a pair in which the test case “i = 0, b2 = false, a = 0, b_r = 1, c = 0” and the execution result “−1” are associated with each other.

また、テストデータ生成装置100は、プログラムバリエーションP1−3をシンボリック実行して得られる命令文の系列からテストデータT3を生成する。ここで、テストデータT3は、テストケース「i=0、b1_r=false、a=0、c=0、b2=false」と実行結果「0」を対応付けたペアを有する。また、テストデータT3は、テストケース「i=0、b1_r=true、a=−1、c=0、b2=false」と実行結果「0」を対応付けたペアを有する。また、テストデータT3は、テストケース「i=0、b1_r=false、a=0、c=1、b2=false」と実行結果「−1」を対応付けたペアを有する。   In addition, the test data generation apparatus 100 generates test data T3 from a series of command statements obtained by symbolically executing the program variation P1-3. Here, the test data T3 has a pair in which the test case “i = 0, b1_r = false, a = 0, c = 0, b2 = false” and the execution result “0” are associated with each other. The test data T3 has a pair in which the test case “i = 0, b1_r = true, a = −1, c = 0, b2 = false” and the execution result “0” are associated with each other. The test data T3 includes a pair in which the test case “i = 0, b1_r = false, a = 0, c = 1, b2 = false” and the execution result “−1” are associated with each other.

また、テストデータ生成装置100は、プログラムバリエーションP1−4をシンボリック実行して得られる命令文の系列からテストデータT4を生成する。ここで、テストデータT4は、テストケース「i=0、b1_r=false、a=0、b_r=0、b2=false、c=0」と実行結果「0」を対応付けたペアを有する。また、テストデータT4は、テストケース「i=0、b1_r=true、a=−1、b_r=0、b2=false、c=0」と実行結果「0」を対応付けたペアを有する。また、テストデータT4は、テストケース「i=0、b1_r=false、a=0、b_r=1、b2=false、c=0」と実行結果「−1」を対応付けたペアを有する。   In addition, the test data generation device 100 generates test data T4 from a series of command statements obtained by symbolically executing the program variation P1-4. Here, the test data T4 has a pair in which the test case “i = 0, b1_r = false, a = 0, b_r = 0, b2 = false, c = 0” and the execution result “0” are associated with each other. The test data T4 has a pair in which the test case “i = 0, b1_r = true, a = −1, b_r = 0, b2 = false, c = 0” and the execution result “0” are associated with each other. The test data T4 includes a pair in which the test case “i = 0, b1_r = false, a = 0, b_r = 1, b2 = false, c = 0” and the execution result “−1” are associated with each other.

図16の例では、テストデータ生成装置100は、プログラムバリエーションP1−5をシンボリック実行して得られる命令文の系列からテストデータT5を生成する。ここで、テストデータT5は、テストケース「x_r=0、b2=false、a=0、c=0、i=0」と実行結果「0」を対応付けたペアを有する。また、テストデータT5は、テストケース「x_r=0、b2=true、a=−1、c=0、i=0」と実行結果「0」を対応付けたペアを有する。また、テストデータT5は、テストケース「x_r=0、b2=false、a=0、c=1、i=0」と実行結果「−1」を対応付けたペアを有する。   In the example of FIG. 16, the test data generation device 100 generates test data T5 from a sequence of command statements obtained by symbolically executing the program variation P1-5. Here, the test data T5 has a pair in which the test case “x_r = 0, b2 = false, a = 0, c = 0, i = 0” and the execution result “0” are associated with each other. The test data T5 includes a pair in which the test case “x_r = 0, b2 = true, a = −1, c = 0, i = 0” and the execution result “0” are associated with each other. The test data T5 has a pair in which the test case “x_r = 0, b2 = false, a = 0, c = 1, i = 0” and the execution result “−1” are associated with each other.

また、テストデータ生成装置100は、プログラムバリエーションP1−6をシンボリック実行して得られる命令文の系列からテストデータT6を生成する。ここで、テストデータT6は、テストケース「x_r=0、b2=false、a=0、b_r=0、i=0、c=0」と実行結果「0」を対応付けたペアを有する。また、テストデータT6は、テストケース「x_r=0、b2=true、a=−1、b_r=0、i=0、c=0」と実行結果「0」を対応付けたペアを有する。また、テストデータT6は、テストケース「x_r=0、b2=false、a=0、b_r=1、i=0、c=0」と実行結果「−1」を対応付けたペアを有する。   In addition, the test data generation device 100 generates test data T6 from a series of command statements obtained by symbolically executing the program variation P1-6. Here, the test data T6 has a pair in which the test case “x_r = 0, b2 = false, a = 0, b_r = 0, i = 0, c = 0” and the execution result “0” are associated with each other. The test data T6 has a pair in which the test case “x_r = 0, b2 = true, a = −1, b_r = 0, i = 0, c = 0” and the execution result “0” are associated with each other. The test data T6 includes a pair in which the test case “x_r = 0, b2 = false, a = 0, b_r = 1, i = 0, c = 0” and the execution result “−1” are associated with each other.

また、テストデータ生成装置100は、プログラムバリエーションP1−7をシンボリック実行して得られる命令文の系列からテストデータT7を生成する。ここで、テストデータT7は、テストケース「x_r=0、b1_r=false、a=0、c=0、i=0、b2=false」と実行結果「0」を対応付けたペアを有する。また、テストデータT7は、テストケース「x_r=0、b1_r=true、a=−1、c=0、i=0、b2=false」と実行結果「0」を対応付けたペアを有する。また、テストデータT7は、テストケース「x_r=0、b1_r=false、a=0、c=1、i=0、b2=false」と実行結果「−1」を対応付けたペアを有する。   In addition, the test data generation device 100 generates test data T7 from a series of command statements obtained by symbolically executing the program variation P1-7. Here, the test data T7 has a pair in which the test case “x_r = 0, b1_r = false, a = 0, c = 0, i = 0, b2 = false” and the execution result “0” are associated with each other. The test data T7 has a pair in which the test case “x_r = 0, b1_r = true, a = −1, c = 0, i = 0, b2 = false” and the execution result “0” are associated with each other. The test data T7 includes a pair in which the test case “x_r = 0, b1_r = false, a = 0, c = 1, i = 0, b2 = false” and the execution result “−1” are associated with each other.

また、テストデータ生成装置100は、プログラムバリエーションP1−8をシンボリック実行して得られる命令文の系列からテストデータT8を生成する。ここで、テストデータT8は、テストケース「x_r=0、b1_r=false、a=0、b_r=0、i=0、b2=false、c=0」と実行結果「0」を対応付けたペアを有する。また、テストデータT8は、テストケース「x_r=0、b1_r=true、a=−1、b_r=0、i=0、b2=false、c=0」と実行結果「0」を対応付けたペアを有する。また、テストデータT8は、テストケース「x_r=0、b1_r=false、a=0、b_r=1、i=0、b2=false、c=0」と実行結果「−1」を対応付けたペアを有する。   In addition, the test data generation device 100 generates test data T8 from a series of command statements obtained by symbolically executing the program variation P1-8. Here, the test data T8 is a pair in which the test case “x_r = 0, b1_r = false, a = 0, b_r = 0, i = 0, b2 = false, c = 0” and the execution result “0” are associated with each other. Have The test data T8 is a pair in which the test case “x_r = 0, b1_r = true, a = −1, b_r = 0, i = 0, b2 = false, c = 0” and the execution result “0” are associated with each other. Have The test data T8 includes a pair in which the test case “x_r = 0, b1_r = false, a = 0, b_r = 1, i = 0, b2 = false, c = 0” and the execution result “−1” are associated with each other. Have

(リファクタリング処理の一例)
次に、図17〜図21を用いて、リファクタリング処理の一例について説明する。
(Example of refactoring process)
Next, an example of the refactoring process will be described with reference to FIGS.

図17〜図21は、リファクタリング処理の一例を示す説明図である。図17に示すように、テストデータ生成装置100は、テストデータT1〜T8のテストケースから、削除候補のプログラム変数の項目と削除候補のパラメータ変数の項目とを削除する。   17 to 21 are explanatory diagrams illustrating an example of the refactoring process. As shown in FIG. 17, the test data generation device 100 deletes the deletion candidate program variable item and the deletion candidate parameter variable item from the test cases of the test data T1 to T8.

図17の例では、テストデータ生成装置100は、プログラムバリエーションP1−2に対応するテストデータT2から、パラメータ変数b_rについての項目を削除する。また、テストデータ生成装置100は、プログラムバリエーションP1−3に対応するテストデータT3から、プログラム変数b1_rについての項目を削除する。   In the example of FIG. 17, the test data generation device 100 deletes the item for the parameter variable b_r from the test data T2 corresponding to the program variation P1-2. Further, the test data generating apparatus 100 deletes the item for the program variable b1_r from the test data T3 corresponding to the program variation P1-3.

また、テストデータ生成装置100は、プログラムバリエーションP1−4に対応するテストデータT4から、パラメータ変数b_rとプログラム変数b1_rとについての項目を削除する。また、テストデータ生成装置100は、プログラムバリエーションP1−5に対応するテストデータT5から、プログラム変数x_rについての項目を削除する。   In addition, the test data generation device 100 deletes items for the parameter variable b_r and the program variable b1_r from the test data T4 corresponding to the program variation P1-4. Further, the test data generating apparatus 100 deletes the item for the program variable x_r from the test data T5 corresponding to the program variation P1-5.

また、テストデータ生成装置100は、プログラムバリエーションP1−6に対応するテストデータT6から、プログラム変数x_rとパラメータ変数b_rとについての項目を削除する。また、テストデータ生成装置100は、プログラムバリエーションP1−7に対応するテストデータT7から、プログラム変数x_rとb1_rとについての項目を削除する。   In addition, the test data generation device 100 deletes items for the program variable x_r and the parameter variable b_r from the test data T6 corresponding to the program variation P1-6. In addition, the test data generation device 100 deletes items for the program variables x_r and b1_r from the test data T7 corresponding to the program variation P1-7.

また、テストデータ生成装置100は、プログラムバリエーションP1−8に対応するテストデータT8から、プログラム変数x_rとb1_rとパラメータ変数b_rとについての項目を削除する。次に、図18の説明に移行する。   In addition, the test data generation device 100 deletes items for the program variables x_r, b1_r, and the parameter variable b_r from the test data T8 corresponding to the program variation P1-8. Next, the description proceeds to FIG.

図18に示すように、テストデータ生成装置100は、テストデータT1〜T8が有するテストケースと実行結果とのペアをマージして、新たなテストデータを作成する。図18の例では、テストデータ生成装置100は、テストデータT1〜T8をマージする際に、実線で囲われたペアや、点線で囲われたペアのように、重複するペアがあれば、一つにまとめてマージして、マージしたテストデータ1800を作成する。次に、図19の説明に移行する。   As illustrated in FIG. 18, the test data generation device 100 merges a pair of test cases and execution results included in the test data T1 to T8 to create new test data. In the example of FIG. 18, when merging the test data T1 to T8, the test data generation device 100 determines that if there are overlapping pairs such as a pair surrounded by a solid line or a pair surrounded by a dotted line. The merged test data 1800 is created. Next, the description shifts to the description of FIG.

図19に示すように、テストデータ生成装置100は、マージしたテストデータ1800のうちで、テストケースが重複するペアがあれば、一つにまとめて、新たなテストデータを作成する。図19の例では、テストデータ生成装置100は、1行目と4行目のペアを一つにまとめて、まとめたテストデータ1900を作成する。次に、図20の説明に移行する。   As shown in FIG. 19, if there is a pair with duplicate test cases in the merged test data 1800, the test data generation apparatus 100 collects them together and creates new test data. In the example of FIG. 19, the test data generation device 100 collects the pairs of the first row and the fourth row into one and creates the combined test data 1900. Next, the description shifts to the description of FIG.

図20に示すように、テストデータ生成装置100は、不変変数データ701から不変名称を特定する。次に、テストデータ生成装置100は、テストデータ1900のうち、テストケースのうちの不変名称のプログラム変数とパラメータ変数との項目が同一の値になるペアがあれば、グルーピングする。   As illustrated in FIG. 20, the test data generation device 100 specifies an invariant name from the invariant variable data 701. Next, the test data generation apparatus 100 groups the test data 1900 if there is a pair in which the program variable and the parameter variable of the invariant name in the test case have the same value.

図20の例では、テストデータ生成装置100は、不変変数データ701から不変名称「a」を特定する。次に、テストデータ生成装置100は、テストデータ1900のうち、不変名称のプログラム変数「a」の項目が同一の値になる1行目と3行目のペアをグルーピングする。また、テストデータ生成装置100は、テストデータ1900のうち、不変名称のプログラム変数「a」の項目が同一の値になる2行目と4行目のペアをグルーピングする。以下の説明では、グルーピング結果を「グループデータ2000」と表記する場合がある。次に、図21の説明に移行する。   In the example of FIG. 20, the test data generation device 100 specifies the invariant name “a” from the invariant variable data 701. Next, the test data generation apparatus 100 groups the pairs of the first and third lines in the test data 1900 in which the item of the program variable “a” with the invariant name has the same value. In addition, the test data generation apparatus 100 groups the pairs of the second and fourth lines in the test data 1900 in which the item of the program variable “a” of the invariant name has the same value. In the following description, the grouping result may be expressed as “group data 2000”. Next, the description proceeds to FIG.

図21に示すように、テストデータ生成装置100は、グループデータ2000が表すグルーピングしたグループのうち、実行結果が一致するグループを抽出する。図21の例では、テストデータ生成装置100は、実行結果がともに「0」で一致する2行目と4行目のペアのグループを抽出する。以下の説明では、抽出したグループを表すデータを「同一判定グループデータ2100」と表記する場合がある。   As illustrated in FIG. 21, the test data generation device 100 extracts a group with the same execution result from the grouped groups represented by the group data 2000. In the example of FIG. 21, the test data generation device 100 extracts a pair group of the second and fourth rows whose execution results are both “0” and match. In the following description, data representing the extracted group may be referred to as “identical determination group data 2100”.

(リグレッションテストの一例)
次に、図22を用いて、リグレッションテストの一例について説明する。
(An example of a regression test)
Next, an example of a regression test will be described with reference to FIG.

図22は、リグレッションテストの一例を示す説明図である。図22に示すように、テストデータ生成装置100は、テストデータを用いてリグレッションテストを実行する。次に、テストデータ生成装置100は、テストデータが有する実行結果と、リグレッションテストの実行結果とを比較して、メソッドの機能が変更されているか否かを判定する。   FIG. 22 is an explanatory diagram showing an example of the regression test. As shown in FIG. 22, the test data generation device 100 executes a regression test using the test data. Next, the test data generation device 100 compares the execution result of the test data with the execution result of the regression test, and determines whether or not the function of the method has been changed.

図22の例では、テストデータ生成装置100は、テストデータが有する1行目〜4行目の各々のペアのテストケースを入力変数として、変更後プログラムP2のリグレッションテストを実行し、1行目〜4行目の各々のペアに対応する実行結果2202「0,0,−1,−1」を取得する。ここで、テストデータ生成装置100は、取得した実行結果2202「0,0,−1,−1」と、テストデータが有する1行目〜4行目の各々のペアの実行結果2201「{0,1}、0,−1,0」とを比較する。   In the example of FIG. 22, the test data generation device 100 executes the regression test of the changed program P2 using the test cases of each pair of the first to fourth lines included in the test data as input variables. The execution result 2202 “0, 0, −1, −1” corresponding to each pair of the fourth to fourth rows is acquired. Here, the test data generation apparatus 100 determines that the acquired execution result 2202 “0, 0, −1, −1” and the execution result 2201 “{0 of each pair of the first to fourth rows included in the test data are included. , 1}, 0, −1, 0 ”.

ここで、テストデータ生成装置100は、1行目のペアについては取得した実行結果2202が、テストデータが有する実行結果2201に含まれると判定する。このため、テストデータ生成装置100は、1行目のペアに対する判定において、メソッドの機能が変更されたと判定しない。   Here, the test data generation device 100 determines that the acquired execution result 2202 for the pair in the first row is included in the execution result 2201 included in the test data. For this reason, the test data generation device 100 does not determine that the function of the method has been changed in the determination for the pair in the first row.

次に、テストデータ生成装置100は、2行目と3行目のペアについては取得した実行結果2202が、テストデータが有する実行結果2201に一致すると判定する。このため、テストデータ生成装置100は、1行目と3行目の各々のペアに対する判定において、メソッドの機能が変更されたと判定しない。   Next, the test data generation device 100 determines that the acquired execution result 2202 matches the execution result 2201 included in the test data for the pair of the second row and the third row. For this reason, the test data generation device 100 does not determine that the function of the method has been changed in the determination for each pair of the first row and the third row.

次に、テストデータ生成装置100は、4行目については取得した実行結果2202が、テストデータが有する実行結果2201に含まれないと判定する。そして、テストデータ生成装置100は、同一判定グループデータ2100を参照して、4行目のペアがグルーピングしたグループに含まれるため、グループに含まれる2行目のペアについての判定結果を参照する。ここで、テストデータ生成装置100は、2行目のペアの判定結果が一致するという判定結果であるため、4行目のペアに対する判定において、メソッドの機能が変更されたと判定しない。   Next, the test data generation device 100 determines that the acquired execution result 2202 for the fourth row is not included in the execution result 2201 included in the test data. Then, the test data generation device 100 refers to the same determination group data 2100 and refers to the determination result for the second row pair included in the group because the fourth row pair is included in the grouped group. Here, the test data generation apparatus 100 does not determine that the function of the method is changed in the determination for the pair in the fourth row because the determination result for the pair in the second row matches.

このように、テストデータ生成装置100は、1行目〜4行目の各々のペアに対する判定においてメソッドの機能が変更されたと判定できなかったため、メソッドの機能が変更されていないと判定する。また、テストデータ生成装置100は、1行目〜4行目の各々のペアに対する判定のいずれかの判定においてメソッドの機能が変更されたと判定した場合は、メソッドの機能が変更されたと判定する。これにより、テストデータ生成装置100は、プログラム変数またはパラメータ変数が変更された変更後プログラムP2であっても、リグレッションテストを実行することができる。   As described above, the test data generation device 100 cannot determine that the function of the method has been changed in the determination for each pair of the first to fourth lines, and thus determines that the function of the method has not been changed. In addition, when the test data generation device 100 determines that the function of the method has been changed in any of the determinations for each pair of the first to fourth lines, the test data generation device 100 determines that the function of the method has been changed. As a result, the test data generation device 100 can execute the regression test even in the changed program P2 in which the program variable or the parameter variable is changed.

(リグレッションテストの実行処理手順)
次に、図23を用いて、テストデータ生成装置100のリグレッションテストの実行処理手順の一例について説明する。
(Regression test execution procedure)
Next, an example of a regression test execution process procedure of the test data generation apparatus 100 will be described with reference to FIG.

図23は、リグレッションテストの実行処理手順の一例を示すフローチャートである。図23において、テストデータ生成装置100は、変更前プログラムP1と変更後プログラムP2とを取得する(ステップS2301)。次に、テストデータ生成装置100は、図24を用いて後述する特定処理を実行する(ステップS2302)。そして、テストデータ生成装置100は、図25を用いて後述する加工処理を実行する(ステップS2303)。   FIG. 23 is a flowchart illustrating an example of a procedure for executing a regression test. In FIG. 23, the test data generating apparatus 100 acquires a pre-change program P1 and a post-change program P2 (step S2301). Next, the test data generation device 100 executes a specific process to be described later with reference to FIG. 24 (step S2302). Then, the test data generation device 100 executes processing described later with reference to FIG. 25 (step S2303).

次に、テストデータ生成装置100は、図26を用いて後述するテストデータ生成処理を実行する(ステップS2304)。そして、テストデータ生成装置100は、図27を用いて後述するリファクタリング処理を実行する(ステップS2305)。   Next, the test data generation device 100 executes a test data generation process which will be described later with reference to FIG. 26 (step S2304). Then, the test data generation device 100 executes a refactoring process to be described later with reference to FIG. 27 (step S2305).

次に、テストデータ生成装置100は、リグレッションテストを実行する(ステップS2306)。リグレッションテストの内容は、図22に上述したため説明を省略する。そして、テストデータ生成装置100は、実行処理を終了する。これにより、テストデータ生成装置100は、変数が変更された変更後プログラムP2に対しても、リグレッションテストを実行することができる。   Next, the test data generation device 100 executes a regression test (step S2306). The content of the regression test has been described above with reference to FIG. Then, the test data generation device 100 ends the execution process. Thereby, the test data generation device 100 can execute the regression test on the changed program P2 in which the variable is changed.

(差異情報の特定処理手順)
次に、図24を用いて、テストデータ生成装置100の差異情報の特定処理手順の一例について説明する。
(Difference information specific processing procedure)
Next, an example of the difference information specifying process procedure of the test data generation apparatus 100 will be described with reference to FIG.

図24は、差異情報の特定処理手順の一例を示すフローチャートである。図24において、テストデータ生成装置100は、変更前プログラムP1における、プログラム変数とテスト対象のメソッドのパラメータ変数と、を抽出する(ステップS2401)。次に、テストデータ生成装置100は、変更後プログラムP2における、プログラム変数とテスト対象のメソッドのパラメータ変数と、を抽出する(ステップS2402)。   FIG. 24 is a flowchart illustrating an example of the difference information identification processing procedure. In FIG. 24, the test data generation apparatus 100 extracts program variables and parameter variables of the test target method in the pre-change program P1 (step S2401). Next, the test data generation device 100 extracts program variables and parameter variables of the test target method in the changed program P2 (step S2402).

そして、テストデータ生成装置100は、ステップS2401〜S2402によって抽出されたプログラム変数とパラメータ変数とから、変更前プログラムP1から変更後プログラムP2への変更前後における不変名称のプログラム変数とパラメータ変数とを抽出する(ステップS2403)。   Then, the test data generation device 100 extracts the program variables and parameter variables having the invariant names before and after the change from the pre-change program P1 to the post-change program P2 from the program variables and parameter variables extracted in steps S2401 to S2402. (Step S2403).

次に、テストデータ生成装置100は、ステップS2401〜S2402によって抽出されたプログラム変数とパラメータ変数とから、変更前プログラムP1から変更後プログラムP2への変更前後における追加候補のプログラム変数とパラメータ変数とを抽出する(ステップS2404)。   Next, the test data generation apparatus 100 obtains additional candidate program variables and parameter variables before and after the change from the pre-change program P1 to the post-change program P2 from the program variables and parameter variables extracted in steps S2401 to S2402. Extract (step S2404).

そして、テストデータ生成装置100は、ステップS2401〜S2402によって抽出されたプログラム変数とパラメータ変数とから、変更前プログラムP1から変更後プログラムP2への変更前後における削除候補のプログラム変数とパラメータ変数とを抽出する(ステップS2405)。   Then, the test data generation device 100 extracts deletion candidate program variables and parameter variables before and after the change from the pre-change program P1 to the post-change program P2 from the program variables and parameter variables extracted in steps S2401 to S2402. (Step S2405).

次に、テストデータ生成装置100は、ステップS2404〜S2405によって抽出された追加候補のプログラム変数とパラメータ変数との集合と、削除候補のプログラム変数とパラメータ変数との集合に、ダミー変数を追加する(ステップS2406)。   Next, the test data generating apparatus 100 adds dummy variables to the set of additional candidate program variables and parameter variables and the set of deletion candidate program variables and parameter variables extracted in steps S2404 to S2405 ( Step S2406).

そして、テストデータ生成装置100は、ステップS2406によってダミー変数が追加された、追加候補のプログラム変数とパラメータ変数との集合と、削除候補のプログラム変数とパラメータ変数との集合と、に基づいて、変更パターンを特定する(ステップS2407)。   Then, the test data generating apparatus 100 changes the data based on the set of addition candidate program variables and parameter variables and the set of deletion candidate program variables and parameter variables to which dummy variables have been added in step S2406. A pattern is specified (step S2407).

次に、テストデータ生成装置100は、ステップS2407によって特定された変更パターンのうち、ダミー変数からダミー変数へと変更される変更パターンと、変数から型が異なる別の変数へと変更される変更パターンと、を除去する(ステップS2408)。そして、テストデータ生成装置100は、変更パターンを定義域ごとに分類する(ステップS2409)。   Next, the test data generation device 100 changes the change pattern that is changed from the dummy variable to the dummy variable and the change pattern that is changed from the variable to another variable having a different type among the change patterns identified in step S2407. Are removed (step S2408). Then, the test data generation device 100 classifies the change patterns for each definition area (step S2409).

次に、テストデータ生成装置100は、ステップS2409によって定義域ごとに分類された変更パターンのうち、変更前プログラムP1のプログラム変数とパラメータ変数との変更パターンを組み合わせて、すべてのバリエーションを特定する(ステップS2410)。   Next, the test data generation device 100 identifies all variations by combining the change patterns of the program variables and the parameter variables of the pre-change program P1 among the change patterns classified for each domain in step S2409 ( Step S2410).

そして、テストデータ生成装置100は、ステップS2410によって特定された変更バリエーションに、値域が重複しないような変更パターンを追加して(ステップS2411)、特定処理を終了する。これにより、テストデータ生成装置100は、プログラムの変更バリエーションを特定することができる。   Then, the test data generating apparatus 100 adds a change pattern that does not overlap the range to the change variation specified in step S2410 (step S2411), and ends the specifying process. Thereby, the test data generation device 100 can specify a program change variation.

(プログラムの加工処理手順)
次に、図25を用いて、テストデータ生成装置100のプログラムの加工処理手順の一例について説明する。
(Program processing procedure)
Next, an example of the processing procedure of the program of the test data generation device 100 will be described with reference to FIG.

図25は、プログラムの加工処理手順の一例を示すフローチャートである。図25において、テストデータ生成装置100は、変更バリエーションを選択する(ステップS2501)。次に、テストデータ生成装置100は、ステップS2501によって選択された変更バリエーションに基づいて、変更前プログラムP1からプログラムバリエーションを作成する(ステップS2502)。   FIG. 25 is a flowchart illustrating an example of a processing procedure of a program. In FIG. 25, the test data generating apparatus 100 selects a change variation (step S2501). Next, the test data generation device 100 creates a program variation from the pre-change program P1 based on the change variation selected in step S2501 (step S2502).

そして、テストデータ生成装置100は、未選択の変更バリエーションがあるか否かを判定する(ステップS2503)。ここで、未選択の変更バリエーションがある場合(ステップS2503:Yes)、テストデータ生成装置100は、ステップS2501の処理に戻る。   Then, the test data generation device 100 determines whether there is an unselected change variation (step S2503). Here, when there is an unselected change variation (step S2503: Yes), the test data generation device 100 returns to the process of step S2501.

一方で、未選択の変更バリエーションがない場合(ステップS2503:No)、テストデータ生成装置100は、加工処理を終了する。これにより、テストデータ生成装置100は、プログラムバリエーションを作成することができる。   On the other hand, when there is no unselected change variation (step S2503: No), the test data generation device 100 ends the processing. Thereby, the test data generation device 100 can create a program variation.

(テストデータ生成処理手順)
次に、図26を用いて、テストデータ生成装置100のテストデータ生成処理手順の一例について説明する。
(Test data generation processing procedure)
Next, an example of a test data generation process procedure of the test data generation apparatus 100 will be described with reference to FIG.

図26は、テストデータ生成処理手順の一例を示すフローチャートである。図26において、テストデータ生成装置100は、プログラムバリエーションを選択する(ステップS2601)。次に、テストデータ生成装置100は、ステップS2601によって選択されたプログラムバリエーションからテストデータを作成する(ステップS2602)。   FIG. 26 is a flowchart illustrating an example of a test data generation processing procedure. In FIG. 26, the test data generating apparatus 100 selects a program variation (step S2601). Next, the test data generation device 100 creates test data from the program variation selected in step S2601 (step S2602).

そして、テストデータ生成装置100は、未選択のプログラムバリエーションがあるか否かを判定する(ステップS2603)。ここで、未選択のプログラムバリエーションがある場合(ステップS2603:Yes)、テストデータ生成装置100は、ステップS2601の処理に戻る。   Then, the test data generation device 100 determines whether there is an unselected program variation (step S2603). If there is an unselected program variation (step S2603: YES), the test data generation device 100 returns to the process of step S2601.

一方で、未選択のプログラムバリエーションがない場合(ステップS2603:No)、テストデータ生成装置100は、テストデータ生成処理を終了する。これにより、テストデータ生成装置100は、テストデータを作成することができる。   On the other hand, when there is no unselected program variation (step S2603: No), the test data generation device 100 ends the test data generation process. Thereby, the test data generation device 100 can create test data.

(リファクタリング処理手順)
次に、図27を用いて、テストデータ生成装置100のリファクタリング処理手順の一例について説明する。
(Refactoring procedure)
Next, an example of the refactoring processing procedure of the test data generation device 100 will be described with reference to FIG.

図27は、リファクタリング処理手順の一例を示すフローチャートである。図27において、テストデータ生成装置100は、テストデータに含まれる削除候補の変数の項目を削除する(ステップS2701)。次に、テストデータ生成装置100は、テストデータが有するテストケースと実行結果のペアをマージする(ステップS2702)。   FIG. 27 is a flowchart illustrating an example of a refactoring processing procedure. In FIG. 27, the test data generating apparatus 100 deletes the item of the deletion candidate variable included in the test data (step S2701). Next, the test data generation device 100 merges the test case and execution result pair of the test data (step S2702).

そして、テストデータ生成装置100は、マージしたテストデータのうち、テストケースが重複するペアを統合する(ステップS2703)。次に、テストデータ生成装置100は、テストケースのうちの不変名称のプログラム変数とパラメータ変数との項目が同一の値になり、実行結果が同一の値になるペアを、グループ化する(ステップS2704)。そして、テストデータ生成装置100は、リファクタリング処理を終了する。   Then, the test data generation apparatus 100 integrates pairs in which test cases overlap among the merged test data (step S2703). Next, the test data generation apparatus 100 groups pairs in which the program variable and parameter variable of the invariant name in the test case have the same value and the execution result has the same value (step S2704). ). Then, the test data generation device 100 ends the refactoring process.

以上説明したように、テストデータ生成装置100によれば、変更前プログラムP1と変更後プログラムP2とから変数の変更パターンを特定し、変更後プログラムP2のテストデータ生成用のプログラムバリエーションを作成することができる。そして、テストデータ生成装置100によれば、プログラムバリエーションに基づいて、変更後プログラムP2のテストデータを生成することができる。   As described above, according to the test data generation apparatus 100, the variable change pattern is specified from the pre-change program P1 and the post-change program P2, and a program variation for generating test data of the post-change program P2 is created. Can do. Then, according to the test data generating apparatus 100, it is possible to generate the test data of the changed program P2 based on the program variation.

これにより、テストデータ生成装置100は、プログラム変数またはパラメータ変数の変更を含む変更後プログラムP2に対しても、リグレッションテストに用いるテストデータを生成することができる。このため、例えば、リグレッションテストの実行者が、変更前プログラムP1と変更後プログラムP2と、を参照して、変更後プログラムP2に対するテストデータを作成する場合に比べて、リグレッションテストの実行者の作業量を低減することができる。また、リグレッションテストの実行者によって誤ったテストデータが作成されることを防止することができる。   Thereby, the test data generation device 100 can generate test data used for the regression test even for the changed program P2 including the change of the program variable or the parameter variable. For this reason, for example, compared with a case where the execution person of the regression test refers to the program P1 before change and the program P2 after change and creates test data for the program P2 after change, the work of the person who executes the regression test The amount can be reduced. Further, it is possible to prevent erroneous test data from being created by a regression tester.

また、テストデータ生成装置100によれば、変数から同一形式の他の変数へ変更される変更パターンと、変数が削除される変更パターンと、変数が追加される変更パターンと、の少なくともいずれかを特定することができる。これにより、テストデータ生成装置100は、プログラムバリエーションの作成に用いる変更パターンが重複しないようにして、変数パターンの数を最小限にすることができる。このため、テストデータ生成装置100は、プログラムバリエーションの作成処理の処理量の増加を抑制することができる。   Moreover, according to the test data generation device 100, at least one of a change pattern that is changed from a variable to another variable of the same format, a change pattern that deletes a variable, and a change pattern that adds a variable is selected. Can be identified. As a result, the test data generation apparatus 100 can minimize the number of variable patterns by preventing the change patterns used for creating the program variations from overlapping. Therefore, the test data generation device 100 can suppress an increase in the processing amount of the program variation creation process.

また、テストデータ生成装置100によれば、複数の変更パターンの組み合わせに基づいて、複数のプログラムバリエーションを作成することができる。これにより、テストデータ生成装置100は、変更後プログラムP2のテストデータ生成用のプログラムバリエーションを作成することができる。また、テストデータ生成装置100によれば、それぞれ異なる変数の変更パターンの組み合わせに基づいて、複数のプログラムバリエーションを作成することができる。これにより、テストデータ生成装置100は、変更パターンの組み合わせの重複を防止することができ、プログラムバリエーションの作成処理の処理量の増加を抑制することができる。   Moreover, according to the test data generation device 100, a plurality of program variations can be created based on a combination of a plurality of change patterns. As a result, the test data generating apparatus 100 can create a program variation for generating test data of the changed program P2. Further, according to the test data generating apparatus 100, a plurality of program variations can be created based on combinations of different variable change patterns. Thereby, the test data generation device 100 can prevent duplication of combinations of change patterns, and can suppress an increase in the processing amount of the program variation creation process.

また、テストデータ生成装置100によれば、プログラムバリエーションをシンボリック実行することにより、自動でテストデータを生成することができる。また、テストデータ生成装置100は、テストデータを用いてリグレッションテストを実行することができる。これにより、テストデータ生成装置100は、プログラム変数またはパラメータ変数が変更された変更後プログラム変更後プログラムP2に対しても、リグレッションテストを実行することができ、リグレッションテストのテスト結果を出力することができる。そして、テストデータ生成装置100の利用者は、リグレッションテストのテスト結果から、変更後プログラムP2に不具合があるか否かを把握することができる。   In addition, according to the test data generation apparatus 100, test data can be automatically generated by symbolically executing a program variation. Further, the test data generation apparatus 100 can execute a regression test using the test data. As a result, the test data generation apparatus 100 can execute the regression test on the changed program P2 after changing the program variable or the parameter variable, and can output the test result of the regression test. it can. Then, the user of the test data generation device 100 can grasp whether or not there is a problem in the changed program P2 from the test result of the regression test.

なお、本実施の形態で説明したテストデータ生成方法は、予め用意されたプログラムをパーソナル・コンピュータやワークステーション等のコンピュータで実行することにより実現することができる。本テストデータ生成プログラムは、ハードディスク、フレキシブルディスク、CD−ROM、MO、DVD等のコンピュータで読み取り可能な記録媒体に記録され、コンピュータによって記録媒体から読み出されることによって実行される。また本テストデータ生成プログラムは、インターネット等のネットワークを介して配布してもよい。   Note that the test data generation method described in the present embodiment can be realized by executing a program prepared in advance on a computer such as a personal computer or a workstation. The test data generation program is recorded on a computer-readable recording medium such as a hard disk, a flexible disk, a CD-ROM, an MO, and a DVD, and is executed by being read from the recording medium by the computer. The test data generation program may be distributed through a network such as the Internet.

上述した実施の形態に関し、さらに以下の付記を開示する。   The following additional notes are disclosed with respect to the embodiment described above.

(付記1)コンピュータに、
テスト対象のメソッドが規定された第1プログラムにおける前記メソッドに用いられる変数と、前記第1プログラムから前記メソッドの内容が変更された第2プログラムにおける前記メソッドに用いられる変数とを比較した比較結果に基づいて、前記メソッドに用いられる変数の変更パターンを特定し、
特定した前記変更パターンに基づいて、前記第1プログラムにおける前記メソッドに用いられる変数を変更した第3プログラムを作成し、
作成した前記第3プログラムをシンボリック実行してテストデータを生成する、
処理を実行させることを特徴とするテストデータ生成プログラム。
(Supplementary note 1)
A comparison result obtained by comparing a variable used for the method in the first program in which the method to be tested is defined with a variable used in the method in the second program in which the content of the method is changed from the first program. Based on the variable change pattern used in the method,
Based on the identified change pattern, create a third program in which variables used for the method in the first program are changed,
Generate test data by executing symbolically the created third program,
A test data generation program characterized by causing a process to be executed.

(付記2)前記特定する処理は、
前記メソッドに用いられる変数について、前記メソッドの内容の変更後に同一形式の他の変数に変更される変更パターンと、前記メソッドの内容の変更後に削除される変更パターンと、前記メソッドの内容の変更後に追加される変更パターンと、のうちの少なくともいずれかの変更パターンを特定することを特徴とする付記1に記載のテストデータ生成プログラム。
(Supplementary note 2)
Regarding variables used in the method, a change pattern that is changed to another variable of the same format after the change of the content of the method, a change pattern that is deleted after the change of the content of the method, and a change of the content of the method The test data generation program according to appendix 1, wherein at least one of the change patterns to be added is specified.

(付記3)前記メソッドに用いられる変数は、前記メソッドの引数になるメソッドパラメータまたは前記メソッドの引数以外の変数であることを特徴とする付記1または2に記載のテストデータ生成プログラム。 (Supplementary Note 3) The test data generation program according to Supplementary Note 1 or 2, wherein the variable used in the method is a method parameter that is an argument of the method or a variable other than the argument of the method.

(付記4)前記作成する処理は、
前記メソッドに用いられる変数ごとに特定した変更パターンの組み合わせに基づいて、前記第3プログラムを作成することを特徴とする付記1〜3のいずれか一つに記載のテストデータ生成プログラム。
(Appendix 4) The process to create is
4. The test data generation program according to any one of appendices 1 to 3, wherein the third program is created based on a combination of change patterns specified for each variable used in the method.

(付記5)前記作成する処理は、
前記メソッドに用いられるそれぞれ異なる変数についての変更パターンの組み合わせに基づいて、前記第3プログラムを作成することを特徴とする付記4に記載のテストデータ生成プログラム。
(Appendix 5) The process to create is
The test data generation program according to appendix 4, wherein the third program is created based on a combination of change patterns for different variables used in the method.

(付記6)前記生成する処理は、
作成した前記第3プログラムにおける命令文の系列の実行条件になる入力変数の値と実行結果になる出力変数の値とを対応付けて有するテストデータを生成することを特徴とする付記4または5に記載のテストデータ生成プログラム。
(Appendix 6) The process to generate is
Additional test 4 or 5 is characterized in that the test data having the value of the input variable that becomes the execution condition of the series of statements in the generated third program and the value of the output variable that becomes the execution result are generated. The test data generation program described.

(付記7)前記コンピュータに、
生成した前記テストデータが有する入力変数の値を実行条件にして前記第2プログラムを実行した場合の出力変数の値が、前記テストデータが有する出力変数の値に一致するか否かを判定する、
処理を実行させることを特徴とする付記6に記載のテストデータ生成プログラム。
(Appendix 7)
Determining whether the value of the output variable when the second program is executed using the value of the input variable of the generated test data as an execution condition matches the value of the output variable of the test data;
The test data generation program according to appendix 6, wherein the process is executed.

(付記8)前記判定する処理は、
生成した前記テストデータが有する入力変数の値を実行条件にして前記第2プログラムを実行した場合の出力変数の値が、前記テストデータが有する出力変数の値に含まれるか否かを判定することを特徴とする付記7に記載のテストデータ生成プログラム。
(Supplementary note 8)
Determining whether the value of the output variable when the second program is executed using the value of the input variable of the generated test data as an execution condition is included in the value of the output variable of the test data The test data generation program according to appendix 7, characterized by:

(付記9)前記コンピュータに、
生成した前記テストデータが有する実行条件と実行結果とを対応付けたペアのうち、実行条件になる入力変数のうちの前記メソッドの変更前後で名称変更されない入力変数の値が同一になるペアであって、かつ実行結果が同一になるペアをグループ化する処理を実行させ、
前記判定する処理は、
グループ化したペアのうち、いずれかのペアに含まれる入力変数の値を実行条件にして前記第2プログラムを実行した場合の出力変数の値が、前記いずれかのペアに含まれる出力変数の値に含まれるか否かを判定することを特徴とする付記7または8に記載のテストデータ生成プログラム。
(Supplementary note 9)
Of the pairs that associate the execution conditions and the execution results of the generated test data, the input variables that are not renamed before and after the method change among the input variables that are the execution conditions are the same. And execute the process of grouping pairs with the same execution result,
The determination process is as follows:
Among the grouped pairs, the value of the output variable when the second program is executed using the value of the input variable included in any pair as the execution condition is the value of the output variable included in any of the pairs 9. The test data generation program according to appendix 7 or 8, wherein it is determined whether or not it is included in the test data.

(付記10)コンピュータが、
テスト対象のメソッドが規定された第1プログラムにおける前記メソッドに用いられる変数と、前記第1プログラムから前記メソッドの内容が変更された第2プログラムにおける前記メソッドに用いられる変数とを比較した比較結果に基づいて、前記メソッドに用いられる変数の変更パターンを特定し、
特定した前記変更パターンに基づいて、前記第1プログラムにおける前記メソッドに用いられる変数を変更した第3プログラムを作成し、
作成した前記第3プログラムをシンボリック実行してテストデータを生成する、
処理を実行することを特徴とするテストデータ生成方法。
(Supplementary note 10)
A comparison result obtained by comparing a variable used for the method in the first program in which the method to be tested is defined with a variable used in the method in the second program in which the content of the method is changed from the first program. Based on the variable change pattern used in the method,
Based on the identified change pattern, create a third program in which variables used for the method in the first program are changed,
Generate test data by executing symbolically the created third program,
A test data generation method characterized by executing processing.

(付記11)テスト対象のメソッドが規定された第1プログラムにおける前記メソッドに用いられる変数と、前記第1プログラムから前記メソッドの内容が変更された第2プログラムにおける前記メソッドに用いられる変数とを比較した比較結果に基づいて、前記メソッドに用いられる変数の変更パターンを特定し、特定した前記変更パターンに基づいて、前記第1プログラムにおける前記メソッドに用いられる変数を変更した第3プログラムを作成する作成部と、
前記作成部によって作成された前記第3プログラムをシンボリック実行してテストデータを生成する生成部と、
を有することを特徴とするテストデータ生成装置。
(Additional remark 11) The variable used for the said method in the 1st program in which the test object method was prescribed | regulated, and the variable used for the said method in the 2nd program from which the content of the said method was changed from the said 1st program Creating a third program in which a variable change pattern used in the method is specified based on the comparison result, and a variable used in the method in the first program is changed based on the specified change pattern And
A generating unit that symbolically executes the third program created by the creating unit to generate test data;
A test data generation apparatus comprising:

100 テストデータ生成装置
301 特定部
302 作成部
303 生成部
304 判定部
DESCRIPTION OF SYMBOLS 100 Test data production | generation apparatus 301 Specification part 302 Creation part 303 Generation part 304 Determination part

Claims (10)

コンピュータに、
テスト対象のメソッドが規定された第1プログラムにおける前記メソッドに用いられる変数と、前記第1プログラムから前記メソッドの内容が変更された第2プログラムにおける前記メソッドに用いられる変数とを比較した比較結果に基づいて、前記メソッドに用いられる変数の変更パターンを特定し、
特定した前記変更パターンに基づいて、前記第1プログラムにおける前記メソッドに用いられる変数を変更した第3プログラムを作成し、
作成した前記第3プログラムをシンボリック実行してテストデータを生成する、
処理を実行させることを特徴とするテストデータ生成プログラム。
On the computer,
A comparison result obtained by comparing a variable used for the method in the first program in which the method to be tested is defined with a variable used in the method in the second program in which the content of the method is changed from the first program. Based on the variable change pattern used in the method,
Based on the identified change pattern, create a third program in which variables used for the method in the first program are changed,
Generate test data by executing symbolically the created third program,
A test data generation program characterized by causing a process to be executed.
前記特定する処理は、
前記メソッドに用いられる変数について、前記メソッドの内容の変更後に同一形式の他の変数に変更される変更パターンと、前記メソッドの内容の変更後に削除される変更パターンと、前記メソッドの内容の変更後に追加される変更パターンと、のうちの少なくともいずれかの変更パターンを特定することを特徴とする請求項1に記載のテストデータ生成プログラム。
The process to specify is
Regarding variables used in the method, a change pattern that is changed to another variable of the same format after the change of the content of the method, a change pattern that is deleted after the change of the content of the method, and a change of the content of the method 2. The test data generation program according to claim 1, wherein at least one of the change patterns to be added is specified.
前記メソッドに用いられる変数は、前記メソッドの引数になるメソッドパラメータまたは前記メソッドの引数以外の変数であることを特徴とする請求項1または2に記載のテストデータ生成プログラム。   The test data generation program according to claim 1, wherein the variable used in the method is a method parameter that is an argument of the method or a variable other than the argument of the method. 前記作成する処理は、
前記メソッドに用いられる変数ごとに特定した変更パターンの組み合わせに基づいて、前記第3プログラムを作成することを特徴とする請求項1〜3のいずれか一つに記載のテストデータ生成プログラム。
The process to create is
The test data generation program according to any one of claims 1 to 3, wherein the third program is created based on a combination of change patterns specified for each variable used in the method.
前記生成する処理は、
作成した前記第3プログラムにおける命令文の系列の実行条件になる入力変数の値と実行結果になる出力変数の値とを対応付けて有するテストデータを生成することを特徴とする請求項4に記載のテストデータ生成プログラム。
The process to generate is
5. The test data having an input variable value that becomes an execution condition of a sequence of statements in the created third program and an output variable value that becomes an execution result in association with each other is generated. Test data generation program.
前記コンピュータに、
生成した前記テストデータが有する入力変数の値を実行条件にして前記第2プログラムを実行した場合の出力変数の値が、前記テストデータが有する出力変数の値に一致するか否かを判定する、
処理を実行させることを特徴とする請求項5に記載のテストデータ生成プログラム。
In the computer,
Determining whether the value of the output variable when the second program is executed using the value of the input variable of the generated test data as an execution condition matches the value of the output variable of the test data;
The test data generation program according to claim 5, wherein the process is executed.
前記判定する処理は、
生成した前記テストデータが有する入力変数の値を実行条件にして前記第2プログラムを実行した場合の出力変数の値が、前記テストデータが有する出力変数の値に含まれるか否かを判定することを特徴とする請求項6に記載のテストデータ生成プログラム。
The determination process is as follows:
Determining whether the value of the output variable when the second program is executed using the value of the input variable of the generated test data as an execution condition is included in the value of the output variable of the test data The test data generation program according to claim 6.
前記コンピュータに、
生成した前記テストデータが有する実行条件と実行結果とを対応付けたペアのうち、実行条件になる入力変数のうちの前記メソッドの変更前後で名称変更されない入力変数の値が同一になるペアであって、かつ実行結果が同一になるペアをグループ化する処理を実行させ、
前記判定する処理は、
グループ化したペアのうち、いずれかのペアに含まれる入力変数の値を実行条件にして前記第2プログラムを実行した場合の出力変数の値が、前記いずれかのペアに含まれる出力変数の値に含まれるか否かを判定することを特徴とする請求項6または7に記載のテストデータ生成プログラム。
In the computer,
Of the pairs that associate the execution conditions and the execution results of the generated test data, the input variables that are not renamed before and after the method change among the input variables that are the execution conditions are the same. And execute the process of grouping pairs with the same execution result,
The determination process is as follows:
Among the grouped pairs, the value of the output variable when the second program is executed using the value of the input variable included in any pair as the execution condition is the value of the output variable included in any of the pairs The test data generation program according to claim 6, wherein it is determined whether or not it is included in the test data.
コンピュータが、
テスト対象のメソッドが規定された第1プログラムにおける前記メソッドに用いられる変数と、前記第1プログラムから前記メソッドの内容が変更された第2プログラムにおける前記メソッドに用いられる変数とを比較した比較結果に基づいて、前記メソッドに用いられる変数の変更パターンを特定し、
特定した前記変更パターンに基づいて、前記第1プログラムにおける前記メソッドに用いられる変数を変更した第3プログラムを作成し、
作成した前記第3プログラムをシンボリック実行してテストデータを生成する、
処理を実行することを特徴とするテストデータ生成方法。
Computer
A comparison result obtained by comparing a variable used for the method in the first program in which the method to be tested is defined with a variable used in the method in the second program in which the content of the method is changed from the first program. Based on the variable change pattern used in the method,
Based on the identified change pattern, create a third program in which variables used for the method in the first program are changed,
Generate test data by executing symbolically the created third program,
A test data generation method characterized by executing processing.
テスト対象のメソッドが規定された第1プログラムにおける前記メソッドに用いられる変数と、前記第1プログラムから前記メソッドの内容が変更された第2プログラムにおける前記メソッドに用いられる変数とを比較した比較結果に基づいて、前記メソッドに用いられる変数の変更パターンを特定し、特定した前記変更パターンに基づいて、前記第1プログラムにおける前記メソッドに用いられる変数を変更した第3プログラムを作成する作成部と、
前記作成部によって作成された前記第3プログラムをシンボリック実行してテストデータを生成する生成部と、
を有することを特徴とするテストデータ生成装置。
A comparison result obtained by comparing a variable used for the method in the first program in which the method to be tested is defined with a variable used in the method in the second program in which the content of the method is changed from the first program. Based on the specified change pattern of the variable used in the method, based on the specified change pattern, a creation unit that creates a third program that changes the variable used in the method in the first program;
A generating unit that symbolically executes the third program created by the creating unit to generate test data;
A test data generation apparatus comprising:
JP2013166860A 2013-08-09 2013-08-09 Test data generation program, test data generation method, and test data generation apparatus Expired - Fee Related JP6205965B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013166860A JP6205965B2 (en) 2013-08-09 2013-08-09 Test data generation program, test data generation method, and test data generation apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013166860A JP6205965B2 (en) 2013-08-09 2013-08-09 Test data generation program, test data generation method, and test data generation apparatus

Publications (2)

Publication Number Publication Date
JP2015035185A JP2015035185A (en) 2015-02-19
JP6205965B2 true JP6205965B2 (en) 2017-10-04

Family

ID=52543637

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013166860A Expired - Fee Related JP6205965B2 (en) 2013-08-09 2013-08-09 Test data generation program, test data generation method, and test data generation apparatus

Country Status (1)

Country Link
JP (1) JP6205965B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10180897B2 (en) * 2016-09-26 2019-01-15 Fujitsu Limited Automated software program repair
JP6925433B2 (en) 2017-10-20 2021-08-25 三菱電機株式会社 Data validation device, data validation method and data validation program

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000305812A (en) * 1999-04-19 2000-11-02 Fujitsu Ltd System for editing retest procedure, system applying retest procedure editing system, and computer-readable recording medium recording retest procedure editing program
JP5874891B2 (en) * 2011-03-30 2016-03-02 日本電気株式会社 Program test apparatus, program test method, and program

Also Published As

Publication number Publication date
JP2015035185A (en) 2015-02-19

Similar Documents

Publication Publication Date Title
Allamanis The adverse effects of code duplication in machine learning models of code
JP5471432B2 (en) Verification support program and verification support device
Angerer et al. Configuration-aware change impact analysis (t)
JP5845888B2 (en) Software correction apparatus, software correction system, software correction method, and software correction program
JP6309795B2 (en) Information processing apparatus, information processing method, and program
JP6205965B2 (en) Test data generation program, test data generation method, and test data generation apparatus
JP6032095B2 (en) Test case generation method, test case generation apparatus, and test case generation program
Bainczyk et al. Model-based testing without models: the TodoMVC case study
JP5825163B2 (en) Information processing apparatus, information processing method, and information processing program
Buinevich et al. Method and algorithms of visual audit of program interaction.
Sun et al. Poster: Toward automating the generation of malware analysis reports using the sandbox logs
JP5772607B2 (en) Generating device, generating method, and generating program
Xu et al. Mining executable specifications of web applications from selenium ide tests
JP6002507B2 (en) Software verification program and software verification system
Le et al. Refixar: Multi-version reasoning for automated repair of regression errors
JP5163308B2 (en) IP model generation device, IP model generation method, and IP model generation program
JP6287436B2 (en) Information processing apparatus, information processing system, information processing method, and program
JP2016099726A (en) Specification generation method, specification generation device, and program
Ghosh et al. Enabling the selection of cots components
JP5900197B2 (en) Route condition selection apparatus, program, and method
WO2015145992A1 (en) Non-functional-evaluation-parameter extraction device, non-functional-evaluation-parameter extraction method, and storage medium
JP6113599B2 (en) Inspection model generator
Hu et al. Equivalence Checking Between System-Level Descriptions by Identifying Potential Cut-Points
JP7024533B2 (en) Detection pattern evaluation model generation system, method and program
JP3796813B2 (en) Drawing processor

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20160510

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20170310

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20170321

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170522

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20170808

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170821

R150 Certificate of patent or registration of utility model

Ref document number: 6205965

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees