JP2014191652A - Test case generation method, test case generation device, and test case generation program - Google Patents

Test case generation method, test case generation device, and test case generation program Download PDF

Info

Publication number
JP2014191652A
JP2014191652A JP2013067571A JP2013067571A JP2014191652A JP 2014191652 A JP2014191652 A JP 2014191652A JP 2013067571 A JP2013067571 A JP 2013067571A JP 2013067571 A JP2013067571 A JP 2013067571A JP 2014191652 A JP2014191652 A JP 2014191652A
Authority
JP
Japan
Prior art keywords
path
test case
conditional expression
program
case generation
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.)
Granted
Application number
JP2013067571A
Other languages
Japanese (ja)
Other versions
JP6032095B2 (en
Inventor
Yoshiharu Maeda
芳晴 前田
Tadahiro Uehara
忠弘 上原
Asako Katayama
朝子 片山
Kazuki Munakata
一樹 宗像
Shoichiro Fujiwara
翔一朗 藤原
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 JP2013067571A priority Critical patent/JP6032095B2/en
Publication of JP2014191652A publication Critical patent/JP2014191652A/en
Application granted granted Critical
Publication of JP6032095B2 publication Critical patent/JP6032095B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To reduce a load of test case generation work accompanied by the change in program.SOLUTION: A test case generation device 100 acquires a symbolic execution result 101-1 and a symbolic execution result 101-2. Next, based on the existence of a value obtained by using a logical product of a path condition formula 102-1 and a path condition formula 102-2 as true out of possible values taken by an input variable "x", the test case generation device 100 determines whether or not a path p2 is related to a path p1. Moreover, the test case generation device 100 compares a path output mathematical expression 103-1 with a path output mathematical expression 103-2. Then, based on a determination result and a comparison result, the test case generation device 100 determines whether or not the test case for testing the action of the path p2 should be generated.

Description

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

従来、プログラム開発において、テストケースを用いて、プログラムの動作をテストする技術がある。テストケースは、プログラムに与える入力値と、入力値を与えた結果出力される値の期待値とを有する。関連する先行技術として、たとえば、過去に行われたテストケースについての情報を保存しておき、テストケースについての情報と対象プログラムを解析して得られた依存関係を組み合わせることにより、テストを行うリグレッションシステムを構築するものがある。また、分析対象プログラムに定義される全ての変数をカバーするようにシンボル化対象の変数を変化させつつ繰り返しシンボリック実行し、分析対象プログラムのコード網羅率が所定の基準を満たせば、分析対象プログラムのテストが完了したこととする技術がある。(たとえば、下記特許文献1、2を参照。)   Conventionally, in program development, there is a technique for testing a program operation using a test case. The test case has an input value given to the program and an expected value of a value output as a result of giving the input value. Relevant prior art, for example, regression for testing by storing information about test cases that have been performed in the past and combining the information about the test cases with the dependencies obtained by analyzing the target program There is something that builds a system. In addition, symbolic execution is repeatedly performed while changing the variables to be symbolized so as to cover all variables defined in the analysis target program, and if the code coverage rate of the analysis target program satisfies a predetermined standard, the analysis target program There is a technique that the test has been completed. (For example, see Patent Documents 1 and 2 below.)

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

しかしながら、従来技術によれば、変更前プログラムの一部が変更された変更後プログラムをテストする際に、変更前プログラムをテストした時に使用されたテストケースをそのまま流用可能か、またはテストケースを新たに生成すべきか、を判定することが難しい。   However, according to the prior art, when testing a post-change program in which a part of the pre-change program has been changed, the test case used when the pre-change program was tested can be used as is or a new test case can be used. It is difficult to determine whether it should be generated.

1つの側面では、本発明は、プログラムの変更に伴うテストケース生成作業の負荷の低減を図るテストケース生成方法、テストケース生成装置、およびテストケース生成プログラムを提供することを目的とする。   In one aspect, an object of the present invention is to provide a test case generation method, a test case generation device, and a test case generation program that reduce the load of test case generation work associated with a program change.

本発明の一側面によれば、第1のプログラムをシンボリック実行することにより、第1のプログラムに含まれる入力変数が取り得る値のうちの第1のプログラムに含まれる第1のパスが実行される条件となる入力変数の値を表す第1の条件式と、第1のパスが実行された場合に出力される第1のプログラムに含まれる出力変数を表す第1の数式と、を含む第1の実行結果を取得し、第1のプログラムの一部が変更された第2のプログラムをシンボリック実行することにより、入力変数の取り得る値のうちの第2のプログラムに含まれる第2のパスが実行される条件となる入力変数の値を表す第2の条件式と、第2のパスが実行された場合に出力される第2のプログラムに含まれる出力変数を表す第2の数式と、を含む第2の実行結果を取得し、入力変数が取り得る値のうちの、取得した第1の条件式と取得した第2の条件式との論理積を真とする値の有無に基づいて、第2のパスが第1のパスに関連するか否かを判断し、取得した第1の数式と、取得した第2の数式とが一致するか否かを判定し、判断結果と判定結果とに基づいて、第2のパスの動作をテストするテストケースを生成すべきか否かを判定するテストケース生成方法、テストケース生成装置、およびテストケース生成プログラムが提案される。   According to an aspect of the present invention, by executing the first program symbolically, the first pass included in the first program is executed out of the possible values of the input variable included in the first program. A first conditional expression representing a value of an input variable serving as a condition to be satisfied, and a first mathematical expression representing an output variable included in the first program output when the first pass is executed The second path included in the second program among the possible values of the input variable by acquiring the execution result of 1 and executing symbolically the second program in which a part of the first program is changed A second conditional expression that represents the value of an input variable that is a condition for executing, and a second mathematical expression that represents an output variable included in the second program that is output when the second pass is executed; To get the second execution result containing Of the possible values of the input variable, the second path is changed to the first path based on the presence or absence of a value that is true of the logical product of the acquired first conditional expression and the acquired second conditional expression. It is determined whether or not they are related, and it is determined whether or not the acquired first mathematical expression matches the acquired second mathematical expression. Based on the determination result and the determination result, the operation of the second path A test case generation method, a test case generation device, and a test case generation program for determining whether or not to generate a test case for testing is proposed.

本発明の一態様によれば、プログラムの変更に伴うテストケース生成作業の負荷の低減を図ることができるという効果を奏する。   According to one aspect of the present invention, there is an effect that it is possible to reduce a load of test case generation work associated with a program change.

図1は、実施の形態1におけるテストケース生成装置の動作例を示す説明図である。FIG. 1 is an explanatory diagram illustrating an operation example of the test case generation device according to the first embodiment. 図2は、テストケース生成装置のハードウェアの一例を示すブロック図である。FIG. 2 is a block diagram illustrating an example of hardware of the test case generation device. 図3は、テストケースの実行手順の一例を示す説明図である。FIG. 3 is an explanatory diagram illustrating an example of a test case execution procedure. 図4は、変更前後のプログラムとテストケースの関係の一例を示す説明図である。FIG. 4 is an explanatory diagram illustrating an example of a relationship between a program and a test case before and after the change. 図5は、変更前プログラムと変更後プログラムとの一例を示す説明図である。FIG. 5 is an explanatory diagram showing an example of the pre-change program and the post-change program. 図6は、シンボリック実行ドライバのプログラムの一例を示す説明図である。FIG. 6 is an explanatory diagram of an example of a symbolic execution driver program. 図7は、変更前プログラムのシンボリック実行の結果の一例を示す説明図である。FIG. 7 is an explanatory diagram showing an example of the result of symbolic execution of the pre-change program. 図8は、変更後プログラムのシンボリック実行の結果の一例を示す説明図である。FIG. 8 is an explanatory diagram illustrating an example of a result of symbolic execution of the changed program. 図9は、テストケース生成装置の機能例を示すブロック図である。FIG. 9 is a block diagram illustrating an example of functions of the test case generation apparatus. 図10は、実施の形態1における変更前後のパスを関連付けた結果の一例を示す説明図である。FIG. 10 is an explanatory diagram illustrating an example of a result of associating paths before and after the change in the first embodiment. 図11は、パス条件式変更種別の分類例を示す説明図である。FIG. 11 is an explanatory diagram of a classification example of the path conditional expression change type. 図12は、実施の形態1におけるパス条件式変更種別の分類結果の一例を示す説明図である。FIG. 12 is an explanatory diagram illustrating an example of the classification result of the path conditional expression change type in the first embodiment. 図13は、パス出力数式変更種別の判定ルールの一例を示す説明図である。FIG. 13 is an explanatory diagram of an example of a determination rule for the path output formula change type. 図14は、判定ルール2を適用した場合の一例を示す説明図である。FIG. 14 is an explanatory diagram showing an example when the determination rule 2 is applied. 図15は、判定ルール3を適用した場合の一例を示す説明図である。FIG. 15 is an explanatory diagram illustrating an example when the determination rule 3 is applied. 図16は、判定ルール4を適用した場合の一例を示す説明図である。FIG. 16 is an explanatory diagram illustrating an example when the determination rule 4 is applied. 図17は、パス出力数式変更判定の分類結果の一例を示す説明図である。FIG. 17 is an explanatory diagram illustrating an example of the classification result of the path output formula change determination. 図18は、テストケース分類ルールの一例を示す説明図である。FIG. 18 is an explanatory diagram of an example of the test case classification rule. 図19は、テストケース分類結果の一例を示す説明図である。FIG. 19 is an explanatory diagram illustrating an example of a test case classification result. 図20は、変更後プログラムのテストケースの入力値生成の一例を示す説明図である。FIG. 20 is an explanatory diagram illustrating an example of generating an input value of a test case of the changed program. 図21は、テストケース生成処理手順の一例を示すフローチャートである。FIG. 21 is a flowchart illustrating an example of a test case generation processing procedure. 図22は、変更前後パス関連付け処理手順の一例を示すフローチャートである。FIG. 22 is a flowchart illustrating an example of the pre-change path association processing procedure. 図23は、パス条件式変更種別分類処理手順の一例を示すフローチャートである。FIG. 23 is a flowchart illustrating an example of a path conditional expression change type classification processing procedure. 図24は、パス出力数式変更種別分類処理手順の一例を示すフローチャートである。FIG. 24 is a flowchart illustrating an example of a path output formula change type classification processing procedure. 図25は、テストケース分類処理手順の一例を示すフローチャートである。FIG. 25 is a flowchart illustrating an example of a test case classification processing procedure. 図26は、変更後プログラムのテストケースの入力値生成処理手順の一例を示すフローチャートである。FIG. 26 is a flowchart illustrating an example of an input value generation processing procedure for a test case of the changed program. 図27は、実施の形態2におけるテストケース生成装置の機能例を示すブロック図である。FIG. 27 is a block diagram illustrating a functional example of the test case generation device according to the second embodiment. 図28は、実施の形態2における変更前後のパスを関連付けた結果の一例を示す説明図である。FIG. 28 is an explanatory diagram illustrating an example of a result of associating paths before and after the change in the second embodiment. 図29は、実施の形態2におけるパス条件式変更種別の分類結果の一例を示す説明図である。FIG. 29 is an explanatory diagram of an example of the classification result of the path conditional expression change type in the second embodiment. 図30は、未生成の変更前後のパス関連付けの作成手順の一例を示す説明図である。FIG. 30 is an explanatory diagram illustrating an example of a procedure for creating a path association before and after an ungenerated change. 図31は、実施の形態2におけるテストケース生成処理手順の一例を示すフローチャート(その1)である。FIG. 31 is a flowchart (part 1) illustrating an example of a test case generation processing procedure according to the second embodiment. 図32は、実施の形態2におけるテストケース生成処理手順の一例を示すフローチャート(その2)である。FIG. 32 is a flowchart (part 2) illustrating an example of a test case generation process procedure according to the second embodiment. 図33は、テスト入力値による変更前後パス関連付け処理手順の一例を示すフローチャートである。FIG. 33 is a flowchart illustrating an example of a pre-change path association processing procedure based on a test input value. 図34は、未検出の変更前後パス関連付け処理手順の一例を示すフローチャートである。FIG. 34 is a flowchart illustrating an example of an undetected before / after change path association processing procedure.

以下に図面を参照して、開示のテストケース生成方法、テストケース生成装置、およびテストケース生成プログラムの実施の形態を詳細に説明する。   Exemplary embodiments of a disclosed test case generation method, test case generation apparatus, and test case generation program will be described below in detail with reference to the drawings.

(実施の形態1の説明)
図1は、実施の形態1におけるテストケース生成装置の動作例を示す説明図である。テストケース生成装置100は、第1のプログラムの一部が変更された第2のプログラムのテストケースを生成すべきか否かを判定するコンピュータである。ここで、プログラムのテストについて説明を行う。また、以下、第1のプログラムを、「変更前プログラム」と呼称する。また、第2のプログラムを、「変更後プログラム」と呼称する。
(Description of Embodiment 1)
FIG. 1 is an explanatory diagram illustrating an operation example of the test case generation device according to the first embodiment. The test case generation device 100 is a computer that determines whether or not to generate a test case of a second program in which a part of the first program is changed. Here, the program test will be described. Hereinafter, the first program is referred to as a “pre-change program”. Further, the second program is referred to as a “post-change program”.

変更前プログラムがリリースされた後、変更前プログラムが稼働して、変更前プログラムの利用が開始された後、変更前プログラムの機能の変更や追加、あるいは、機能の障害や不具合などに対応するため、変更前プログラムの一部を変更することが行われる。変更前プログラムの一部を変更する場合、変更前プログラムの変更が原因となって、変更前プログラムの一部が変更された変更後プログラム全体において、仕様外の機能障害が発生しないか、および仕様通りに部分変更が実装されたか、を確認することが行われる。機能障害は、デグレード、退行と呼ばれる。   After the pre-change program is released, after the pre-change program is started and the use of the pre-change program is started, the function of the pre-change program is changed or added, or a function failure or malfunction is dealt with. A part of the pre-change program is changed. When changing a part of the program before the change, if the program before the change is caused by the change of the program before the change, there is no functional failure outside the specification in the entire program after the change, and the specification It is confirmed whether the partial change is implemented as described above. The dysfunction is called degradation, regression.

したがって、確認のため、変更前プログラムの部分変更が終了した後、変更後プログラムに対して再度テストが行われる。テストには、テストケースが利用される。テストケースは、テスト対象となるプログラムに与えるテスト入力値と、テスト入力値をプログラムに与えた場合に、プログラムから出力される値の期待値とを有する。テストケースは、プログラムの機能ごとに用意される。   Therefore, after the partial change of the pre-change program is completed, the test is performed again on the post-change program for confirmation. Test cases are used for testing. The test case has a test input value given to the program to be tested and an expected value of a value output from the program when the test input value is given to the program. A test case is prepared for each function of the program.

また、具体的な、変更後プログラムのテストの確認内容としては、以下の2つとなる。1つ目の確認内容は、変更後プログラムの機能のうちの変更されていない機能が、プログラム開発者の意図に反して変更されていないことを確認する内容である。1つ目の確認内容を行うテストは、「リグレッションテスト」と呼称される。2つ目の確認内容は、変更後プログラムの機能のうちの変更および追加の機能が、プログラム開発者の意図通り、変更および追加されていることを確認する内容である。   In addition, there are the following two specific confirmation contents of the test of the changed program. The first confirmation content is a content for confirming that an unchanged function among the functions of the changed program has not been changed against the intention of the program developer. The test for performing the first confirmation content is referred to as a “regression test”. The second confirmation content is a content for confirming that a change and an additional function among the functions of the changed program are changed and added as intended by the program developer.

ここで、プログラムの機能ごとのテストケースを1つ目の確認内容に関連するテストケースと、2つ目の確認内容に関連するテストケースとに分類することと、追加された機能に関連するテストケースを生成することとは、手間がかかる。したがって、この2つの作業は、プログラム開発プロジェクトにおいて、テストの工数を増大させる要因となる。   Here, the test cases for each function of the program are classified into test cases related to the first confirmation contents and test cases related to the second confirmation contents, and tests related to the added functions. Generating a case is troublesome. Therefore, these two operations are factors that increase the number of test steps in the program development project.

テストケースを分類する技術として、テストケース実行時の実行トレースの動的解析などを利用して、プログラムとテストケースの関係を構築し、構築した関係を利用して、プログラム変更に対応するテストケースを選択するものがある。プログラム変更に対応するテストケースだけを選択して再実行することにより、リグレッションテストの手間を削減することができる。   As a technology for classifying test cases, the relationship between programs and test cases is built using dynamic analysis of execution traces during test case execution, and test cases corresponding to program changes using the built relationships. There is something to choose. By selecting only test cases corresponding to program changes and re-execution, it is possible to reduce the labor of regression testing.

また、追加された機能に関連するテストケースのテスト入力値を生成する技術として、プログラムや設計書や設計モデルを分析することにより、テスト入力値を生成するものがある。   Further, as a technique for generating test input values for test cases related to added functions, there is a technique for generating test input values by analyzing a program, a design document, or a design model.

しかしながら、上述したテストケースを分類する技術は、ある機能を追加するためにプログラムの部分変更を行うと、今回追加した機能のテストケースは、既存のテストケースの中には存在しないため、追加した機能に関連するテストケースを選択することが難しい。また、上述した追加された機能に関連するテストケースのテスト入力値を生成する技術は、あるバージョンのプログラム等を部分変更して次のバージョンを開発すると、変更に起因する変更および追加の部分を対象としたテストケースを特定することが難しい。   However, the above-mentioned technology for classifying test cases has been added because the test case for the function added this time does not exist in the existing test cases when the program is partially changed to add a certain function. It is difficult to select test cases related to the function. In addition, the technology for generating test input values for test cases related to the added functions described above is to change the part of a certain version of the program and develop the next version. It is difficult to specify the target test case.

そこで、テストケース生成装置100は、プログラムの一部変更時に、変更前後のパスが実行される条件式が充足可能となるパス同士の出力変数を比較してテストケースを生成すべきか否かを判断する。これにより、テストケース生成装置100は、プログラムの一部変更に伴うテストケース生成作業の負荷を削減する。   Accordingly, the test case generation apparatus 100 determines whether or not to generate a test case by comparing output variables between paths that satisfy a conditional expression for executing a path before and after the change when the program is partially changed. To do. As a result, the test case generation device 100 reduces the load of test case generation work associated with a partial change in the program.

ここで、図1に表示する変更前プログラムPrePrgと変更後プログラムPostPrgとについて説明する。変更後プログラムPostPrgは、変更前プログラムPrePrgの一部が変更されたプログラムである。変更前プログラムPrePrgは、if文の条件が真のときに実行する処理を経由するパスp1とelse if文とを経由するパスとの2つのパスがある。ここで、p1を第1のパスとする。また、変更後プログラムPostPrgは、if文の条件が真のときに実行する処理を経由するパスp2とelse if文とを経由するパスとの2つのパスがある。ここで、p2を第2のパスとする。また、パスとは、プログラムに含まれる一連の命令文である。一連の命令文が実行されることにより、何らかの機能を実現する可能性がある。   Here, the pre-change program PrePrg and the post-change program PostPrg displayed in FIG. 1 will be described. The post-change program PostPrg is a program in which a part of the pre-change program PrePrg has been changed. The pre-change program PrePrg has two paths: a path p1 that passes through a process that is executed when the condition of the if statement is true, and a path that passes through an else if statement. Here, let p1 be the first pass. Further, the post-change program PostPrg has two paths: a path p2 that passes through a process that is executed when the condition of the if statement is true, and a path that passes through an else if statement. Here, let p2 be the second path. A path is a series of statements included in a program. Some functions may be realized by executing a series of statements.

本実施の形態にかかるテストケース生成装置100は、あるパスが実行される条件となる入力変数の値を表す条件式と、パスが実行された場合に出力されるプログラムに含まれる出力変数を表す数式と、を含むシンボリック実行の実行結果を取得する。シンボリック実行の実行結果を、以下、「シンボリック実行結果」と称する。なお、シンボリック実行を行う装置は、テストケース生成装置100でもよいし、他の装置であってもよい。   The test case generation apparatus 100 according to the present embodiment represents a conditional expression that represents the value of an input variable that is a condition for executing a certain path, and an output variable that is included in a program that is output when the path is executed. The execution result of the symbolic execution including the mathematical expression is acquired. The execution result of symbolic execution is hereinafter referred to as “symbolic execution result”. Note that the device that performs symbolic execution may be the test case generation device 100 or another device.

パスが実行される条件となる入力変数の値を表す条件式を、以下、「パス条件式」と呼称する。また、パスが実行された場合に出力されるプログラムに含まれる出力変数を表す数式を、「パス出力数式」と呼称する。入力変数とは、あるプログラムに含まれる変数であり、プログラムパスに与えられる値が格納される変数である。また、出力変数は、あるプログラムに含まれる変数であり、プログラムから出力される値が格納される変数である。図1の変更前プログラムPrePrgと変更後プログラムPostPrgでは、入力変数は“x”となり、出力変数は、“rtn”となる。本実施の形態では、入力変数と出力変数との数が、変更前プログラムPrePrgと変更後プログラムPostPrgとでそれぞれ一致することを前提とする。   A conditional expression representing the value of an input variable that is a condition for executing a pass is hereinafter referred to as a “pass conditional expression”. A mathematical expression representing an output variable included in a program output when a pass is executed is referred to as a “pass output mathematical expression”. An input variable is a variable included in a certain program, and is a variable in which a value given to a program path is stored. The output variable is a variable included in a certain program, and is a variable in which a value output from the program is stored. In the pre-change program PrePrg and the post-change program PostPrg in FIG. 1, the input variable is “x” and the output variable is “rtn”. In the present embodiment, it is assumed that the numbers of input variables and output variables are the same in the pre-change program PrePrg and the post-change program PostPrg.

シンボリック実行とは、プログラムPの変数に具体的な確定値を入力する代わりにシンボル値と呼ばれる記号値を入力して、シンボル値のままプログラムを模擬的に実行し、プログラムの実行結果を評価する技術である。図1に示す変更前プログラムPrePrgと変更後プログラムPostPrgとは、Java(登録商標)により記述されているが、変更前プログラムPrePrgと変更後プログラムPostPrgとは、シンボリック実行が行える他の言語で記述されていてもよい。   In symbolic execution, instead of inputting a specific definite value into a variable of program P, a symbol value called a symbol value is input, the program is simulated and executed as it is, and the execution result of the program is evaluated. Technology. The pre-change program PrePrg and the post-change program PostPrg shown in FIG. 1 are described in Java (registered trademark), but the pre-change program PrePrg and the post-change program PostPrg are described in other languages that can perform symbolic execution. It may be.

図1では、テストケース生成装置100は、パスp2をテストするテストケースについて、テストケースを生成すべきか否かを判定する。具体的に、テストケース生成装置100は、パスp1をテストするテストケースをそのまま流用できて、テストケースの生成が不要であるのか、または、流用できず、パスp2のテストするテストケースを生成すべきなのかを判定することを行う。   In FIG. 1, the test case generation apparatus 100 determines whether or not a test case should be generated for a test case that tests the path p2. Specifically, the test case generation apparatus 100 can divert the test case for testing the path p1 as it is, and it is not necessary to generate the test case, or the test case generation apparatus 100 generates a test case for testing the path p2. Determine what should be done.

図1の例では、テストケース生成装置100は、パスp1が実行される条件となるパス条件式102−1と、パスp1が実行された場合に出力されるパス出力数式103−1とを含むシンボリック実行結果101−1を取得する。さらに、テストケース生成装置100は、パスp2が実行される条件となるパス条件式102−2とパスp2が実行された場合に出力されるパス出力数式103−2とを含むシンボリック実行結果101−2を取得する。   In the example of FIG. 1, the test case generation device 100 includes a path condition expression 102-1 that is a condition for executing the path p1, and a path output expression 103-1 that is output when the path p1 is executed. The symbolic execution result 101-1 is acquired. Further, the test case generation apparatus 100 includes a symbolic execution result 101-including a path condition expression 102-2 that is a condition for executing the path p2 and a path output expression 103-2 that is output when the path p2 is executed. 2 is acquired.

次に、テストケース生成装置100は、入力変数“x”が取り得る値のうちの、パス条件式102−1とパス条件式102−2との論理積を真とする値の有無に基づいて、パスp2がパスp1に関連するか否かを判断する。ここで、ある条件式と別の条件式との論理積を真とする値の有無を特定することを、以下、“充足可能性の判定”と呼称する。ある条件式と別の条件式との論理積を真とする値が有る場合、“充足可能”であるとし、ある条件式と別の条件式との論理積を真とする値が無い場合、“充足不可能”であるとする。テストケース生成装置100は、論理積が充足可能となる場合、パスp2がパスp1に関連すると判断し、論理積が充足不可能となる場合、パスp2がパスp1に関連しないと判断する。   Next, the test case generation device 100 determines whether there is a value that makes the logical product of the path condition expression 102-1 and the path condition expression 102-2 true among the possible values of the input variable “x”. , It is determined whether the path p2 is related to the path p1. Here, specifying the presence or absence of a value that makes the logical product of one conditional expression and another conditional expression true is hereinafter referred to as “determination of satisfiability”. If there is a value that is true of the logical product of one conditional expression and another conditional expression, it is considered “satisfiable”, and if there is no value that is true of the logical product of one conditional expression and another conditional expression, Assume that it is “unsatisfiable”. The test case generation device 100 determines that the path p2 is related to the path p1 when the logical product can be satisfied, and determines that the path p2 is not related to the path p1 when the logical product cannot be satisfied.

グラフ110は、入力変数“x”に対して、パス条件式102−1とパス条件式102−2とが真となる範囲を示す。グラフ110が示すように、int型の入力変数“x”が取り得る値のうちのx<10の値が与えられる場合、パスp1のパス条件式とパスp2のパス条件式との論理積が真となる。したがって、パス条件式102−1とパス条件式102−2との論理積を真とする値があるため、充足可能となり、テストケース生成装置100は、パスp2がパスp1に関連すると判断する。   The graph 110 shows a range in which the path condition expression 102-1 and the path condition expression 102-2 are true for the input variable “x”. As shown in the graph 110, when a value of x <10 among possible values of the int-type input variable “x” is given, the logical product of the path condition expression of the path p1 and the path condition expression of the path p2 is Become true. Therefore, since there is a value for which the logical product of the path conditional expression 102-1 and the path conditional expression 102-2 is true, it can be satisfied, and the test case generating apparatus 100 determines that the path p2 is related to the path p1.

また、テストケース生成装置100は、パス出力数式103−1と、パス出力数式103−2とを比較する。具体的な比較方法としては、図13〜図16にて後述する。図1の例では、比較結果が一致しなかったことを示すこととする。   Further, the test case generation device 100 compares the path output formula 103-1 with the path output formula 103-2. A specific comparison method will be described later with reference to FIGS. In the example of FIG. 1, it is assumed that the comparison results do not match.

テストケース生成装置100は、判断結果と比較結果とに基づいて、パスp2の動作をテストするテストケースを生成すべきか否かを判定する。具体的に、テストケース生成装置100は、判断結果がパスp2がパスp1に関連することを示し、かつ、比較結果が一致することを示す場合、パスp1の動作をテストするテストケースがそのまま流用できるため、テストケースを生成しなくてよいと判定する。また、テストケース生成装置100は、判断結果がパスp2がパスp1に関連することを示し、かつ、比較結果が一致しないことを示す場合、パスp1の動作をテストするテストケースがそのまま流用できないため、テストケースを生成すべきであると判定する。   The test case generation device 100 determines whether or not to generate a test case for testing the operation of the path p2, based on the determination result and the comparison result. Specifically, when the determination result indicates that the path p2 is related to the path p1 and the comparison result matches, the test case generation apparatus 100 uses the test case for testing the operation of the path p1 as it is. Therefore, it is determined that it is not necessary to generate a test case. In addition, when the determination result indicates that the path p2 is related to the path p1 and the comparison result does not match, the test case generation apparatus 100 cannot use the test case for testing the operation of the path p1 as it is. It is determined that a test case should be generated.

図1の例では、テストケース生成装置100は、パスp2の動作をテストするテストケースを生成すべきであると判定する。以下、図2〜図26を用いて、実施の形態1にかかるテストケース生成装置100の説明を行う。   In the example of FIG. 1, the test case generation device 100 determines that a test case for testing the operation of the path p2 should be generated. Hereinafter, the test case generation apparatus 100 according to the first embodiment will be described with reference to FIGS.

(テストケース生成装置のハードウェア)
図2は、テストケース生成装置のハードウェアの一例を示すブロック図である。図2において、テストケース生成装置100は、CPU(Central Processing Unit)201と、ROM(Read‐Only Memory)202と、RAM(Random Access Memory)203と、を含む。また、テストケース生成装置100は、ディスクドライブ204と、ディスク205と、通信インターフェース206と、を含む。また、テストケース生成装置100は、ディスプレイ207と、キーボード208と、マウス209とを含む。また、CPU201〜マウス209はバス210によってそれぞれ接続される。
(Test case generator hardware)
FIG. 2 is a block diagram illustrating an example of hardware of the test case generation device. 2, the test case generation apparatus 100 includes a CPU (Central Processing Unit) 201, a ROM (Read-Only Memory) 202, and a RAM (Random Access Memory) 203. The test case generation apparatus 100 includes a disk drive 204, a disk 205, and a communication interface 206. The test case generation apparatus 100 includes a display 207, a keyboard 208, and a mouse 209. Further, the CPU 201 to the mouse 209 are connected by a bus 210, respectively.

CPU201は、テストケース生成装置100の全体の制御を司る演算処理装置である。ROM202は、ブートプログラムなどのプログラムを記憶する不揮発性メモリである。RAM203は、CPU201のワークエリアとして使用される揮発性メモリである。   The CPU 201 is an arithmetic processing device that controls the entire test case generation device 100. The ROM 202 is a non-volatile memory that stores a program such as a boot program. A RAM 203 is a volatile memory used as a work area for the CPU 201.

ディスクドライブ204は、CPU201の制御に従ってディスク205に対するデータのリードおよびライトを制御する制御装置である。ディスクドライブ204には、たとえば、磁気ディスクドライブ、光ディスクドライブ、ソリッドステートドライブなどを採用することができる。ディスク205は、ディスクドライブ204の制御で書き込まれたデータを記憶する不揮発性メモリである。たとえばディスクドライブ204が磁気ディスクドライブである場合、ディスク205には、磁気ディスクを採用することができる。また、ディスクドライブ204が光ディスクドライブである場合、ディスク205には、光ディスクを採用することができる。また、ディスクドライブ204がソリッドステートドライブである場合、ディスク205には、半導体素子メモリを採用することができる。   The disk drive 204 is a control device that controls reading and writing of data with respect to the disk 205 in accordance with the control of the CPU 201. As the disk drive 204, for example, a magnetic disk drive, an optical disk drive, a solid state drive, or the like can be adopted. The disk 205 is a non-volatile memory that stores data written under the control of the disk drive 204. For example, when the disk drive 204 is a magnetic disk drive, a magnetic disk can be adopted as the disk 205. Further, when the disk drive 204 is an optical disk drive, an optical disk can be adopted as the disk 205. When the disk drive 204 is a solid state drive, a semiconductor element memory can be adopted for the disk 205.

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

ディスプレイ207は、マウスカーソル、アイコンあるいはツールボックスをはじめ、文書、画像、機能情報などのデータを表示する装置である。ディスプレイ207には、たとえば、CRT(Cathode Ray Tube)、TFT(Thin Film Transistor)液晶ディスプレイ、プラズマディスプレイなどを採用することができる。   The display 207 is a device that displays data such as a document, an image, and function information as well as a mouse cursor, an icon, or a tool box. As the display 207, for example, a cathode ray tube (CRT), a thin film transistor (TFT) liquid crystal display, a plasma display, or the like can be employed.

キーボード208は、文字、数字、各種指示などの入力のためのキーを有し、データの入力を行う装置である。また、キーボード208は、タッチパネル式の入力パッドやテンキーなどであってもよい。マウス209は、マウスカーソルの移動や範囲選択、あるいはウィンドウの移動やサイズの変更などを行う装置である。マウス209は、ポインティングデバイスとして同様に機能を有するものであれば、トラックボールやジョイスティックなどであってもよい。次に、図3を用いて、テストケースの実行手順の一例を示す。   The keyboard 208 is a device that has keys for inputting characters, numbers, various instructions, and the like and inputs data. The keyboard 208 may be a touch panel type input pad or a numeric keypad. The mouse 209 is a device for moving a mouse cursor, selecting a range, moving a window, changing a size, and the like. The mouse 209 may be a trackball or a joystick as long as it has the same function as a pointing device. Next, an example of a test case execution procedure will be described with reference to FIG.

図3は、テストケースの実行手順の一例を示す説明図である。テストケースが実行される時に入力されるデータは、テスト対象プログラムPrg、テスト入力値Inv、および、期待値Epvである。テスト入力値Invは、テスト対象プログラムPrgの様々な動作のうち、仕様通りであるか確認したい動作をテスト対象プログラムPrgに実行させる値である。テストケースは、テスト対象プログラムの動作が想定通りか確認したい事柄である。また、様々な確認事項をテストするテストケースを作成して、テストケースらを集合させたものを、「テストスィート」と呼称する。期待値Epvは、仕様通りにテスト対象プログラムPrgが動作した場合のテスト対象プログラムPrgの望ましい動作結果であり、たとえば、注目する変数の出力値などである。   FIG. 3 is an explanatory diagram illustrating an example of a test case execution procedure. Data input when the test case is executed are the test target program Prg, the test input value Inv, and the expected value Epv. The test input value Inv is a value that causes the test target program Prg to perform an operation to be confirmed as being in accordance with the specification among various operations of the test target program Prg. The test case is a matter to confirm whether the operation of the test target program is as expected. Also, a test case for testing various confirmation items and a collection of the test cases are referred to as a “test suite”. The expected value Epv is a desired operation result of the test target program Prg when the test target program Prg operates according to the specification, and is, for example, an output value of a variable of interest.

テスト対象プログラムPrgは、プログラム実行環境が構築された装置によって実行される。プログラム実行環境が構築された装置は、テストケース生成装置100でもよいし、他の装置でもよい。図3では、説明の簡略化のため、テストケース生成装置100がテスト対象プログラムPrgを実行するものとする。   The test target program Prg is executed by a device in which a program execution environment is constructed. The apparatus in which the program execution environment is constructed may be the test case generation apparatus 100 or another apparatus. In FIG. 3, it is assumed that the test case generation device 100 executes the test target program Prg for the sake of simplicity.

テストケース生成装置100は、テスト入力値Invをテスト対象プログラムPrgに与えて、プログラム実行結果Prsを得る。そして、テストケース生成装置100は、プログラム実行結果Prsと期待値Epvとを比較することによりテスト結果判定を行い、テスト結果Trsを出力する。具体的に、プログラム実行結果Prsと期待値Epvとが一致する場合、テスト結果Trsは、成功となる。また、プログラム実行結果Prsと期待値Epvとが一致しない場合、テスト結果Trsは、失敗となる。次に、図4を用いてプログラム変更前後でのプログラムとテストケースの関係を説明する。   The test case generation device 100 gives the test input value Inv to the test target program Prg, and obtains the program execution result Prs. Then, the test case generation apparatus 100 determines the test result by comparing the program execution result Prs and the expected value Epv, and outputs the test result Trs. Specifically, when the program execution result Prs matches the expected value Epv, the test result Trs is successful. Further, when the program execution result Prs and the expected value Epv do not match, the test result Trs fails. Next, the relationship between the program and the test case before and after the program change will be described with reference to FIG.

図4は、変更前後のプログラムとテストケースの関係の一例を示す説明図である。変更前プログラムPrePrgは、機能PreF1と、機能PreF2と、…、機能PreFMとを含む。また、変更前プログラムPrePrgが変更された変更後プログラムPostPrgは、機能PostF1と、機能PostF2と、…、機能PostFMと、機能PostFXとを含む。変更後プログラムPostPrgの各機能のうち、機能PostF1は変更されておらず、機能PostF2は変更されており、…、機能PostFMは変更されておらず、機能PostFXは追加された機能である。   FIG. 4 is an explanatory diagram illustrating an example of a relationship between a program and a test case before and after the change. The pre-change program PrePrg includes a function PreF1, a function PreF2, ..., a function PreFM. The post-change program PostPrg in which the pre-change program PrePrg has been changed includes a function PostF1, a function PostF2,..., A function PostFM, and a function PostFX. Among the functions of the post-change program PostPrg, the function PostF1 is not changed, the function PostF2 is changed,..., The function PostFM is not changed, and the function PostFX is an added function.

また、変更前プログラムPrePrgのテストスィートPreTsは、テストケース1と、テストケース2と、…、テストケースNとを有する。テストケース1は、機能PreF1をテストするテストケースである。テストケース2は、機能PreF2をテストするテストケースである。テストケースNは、機能PreFMをテストするテストケースである。   Further, the test suite PreTs of the pre-change program PrePrg has a test case 1, a test case 2,. Test case 1 is a test case for testing the function PreF1. Test case 2 is a test case for testing the function PreF2. The test case N is a test case for testing the function PreFM.

テストケース生成装置100は、既存のテストケースとなるテストケース1〜テストケースNが、変更前プログラムPrePrgの変更の結果、変更しなくてよいのか、それとも変更すべきであるのかを分類する。また、テストケース生成装置100は、変更前プログラムPrePrgの変更の結果、対応するテストケースが既存のテストケースになく、追加された機能があるかを判断する。さらに、テストケース生成装置100は、追加された機能に対するテストケースを生成する。   The test case generation apparatus 100 classifies whether the test cases 1 to N, which are existing test cases, need not be changed or should be changed as a result of the change of the pre-change program PrePrg. Further, as a result of the change of the pre-change program PrePrg, the test case generation apparatus 100 determines whether there is no corresponding test case in the existing test case and there is an added function. Furthermore, the test case generation device 100 generates a test case for the added function.

具体的に、図4の例では、機能PostF1と、機能PostFMとに対して、テストケース生成装置100は、テストケース1〜テストケースNから対応するテストケースを特定する。そして、テストケース生成装置100は、機能PostF1と、機能PostFMの動作をテストするテストケースとして用いることができると判定する。   Specifically, in the example of FIG. 4, for the function PostF1 and the function PostFM, the test case generation device 100 specifies a corresponding test case from the test cases 1 to N. Then, the test case generation device 100 determines that the function PostF1 can be used as a test case for testing the operation of the function PostFM.

また、機能PostF2に対して、テストケース生成装置100は、テストケース1〜テストケースNから対応するテストケースを特定する。そして、テストケース生成装置100は、特定したテストケースを用いて、機能PostF2をテストするテストケースを生成すべきであると判定する。さらに、機能PostFXに対して、テストケース生成装置100は、テストケースを追加すべきであることを判定する。そして、テストケース生成装置100は、機能PostFXに対する追加テストケースを生成する。   In addition, for the function PostF2, the test case generation device 100 specifies a corresponding test case from the test cases 1 to N. Then, the test case generation device 100 determines that a test case for testing the function PostF2 should be generated using the specified test case. Furthermore, for the function PostFX, the test case generation device 100 determines that a test case should be added. Then, the test case generation device 100 generates an additional test case for the function PostFX.

機能PostF1〜機能PostFXに対応するテストケースを特定する際には、テストケース生成装置100は、機能PostF1〜機能PostFXに対応する機能PreF1〜機能PreFMを特定する。機能PreF1〜機能PreFMは、テストケース1〜テストケースNのいずれかに関連付けられている。したがって、機能PostF1〜機能PostFXに対応する機能PostF1〜機能PostFXをそれぞれ特定することにより、機能PostF1〜機能PostFXに対応するテストケースも特定することができる。機能PostF1〜機能PostFXに対応する機能PreF1〜機能PreFMを特定する手順の詳細については、図10〜図12にて後述する。   When specifying the test cases corresponding to the functions PostF1 to PostFX, the test case generation apparatus 100 specifies the functions PreF1 to PreFM corresponding to the functions PostF1 to PostFX. The function PreF1 to the function PreFM are associated with any one of the test case 1 to the test case N. Therefore, the test cases corresponding to the functions PostF1 to PostFX can be specified by specifying the functions PostF1 to PostFX corresponding to the functions PostF1 to PostFX, respectively. Details of the procedure for specifying the functions PreF1 to PreFM corresponding to the functions PostF1 to PostFX will be described later with reference to FIGS.

また、機能PostF1〜機能PostFXに対応する機能PreF1〜機能PreFMを特定したのち、機能PostF1〜機能PostFXの動作をテストするテストケースを生成の要否についての手順の詳細は、図13〜図19にて後述する。   Details of the procedure for determining whether it is necessary to generate a test case for testing the operation of the function PostF1 to the function PostFX after specifying the function PreF1 to the function PreFM corresponding to the function PostF1 to the function PostFX will be described with reference to FIGS. Will be described later.

次に、図5を用いて、本実施の形態における、変更前プログラムPrePrgの一例と変更後プログラムPostPrgの一例とを説明する。   Next, an example of the pre-change program PrePrg and an example of the post-change program PostPrg in the present embodiment will be described with reference to FIG.

図5は、変更前プログラムと変更後プログラムとの一例を示す説明図である。図5に示す変更前プログラムPrePrgのソースコードである変更前ソースコードPrePrgSrcは、“TestTarget”クラスの“targetFunc”メソッドについて規定したものである。変更前ソースコードPrePrgSrcが示すように、変更前プログラムPrePrgは、変数「x」を入力値として、変数「rtn」を出力結果とする。   FIG. 5 is an explanatory diagram showing an example of the pre-change program and the post-change program. The pre-change source code PrePrgSrc, which is the source code of the pre-change program PrePrg shown in FIG. 5, defines the “targetFunc” method of the “TestTarget” class. As indicated by the pre-change source code PrePrgSrc, the pre-change program PrePrg takes the variable “x” as an input value and the variable “rtn” as an output result.

また、変更前ソースコードPrePrgSrcは、if文501と、else if文502と、else文503とを有する。そして、変更前ソースコードPrePrgSrcは、if文501の条件を満たすと実行される更新文504と、else if文502の条件を満たすと実行される更新文505と、else文503に制御が到達した際に実行される更新文506とを有する。   The pre-change source code PrePrgSrc includes an if statement 501, an else if statement 502, and an else statement 503. Then, the pre-change source code PrePrgSrc reaches the update statement 504 that is executed when the condition of the if statement 501 is satisfied, the update statement 505 that is executed when the condition of the else if statement 502 is satisfied, and the else statement 503. Update statement 506 to be executed at the time.

また、変更後プログラムPostPrgのソースコードである変更後ソースコードPostPrgSrcは、if文511と、else if文512と、else if文513と、else文514とを有する。そして、変更後ソースコードPostPrgSrcは、if文511の条件を満たすと実行される更新文515と、else if文512の条件を満たすと実行される更新文516とを有する。さらに、変更後ソースコードPostPrgSrcは、else if文513の条件を満たすと実行される更新文517と、else文514に制御が到達した際に実行される更新文518とを有する。   The changed source code PostPrgSrc, which is the source code of the changed program PostPrg, includes an if statement 511, an else if statement 512, an else if statement 513, and an else statement 514. The post-change source code PostPrgSrc includes an update statement 515 executed when the condition of the if statement 511 is satisfied, and an update statement 516 executed when the condition of the else if statement 512 is satisfied. Further, the changed source code PostPrgSrc includes an update statement 517 that is executed when the condition of the else if statement 513 is satisfied, and an update statement 518 that is executed when control reaches the else statement 514.

if文511は、if文501の条件式が変更された文である。else if文512は、else if文502の条件式が変更された文である。else if文513は、新たに追加された条件文である。else文514は、if文511〜else if文513の変更により、制御が到達する条件がelse文503と比較して変更されている。更新文515は、更新文504と同一内容である。更新文516は、更新文505と同一内容である。更新文517は、追加された文である。更新文518は、更新文506と比較して出力結果が変更されている。   The if statement 511 is a statement in which the conditional expression of the if statement 501 is changed. The else if statement 512 is a statement in which the conditional expression of the else if statement 502 is changed. The else if statement 513 is a newly added conditional statement. In the else statement 514, the condition for the control to reach is changed in comparison with the else statement 503 by changing the if statement 511 to the else if statement 513. The update sentence 515 has the same content as the update sentence 504. The update sentence 516 has the same content as the update sentence 505. The update sentence 517 is an added sentence. The output result of the update statement 518 is changed compared to the update statement 506.

次に、変更前プログラムPrePrgと、変更後プログラムPostPrgとをシンボリック実行するシンボリック実行ドライバのプログラムの一例を示す。   Next, an example of a symbolic execution driver program for executing symbolically the pre-change program PrePrg and the post-change program PostPrg is shown.

図6は、シンボリック実行ドライバのプログラムの一例を示す説明図である。図6に示すシンボリック実行用ドライバのソースコードSymDrvSrcは、“TestDriver”クラスを規定したものである。ソースコードSymDrvSrcは、コード群601〜コード群603を含む。また、図6では、テスト対象プログラムのソースコードPrgSrcを図示する。   FIG. 6 is an explanatory diagram of an example of a symbolic execution driver program. The source code SymDrvSrc of the symbolic execution driver shown in FIG. 6 defines the “TestDriver” class. The source code SymDrvSrc includes a code group 601 to a code group 603. FIG. 6 shows the source code PrgSrc of the test target program.

コード群601は、シンボリック変数を指定したコードである。ここで、シンボリック変数とは、変数xを具体的な値ではなくxという文字として扱う変数のことである。コード群602は、出力変数を指定したコードである。コード群603は、パス結果の記録対象を指定したコードである。   The code group 601 is a code specifying a symbolic variable. Here, the symbolic variable is a variable that handles the variable x as a character x instead of a specific value. A code group 602 is a code specifying an output variable. A code group 603 is a code that designates a recording result of a pass result.

“TestDriver”クラスの“testFunc”メソッドが実行されることにより、ソースコードPrgSrcの実行オブジェクトが実行される。次に、図7と図8とを用いて、変更前プログラムPrePrgと変更後プログラムPostPrgとのシンボリック実行の結果について説明する。   By executing the “testFunc” method of the “TestDriver” class, the execution object of the source code PrgSrc is executed. Next, the result of symbolic execution of the pre-change program PrePrg and the post-change program PostPrg will be described with reference to FIGS.

図7は、変更前プログラムのシンボリック実行の結果の一例を示す説明図である。テストケース生成装置100は、変更前プログラムPrePrgに対してシンボリック実行用ドライバを実行することにより、変更前プログラムのシンボリック実行結果701を得る。   FIG. 7 is an explanatory diagram showing an example of the result of symbolic execution of the pre-change program. The test case generation apparatus 100 obtains the symbolic execution result 701 of the pre-change program by executing the symbolic execution driver for the pre-change program PrePrg.

シンボリック実行結果701は、3つのパスについてのシンボリック実行結果を示す。図7に示すシンボリック実行結果701は、レコード701−1〜レコード701−3を有する。シンボリック実行結果701は、パスIDと、パス条件式と、パス出力数式という3つのフィールドを有する。パスIDは、パスを識別するIDである。パス条件式は、該当のパスが実行される条件となる入力変数の値を表す条件式である。パス出力数式は、該当のパスが実行された場合に出力される出力変数を表す数式である。   A symbolic execution result 701 indicates symbolic execution results for three paths. The symbolic execution result 701 illustrated in FIG. 7 includes records 701-1 to 701-3. The symbolic execution result 701 has three fields: a path ID, a path condition expression, and a path output expression. The path ID is an ID for identifying a path. The path conditional expression is a conditional expression that represents the value of an input variable that is a condition for executing the corresponding path. The path output formula is a formula that represents an output variable that is output when the corresponding path is executed.

本実施の形態において、変更前プログラムPrePrgは、M個のパスを含むものとする。Mは、1以上の整数である。図7に示すシンボリック実行結果701は、M=3の場合の例を示す。また、xを1以上M以下の整数として、変更前プログラムPrePrgのパスxのパス条件式を、“PrexPC”と呼称する。また、変更前プログラムPrePrgのパスxのパス出力数式を、“PrexR”と呼称する。   In the present embodiment, the pre-change program PrePrg includes M paths. M is an integer of 1 or more. A symbolic execution result 701 shown in FIG. 7 shows an example in the case of M = 3. Further, the path conditional expression of the path x of the pre-change program PrePrg is referred to as “PrexPC”, where x is an integer between 1 and M. Further, the path output formula of the path x of the pre-change program PrePrg is referred to as “PrexR”.

図8は、変更後プログラムのシンボリック実行の結果の一例を示す説明図である。テストケース生成装置100は、変更後プログラムPostPrgに対してシンボリック実行用ドライバを実行することにより、変更後プログラムのシンボリック実行結果801を得る。   FIG. 8 is an explanatory diagram illustrating an example of a result of symbolic execution of the changed program. The test case generation apparatus 100 obtains a symbolic execution result 801 of the changed program by executing a symbolic execution driver for the changed program PostPrg.

シンボリック実行結果801は、4つのパスについてのシンボリック実行結果を示す。図8に示すシンボリック実行結果801は、レコード801−1〜レコード801−4を有する。   A symbolic execution result 801 indicates symbolic execution results for four paths. The symbolic execution result 801 illustrated in FIG. 8 includes records 801-1 to 801-4.

本実施の形態において、変更後プログラムPostPrgは、N個のパスを含むものとする。Nは、1以上の整数である。図8に示すシンボリック実行結果801は、N=4の場合の例を示す。また、xを1以上N以下の整数として、変更後プログラムPostPrgのパスxのパス条件式を、“PostxPC”と呼称する。また、変更後プログラムPostPrgのパスxのパス出力数式を、“PostxR”と呼称する。   In the present embodiment, it is assumed that the post-change program PostPrg includes N paths. N is an integer of 1 or more. A symbolic execution result 801 shown in FIG. 8 shows an example when N = 4. Further, the path condition expression of the path x of the post-change program PostPrg is referred to as “PostxPC”, where x is an integer between 1 and N. Further, the path output formula of the path x of the post-change program PostPrg is referred to as “PostxR”.

(テストケース生成装置100の機能)
次に、テストケース生成装置100の機能について説明する。図9は、テストケース生成装置の機能例を示すブロック図である。テストケース生成装置100は、第1取得部901と、第2取得部902と、パス関連判断部903と、関連情報作成部904と、特定部905と、数式判定部906と、生成判定部907と、算出部908と、テストケース生成部909を含む。制御部となる第1取得部901〜テストケース生成部909は、記憶装置に記憶されたプログラムをCPU201が実行することにより、第1取得部901〜テストケース生成部909の機能を実現する。記憶装置とは、具体的には、たとえば、図2に示したROM202、RAM203、ディスク205などである。または、通信インターフェース206を経由して他のCPUが実行することにより、第1取得部901〜テストケース生成部909の機能を実現してもよい。
(Function of test case generation apparatus 100)
Next, functions of the test case generation device 100 will be described. FIG. 9 is a block diagram illustrating an example of functions of the test case generation apparatus. The test case generation device 100 includes a first acquisition unit 901, a second acquisition unit 902, a path relation determination unit 903, a related information creation unit 904, a specification unit 905, a mathematical expression determination unit 906, and a generation determination unit 907. And a calculation unit 908 and a test case generation unit 909. The first acquisition unit 901 to the test case generation unit 909 serving as the control unit realize the functions of the first acquisition unit 901 to the test case generation unit 909 by causing the CPU 201 to execute a program stored in the storage device. Specifically, the storage device is, for example, the ROM 202, the RAM 203, the disk 205, etc. shown in FIG. Alternatively, the functions of the first acquisition unit 901 to the test case generation unit 909 may be realized by execution by another CPU via the communication interface 206.

第1取得部901は、変更前プログラムPrePrgをシンボリック実行することにより、変更前プログラムPrePrgに含まれる第1のパスの第1のパス条件式と、第1のパスの第1のパス出力数式と、を含む第1のシンボリック実行結果を取得する。   The first acquisition unit 901 performs symbolic execution of the pre-change program PrePrg so that the first path conditional expression of the first path included in the pre-change program PrePrg, the first path output formula of the first path, To obtain a first symbolic execution result.

また、第1のシンボリック実行結果は、変更前プログラムPrePrgに含まれるパス群の各々のパスごとの、パス条件式と、パス出力数式とを含んでもよい。なお、取得された第1のシンボリック実行結果は、RAM203、ディスク205などの記憶領域に記憶される。   Further, the first symbolic execution result may include a path condition expression and a path output expression for each path of the path group included in the pre-change program PrePrg. The obtained first symbolic execution result is stored in a storage area such as the RAM 203 and the disk 205.

第2取得部902は、変更後プログラムPostPrgをシンボリック実行することにより、変更後プログラムPostPrgに含まれる第2のパスの第2のパス条件式と、第2のパスの第2のパス出力数式と、を含む第2のシンボリック実行結果を取得する。   The second acquisition unit 902 performs symbolic execution of the post-change program PostPrg, so that the second pass condition formula of the second pass included in the post-change program PostPrg, the second pass output formula of the second pass, , Including a second symbolic execution result.

また、第2のシンボリック実行結果は、変更後プログラムPostPrgに含まれるパス群の各々のパスごとの、パス条件式と、パス出力数式とを含んでもよい。なお、取得された第2のシンボリック実行結果は、RAM203、ディスク205などの記憶領域に記憶される。   The second symbolic execution result may include a path condition expression and a path output expression for each path in the path group included in the post-change program PostPrg. The acquired second symbolic execution result is stored in a storage area such as the RAM 203 and the disk 205.

パス関連判断部903は、入力変数が取り得る値のうちの、第1取得部901によって取得された第1のパス条件式と第2取得部902によって取得された第2のパス条件式との充足可能性に基づいて、第2のパスが第1のパスに関連するか否かを判断する。   The path-related determining unit 903 includes the first path conditional expression acquired by the first acquiring unit 901 and the second path conditional expression acquired by the second acquiring unit 902 among the possible values of the input variable. Based on the satisfiability, it is determined whether the second path is related to the first path.

また、パス関連判断部903は、第1のシンボリック実行結果に含まれるパスと第2のパスとの組ごとに、前述のパスのパス条件式と第2の条件式との充足可能性に基づいて、第2のパスが第1の実行結果に含まれるパスに関連するか否かを判断してもよい。   Further, the path relation determination unit 903 is based on the satisfiability of the path condition expression and the second condition expression of the path described above for each pair of the path and the second path included in the first symbolic execution result. Thus, it may be determined whether or not the second path is related to the path included in the first execution result.

また、パス関連判断部903は、第1のシンボリック実行結果に含まれるパスと第2のシンボリック実行結果に含まれるパスとの組ごとに、2つのパスの条件式の論理積を真とする値の有無に基づいて、2つのパスが関連するか否かを判断してもよい。なお、判断結果は、RAM203、ディスク205などの記憶領域に記憶される。   In addition, the path relation determination unit 903 is a value for which the logical product of the conditional expressions of the two paths is true for each pair of the path included in the first symbolic execution result and the path included in the second symbolic execution result. Whether or not two paths are related may be determined based on the presence or absence of. Note that the determination result is stored in a storage area such as the RAM 203 or the disk 205.

関連情報作成部904は、パス関連判断部903によって第2のパスが第1のシンボリック実行結果に含まれるパスに関連すると判断された場合、第2のパスが第1のシンボリック実行結果に含まれるパスに関連することを示す関連情報を作成する。関連情報の作成については、図10にて後述する。   When the path relation determination unit 903 determines that the second path is related to the path included in the first symbolic execution result, the related information creation unit 904 includes the second path in the first symbolic execution result. Create related information indicating that it is related to the path. The creation of related information will be described later with reference to FIG.

また、関連情報作成部904は、次の条件を満たすと判断された場合、第2のシンボリック実行結果に含まれるパスが第1のシンボリック実行結果に含まれるパスに関連することを示す関連情報を作成してもよい。次の条件とは、パス関連判断部903によって第2のシンボリック実行結果に含まれるパスが第1のシンボリック実行結果に含まれるパスに関連すると判断された場合である。なお、関連情報は、RAM203、ディスク205などの記憶領域に記憶される。   In addition, when it is determined that the following condition is satisfied, the related information creation unit 904 displays related information indicating that the path included in the second symbolic execution result is related to the path included in the first symbolic execution result. You may create it. The next condition is a case where the path relation determination unit 903 determines that the path included in the second symbolic execution result is related to the path included in the first symbolic execution result. The related information is stored in a storage area such as the RAM 203 and the disk 205.

特定部905は、パス関連判断部903によって第2のパスが第1のパスに関連すると判断した場合、第1のパス条件式と第2のパス条件式の否定との充足可能性を特定するとともに、第1のパス条件式の否定と第2の条件式との充足可能性を特定する。2つの充足可能性の特定については、具体的には、図11にて説明する。   When the path relevance determining unit 903 determines that the second path is related to the first path, the specifying unit 905 specifies the satisfiability of the first path conditional expression and the negation of the second path conditional expression. At the same time, the satisfaction of the negation of the first pass conditional expression and the second conditional expression is specified. The specification of the two satisfiability possibilities will be specifically described with reference to FIG.

また、特定部905は、関連情報が示す第1の実行結果に含まれる各パスに対応するパス条件式と関連情報が示す第2の実行結果に含まれる各パスに対応するパス条件式の否定との充足可能性を関連情報ごとに特定する。さらに、特定部905は、関連情報が示す第1の実行結果に含まれる各パスに対応するパス条件式の否定と関連情報が示す第1の実行結果に含まれる各パスに対応する条件式との充足可能性を関連情報ごとに特定してもよい。なお、特定結果は、RAM203、ディスク205などの記憶領域に記憶される。   Further, the specifying unit 905 negates a path conditional expression corresponding to each path included in the first execution result indicated by the related information and a path conditional expression corresponding to each path included in the second execution result indicated by the related information. For each piece of related information. Further, the specifying unit 905 negates the path conditional expression corresponding to each path included in the first execution result indicated by the related information and the conditional expression corresponding to each path included in the first execution result indicated by the related information; May be specified for each related information. The identification result is stored in a storage area such as the RAM 203 and the disk 205.

数式判定部906は、第1取得部901によって取得された第1のパス出力数式と、第2取得部902によって取得された第2のパス出力数式とが一致するか否かを判定する。具体的な判定の方法としては、図13〜図16にて後述する。また、数式判定部906は、関連情報作成部904によって作成された関連情報が示す第1のパス出力数式と第2のパス出力数式とが一致するか否かを判定してもよい。   The formula determination unit 906 determines whether or not the first path output formula acquired by the first acquisition unit 901 matches the second path output formula acquired by the second acquisition unit 902. A specific determination method will be described later with reference to FIGS. The mathematical expression determination unit 906 may determine whether or not the first path output mathematical expression and the second path output mathematical expression indicated by the related information created by the related information creation unit 904 match.

また、数式判定部906は、第1のシンボリック実行結果に含まれる各パスと第2のパスとの組合せの組ごとに、第1のシンボリック実行結果に含まれるパス出力数式と、第2のパス出力数式とが一致するか否かを判定してもよい。   In addition, the mathematical expression determination unit 906, for each combination of each path and second path included in the first symbolic execution result, the path output mathematical expression included in the first symbolic execution result and the second path It may be determined whether or not the output formula matches.

また、数式判定部906は、第1のシンボリック実行結果に含まれるパス出力数式と、取得した第2のシンボリック実行結果に含まれるパス出力数式とが一致するか否かを判定してもよい。数式判定部906は、第1のシンボリック実行結果に含まれる各パスと第2のシンボリック実行結果に含まれる各パスとの組合せの組ごとに一致するか否かを判定する。なお、判定結果は、RAM203、ディスク205などの記憶領域に記憶される。   Further, the mathematical expression determination unit 906 may determine whether or not the path output mathematical expression included in the first symbolic execution result matches the path output mathematical expression included in the acquired second symbolic execution result. The mathematical expression determination unit 906 determines whether each combination included in each path included in the first symbolic execution result matches each combination included in the second symbolic execution result. Note that the determination result is stored in a storage area such as the RAM 203 or the disk 205.

生成判定部907は、パス関連判断部903による判断結果と数式判定部906による判定結果とに基づいて、第2のパスの動作をテストするテストケースを生成すべきか否かを判定する。また、生成判定部907は、特定部905による特定結果と数式判定部906による判定結果とに基づいて、第2のパスの動作をテストするテストケースを生成すべきか否かを判定してもよい。具体的な判定方法は、図18にて後述する。   The generation determination unit 907 determines whether or not to generate a test case for testing the operation of the second path, based on the determination result by the path relation determination unit 903 and the determination result by the mathematical expression determination unit 906. Further, the generation determination unit 907 may determine whether or not to generate a test case for testing the operation of the second pass, based on the identification result by the identification unit 905 and the determination result by the mathematical expression determination unit 906. . A specific determination method will be described later with reference to FIG.

また、生成判定部907は、次に示す条件を満たす場合、第2のパスの動作をテストするテストケースを生成すべきであると判定してもよい。次に示す条件とは、特定部905が第1のパス条件式の否定と第2のパス条件式とが充足可能であると特定し、かつ、数式判定部906による判定結果が第1のパス出力数式と第2のパス出力数式とが一致することを示す場合である。   The generation determination unit 907 may determine that a test case for testing the operation of the second pass should be generated when the following condition is satisfied. The following condition is that the specifying unit 905 specifies that the negation of the first pass conditional expression and the second pass conditional expression can be satisfied, and the determination result by the formula determining unit 906 is the first pass. This is a case where the output formula and the second path output formula match.

また、生成判定部907は、次の情報に基づいて、第2のパスの動作をテストするテストケースを生成すべきか否かを判定してもよい。次の情報とは、関連情報作成部904によって作成された関連情報と、数式判定部906による第1の実行結果に含まれるパスと第2のパスとの組ごとの判定結果とである。   The generation determination unit 907 may determine whether or not to generate a test case for testing the operation of the second pass based on the following information. The next information is the related information created by the related information creating unit 904 and the determination result for each pair of the path and the second path included in the first execution result by the mathematical expression determination unit 906.

また、生成判定部907は、次に示す情報に基づいて、第2のシンボリック実行結果に含まれる各パスの動作をテストするテストケースを生成すべきか否かを判定してもよい。次に示す情報は、関連情報作成部904によって作成された関連情報と、数式判定部906による第1のシンボリック実行結果に含まれるパスと第2のシンボリック実行結果に含まれるパスとの組ごとの判定結果とになる。   Further, the generation determination unit 907 may determine whether to generate a test case for testing the operation of each path included in the second symbolic execution result based on the following information. The following information is provided for each set of the related information created by the related information creation unit 904, the path included in the first symbolic execution result by the formula determination unit 906, and the path included in the second symbolic execution result. It becomes a judgment result.

また、生成判定部907は、次に示す情報に基づいて、第2のシンボリック実行結果に含まれる各パスの動作をテストするテストケースを生成すべきか否かを判定してもよい。次に示す情報は、特定部905による関連情報ごとの特定結果と、数式判定部906による第1のシンボリック実行結果に含まれるパスと第2の実行結果に含まれる各パスとの組ごとの判定結果とになる。なお、判定結果は、RAM203、ディスク205などの記憶領域に記憶される。   Further, the generation determination unit 907 may determine whether to generate a test case for testing the operation of each path included in the second symbolic execution result based on the following information. The following information is determined for each set of the identification result for each piece of related information by the identification unit 905 and the path included in the first symbolic execution result by the formula determination unit 906 and each path included in the second execution result. Result. Note that the determination result is stored in a storage area such as the RAM 203 or the disk 205.

算出部908は、生成判定部907によって第2のパスの動作をテストするテストケースを生成すべきであると判定された場合、第2のパス条件式を真とする入力変数の値を算出する。具体的な算出例は、図20にて後述する。   When the generation determination unit 907 determines that the test case for testing the operation of the second path should be generated, the calculation unit 908 calculates the value of the input variable that makes the second path conditional expression true. . A specific calculation example will be described later with reference to FIG.

また、算出部908は、生成判定部907によって第2のパスの動作をテストするテストケースを生成すべきであると判定された場合、第1のパス条件式の否定と第2のパス条件式との論理積を真とする値を算出してもよい。なお、算出した値は、RAM203、ディスク205などの記憶領域に記憶される。   In addition, when the generation determination unit 907 determines that the test case for testing the operation of the second pass should be generated, the calculation unit 908 negates the first pass conditional expression and the second pass conditional expression. You may calculate the value which makes the logical product and true. The calculated value is stored in a storage area such as the RAM 203 and the disk 205.

テストケース生成部909は、算出部908によって算出された値を入力変数の値とする第2のパスの動作をテストするテストケースを生成する。なお、生成したテストケースは、RAM203、ディスク205などの記憶領域に記憶されてもよいし、ディスプレイ207に表示されてもよいし、通信インターフェース206を経由して外部装置へ送信されてもよい。   The test case generation unit 909 generates a test case that tests the operation of the second pass using the value calculated by the calculation unit 908 as the value of the input variable. The generated test case may be stored in a storage area such as the RAM 203 and the disk 205, displayed on the display 207, or transmitted to an external device via the communication interface 206.

図10は、実施の形態1における変更前後のパスを関連付けた結果の一例を示す説明図である。テストケース生成装置100は、シンボリック実行結果701と、シンボリック実行結果801と、を受け付けて、パス関連付け結果1001を出力する。具体的に、テストケース生成装置100は、変更前後プログラムのパス条件式を、それぞれ、PrePC、PostPCとすると、下記条件式(1)を作成し、条件式(1)の充足可能性を判定する。   FIG. 10 is an explanatory diagram illustrating an example of a result of associating paths before and after the change in the first embodiment. The test case generation device 100 receives the symbolic execution result 701 and the symbolic execution result 801 and outputs a path association result 1001. Specifically, the test case generation apparatus 100 creates the following conditional expression (1) and determines the satisfaction of the conditional expression (1) when the path conditional expressions of the pre-change and post-change programs are PrePC and PostPC, respectively. .

PrePC∧PostPC …(1)   PrePC ∧ PostPC (1)

テストケース生成装置100は、Pre1PC〜Pre3PCと、Post1PC〜Post4PCとの全ての組合せに対して、条件式(1)の充足可能性を判定する。そして、テストケース生成装置100は、充足可能となったパスの組合せを関連付ける。   The test case generation device 100 determines the satisfaction of the conditional expression (1) for all combinations of Pre1PC to Pre3PC and Post1PC to Post4PC. Then, the test case generation device 100 associates a combination of paths that can be satisfied.

条件式の充足可能性の判定は、たとえばSMT(Satisfiability Modulo Theory)ソルバやSAT(SATisfiability)ソルバなどの制約ソルバが利用される。   For example, a constraint solver such as an SMT (Satisfiability Modulus Theory) solver or an SAT (SAT is a fidelity) solver is used to determine whether the conditional expression is satisfiable.

図10の例では、Pre2PCとPost1PC、Pre2PCとPost2PC、Pre2PCとPost3PC、Pre2PCとPost4PC、という4つの組合せについての条件式(1)の充足可能性を図示する。Pre2PC∧Post1PCは、10≦x<20となるxによって真となるため、条件式(1)が充足可能である。Pre2PC∧Post2PCは、20≦x<30となるxによって真となるため、条件式(1)が充足可能である。Pre2PC∧Post3PCは、30≦x<40となるxによって真となるため、条件式(1)が充足可能である。Pre2PC∧Post4PCは、真となるxが存在しないため、条件式(1)が充足不可能である。   In the example of FIG. 10, the satisfiability of the conditional expression (1) for four combinations of Pre2PC and Post1PC, Pre2PC and Post2PC, Pre2PC and Post3PC, Pre2PC and Post4PC is illustrated. Since Pre2PC∧Post1PC is true when x satisfies 10 ≦ x <20, conditional expression (1) can be satisfied. Since Pre2PC∧Post2PC is true when x satisfies 20 ≦ x <30, the conditional expression (1) can be satisfied. Since Pre2PC∧Post3PC is true when x satisfies 30 ≦ x <40, conditional expression (1) can be satisfied. Since Pre2PC∧Post4PC does not have true x, conditional expression (1) cannot be satisfied.

したがって、テストケース生成装置100は、条件式(1)が充足可能となった、Pre2PCとPost1PCとを関連付け、Pre2PCとPost2PCとを関連付け、Pre2PCとPost3PCとを関連付ける。以下、関連付けた組合せを含む情報を、関連情報とする。関連情報は、パス関連付け結果1001のレコード1つ分の情報である。   Therefore, the test case generation device 100 associates Pre2PC and Post1PC, which can satisfy the conditional expression (1), associates Pre2PC and Post2PC, and associates Pre2PC and Post3PC. Hereinafter, information including the associated combination is referred to as related information. The related information is information for one record of the path association result 1001.

パス関連付け結果1001は、テストケース組番号と、変更前プログラムのパスIDと、変更後プログラムのパスIDという3つのフィールドを有する。パス関連付け結果1001は、レコード1001−1〜レコード1001−6を有する。テストケース組番号フィールドには、関連付けられた組合せを一意に特定する番号が格納される。変更前プログラムのパスIDフィールドは、関連情報の変更前プログラムのパスIDが格納される。変更後プログラムのパスIDフィールドは、関連情報の変更後プログラムのパスIDが格納される。   The path association result 1001 has three fields: a test case group number, a path ID of the program before change, and a path ID of the program after change. The path association result 1001 includes records 1001-1 to 1001-6. The test case group number field stores a number that uniquely identifies the associated combination. The path ID field of the program before change stores the path ID of the program before change of the related information. The path ID field of the post-change program stores the path ID of the post-change program.

以下、関連情報の変更前プログラムのパス条件式を、“PrePC_TC”と呼称する。同様に、関連情報の変更後プログラムのパス条件式を、“PostPC_TC”と呼称する。また、関連情報の変更前プログラムのパス出力数式を、“PreR_TC”と呼称する。同様に、関連情報の変更後プログラムのパス出力数式を、“PostR_TC”と呼称する。   Hereinafter, the path conditional expression of the pre-change program for related information is referred to as “PrePC_TC”. Similarly, the path conditional expression of the program after the change of the related information is referred to as “PostPC_TC”. Further, the path output formula of the pre-change program of related information is referred to as “PreR_TC”. Similarly, the path output formula of the program after changing the related information is referred to as “PostR_TC”.

また、本実施の形態において、関連情報は、L個作成されるものとする。Lは、1以上の整数である。図10に示すパス関連付け結果1001は、L=6の場合の例を示す。   In the present embodiment, L pieces of related information are created. L is an integer of 1 or more. A path association result 1001 shown in FIG. 10 shows an example in the case of L = 6.

図11は、パス条件式変更種別の分類例を示す説明図である。テストケース生成装置100は、図10により関連付けられた関連情報のそれぞれに対して、パス条件式がどのように変更されたかを示す種別に分類する。具体的に、テストケース生成装置100は、条件式(2−1)と条件式(2−2)の充足可能性を、制約ソルバを用いて判定する。   FIG. 11 is an explanatory diagram of a classification example of the path conditional expression change type. The test case generation device 100 classifies each of the related information associated in FIG. 10 into a type indicating how the path conditional expression is changed. Specifically, the test case generation device 100 determines the satisfaction of the conditional expression (2-1) and the conditional expression (2-2) using a constraint solver.

PrePC_TC(i)∧¬PostPC_TC(i) …(2−1)
¬PrePC_TC(i)∧PostPC_TC(i) …(2−2)
PrePC_TC (i) ∧PostPC_TC (i) (2-1)
¬PrePC_TC (i) ∧PostPC_TC (i) (2-2)

ただし、“(i)”は、関連情報のi番目の組であることを示す。テストケース生成装置100は、条件式(2−1)と条件式(2−2)の充足可能性の結果に基づいて、パス条件式変更種別を4つに分類する。   However, “(i)” indicates the i-th set of related information. The test case generation device 100 classifies the path conditional expression change types into four based on the results of satisfiability of the conditional expressions (2-1) and (2-2).

1つ目の分類として、条件式(2−1)と条件式(2−2)が共に充足不可能である場合、PrePC_TC(i)を真とする入力変数が取り得る集合とPostPC_TC(i)を真とする入力変数が取り得る集合が一致することを示す。この場合、テストケース生成装置100は、パス条件式変更種別を“不変”に特定する。特定したパス条件式変更種別は、関連情報に付与される。   As a first classification, when both the conditional expression (2-1) and the conditional expression (2-2) are unsatisfiable, a set that can be taken by an input variable having PrePC_TC (i) as true and PostPC_TC (i) Indicates that the sets that can be taken by the input variable that is true match. In this case, the test case generation device 100 identifies the path conditional expression change type as “invariant”. The identified path conditional expression change type is given to the related information.

2つ目の分類として、条件式(2−1)が充足可能であり、条件式(2−2)が充足不可能である場合、PostPC_TC(i)を真とする入力変数が取り得る値の集合が、PrePC_TC(i)を真とする入力変数が取り得る値の集合に含まれることを示す。この場合、テストケース生成装置100は、パス条件式変更種別を“縮小”に特定する。特定したパス条件式変更種別は、関連情報に付与される。   As the second classification, when the conditional expression (2-1) is satisfiable and the conditional expression (2-2) is unsatisfiable, the value of the input variable that PostPC_TC (i) is true can be taken. It indicates that the set is included in the set of possible values for the input variable that is true for PrePC_TC (i). In this case, the test case generation device 100 specifies the path conditional expression change type as “reduced”. The identified path conditional expression change type is given to the related information.

3つ目の分類として、条件式(2−1)が充足不可能であり、条件式(2−2)が充足可能である場合、PostPC_TC(i)を真とする入力変数が取り得る値の集合が、PrePC_TC(i)を真とする入力変数が取り得る値の集合を含むことを示す。この場合、テストケース生成装置100は、パス条件式変更種別を“拡大”に特定する。特定したパス条件式変更種別は、関連情報に付与される。   As a third classification, when conditional expression (2-1) is unsatisfiable and conditional expression (2-2) is satisfiable, an input variable having PostPC_TC (i) as true Indicates that the set includes a set of possible values for an input variable that is true for PrePC_TC (i). In this case, the test case generation apparatus 100 specifies the path conditional expression change type as “enlarged”. The identified path conditional expression change type is given to the related information.

4つ目の分類として、条件式(2−1)と条件式(2−2)が共に充足可能である場合、PrePC_TC(i)を真とする入力変数が取り得る集合とPostPC_TC(i)を真とする入力変数が取り得る集合とが一部重なることを示す。この場合、テストケース生成装置100は、パス条件式変更種別を“重複”に特定する。特定したパス条件式変更種別は、関連情報に付与される。   As a fourth classification, when both the conditional expression (2-1) and the conditional expression (2-2) can be satisfied, a set that can be taken by an input variable having PrePC_TC (i) as true and PostPC_TC (i) Indicates that the set that can be assumed by the input variable that is true partially overlaps. In this case, the test case generation device 100 specifies the path conditional expression change type as “duplicate”. The identified path conditional expression change type is given to the related information.

図12は、実施の形態1におけるパス条件式変更種別の分類結果の一例を示す説明図である。図12では、テストケース生成装置100が、図11にて示したパス条件式変更種別の分類手順に従って、関連情報のパス条件式変更種別を分類した結果となるパス条件式変更種別結果1201を示す。   FIG. 12 is an explanatory diagram illustrating an example of the classification result of the path conditional expression change type in the first embodiment. FIG. 12 shows a path condition expression change type result 1201 that is a result of the test case generation device 100 classifying the path condition expression change type of the related information according to the classification procedure of the path condition expression change type shown in FIG. .

パス条件式変更種別結果1201は、パス関連付け結果1001が有するフィールドと、パス条件式変更種別フィールドとを有する。パス条件式変更種別フィールドには、該当の関連情報のパス条件式変更種別が格納される。図12に示すパス条件式変更種別結果1201は、レコード1201−1〜レコード1201−6を有する。たとえば、レコード1201−1は、Pre1とPost1の関連情報のパス条件式変更種別が、“拡大”であることを示す。   The path conditional expression change type result 1201 includes a field included in the path association result 1001 and a path conditional expression change type field. The path condition expression change type field stores the path condition expression change type of the relevant information. The path conditional expression change type result 1201 illustrated in FIG. 12 includes records 1201-1 to 1201-6. For example, the record 1201-1 indicates that the path conditional expression change type of the related information of Pre1 and Post1 is “enlarged”.

図13は、パス出力数式変更種別の判定ルールの一例を示す説明図である。図13では、パス出力数式変更種別の判定ルールを表1301として示す。表1301は、ルール番号と、パス出力数式変更種別判定ルールとを有する。パス出力数式変更種別判定ルールを、以下、単に、「判定ルール」と称する。表1301は、レコード1301−1〜1301−4を有する。レコード1301−1〜1301−4のそれぞれが1つの判定ルールを示す。以下、レコード1301−1〜レコード1301−4がそれぞれ示す判定ルールを、「判定ルール1」〜「判定ルール4」と呼称する。   FIG. 13 is an explanatory diagram of an example of a determination rule for the path output formula change type. In FIG. 13, the determination rule of the path output formula change type is shown as a table 1301. Table 1301 has a rule number and a path output formula change type determination rule. The path output formula change type determination rule is hereinafter simply referred to as “determination rule”. The table 1301 includes records 1301-1 to 1301-4. Each of the records 1301-1 to 1301-4 indicates one determination rule. Hereinafter, the determination rules respectively indicated by the records 1301-1 to 1301-4 are referred to as “determination rules 1” to “determination rules 4”.

テストケース生成装置100は、関連情報のPreR_TC(i)とPostR_TC(i)とが、レコード1301−1が示す判定ルール1を満たす場合、パス出力数式変更種別を“不変”と判定する。判定したパス出力数式変更種別は、関連情報に付与される。   When the related information PreR_TC (i) and PostR_TC (i) satisfy the determination rule 1 indicated by the record 1301-1, the test case generation device 100 determines that the path output formula change type is “invariant”. The determined path output formula change type is given to the related information.

一方、テストケース生成装置100は、PreR_TC(i)とPostR_TC(i)とが判定ルール1を満たさない場合、判定ルール2〜判定ルール4のいずれかを適用する。適用手順の第1の例として、テストケース生成装置100は、判定ルール2を適用して、判定ルール2による判定結果を出力する。また、適用手順の第2の例として、テストケース生成装置100は、適用手順の第1の例に従って判定ルール2を適用して、判定ルール2による判定結果が“判定不能”となった場合、判定ルール3を適用し、判定ルール3による判定結果を出力してもよい。さらに、適用手順の第3の例として、テストケース生成装置100は、適用手順の第2の例に従って、判定ルール3を適用して、判定ルール3による判定結果が“判定不能”となった場合、判定ルール4を適用し、判定ルール4による判定結果を出力してもよい。   On the other hand, when PreR_TC (i) and PostR_TC (i) do not satisfy the determination rule 1, the test case generation device 100 applies any one of the determination rule 2 to the determination rule 4. As a first example of the application procedure, the test case generation device 100 applies the determination rule 2 and outputs a determination result based on the determination rule 2. As a second example of the application procedure, the test case generation device 100 applies the determination rule 2 according to the first example of the application procedure, and the determination result by the determination rule 2 becomes “determination impossible”. The determination rule 3 may be applied, and the determination result based on the determination rule 3 may be output. Furthermore, as a third example of the application procedure, the test case generation device 100 applies the determination rule 3 according to the second example of the application procedure, and the determination result by the determination rule 3 becomes “determination impossible” The determination rule 4 may be applied, and the determination result according to the determination rule 4 may be output.

判定ルール1は、PreR_TC(i)とPostR_TC(i)とを、文字列として比較し、一致した場合、パス出力数式変更種別を“不変”と判断するルールである。文字列として比較する場合に、テストケース生成装置100は、PreR_TC(i)の文字列と、PostR_TC(i)の文字列をそのまま比較してもよいし、スペースやタブを除いて比較してもよい。   The determination rule 1 is a rule in which PreR_TC (i) and PostR_TC (i) are compared as character strings, and if they match, the path output formula change type is determined to be “invariant”. When comparing as a character string, the test case generation apparatus 100 may compare the character string of PreR_TC (i) and the character string of PostR_TC (i) as they are, or may compare them excluding spaces and tabs. Good.

判定ルール2については、図14にて説明する。判定ルール3のパス出力数式変更種別判定ルールについては、図15にて説明する。判定ルール4のパス出力数式変更種別判定ルールについては、図16にて説明する。   The determination rule 2 will be described with reference to FIG. The path output formula change type determination rule of the determination rule 3 will be described with reference to FIG. The path output formula change type determination rule of the determination rule 4 will be described with reference to FIG.

図14は、判定ルール2を適用した場合の一例を示す説明図である。判定ルール2は、下記条件式(3−1)、下記条件式(3−2)、下記条件式(3−3)の充足可能性を判定した結果を用いて、パス出力数式変更種別を判定するルールである。   FIG. 14 is an explanatory diagram showing an example when the determination rule 2 is applied. The determination rule 2 determines the path output expression change type using the result of determining the satisfaction of the following conditional expression (3-1), the following conditional expression (3-2), and the following conditional expression (3-3). It is a rule to do.

(R=PreR_TC(i))∧(R=PostR_TC(i)) …(3−1)
¬(R=PreR_TC(i))∧(R=PostR_TC(i)) …(3−2)
(R=PreR_TC(i))∧¬(R=PostR_TC(i)) …(3−3)
(R = PreR_TC (i)) ∧ (R = PostR_TC (i)) (3-1)
¬ (R = PreR_TC (i)) ∧ (R = PostR_TC (i)) (3-2)
(R = PreR_TC (i)) ∧¬ (R = PostR_TC (i)) (3-3)

具体的に、判定ルール2を適用した場合、テストケース生成装置100は、条件式(3−1)、条件式(3−2)、条件式(3−3)の順に、充足可能、充足不可能、充足不可能となる場合、パス出力数式変更種別を“不変”と判定する。また、条件式(3−1)、条件式(3−2)、条件式(3−3)の順に、充足可能、充足不可能、充足不可能の順とならない場合、テストケース生成装置100は、パス出力数式変更種別を“変更”と判定する。さらに、制約ソルバが充足可能性を判定できない場合、テストケース生成装置100は、パス出力数式変更種別を“判定不能”と判定する。判定したパス出力数式変更種別は、関連情報に付与される。   Specifically, when the determination rule 2 is applied, the test case generation device 100 can satisfy or fail in the order of the conditional expression (3-1), the conditional expression (3-2), and the conditional expression (3-3). If possible and unsatisfactory, the path output formula change type is determined to be “invariant”. In addition, when the conditional expression (3-1), the conditional expression (3-2), and the conditional expression (3-3) are not in the order of satisfiable, unsatisfiable, and unsatisfiable, the test case generation device 100 The path output formula change type is determined as “change”. Furthermore, when the constraint solver cannot determine the satisfiability, the test case generation device 100 determines that the path output formula change type is “determination impossible”. The determined path output formula change type is given to the related information.

表1401は、判定ルール2を適用しようとする関連情報TC1〜TC3について表示する。表1401は、レコード1401−1〜レコード1401−3を有する。関連情報TC1〜TC3に対して、判定ルール2を適用した際の判定結果が表1402である。表1402は、レコード1402−1〜レコード1402−3を有する。たとえば、レコード1402−1は、条件式(3−1)、条件式(3−2)、条件式(3−3)の順に、充足可能、充足不可能、充足不可能となったため、判定結果が“不変”であると判定されたことを示す。   The table 1401 displays related information TC1 to TC3 to which the determination rule 2 is to be applied. The table 1401 includes records 1401-1 to 1401-3. Table 1402 shows the determination results when the determination rule 2 is applied to the related information TC1 to TC3. The table 1402 includes records 1402-1 to 1402-3. For example, the record 1402-1 is satisfiable, unsatisfiable, and unsatisfiable in order of the conditional expression (3-1), the conditional expression (3-2), and the conditional expression (3-3). Is determined to be “invariant”.

また、レコード1402−2とレコード1402−3は、制約ソルバが、条件式(3−1)、条件式(3−2)、条件式(3−3)の充足可能性を判定不能であったため、判断結果が“判定不能”であると判定されたことを示す。なお、制約ソルバが判定不能となる場合として、たとえば、条件式に、非線形の関数が含まれる場合である。   In addition, in record 1402-2 and record 1402-3, the constraint solver was unable to determine the satisfiability of conditional expression (3-1), conditional expression (3-2), and conditional expression (3-3). , Indicating that the determination result is determined to be “determination impossible”. The case where the constraint solver cannot be determined is, for example, a case where a nonlinear function is included in the conditional expression.

図15は、判定ルール3を適用した場合の一例を示す説明図である。判定ルール3は、交換法則、分配法則などを利用してパス出力数式変更種別を判定するルールである。具体的に、判定ルール3を適用した場合、テストケース生成装置100は、PreR_TC(i)とPostR_TC(i)を展開し、変数のアルファベット順に並べた式とした後、文字列として比較し、一致した場合、パス出力数式変更種別を“不変”と判定する。一方、一致しない場合、テストケース生成装置100は、パス出力数式変更種別を“変更”と判定する。また、交換法則、分配法則などが利用できない場合、テストケース生成装置100は、パス出力数式変更種別を“判定不能”と判定する。また、交換法則と分配法則以外として、テストケース生成装置100は、結合法則を利用してもよい。   FIG. 15 is an explanatory diagram illustrating an example when the determination rule 3 is applied. The determination rule 3 is a rule for determining a path output formula change type using an exchange law, a distribution law, or the like. Specifically, when the determination rule 3 is applied, the test case generation device 100 expands PreR_TC (i) and PostR_TC (i), forms an expression in alphabetical order of variables, compares them as character strings, and matches them. In this case, the path output formula change type is determined to be “invariant”. On the other hand, if they do not match, the test case generation device 100 determines that the path output formula change type is “change”. When the exchange law, the distribution law, or the like cannot be used, the test case generation apparatus 100 determines that the path output formula change type is “determination impossible”. In addition to the exchange law and the distribution law, the test case generation apparatus 100 may use a combination law.

表1401は、判定ルール3を適用しようとする関連情報TC1〜TC3について表示する。関連情報TC1〜TC3に対して、判定ルール3を適用した際の判定結果が表1501である。表1501は、レコード1501−1〜レコード1501−3を有する。   A table 1401 displays related information TC1 to TC3 to which the determination rule 3 is to be applied. Table 1501 shows the determination results when the determination rule 3 is applied to the related information TC1 to TC3. The table 1501 includes records 1501-1 to 1501-3.

たとえば、レコード1501−1は、交換法則をPreR_TCとPostR_TCとに適用した結果の文字列が共に“x+2*y”となり、パス出力数式変更種別が“不変”であると判定されたことを示す。また、レコード1501−2は、分配法則と交換法則とをPreR_TCとPostR_TCとに適用した結果の文字列が共に“f(x)*z(x,y)+g(y)*z(x,y)”となり、パス出力数式変更種別が“不変”であると判定されたことを示す。一方、レコード1501−3は、分配法則と交換法則とがPreR_TCとPostR_TCとに適用できず、パス出力数式変更種別が“判定不能”であると判定されたことを示す。   For example, the record 1501-1 indicates that the character strings resulting from applying the exchange rule to PreR_TC and PostR_TC are both “x + 2 * y” and the path output formula change type is determined to be “invariant”. In the record 1501-2, a character string resulting from applying the distribution law and the exchange law to PreR_TC and PostR_TC is “f (x) * z (x, y) + g (y) * z (x, y ) ”, Indicating that the path output formula change type is determined to be“ invariant ”. On the other hand, the record 1501-3 indicates that the distribution law and the exchange law cannot be applied to PreR_TC and PostR_TC, and it is determined that the path output formula change type is “undecidable”.

図16は、判定ルール4を適用した場合の一例を示す説明図である。判定ルール4は、パス条件式が真となる入力値を用いて、パス出力数式変更種別を判定するルールである。具体的に、判定ルール4を適用した場合、テストケース生成装置100は、PrePC_TC(i)と、PostPC_TC(i)とが真となる入力値を指定数個生成する。図16の例では、指定数を、2とする。そして、テストケース生成装置100は、生成した入力値全てに対して、PreR_TC(i)の値と、PostR_TC(i)の値とが一致した場合、パス出力数式変更種別を“不変”と判定する。また、一致しない場合、テストケース生成装置100は、パス出力数式変更種別を“変更”と判定する。   FIG. 16 is an explanatory diagram illustrating an example when the determination rule 4 is applied. The determination rule 4 is a rule for determining a path output formula change type using an input value for which the path conditional expression is true. Specifically, when the determination rule 4 is applied, the test case generation device 100 generates a specified number of input values for which PrePC_TC (i) and PostPC_TC (i) are true. In the example of FIG. 16, the designated number is 2. The test case generation apparatus 100 determines that the path output formula change type is “invariant” when the value of PreR_TC (i) matches the value of PostR_TC (i) for all the generated input values. . If they do not match, the test case generation device 100 determines that the path output formula change type is “change”.

表1601は、判定ルール4を適用しようとする関連情報TC3、TC4について表示する。表1601は、レコード1601−1、レコード1601−2を有する。関連情報TC3、TC4に対して、判定ルール4を適用した際の判定結果が表1602である。表1602は、レコード1602−1、レコード1602−2を有する。   A table 1601 displays related information TC3 and TC4 to which the determination rule 4 is to be applied. The table 1601 has a record 1601-1 and a record 1601-2. Table 1602 shows determination results when the determination rule 4 is applied to the related information TC3 and TC4. The table 1602 includes a record 1602-1 and a record 1602-2.

たとえば、レコード1602−1は、PreR_TCとPostR_TCのそれぞれに入力値x=X1、y=Y1を入力した結果が一致し、入力値x=X2、y=Y2を入力した結果が一致して、判定結果が“不変”であると判定されたことを示す。また、レコード1602−2は、PreR_TCとPostR_TCのそれぞれに入力値x=X3、y=Y3を入力した結果が一致しないため、判定結果が“変更”であると判定されたことを示す。   For example, in the record 1602-1, the result of inputting the input values x = X1 and y = Y1 to PreR_TC and PostR_TC respectively matches, and the result of inputting the input values x = X2 and y = Y2 matches. Indicates that the result is determined to be “invariant”. The record 1602-2 indicates that the determination result is determined to be “change” because the input values x = X3 and y = Y3 do not match with each of PreR_TC and PostR_TC.

図17は、パス出力数式変更判定の分類結果の一例を示す説明図である。図17では、テストケース生成装置100が、図13〜図16にて示したパス出力数式変更種別の分類手順に従って、関連情報のパス出力数式変更種別を分類した結果となるパス出力数式変更種別結果1701を示す。   FIG. 17 is an explanatory diagram illustrating an example of the classification result of the path output formula change determination. In FIG. 17, the test case generation apparatus 100 performs a path output formula change type result that is a result of classifying the path output formula change type of the related information according to the classification procedure of the path output formula change type shown in FIGS. 1701 is shown.

パス出力数式変更種別結果1701は、パス関連付け結果1001が有するフィールドと、パス出力数式変更種別フィールドとを有する。パス出力数式変更種別フィールドには、該当の関連情報のパス出力数式変更種別が格納される。図17に示すパス出力数式変更種別結果1701は、レコード1701−1〜レコード1701−6を有する。たとえば、レコード1701−1は、Pre1とPost1の関連情報のパス出力数式変更種別が、“不変”であることを示す。   The path output formula change type result 1701 includes a field included in the path association result 1001 and a path output formula change type field. The path output formula change type field of the relevant information is stored in the path output formula change type field. The path output formula change type result 1701 illustrated in FIG. 17 includes records 1701-1 to 1701-6. For example, the record 1701-1 indicates that the path output formula change type of the related information between Pre1 and Post1 is “invariant”.

図18は、テストケース分類ルールの一例を示す説明図である。図18に示すテストケース分類ルールテーブル1801は、パス条件式変更種別とパス出力数式変更種別とに応じて、テストケース種別の分類ルールを示す。テストケース種別は、テストケースを生成すべきか否かを示す。さらに、テストケース種別は、テストケースを生成すべき際に新たな機能に対するテストケースである可能性があるか否かを示す。テストケース分類ルールを、以下、単に、「分類ルール」と呼称する。テストケース分類ルールテーブル1801は、レコード1801−1〜レコード1801−13を有する。   FIG. 18 is an explanatory diagram of an example of the test case classification rule. A test case classification rule table 1801 shown in FIG. 18 shows test rule classification rules according to the path condition formula change type and the path output formula change type. The test case type indicates whether or not a test case should be generated. Furthermore, the test case type indicates whether or not there is a possibility of a test case for a new function when a test case is to be generated. Hereinafter, the test case classification rule is simply referred to as “classification rule”. The test case classification rule table 1801 includes records 1801-1 to 1801-13.

テストケース分類ルールテーブル1801は、分類ルール、パス条件式変更種別、パス出力数式変更種別、テストケースパス条件式、テストケース種別という5つのフィールドを含む。分類ルールフィールドには、分類ルールを識別する番号が格納される。以下、レコード1801−1〜レコード1801−13がそれぞれ示す分類ルールを、「分類ルール1」〜「分類ルール9」と呼称する。   The test case classification rule table 1801 includes five fields: classification rule, path condition expression change type, path output formula change type, test case path condition expression, and test case type. In the classification rule field, a number for identifying the classification rule is stored. Hereinafter, the classification rules indicated by the records 1801-1 to 1801-13 are referred to as “classification rule 1” to “classification rule 9”, respectively.

パス条件式変更種別フィールドには、該当の分類ルールが適用される条件の1つとなるパス条件式変更種別が格納される。パス出力数式変更種別フィールドには、該当の分類ルールが適用される条件の1つとなるパス出力数式変更種別が格納される。テストケースパス条件式フィールドには、該当の分類ルールが適用された場合のテストケースの入力値が満たす条件式が格納される。テストケース種別フィールドには、該当の分類ルールが適用された場合のテストケースの変更要否種別が格納される。テストケース種別は、“不変”と、“回帰”と、“変更”と、“追加”と、“確認”がある。   The path condition expression change type field stores a path condition expression change type that is one of the conditions to which the corresponding classification rule is applied. The path output formula change type field stores a path output formula change type that is one of the conditions to which the corresponding classification rule is applied. The test case path conditional expression field stores a conditional expression that satisfies the input value of the test case when the corresponding classification rule is applied. The test case type field stores the type of necessity of changing the test case when the corresponding classification rule is applied. Test case types include “invariant”, “regression”, “change”, “add”, and “confirm”.

“不変”と“回帰”とは、変更後プログラムPostPrgのパスの機能が、変更前プログラムPrePrgのパスの機能から変更されておらず、変更前プログラムPrePrgのパスをテストするテストケースを生成しなくてよいことを示す。また、“回帰”は、変更後プログラムPostPrgのパス条件式が、変更前プログラムPrePrgのパス条件式から変更されており、該当のテストケースが、変更後プログラムPostPrgの動作を確認するテストケースとして実行された方がよいことも示す。   “Invariant” and “Regression” means that the path function of the post-change program PostPrg is not changed from the path function of the pre-change program PrePrg, and does not generate a test case for testing the path of the pre-change program PrePrg. Indicates that it is okay. “Regression” is executed as a test case in which the path condition formula of the post-change program PostPrg is changed from the path condition formula of the pre-change program PrePrg, and the corresponding test case confirms the operation of the post-change program PostPrg. It also shows that it is better to be done.

“変更”と“追加”とは、変更後プログラムPostPrgのパスの機能が、変更前プログラムPrePrgのパスの機能から変更されており、変更後プログラムPostPrgのパスをテストするテストケースを生成すべきであることを示す。さらに、“追加”は、変更後プログラムPostPrgのパスの機能が新しい機能である可能性も示す。   “Change” and “add” means that the path function of the post-change program PostPrg is changed from the path function of the pre-change program PrePrg, and a test case for testing the path of the post-change program PostPrg should be generated. It shows that there is. Furthermore, “add” indicates that the path function of the post-change program PostPrg may be a new function.

“確認”は、変更後プログラムPostPrgのパスの機能が、変更前プログラムPrePrgのパスの機能から変更されたか否かを判断できず、変更後プログラムPostPrgのパスをテストするテストケースを生成すべきか否か判断できないことを示す。テストケース生成装置100の利用者は、テストケース種別が“確認”となったテストケースに対して、たとえば、該当のパスの処理内容の確認を行う。   “Confirmation” cannot determine whether or not the path function of the post-change program PostPrg has been changed from the pre-change program PrePrg path function, and whether or not to generate a test case for testing the post-change program PostPrg path Indicates that it cannot be determined. The user of the test case generation apparatus 100 confirms, for example, the processing contents of the corresponding path for the test case whose test case type is “confirmed”.

レコード1801−1は、パス条件式変更種別が“不変”であり、パス出力数式変更種別が“不変”である関連情報についての分類ルールである分類ルール1について示す。分類ルール1の条件が満たされた関連情報は、テストケース種別が“不変”となり、テストケースパス条件式がPostPC_TCとなることを示す。   A record 1801-1 indicates a classification rule 1 that is a classification rule for related information whose path conditional expression change type is “invariant” and whose path output expression change type is “invariant”. The related information that satisfies the condition of the classification rule 1 indicates that the test case type is “invariant” and the test case path conditional expression is PostPC_TC.

レコード1801−2は、パス条件式変更種別が“不変”であり、パス出力数式変更種別が“変更”である関連情報についての分類ルールである分類ルール2について示す。分類ルール2の条件が満たされた関連情報は、テストケース種別が“変更”となり、テストケースパス条件式がPostPC_TCとなることを示す。   A record 1801-2 indicates a classification rule 2 that is a classification rule for related information whose path conditional expression change type is “invariable” and whose path output expression change type is “change”. The related information that satisfies the condition of the classification rule 2 indicates that the test case type is “changed” and the test case path conditional expression is PostPC_TC.

レコード1801−3は、パス条件式変更種別が“縮小”であり、パス出力数式変更種別が“不変”である関連情報についての分類ルールである分類ルール3について示す。分類ルール3の条件が満たされた関連情報は、テストケース種別が“回帰”となり、テストケースパス条件式がPostPC_TCとなることを示す。   A record 1801-3 indicates a classification rule 3 that is a classification rule for related information in which the path conditional expression change type is “reduced” and the path output formula change type is “invariant”. The related information that satisfies the condition of the classification rule 3 indicates that the test case type is “regression” and the test case path conditional expression is PostPC_TC.

レコード1801−4は、パス条件式変更種別が“縮小”であり、パス出力数式変更種別が“変更”である関連情報についての分類ルールである分類ルール4について示す。分類ルール4の条件が満たされた関連情報は、テストケース種別が“追加”となり、テストケースパス条件式がPostPC_TCとなることを示す。テストケース種別を“追加”とする根拠として、パス条件式変更種別が“縮小”であり、機能が変更しているということは、新しい機能を提供するために、パス条件式を細分化して、新しい機能となるソースコードを記述した可能性が高いからである。   A record 1801-4 indicates a classification rule 4 that is a classification rule for related information whose path condition formula change type is “reduction” and whose path output formula change type is “change”. The related information that satisfies the condition of the classification rule 4 indicates that the test case type is “addition” and the test case path conditional expression is PostPC_TC. As the basis for the test case type as “add”, the path condition expression change type is “reduction” and the function is changed. In order to provide a new function, the path condition expression is subdivided. This is because there is a high possibility that the source code that will be a new function is described.

レコード1801−5とレコード1801−6とは、パス条件式変更種別が“拡大”であり、パス出力数式変更種別が“不変”である関連情報についての分類ルールである分類ルール5について示す。分類ルール5の条件が満たされた関連情報は、テストケースパス条件式に応じて2つに分割することになる。分類ルール5の条件が満たされた関連情報のうちのテストケースパス条件式PrePC_TC∧PostPC_TCを満たす関連情報のテストケース種別は、“回帰”となることを示す。   Records 1801-5 and 1801-6 indicate classification rule 5, which is a classification rule for related information in which the path conditional expression change type is “expanded” and the path output formula change type is “invariant”. The related information that satisfies the condition of the classification rule 5 is divided into two according to the test case path conditional expression. It shows that the test case type of the related information satisfying the test case path conditional expression PrePC_TC_PostPC_TC among the related information satisfying the condition of the classification rule 5 is “regression”.

一方、分類ルール5の条件が満たされた関連情報のうちのテストケースパス条件式¬PrePC_TC∧PostPC_TCを満たす関連情報のテストケース種別は、“追加”となる。テストケース種別を“追加”とする根拠として、パス条件式変更種別が“拡大”であるということは、新しい入力値に対応するために、パス条件式を拡大した可能性が高いからである。   On the other hand, the test case type of the related information satisfying the test case path conditional expression ¬ PrePC_TC∧PostPC_TC among the related information satisfying the condition of the classification rule 5 is “added”. The reason that the path condition formula change type is “expanded” as the basis for “adding” the test case type is that there is a high possibility that the path condition formula has been expanded in order to correspond to a new input value.

レコード1801−7とレコード1801−8とは、パス条件式変更種別が“拡大”であり、パス出力数式変更種別が“変更”である関連情報についての分類ルールである分類ルール6について示す。分類ルール6の条件が満たされた関連情報は、テストケースパス条件式に応じて2つに分割することになる。分類ルール6の条件が満たされた関連情報のうちのテストケースパス条件式prePC_TC∧PostPC_TCを満たす関連情報のテストケース種別は、“変更”となる。一方、分類ルール6の条件が満たされた関連情報のうちのテストケースパス条件式¬PrePC_TC∧PostPC_TCを満たす関連情報のテストケース種別は、“変更”となる。   Records 1801-7 and 1801-8 indicate the classification rule 6 that is a classification rule for related information whose path condition formula change type is “enlarged” and whose path output formula change type is “change”. The related information satisfying the condition of the classification rule 6 is divided into two according to the test case path conditional expression. The test case type of the related information satisfying the test case path conditional expression prePC_TC∧PostPC_TC among the related information satisfying the condition of the classification rule 6 is “change”. On the other hand, the test case type of the related information satisfying the test case path conditional expression ¬PrePC_TC∧PostPC_TC among the related information satisfying the condition of the classification rule 6 is “change”.

レコード1801−9とレコード1801−10とは、パス条件式変更種別が“重複”であり、パス出力数式変更種別が“不変”である関連情報についての分類ルールである分類ルール7について示す。分類ルール7の条件が満たされた関連情報は、テストケースパス条件式に応じて2つに分割することになる。分類ルール7の条件が満たされた関連情報のうちのテストケースパス条件式prePC_TC∧PostPC_TCを満たす関連情報のテストケース種別は、“回帰”となることを示す。   Records 1801-9 and 1801-10 show classification rule 7 which is a classification rule for related information whose path condition formula change type is “duplicate” and whose path output formula change type is “invariant”. The related information satisfying the condition of the classification rule 7 is divided into two according to the test case path conditional expression. Of the related information that satisfies the condition of the classification rule 7, the test case type of the related information that satisfies the test case path conditional expression prePC_TC∧PostPC_TC indicates “regression”.

一方、分類ルール7の条件が満たされた関連情報のうちのテストケースパス条件式¬PrePC_TC∧PostPC_TCを満たす関連情報のテストケース種別は、“追加”となる。テストケース種別を“追加”とする根拠として、パス条件式変更種別が“重複”であるということは、パス条件式を縮小した箇所と拡大した箇所があることになり、新しい入力値に対応するために、パス条件式を拡大した可能性が高いからである。   On the other hand, the test case type of the related information satisfying the test case path conditional expression ¬ PrePC_TC∧PostPC_TC among the related information satisfying the condition of the classification rule 7 is “added”. The reason for changing the test condition type to “add” is that the path condition formula change type is “duplicate”, which means that the path condition formula is reduced and expanded, and it corresponds to the new input value. Therefore, there is a high possibility that the path conditional expression is expanded.

レコード1801−11とレコード1801−12とは、パス条件式変更種別が“重複”であり、パス出力数式変更種別が“変更”である関連情報についての分類ルールである分類ルール8について示す。分類ルール8の条件が満たされた関連情報は、テストケースパス条件式に応じて2つに分割することになる。分類ルール8の条件が満たされた関連情報のうちのテストケースパス条件式prePC_TC∧PostPC_TCを満たす関連情報のテストケース種別は、“変更”となる。一方、分類ルール8の条件が満たされた関連情報のうちのテストケースパス条件式¬prePC_TC∧PostPC_TCを満たす関連情報のテストケース種別は、“変更”となる。   A record 1801-11 and a record 1801-12 indicate a classification rule 8 that is a classification rule for related information whose path condition formula change type is “duplicate” and whose path output formula change type is “change”. The related information that satisfies the condition of the classification rule 8 is divided into two according to the test case path conditional expression. The test case type of the related information satisfying the test case path conditional expression prePC_TC∧PostPC_TC among the related information satisfying the condition of the classification rule 8 is “change”. On the other hand, the test case type of the related information satisfying the test case path conditional expression ¬prePC_TC∧PostPC_TC among the related information satisfying the condition of the classification rule 8 is “change”.

レコード1801−13は、パス出力数式変更種別が“判定不能”である関連情報についての分類ルールである分類ルール9について示す。分類ルール9の条件が満たされた関連情報は、テストケース種別が“確認”となり、テストケースパス条件式がPostPC_TCとなることを示す。   A record 1801-13 indicates a classification rule 9 that is a classification rule for related information whose path output formula change type is “undecidable”. The related information that satisfies the condition of the classification rule 9 indicates that the test case type is “confirmed” and the test case path conditional expression is PostPC_TC.

図19は、テストケース分類結果の一例を示す説明図である。図19では、図18にて示したテストケース分類ルールに従って、テストケース生成要否を分類した結果となる結果を示す。   FIG. 19 is an explanatory diagram illustrating an example of a test case classification result. FIG. 19 shows a result obtained by classifying the necessity of test case generation according to the test case classification rule shown in FIG.

図19に示す表1901は、パス条件式変更種別結果1201が有するフィールドと、パス出力数式変更種別フィールドとを有する。テストケース生成装置100は、表1901から、テストケース生成要否分類結果1902を出力する。テストケース生成要否分類結果1902は、レコード1902−1〜レコード1902−10を有する。たとえば、レコード1902−1は、Pre1とPost1の関連情報のテストケースパス条件式が、PrePC_TC∧PostPC_TCであり、テストケース種別が“回帰”であることを示す。   A table 1901 illustrated in FIG. 19 includes a field included in the path conditional expression change type result 1201 and a path output formula change type field. The test case generation device 100 outputs a test case generation necessity classification result 1902 from the table 1901. The test case generation necessity classification result 1902 includes records 1902-1 to 1902-10. For example, the record 1902-1 indicates that the test case path conditional expression of the related information between Pre1 and Post1 is PrePC_TC∧PostPC_TC, and the test case type is “regression”.

図20は、変更後プログラムのテストケースの入力値生成の一例を示す説明図である。図20では、図19にて得たテストケース生成要否分類結果1902から、変更後プログラムPostPrgのテストケースの入力値を生成する例を示す。具体的に、図20では、テストケース生成要否分類結果1902のうちの、利用者が指定したテストケース種別が“追加”となったレコード1902−2とレコード1902−6とについてのテストケースの入力値を生成する。   FIG. 20 is an explanatory diagram illustrating an example of generating an input value of a test case of the changed program. FIG. 20 shows an example of generating test case input values of the post-change program PostPrg from the test case generation necessity classification result 1902 obtained in FIG. Specifically, in FIG. 20, of the test case generation necessity classification result 1902, the test case of the record 1902-2 and the record 1902-6 in which the test case type designated by the user is “added”. Generate input values.

テストケース生成装置100は、テストケースパス条件式を満たす値を、制約ソルバを利用して算出する。算出した結果を、表2001として示す。表2001は、レコード2001−1とレコード2001−2を有する。   The test case generation device 100 calculates a value satisfying the test case path conditional expression using a constraint solver. The calculated results are shown in Table 2001. The table 2001 includes a record 2001-1 and a record 2001-2.

表2001は、テストケース組番号と、テストケース種別と、テストケースパス条件式と、テスト入力値の条件式と、テスト入力値という5つのフィールドを有する。テストケース組番号と、テストケース種別と、テストケースパス条件式とは、テストケース生成要否分類結果1902の同名のフィールドと同じである。テスト入力値の条件式フィールドには、テストケースパス条件式から得られるテスト入力値の条件式が格納される。テスト入力値フィールドには、算出した値が格納される。   The table 2001 has five fields: a test case group number, a test case type, a test case pass conditional expression, a test input value conditional expression, and a test input value. The test case group number, the test case type, and the test case pass conditional expression are the same as the field of the same name in the test case generation necessity classification result 1902. The test input value conditional expression field stores a test input value conditional expression obtained from the test case path conditional expression. The calculated value is stored in the test input value field.

テストケース生成装置100は、入力値として算出した値を設定したテストケースを、変更後プログラムPostPrgのテストケースとして生成する。なお、テストケースの期待値に関しては、テストケース生成装置100の利用者等により設定される。   The test case generation device 100 generates a test case in which a value calculated as an input value is set as a test case of the post-change program PostPrg. Note that the expected value of the test case is set by the user of the test case generation apparatus 100 or the like.

次に、図21〜図26を用いて、テストケース生成装置100が実行するフローチャートの説明を行う。   Next, a flowchart executed by the test case generation apparatus 100 will be described with reference to FIGS.

図21は、テストケース生成処理手順の一例を示すフローチャートである。テストケース生成処理は、変更後プログラムPostPrgに対するテストケースを生成する処理である。テストケース生成装置100は、変更前プログラムPrePrgと変更後プログラムPostPrgとのシンボリック実行結果を取得する(ステップS2101)。次に、テストケース生成装置100は、変更前後パス関連付け処理を実行する(ステップS2102)。変更前後パス関連付け処理の詳細は、図22にて後述する。なお、変更前後パス関連付け処理によって、L個の関連情報が生成されたものとする。   FIG. 21 is a flowchart illustrating an example of a test case generation processing procedure. The test case generation process is a process for generating a test case for the post-change program PostPrg. The test case generation device 100 acquires symbolic execution results of the pre-change program PrePrg and the post-change program PostPrg (step S2101). Next, the test case generation device 100 executes a before / after change path association process (step S2102). Details of the path association process before and after the change will be described later with reference to FIG. It is assumed that L pieces of related information have been generated by the pre-change path association processing.

続けて、テストケース生成装置100は、1をiに代入する(ステップS2103)。次に、テストケース生成装置100は、i番目の関連情報に対して、パス条件式変更種別分類処理を実行する(ステップS2104)。パス条件式変更種別分類処理の詳細は、図23にて説明する。続けて、テストケース生成装置100は、i番目の関連情報に対して、パス出力数式変更種別分類処理を実行する(ステップS2105)。パス出力数式変更種別分類処理の詳細は、図24にて説明する。   Subsequently, the test case generation device 100 substitutes 1 for i (step S2103). Next, the test case generation device 100 executes a path conditional expression change type classification process for the i-th related information (step S2104). Details of the path conditional expression change type classification processing will be described with reference to FIG. Subsequently, the test case generation device 100 executes a path output formula change type classification process for the i-th related information (step S2105). Details of the path output formula change type classification process will be described with reference to FIG.

なお、ステップS2104の処理と、ステップS2105の処理には依存関係がないことから、テストケース生成装置100は、ステップS2104の処理とステップS2105の処理とを並列に実行してもよい。また、ステップS2105の処理は、関連情報に対してでなく、変更前後のパスの全ての組合せに対して行ってもよい。   Note that since there is no dependency relationship between the process of step S2104 and the process of step S2105, the test case generation apparatus 100 may execute the process of step S2104 and the process of step S2105 in parallel. Further, the processing in step S2105 may be performed not on the related information but on all combinations of paths before and after the change.

次に、テストケース生成装置100は、i番目の関連情報に対して、テストケース分類処理を実行する(ステップS2106)。テストケース分類処理の詳細は、図25にて後述する。なお、ステップ2106の処理について、ステップS2105の処理において、パス出力数式変更種別が“変更”となった場合、図18を参照すると、テストケース種別は、テストケースを生成すべきことを示す“変更”か“追加”となる。   Next, the test case generation device 100 performs a test case classification process on the i-th related information (step S2106). Details of the test case classification process will be described later with reference to FIG. As for the process of step 2106, when the path output formula change type is “change” in the process of step S2105, referring to FIG. 18, the test case type indicates that a test case should be generated. "Or" Add ".

したがって、利用者がテストケースを生成すべきか否かを知りたい場合、テストケース生成装置100は、関連情報に対して、ステップS2104の処理を行わず、ステップS2105の処理を行ってもよい。そして、テストケース生成装置100は、パス出力数式変更種別が“不変”となった場合に、ステップS2104の処理を行ってもよい。ステップS2104の結果が “拡大”または“重複”である場合、テストケース生成装置100は、¬PrePC_TC∧PostPC_TCとなるテストケースパス条件式において、テストケース種別を“変更”か“追加”と判定する。   Therefore, when the user wants to know whether or not a test case should be generated, the test case generation apparatus 100 may perform the process of step S2105 on the related information without performing the process of step S2104. Then, the test case generation apparatus 100 may perform the process of step S2104 when the path output formula change type becomes “invariant”. When the result of step S2104 is “enlarge” or “duplicate”, the test case generation apparatus 100 determines that the test case type is “changed” or “added” in the test case path conditional expression of ¬PrePC_TC∧PostPC_TC. .

続けて、テストケース生成装置100は、i+1をiに代入する(ステップS2107)。次に、テストケース生成装置100は、iがLより大きいか否かを判断する(ステップS2108)。iがL以下である場合(ステップS2108:No)、テストケース生成装置100は、ステップS2104の処理に移行する。iがLより大きい場合(ステップS2108:Yes)、テストケース生成装置100は、テストケース分類結果を出力する(ステップS2109)。出力先として、テストケース生成装置100は、テストケース分類結果をRAM203、ディスク205等の記憶装置に格納してもよいし、テストケース分類結果をディスプレイ207に表示してもよい。   Subsequently, the test case generation device 100 substitutes i + 1 for i (step S2107). Next, the test case generation device 100 determines whether i is greater than L (step S2108). When i is L or less (step S2108: No), the test case generation device 100 proceeds to the process of step S2104. When i is larger than L (step S2108: Yes), the test case generation device 100 outputs a test case classification result (step S2109). As an output destination, the test case generation apparatus 100 may store the test case classification result in a storage device such as the RAM 203 and the disk 205, or may display the test case classification result on the display 207.

次に、テストケース生成装置100は、変更後プログラムのテストケースの入力値生成処理を実行する(ステップS2110)。変更後プログラムのテストケースの入力値生成処理の詳細は、図26にて後述する。続けて、テストケース生成装置100は、テスト入力値を生成したテストケースを出力する(ステップS2111)。   Next, the test case generation apparatus 100 executes test case input value generation processing of the changed program (step S2110). Details of the test case input value generation processing of the post-change program will be described later with reference to FIG. Subsequently, the test case generation device 100 outputs the test case that generated the test input value (step S2111).

ステップS2111の処理終了後、テストケース生成装置100は、テストケース生成処理を終了する。テストケース生成処理を実行することにより、テストケース生成装置100は、変更後プログラムPostPrgの動作をテストするテストケースを生成することができる。   After the process of step S2111 ends, the test case generation device 100 ends the test case generation process. By executing the test case generation process, the test case generation apparatus 100 can generate a test case for testing the operation of the post-change program PostPrg.

図22は、変更前後パス関連付け処理手順の一例を示すフローチャートである。変更前後パス関連付け処理は、変更前プログラムPrePrgの各パスと変更後プログラムPostPrgの各パスとのうち、関連するパス同士を検出して関連情報を作成する処理である。また、図22では、変更前プログラムPrePrgのi番目のパスをPre(i)と表現し、i番目のパスの条件式をPrePC(i)と表現する。同様に、変更後プログラムPostPrgのj番目のパスをPost(j)と表現し、j番目のパスの条件式を、PostPC(j)と表現する。   FIG. 22 is a flowchart illustrating an example of the pre-change path association processing procedure. The pre-change path association process is a process for creating related information by detecting related paths among the paths of the pre-change program PrePrg and the post-change program PostPrg. In FIG. 22, the i-th path of the pre-change program PrePrg is expressed as Pre (i), and the conditional expression of the i-th path is expressed as PrePC (i). Similarly, the jth path of the post-change program PostPrg is expressed as Post (j), and the conditional expression of the jth path is expressed as PostPC (j).

テストケース生成装置100は、iに1を代入し、jに1を代入する(ステップS2201)。次に、テストケース生成装置100は、PrePC(i)∧PostPC(j)が充足可能か否かを判断する(ステップS2202)。PrePC(i)∧PostPC(j)が充足可能である場合(ステップS2202:Yes)、テストケース生成装置100は、Pre(i)とPost(j)とをテストケース組とする関連情報を作成する(ステップS2203)。ステップS2203の処理終了後、または、PrePC(i)∧PostPC(j)が充足不可能である場合(ステップS2202:No)、テストケース生成装置100は、j+1をjに代入する(ステップS2204)。   The test case generation device 100 substitutes 1 for i, and substitutes 1 for j (step S2201). Next, the test case generation device 100 determines whether PrePC (i) ∧PostPC (j) can be satisfied (step S2202). When PrePC (i) ∧PostPC (j) is satisfiable (step S2202: Yes), the test case generation device 100 creates related information using Pre (i) and Post (j) as a test case group. (Step S2203). After the process of step S2203 is completed, or when PrePC (i) ∧PostPC (j) cannot be satisfied (step S2202: No), the test case generation device 100 substitutes j + 1 for j (step S2204).

続けて、テストケース生成装置100は、jがNより大きいか否かを判断する(ステップS2205)。jがN以下である場合(ステップS2205:No)、テストケース生成装置100は、ステップS2202の処理に移行する。jがNより大きい場合(ステップS2205:Yes)、テストケース生成装置100は、i+1をiに代入し、1をjに代入する(ステップS2206)。   Subsequently, the test case generation device 100 determines whether j is greater than N (step S2205). When j is N or less (step S2205: No), the test case generation device 100 proceeds to the process of step S2202. When j is larger than N (step S2205: Yes), the test case generation device 100 substitutes i + 1 for i and substitutes 1 for j (step S2206).

続けて、テストケース生成装置100は、iがMより大きいか否かを判断する(ステップS2207)。iがM以下である場合(ステップS2207:No)、テストケース生成装置100は、ステップS2202の処理に移行する。iがMより大きい場合(ステップS2207:Yes)、テストケース生成装置100は、作成した関連情報を出力する(ステップS2208)。ステップS2208の処理終了後、テストケース生成装置100は、変更前後パス関連付け処理を終了する。変更前後パス関連付け処理を実行することにより、テストケース生成装置100は、関連するパス同士を検出して関連情報を作成することができる。   Subsequently, the test case generation device 100 determines whether i is larger than M (step S2207). When i is M or less (step S2207: No), the test case generation device 100 proceeds to the process of step S2202. When i is larger than M (step S2207: Yes), the test case generation device 100 outputs the created related information (step S2208). After the process of step S2208 ends, the test case generation device 100 ends the pre-change path association process. By executing the pre-change path association process, the test case generation device 100 can detect related paths and create related information.

図23は、パス条件式変更種別分類処理手順の一例を示すフローチャートである。パス条件式変更種別分類処理は、関連情報のパス条件式変更種別を分類する処理である。図23では、i番目の関連情報が示す変更前プログラムPrePrgのパス条件式をPrePC_TC(i)と表現する。また、i番目の関連情報が示す変更後プログラムPostPrgのパス条件式をPostPC_TC(i)と表現する。   FIG. 23 is a flowchart illustrating an example of a path conditional expression change type classification processing procedure. The path condition expression change type classification process is a process of classifying the path condition expression change type of the related information. In FIG. 23, the path conditional expression of the pre-change program PrePrg indicated by the i-th related information is expressed as PrePC_TC (i). Further, the path conditional expression of the post-change program PostPrg indicated by the i-th related information is expressed as PostPC_TC (i).

テストケース生成装置100は、条件式(2−1)の充足可能性と条件式(2−2)の充足可能性とを判定する(ステップS2301)。次に、テストケース生成装置100は、条件式(2−1)と条件式(2−2)とが共に充足不可能であると判定したか否かを判断する(ステップS2302)。条件式(2−1)と条件式(2−2)とが共に充足不可能であると判定した場合(ステップS2302:Yes)、テストケース生成装置100は、パス条件式変更種別を“不変”に特定する(ステップS2303)。   The test case generation device 100 determines the satisfaction of the conditional expression (2-1) and the satisfaction of the conditional expression (2-2) (step S2301). Next, the test case generation device 100 determines whether or not both the conditional expression (2-1) and the conditional expression (2-2) are determined to be unsatisfactory (step S2302). When it is determined that both the conditional expression (2-1) and the conditional expression (2-2) are unsatisfiable (step S2302: Yes), the test case generation device 100 sets the path conditional expression change type to “invariant”. (Step S2303).

条件式(2−1)と条件式(2−2)とのうち少なくとも一方の条件式が充足不可能でないと判定した場合(ステップS2302:No)、テストケース生成装置100は、条件式(2−1)が充足可能であり、かつ条件式(2−2)が充足不可能であると判定したか否かを判断する(ステップS2304)。条件式(2−1)が充足可能であり、かつ条件式(2−2)が充足不可能である場合(ステップS2304:Yes)、テストケース生成装置100は、パス条件式変更種別を“縮小”に特定する(ステップS2305)。   When it is determined that at least one of the conditional expression (2-1) and the conditional expression (2-2) is unsatisfiable (step S2302: No), the test case generation device 100 outputs the conditional expression (2 It is determined whether it is determined that -1) is satisfiable and conditional expression (2-2) is unsatisfiable (step S2304). When the conditional expression (2-1) can be satisfied and the conditional expression (2-2) cannot be satisfied (step S2304: Yes), the test case generation apparatus 100 reduces the path conditional expression change type to “reduction”. "(Step S2305).

条件式(2−1)が充足可能でない、または条件式(2−2)が充足不可能でない場合(ステップS2304:No)、テストケース生成装置100は、条件式(2−1)が充足不可能であり、かつ条件式(2−2)が充足可能であると判定したか否かを判断する(ステップS2306)。条件式(2−1)が充足不可能であり、かつ条件式(2−2)が充足可能である場合(ステップS2306:Yes)、テストケース生成装置100は、パス条件式変更種別を“拡大”に特定する(ステップS2307)。   When the conditional expression (2-1) is not satisfiable or the conditional expression (2-2) is not satisfiable (step S2304: No), the test case generation apparatus 100 is not satisfied with the conditional expression (2-1). It is determined whether it is possible and it is determined that the conditional expression (2-2) can be satisfied (step S2306). When the conditional expression (2-1) cannot be satisfied and the conditional expression (2-2) can be satisfied (step S2306: Yes), the test case generation device 100 sets the path conditional expression change type to “enlarge” "(Step S2307).

一方、条件式(2−1)と条件式(2−2)が共に充足可能である場合(ステップS2306:No)、テストケース生成装置100は、パス条件式変更種別を“重複”に特定する(ステップS2308)。ステップS2303、ステップS2305、ステップS2307、ステップS2308、のうちのいずれかの処理終了後、テストケース生成装置100は、特定したパス条件式変更種別を出力する(ステップS2309)。出力されたパス条件式変更種別は、i番目の関連情報に付与される。   On the other hand, when both the conditional expression (2-1) and the conditional expression (2-2) can be satisfied (step S2306: No), the test case generation device 100 identifies the path conditional expression change type as “duplicate”. (Step S2308). After completion of any one of step S2303, step S2305, step S2307, and step S2308, the test case generation device 100 outputs the specified path conditional expression change type (step S2309). The output path conditional expression change type is assigned to the i-th related information.

ステップS2309の処理終了後、テストケース生成装置100は、パス条件式変更種別分類処理を終了する。パス条件式変更種別分類処理を実行することにより、テストケース生成装置100は、i番目の関連情報が示す変更後プログラムPostPrgのパス条件式が、変更前プログラムPrePrgのパス条件式からどのように変更されたかを取得することができる。   After the process of step S2309 ends, the test case generation device 100 ends the path conditional expression change type classification process. By executing the path condition expression change type classification process, the test case generation device 100 changes how the path condition expression of the post-change program PostPrg indicated by the i th related information is changed from the path condition expression of the pre-change program PrePrg. You can get what was done.

図24は、パス出力数式変更種別分類処理手順の一例を示すフローチャートである。パス出力数式変更種別分類処理は、関連情報のパス出力数式変更種別を分類する処理である。図24では、i番目の関連情報が示す変更前プログラムPrePrgのパス出力数式をPreR_TC(i)と表現する。また、i番目の関連情報が示す変更後プログラムPostPrgのパス出力数式をPostR_TC(i)と表現する。   FIG. 24 is a flowchart illustrating an example of a path output formula change type classification processing procedure. The path output formula change type classification process is a process of classifying the path output formula change type of the related information. In FIG. 24, the path output formula of the pre-change program PrePrg indicated by the i-th related information is expressed as PreR_TC (i). Further, the path output formula of the post-change program PostPrg indicated by the i-th related information is expressed as PostR_TC (i).

テストケース生成装置100は、判定ルール1として、PreR_TC(i)とPostR_TC(i)とが文字列として比較して一致するか否かを判断する(ステップS2401)。一致しない場合(ステップS2401:No)、テストケース生成装置100は、判定ルール2〜4を適用する(ステップS2402)。続けて、テストケース生成装置100は、判定ルール2〜4を適用した結果、“不変”であると判断したか否かを判断する(ステップS2403)。   As the determination rule 1, the test case generation apparatus 100 compares PreR_TC (i) and PostR_TC (i) as character strings and determines whether or not they match (step S2401). When they do not match (step S2401: No), the test case generation device 100 applies the determination rules 2 to 4 (step S2402). Subsequently, the test case generation apparatus 100 determines whether or not it is determined to be “invariant” as a result of applying the determination rules 2 to 4 (step S2403).

文字列として比較して一致した場合(ステップS2401:Yes)、または、判定ルール2〜4を適用した結果、“不変”であると判断した場合(ステップS2403:Yes)、テストケース生成装置100は、パス出力数式変更種別を“不変”と判断する(ステップS2404)。   When compared as a character string and matched (step S2401: Yes), or when it is determined to be “invariant” as a result of applying the determination rules 2 to 4 (step S2403: Yes), the test case generation device 100 The path output formula change type is determined to be “invariant” (step S2404).

判定ルール2〜4を適用した結果、“不変”でないと判断した場合(ステップS2403:No)、テストケース生成装置100は、判定ルール2〜4を適用した結果、“変更”であると判断したか否かを判断する(ステップS2405)。判定ルール2〜4を適用した結果、“変更”であると判断した場合(ステップS2405:Yes)、テストケース生成装置100は、パス出力数式変更種別を“変更”と判断する(ステップS2406)。   As a result of applying the determination rules 2 to 4, when it is determined that it is not “invariant” (step S <b> 2403: No), the test case generation device 100 determines that it is “changed” as a result of applying the determination rules 2 to 4. It is determined whether or not (step S2405). As a result of applying the determination rules 2 to 4, when it is determined as “change” (step S 2405: Yes), the test case generation device 100 determines that the path output formula change type is “change” (step S 2406).

一方、判定ルール2〜4を適用した結果、“判定不能”であると判断した場合(ステップS2405:No)、テストケース生成装置100は、パス出力数式変更種別を“判定不能”と判断する(ステップS2407)。ステップS2404、ステップS2406、ステップS2407、のうちのいずれかの処理終了後、テストケース生成装置100は、判断したパス出力数式変更種別を出力する(ステップS2408)。出力されたパス出力数式変更種別は、i番目の関連情報に付与される。   On the other hand, when it is determined that “determination is impossible” as a result of applying the determination rules 2 to 4 (step S2405: No), the test case generation device 100 determines that the path output formula change type is “determination impossible” (step S2405: No). Step S2407). After the completion of any one of steps S2404, S2406, and S2407, the test case generation device 100 outputs the determined path output formula change type (step S2408). The output path output formula change type is assigned to the i-th related information.

ステップS2408の処理終了後、テストケース生成装置100は、パス出力数式変更種別分類処理を終了する。パス出力数式変更種別分類処理を実行することにより、テストケース生成装置100は、i番目の関連情報が示す変更後プログラムPostPrgのパスの機能が、変更前プログラムPrePrgのパスの機能から変更されたか否かを特定することができる。   After the process of step S2408 ends, the test case generation device 100 ends the path output formula change type classification process. By executing the path output formula change type classification process, the test case generation device 100 determines whether the path function of the post-change program PostPrg indicated by the i-th related information has been changed from the path function of the pre-change program PrePrg. Can be identified.

図25は、テストケース分類処理手順の一例を示すフローチャートである。テストケース分類処理は、関連情報のテストケース分類を特定する処理である。テストケース生成装置100は、関連情報のパス条件式変更種別とパス出力数式変更種別とを取得する(ステップS2501)。次に、テストケース生成装置100は、テストケース分類ルールテーブル1801を参照して、取得したパス条件式変更種別とパス出力数式変更種別とに応じたテストケース分類を判定する(ステップS2502)。続けて、テストケース生成装置100は、判定したテストケース分類を出力する(ステップS2503)。ステップS2503の処理終了後、テストケース生成装置100は、テストケース分類処理を終了する。テストケース分類処理を実行することにより、テストケース生成装置100は、テストケース分類を特定することができる。   FIG. 25 is a flowchart illustrating an example of a test case classification processing procedure. The test case classification process is a process for specifying the test case classification of the related information. The test case generation device 100 acquires the path condition formula change type and the path output formula change type of the related information (step S2501). Next, the test case generation device 100 refers to the test case classification rule table 1801 and determines the test case classification corresponding to the acquired path condition expression change type and path output expression change type (step S2502). Subsequently, the test case generation device 100 outputs the determined test case classification (step S2503). After the process of step S2503 is completed, the test case generation device 100 ends the test case classification process. By executing the test case classification process, the test case generation apparatus 100 can specify the test case classification.

図26は、変更後プログラムのテストケースの入力値生成処理手順の一例を示すフローチャートである。変更後プログラムのテストケースの入力値生成処理は、変更後プログラムPostPrgのテストケースの入力値を生成する処理である。   FIG. 26 is a flowchart illustrating an example of an input value generation processing procedure for a test case of the changed program. The test case input value generation process of the post-change program is a process of generating the test case input value of the post-change program PostPrg.

テストケース生成装置100は、テストケース種別の指定を受け付ける(ステップS2601)。次に、テストケース生成装置100は、指定されたテストケース種別の関連情報を選択する(ステップS2602)。続けて、テストケース生成装置100は、選択した関連情報のテストケースパス条件式を取得する(ステップS2603)。次に、テストケース生成装置100は、取得したテストケースパス条件式を満たす値を、制約ソルバを利用して算出する(ステップS2604)。続けて、テストケース生成装置100は、算出した値をテスト入力値とするテストケースを生成する(ステップS2605)。   The test case generation device 100 accepts specification of a test case type (step S2601). Next, the test case generation device 100 selects related information of the designated test case type (step S2602). Subsequently, the test case generation device 100 acquires a test case path conditional expression of the selected related information (step S2603). Next, the test case generation device 100 calculates a value satisfying the acquired test case path conditional expression using a constraint solver (step S2604). Subsequently, the test case generation device 100 generates a test case using the calculated value as a test input value (step S2605).

ステップS2605において、テストケース生成装置100は、たとえば、関連情報の変更前プログラムPrePrgのパスの動作をテストするテストケースをコピーして、コピー先のテストケースのテスト入力値を算出した値に上書きしてもよい。コピー先のテストケースが、変更後プログラムPostPrgのパスの動作をテストするテストケースとして生成されたこととなる。また、変更前プログラムPrePrgの試験を今後行わないのであれば、テストケース生成装置100は、関連情報の変更前プログラムPrePrgのパスの動作をテストするテストケースのテスト入力値を、算出した値で上書きしてもよい。上書きされたテストケースが、変更後プログラムPostPrgのパスの動作をテストするテストケースとして生成されたこととなる。   In step S2605, for example, the test case generation apparatus 100 copies a test case that tests the path operation of the pre-change program PrePrg of related information, and overwrites the calculated value of the test input value of the copy destination test case. May be. The copy destination test case is generated as a test case for testing the path operation of the post-change program PostPrg. If the test of the pre-change program PrePrg is not to be performed in the future, the test case generating apparatus 100 overwrites the test input value of the test case for testing the path operation of the pre-change program PrePrg of related information with the calculated value. May be. The overwritten test case is generated as a test case for testing the path operation of the post-change program PostPrg.

ステップS2605の処理終了後、テストケース生成装置100は、変更後プログラムのテストケースの入力値生成処理を終了する。変更後プログラムのテストケースの入力値生成処理を実行することにより、テストケース生成装置100は、変更後プログラムのテストケースの入力値を用意することができる。   After the process of step S2605 ends, the test case generation device 100 ends the test case input value generation process of the changed program. By executing the test case input value generation process of the post-change program, the test case generation apparatus 100 can prepare the test case input value of the post-change program.

以上説明したように、テストケース生成装置100によれば、プログラムの一部が変更された場合、変更前後のパスが実行される条件式が充足可能となるパス同士の出力変数を比較してテストケースを生成すべきか否かを判断する。これにより、テストケース生成装置100の利用者は、第2のパスの動作をテストするテストケースを生成すべきか否かを知ることができ、テストケースを生成すべきか否かを利用者が判断しなくてよい分、テストケース生成作業の負荷を削減することができる。   As described above, according to the test case generation apparatus 100, when a part of the program is changed, the test is performed by comparing the output variables of the paths that can satisfy the conditional expression for executing the path before and after the change. Determine whether a case should be generated. Thereby, the user of the test case generation apparatus 100 can know whether or not to generate a test case for testing the operation of the second pass, and the user can determine whether or not to generate a test case. Since it is not necessary, the load of test case generation work can be reduced.

また、テストケース生成装置100によれば、第2のパスの動作をテストするテストケースを生成すべきであると判定した際、第2のパス条件式を真とする入力変数の値を算出し、算出した値を入力変数の値とする第2のパスのテストケースを生成してもよい。変更されたテストケースが第2のパスの動作をテストするテストケースとなり、テストケース生成装置100の利用者は、変更部分および追加部分のテストケースを生成せずに済み、テストケース生成作業の負荷を削減することができる。   Also, according to the test case generation apparatus 100, when it is determined that a test case for testing the operation of the second path should be generated, the value of the input variable that makes the second path conditional expression true is calculated. The test case of the second pass may be generated using the calculated value as the value of the input variable. The changed test case becomes a test case for testing the operation of the second path, and the user of the test case generation apparatus 100 does not have to generate the test part of the changed part and the additional part, and the load of the test case generation work Can be reduced.

また、テストケース生成装置100によれば、条件式(2−1)と条件式(2−2)との充足可能性とに基づいて、第2のパスの動作をテストするテストケースを生成すべきか否かを判定してもよい。   Further, according to the test case generation device 100, a test case for testing the operation of the second pass should be generated based on the satisfaction of the conditional expression (2-1) and the conditional expression (2-2). It may be determined whether or not.

これにより、テストケース生成装置100の利用者は、テストケース種別が“不変”か“回帰”であれば、テストケースを生成しなくてよいことを知ることができ、また、“変更”か“追加”であれば、テストケースを生成すべきであることを知ることができる。また、テストケース種別が“回帰”である場合、出力される値は同一であるがパス条件式が変更したため、たとえば、第1のパス条件式を真とするテスト入力値を有するテストケースのうち、第2のパス条件式を真としないテストケースがある可能性がある。第2のパス条件式を真としないテストケースは実行しなくてよいため、テストケース種別が“回帰”であると知ったテストケース生成装置100の利用者は、テストケースの実行の要否を検討することができる。   Thus, the user of the test case generation apparatus 100 can know that the test case need not be generated if the test case type is “invariable” or “regression”. If it is “Add”, it is possible to know that a test case should be generated. In addition, when the test case type is “regression”, the output value is the same, but the path conditional expression has changed. For example, among test cases having a test input value that makes the first path conditional expression true There may be a test case in which the second path conditional expression is not true. Since it is not necessary to execute a test case that does not make the second pass conditional expression true, the user of the test case generation apparatus 100 who knows that the test case type is “regression” determines whether or not the test case needs to be executed. Can be considered.

また、テストケース生成装置100の利用者は、条件式(2−2)が充足可能であると特定し、かつ、第1のパス出力数式と第2のパス出力数式とが一致する場合、第1のパス条件式の否定と第2のパス条件式を真とする入力変数の値を算出してもよい。条件式(2−2)が充足可能となる場合とは、パス条件式変更種別が“拡大”または“重複”となる場合である。テストケース生成装置100は、第1のパス条件式の否定と第2のパス条件式を真とする入力変数の値を算出して、変更前プログラムには含まれていないパス条件式に対する、テストケースのテスト入力値を生成することができる。   In addition, when the user of the test case generation device 100 specifies that the conditional expression (2-2) is satisfiable and the first path output formula and the second path output formula match, It is also possible to calculate the value of an input variable that negates the first pass condition expression and makes the second pass condition expression true. The case where the conditional expression (2-2) can be satisfied is a case where the path conditional expression change type is “enlarged” or “duplicate”. The test case generation device 100 calculates the value of an input variable that makes the first pass conditional expression negative and the second pass conditional expression true, and tests the path conditional expression that is not included in the pre-change program. A test input value for the case can be generated.

また、テストケース生成装置100によれば、変更前プログラムPrePrgに含まれるパスごとのパス条件式とパス出力数式と第2のパスのパス条件式とパス出力数式とに基づき、第2のパスの動作をテストするテストケースを生成すべきか否かを判定してもよい。これにより、テストケース生成装置100の利用者は、変更前プログラムPrePrgに含まれるパスのうち、第2のパスに関連するパスのテストケースがそのまま流用できるか、または第2のパス用にテストケースを生成すべきかを知ることができる。   Further, according to the test case generation apparatus 100, based on the path condition formula for each path included in the pre-change program PrePrg, the path output formula, the path condition formula for the second path, and the path output formula, It may be determined whether a test case for testing the operation should be generated. Thereby, the user of the test case generation apparatus 100 can use the test case of the path related to the second path among the paths included in the pre-change program PrePrg as it is, or the test case for the second path. Can be generated.

また、テストケース生成装置100によれば、変更前プログラムPrePrgと変更後プログラムPostPrgとのパスごとのパス条件式とパス出力数式とに基づき、変更後プログラムPostPrgの各パスのテストケースを生成すべきか否かを判定してもよい。これにより、テストケース生成装置100の利用者は、変更後プログラムPostPrgに含まれるパス全てに対して、テストケースを生成すべきか否かを知ることができる。   Further, according to the test case generation apparatus 100, should a test case for each path of the post-change program PostPrg be generated based on the path condition formula and path output formula for each path of the pre-change program PrePrg and the post-change program PostPrg? It may be determined whether or not. Thereby, the user of the test case generation apparatus 100 can know whether or not test cases should be generated for all paths included in the post-change program PostPrg.

また、テストケース生成装置100によれば、関連情報ごとに、パス条件式変更種別を特定し、パス条件式変更種別と、パス出力数式とに基づいて、変更後プログラムPostPrgの各パスのテストケース種別を判定してもよい。たとえば、テストケース生成装置100の利用者は、出力された変更後プログラムPostPrgの各パスのテストケース種別のうちの“不変”と“回帰”とを指定することにより、リグレッションテストを実行するテストケースを選択することができる。また、テストケース生成装置100の利用者は、出力された変更後プログラムPostPrgの各パスのテストケース種別のうちの“変更”と“追加”とを指定することにより、変更部分および追加部分を実行するテストケースを選択することができる。   Further, according to the test case generation device 100, the path condition formula change type is specified for each related information, and the test cases of the paths of the post-change program PostPrg based on the path condition formula change type and the path output formula. The type may be determined. For example, the user of the test case generation apparatus 100 designates “invariant” and “regression” among the test case types of each path of the output post-change program PostPrg, thereby executing a regression test. Can be selected. Further, the user of the test case generation apparatus 100 executes the changed part and the added part by specifying “change” and “add” among the test case types of each path of the output post-change program PostPrg. The test case to be selected can be selected.

(実施の形態2の説明)
実施の形態1にかかるテストケース生成装置100は、変更前後のパスの関連付けにおける条件式(1)の充足可能性の判定と、パス条件式変更種別の分類における条件式(2−1)と条件式(2−2)の充足可能性の判定とにおいて、制約ソルバを利用する。しかしながら、制約ソルバによる充足可能性の判定は時間を要する。そこで、実施の形態2にかかるテストケース生成装置は、制約ソルバによる充足可能性の判定の回数を削減する。以下、図27〜図34を用いて、実施の形態2にかかるテストケース生成装置2700について説明する。なお、実施の形態1において説明した箇所と同様の箇所については、同一符号を付して図示および説明を省略する。
(Description of Embodiment 2)
The test case generation device 100 according to the first embodiment determines whether or not the conditional expression (1) is satisfiable in the path association before and after the change, and the conditional expression (2-1) and the condition in the classification of the path conditional expression change type. In determining the satisfiability of the expression (2-2), a constraint solver is used. However, the determination of satisfiability by the constraint solver takes time. Thus, the test case generation device according to the second embodiment reduces the number of times of determination of satisfiability by the constraint solver. Hereinafter, the test case generation device 2700 according to the second exemplary embodiment will be described with reference to FIGS. In addition, about the location similar to the location demonstrated in Embodiment 1, the same code | symbol is attached | subjected and illustration and description are abbreviate | omitted.

図27は、実施の形態2におけるテストケース生成装置の機能例を示すブロック図である。テストケース生成装置2700は、第1取得部2701と、第2取得部2702と、テスト入力値判断部2703と、関連情報生成部2704と、特定部2705と、組作成部2706と、パス関連判断部2707と、関連情報作成部2708と、を含む。さらに、テストケース生成装置2700は、数式判定部2709と、生成判定部2710と、算出部908と、テストケース生成部909を含む。   FIG. 27 is a block diagram illustrating a functional example of the test case generation device according to the second embodiment. The test case generation device 2700 includes a first acquisition unit 2701, a second acquisition unit 2702, a test input value determination unit 2703, a related information generation unit 2704, a specification unit 2705, a set creation unit 2706, and a path related determination. A section 2707 and a related information creation section 2708. Furthermore, the test case generation device 2700 includes a mathematical expression determination unit 2709, a generation determination unit 2710, a calculation unit 908, and a test case generation unit 909.

制御部となる第1取得部2701〜生成判定部2710と、算出部908と、テストケース生成部909は、記憶装置に記憶されたプログラムをCPU201が実行することにより、各機能を実現する。記憶装置とは、具体的には、たとえば、図2に示したROM202、RAM203、ディスク205などである。または、通信インターフェース206を経由して他のCPUが実行することにより、第1取得部2701〜生成判定部2710と、算出部908と、テストケース生成部909の機能を実現してもよい。   The first acquisition unit 2701 to the generation determination unit 2710, the calculation unit 908, and the test case generation unit 909, which are control units, realize each function by the CPU 201 executing a program stored in the storage device. Specifically, the storage device is, for example, the ROM 202, the RAM 203, the disk 205, etc. shown in FIG. Alternatively, the functions of the first acquisition unit 2701 to the generation determination unit 2710, the calculation unit 908, and the test case generation unit 909 may be realized by another CPU executing via the communication interface 206.

第1取得部2701は、第1のシンボリック実行結果と、第1のシンボリック実行結果に含まれる各パスの動作をテストするテストケースのテスト入力値とを取得する。なお、取得された情報は、RAM203、ディスク205などの記憶領域に記憶される。   The first acquisition unit 2701 acquires a first symbolic execution result and a test input value of a test case for testing the operation of each path included in the first symbolic execution result. The acquired information is stored in a storage area such as the RAM 203 and the disk 205.

第2取得部2702は、第2のシンボリック実行結果と、第2のシンボリック実行結果に含まれる各パスのパス条件式を満たすテスト入力値とを取得する。第2のパス条件式を満たすテスト入力値の取得例として、第2取得部2702は、制約ソルバを利用して、第2のパス条件式を満たす値を取得する。なお、取得された情報は、RAM203、ディスク205などの記憶領域に記憶される。   The second acquisition unit 2702 acquires a second symbolic execution result and a test input value that satisfies the path condition expression of each path included in the second symbolic execution result. As an example of acquiring a test input value that satisfies the second path conditional expression, the second acquisition unit 2702 acquires a value that satisfies the second path conditional expression using a constraint solver. The acquired information is stored in a storage area such as the RAM 203 and the disk 205.

テスト入力値判断部2703は、第1のパスの動作をテストするテストケースの入力値を、第2のパスのパス条件式に与えた場合に第2の条件式が真となるか否かを判断する。また、テスト入力値判断部2703は、第2取得部2702によって取得されたテスト入力値を、第1のパスのパス条件式に与えた場合に第1の条件式が真となるか否かを判断してもよい。   The test input value determination unit 2703 determines whether or not the second conditional expression is true when the input value of the test case for testing the operation of the first path is given to the path conditional expression of the second path. to decide. Further, the test input value determination unit 2703 determines whether or not the first conditional expression is true when the test input value acquired by the second acquisition unit 2702 is given to the path conditional expression of the first path. You may judge.

また、テスト入力値判断部2703は、第1取得部2701によって取得されたテストケースごとに、テストケースのテスト入力値を、第2のシンボリック実行結果に含まれる各パスのパス条件式に与える。そして、テスト入力値判断部2703は、テスト入力値を与えた場合に第2のシンボリック実行結果に含まれる各パスのパス条件式が真となるか否かを判断してもよい。   Also, the test input value determination unit 2703 gives the test input value of the test case to the path condition expression of each path included in the second symbolic execution result for each test case acquired by the first acquisition unit 2701. Then, the test input value determination unit 2703 may determine whether or not the path condition expression of each path included in the second symbolic execution result is true when the test input value is given.

また、テスト入力値判断部2703は、第2取得部2702によって取得されたテスト入力値ごとに、テスト入力値を第1のシンボリック実行結果に含まれる各パスのパス条件式に与える。そして、テスト入力値判断部2703は、テスト入力値を与えた場合に第1のシンボリック実行結果に含まれる各パスのパス条件式が真となるか否かを判断してもよい。具体的な判断方法については、図28にて後述する。なお、判断結果は、RAM203、ディスク205などの記憶領域に記憶される。   Also, the test input value determination unit 2703 gives the test input value to the path condition expression of each path included in the first symbolic execution result for each test input value acquired by the second acquisition unit 2702. Then, the test input value determination unit 2703 may determine whether or not the path condition expression of each path included in the first symbolic execution result is true when the test input value is given. A specific determination method will be described later with reference to FIG. Note that the determination result is stored in a storage area such as the RAM 203 or the disk 205.

関連情報生成部2704は、次に示す場合、第2のシンボリック実行結果に含まれる各パスが、前述の各パスの条件式が真となる入力値に対応する第1のシンボリック実行結果に含まれるパスに関連することを示す第1の関連情報を生成する。次に示す場合とは、テスト入力値判断部2703が第2のシンボリック実行結果に含まれる各パスの条件式が真となると判断した場合である。   In the following case, the related information generation unit 2704 includes each path included in the second symbolic execution result in the first symbolic execution result corresponding to the input value for which the conditional expression of each path is true. First related information indicating that the path is related is generated. The case shown below is a case where the test input value determination unit 2703 determines that the conditional expression of each path included in the second symbolic execution result is true.

また、関連情報生成部2704は、次に示す場合、真となった第2のシンボリック実行結果に含まれるパスが、第1のシンボリック実行結果に含まれるパスに関連することを示す第1の関連情報を生成してもよい。次に示す場合とは、テスト入力値判断部2703が第1のシンボリック実行結果に含まれる各パスの条件式が真となると判断した場合である。具体的な生成方法については、図28にて後述する。なお、生成された関連情報は、RAM203、ディスク205などの記憶領域に記憶される。   Further, in the following case, the related information generation unit 2704 displays the first relation indicating that the path included in the second symbolic execution result that is true is related to the path included in the first symbolic execution result. Information may be generated. The case shown below is a case where the test input value determination unit 2703 determines that the conditional expression of each path included in the first symbolic execution result is true. A specific generation method will be described later with reference to FIG. The generated related information is stored in a storage area such as the RAM 203 and the disk 205.

特定部2705は、第1の関連情報が示す第1のシンボリック実行結果に含まれるパスに対応するパス条件式と第2のシンボリック実行結果に含まれる各パスに対応するパス条件式の否定との充足可能性を第1の関連情報ごとに特定する。さらに、特定部2705は、第1の関連情報が示す第1のシンボリック実行結果に含まれるパスに対応するパス条件式の否定と第2のシンボリック実行結果に含まれる各パスに対応するパス条件式との充足可能性を第1の関連情報ごとに特定する。   The specifying unit 2705 obtains a path conditional expression corresponding to the path included in the first symbolic execution result indicated by the first related information and a negative of the path conditional expression corresponding to each path included in the second symbolic execution result. Satisfiability is specified for each first related information. Furthermore, the specifying unit 2705 negates the path conditional expression corresponding to the path included in the first symbolic execution result indicated by the first related information and the path conditional expression corresponding to each path included in the second symbolic execution result. Is specified for each first related information.

また、特定部2705は、第2の関連情報が示す第1のシンボリック実行結果に含まれるパスに対応する条件式と第2のシンボリック実行結果に含まれるパスに対応するパス条件式の否定との充足可能性を第2の関連情報ごとに特定する。さらに、特定部2705は、第2の関連情報が示す第1のシンボリック実行結果に含まれるパスに対応する条件式の否定と第2のシンボリック実行結果に含まれるパスに対応するパス条件式との充足可能性を第2の関連情報ごとに特定する。なお、生成された関連情報は、RAM203、ディスク205などの記憶領域に記憶される。   In addition, the specifying unit 2705 determines that the conditional expression corresponding to the path included in the first symbolic execution result indicated by the second related information and the negative of the path conditional expression corresponding to the path included in the second symbolic execution result. Satisfiability is specified for each second related information. Further, the specifying unit 2705 negates the conditional expression corresponding to the path included in the first symbolic execution result indicated by the second related information and the path conditional expression corresponding to the path included in the second symbolic execution result. Satisfiability is specified for each second related information. The generated related information is stored in a storage area such as the RAM 203 and the disk 205.

組作成部2706は、第1のシンボリック実行結果に含まれるパスと第2のシンボリック実行結果に含まれるパスとの組から、第1の関連情報ごとの特定結果に基づいて特定される組を除く残余の組を作成する。第1の関連情報ごとの特定結果に基づいて特定される組については、図30について後述する。なお、作成された組を示す情報は、RAM203、ディスク205などの記憶領域に記憶される。   The set creation unit 2706 excludes a set specified based on the specified result for each first related information from the set of the path included in the first symbolic execution result and the path included in the second symbolic execution result. Create the rest pair. The group identified based on the identification result for each first related information will be described later with reference to FIG. Information indicating the created set is stored in a storage area such as the RAM 203 or the disk 205.

パス関連判断部2707は、テスト入力値判断部2703による判断結果に基づいて、第2のパスが前記第1のパスに関連するか否かを判断する。たとえば、テスト入力値判断部2703が、第1のパスの動作をテストするテストケースの入力値を、第2のパスのパス条件式に与えた場合に第2の条件式が真となったと判断したとする。このとき、パス関連判断部2707は、第2のパスが前記第1のパスに関連すると判断する。   The path relation determination unit 2707 determines whether the second path is related to the first path based on the determination result by the test input value determination unit 2703. For example, the test input value determination unit 2703 determines that the second conditional expression is true when the input value of the test case for testing the operation of the first path is given to the path conditional expression of the second path. Suppose that At this time, the path relation determination unit 2707 determines that the second path is related to the first path.

また、パス関連判断部2707は、特定部2705による特定結果に基づいて、第2のパスが変更前プログラムPrePrgに含まれるパス群のうちの第1のパスとは異なるパスに関連しないことを判断してもよい。たとえば、特定部2705が、第1のパスのパス条件式の否定と第2のパスのパス条件式との論理積が充足可能であり、かつ、第1のパスのパス条件式と第2のパスのパス条件式の否定との論理積が充足不可能であると特定したとする。このとき、パス関連判断部2707は、第2のパスが変更前プログラムPrePrgに含まれるパス群のうちの第1のパスとは異なるパスに関連しないと判断する。なお、関連しないと判断されたパス同士の組が、組生成部2706にて説明した、第1の関連情報ごとの特定結果に基づいて特定される組のこととなる。   The path relation determination unit 2707 determines that the second path is not related to a path different from the first path in the path group included in the pre-change program PrePrg based on the specification result by the specification unit 2705. May be. For example, the specifying unit 2705 can satisfy the logical product of the negation of the path condition expression of the first path and the path condition expression of the second path, and the path condition expression of the first path and the second path condition expression Suppose that it is specified that the logical product of negating the path conditional expression of the path is not satisfactory. At this time, the path relation determination unit 2707 determines that the second path is not related to a path different from the first path in the path group included in the pre-change program PrePrg. Note that a pair of paths determined to be unrelated is a pair identified based on the identification result for each first related information described in the pair generation unit 2706.

また、パス関連判断部2707は、特定部2705による特定結果に基づいて、変更後プログラムPostPrgに含まれるパス群のうちの第2のパスとは異なるパスが第1のパスに関連しないことを判断してもよい。たとえば、特定部2705が、第1のパスのパス条件式の否定と第2のパスのパス条件式との論理積が充足不可能であり、かつ、第1のパスのパス条件式と第2のパスのパス条件式の否定との論理積が充足可能であると特定したとする。このとき、パス関連判断部2707は、第2のパスが変更前プログラムPrePrgに含まれるパス群のうちの第1のパスとは異なるパスに関連しないと判断する。   Further, the path relation determination unit 2707 determines, based on the specification result by the specification unit 2705, that a path different from the second path in the path group included in the post-change program PostPrg is not related to the first path. May be. For example, the specifying unit 2705 cannot satisfy the logical product of the negation of the path condition expression of the first path and the path condition expression of the second path, and the path condition expression of the first path and the second path condition expression Suppose that it is specified that the logical product with the negation of the path condition expression of the path can be satisfied. At this time, the path relation determination unit 2707 determines that the second path is not related to a path different from the first path in the path group included in the pre-change program PrePrg.

また、パス関連判断部2707は、組作成部2706によって作成された残余の組ごとに、次に示す情報に基づいて、第2の実行結果に含まれる各パスが第1の実行結果に含まれる各パスに関連するか否かを判断してもよい。次に示す情報は、第1のシンボリック実行結果に含まれる各パスの条件式と第2のシンボリック実行結果に含まれる各パスとの充足可能性である。なお、判断結果は、RAM203、ディスク205などの記憶領域に記憶される。   In addition, for each remaining pair created by the pair creation unit 2706, the path relation determination unit 2707 includes each path included in the second execution result based on the following information in the first execution result. It may be determined whether or not each path is related. The following information is the satisfiability of the conditional expression of each path included in the first symbolic execution result and each path included in the second symbolic execution result. Note that the determination result is stored in a storage area such as the RAM 203 or the disk 205.

関連情報作成部2708は、次に示す場合、第2のシンボリック実行結果に含まれる各パスが第1のシンボリック実行結果に含まれる各パスに関連することを示す第2の関連情報を作成する。次に示す場合は、パス関連判断部2707によって第2のシンボリック実行結果に含まれる各パスが第1の実行結果に含まれる各パスに関連すると判断された場合である。なお、作成された第2の関連情報は、RAM203、ディスク205などの記憶領域に記憶される。   In the following case, the related information creation unit 2708 creates second related information indicating that each path included in the second symbolic execution result is related to each path included in the first symbolic execution result. The following cases are cases where the path relation determination unit 2707 determines that each path included in the second symbolic execution result is related to each path included in the first execution result. The created second related information is stored in a storage area such as the RAM 203 or the disk 205.

数式判定部2709は、第1のシンボリック実行結果に含まれるパス出力数式と、取得した第2のシンボリック実行結果に含まれるパス出力数式とが一致するか否かを判断する。数式判定部2709は、第1のシンボリック実行結果に含まれる各パスと第2のシンボリック実行結果に含まれる各パスとの組合せの組ごとに比較する。また、数式判定部2709は、関連情報生成部2704によって生成された第1の関連情報および関連情報作成部2708によって作成された第2の関連情報が示す第1のパス出力数式と第2のパス出力数式とを比較してもよい。なお、比較結果は、RAM203、ディスク205などの記憶領域に記憶される。   The formula determination unit 2709 determines whether the path output formula included in the first symbolic execution result matches the path output formula included in the acquired second symbolic execution result. The formula determination unit 2709 compares each combination included in each path included in the first symbolic execution result and each path included in the second symbolic execution result. The mathematical expression determination unit 2709 also includes a first path output mathematical expression and a second path indicated by the first related information generated by the related information generation unit 2704 and the second related information generated by the related information generation unit 2708. The output formula may be compared. The comparison result is stored in a storage area such as the RAM 203 or the disk 205.

生成判定部2710は、次に示す情報に基づいて、第2の実行結果に含まれる各パスの動作をテストするテストケースを生成すべきか否かを判定する。次に示す情報は、特定部2705による第1の関連情報ごとの特定結果および第2の関連情報ごとの特定結果と、数式判定部2709による第1の実行結果に含まれる各パスと第2の実行結果に含まれる各パスとの組合せの組ごとの判定結果とである。なお、判定結果は、RAM203、ディスク205などの記憶領域に記憶される。   The generation determination unit 2710 determines whether or not to generate a test case for testing the operation of each path included in the second execution result, based on the following information. The following information includes the identification result for each first related information and the identification result for each second related information by the specifying unit 2705, each path included in the first execution result by the mathematical expression determination unit 2709, and the second It is the determination result for each set of combinations with each path included in the execution result. Note that the determination result is stored in a storage area such as the RAM 203 or the disk 205.

図28は、実施の形態2における変更前後のパスを関連付けた結果の一例を示す説明図である。表2801は、変更前プログラムPrePrgのパス条件式とテスト入力値とを示す。表2801は、レコード2801−1〜レコード2801−3を有する。また、表2802は、変更後プログラムPostPrgのパス条件式とテスト入力値とを示す。表2802は、レコード2802−1〜レコード2802−4を有する。表2801と表2802とは、パスIDと、入力変数と、テスト入力値と、パス条件式という、4つのフィールドを有する。   FIG. 28 is an explanatory diagram illustrating an example of a result of associating paths before and after the change in the second embodiment. Table 2801 shows the path conditional expression and test input value of the pre-change program PrePrg. The table 2801 includes records 2801-1 to 2801-3. Table 2802 shows the path conditional expression and the test input value of the post-change program PostPrg. The table 2802 includes records 2802-1 to 2802-4. Tables 2801 and 2802 have four fields: a path ID, an input variable, a test input value, and a path conditional expression.

テストケース生成装置2700は、変更前プログラムPrePrgの各パスのテスト入力値を、変更後プログラムPostPrgのパス条件式PostPCに与える。値を与えたパス条件式が真となった場合、テストケース生成装置2700は、該当のパスPreと、与えられたパス条件式PostPCに対応するパスPostとを関連付けて、関連情報とする。なお、変更前プログラムPrePrgの各パスのテスト入力値は、変更前プログラムをテストする際に生成されており、本実施の形態を実行するために改めて用意しなくてよい。   The test case generation device 2700 gives the test input value of each path of the pre-change program PrePrg to the path conditional expression PostPC of the post-change program PostPrg. When the path conditional expression to which the value is given becomes true, the test case generation device 2700 associates the corresponding path Pre with the path Post corresponding to the given path conditional expression PostPC, and sets it as related information. Note that the test input value of each path of the pre-change program PrePrg is generated when the pre-change program is tested, and need not be prepared again in order to execute the present embodiment.

さらに、テストケース生成装置2700は、変更後プログラムPostPrgの各パスのテスト入力値を、変更前プログラムPrePrgのパス条件式PrePCに与える。値を与えたパス条件式が真となった場合、テストケース生成装置2700は、該当のパスPostと、与えられたパス条件式PostPCに対応するパスPreとを関連付けて、関連情報とする。なお、変更後プログラムPostPrgの各パスのテスト入力値は、制約ソルバを利用することにより生成できる。この時の制約ソルバによるテスト入力値の算出については、条件式が論理積でないために処理量が多くなく、算出にかかる時間は短く済む。   Further, the test case generation device 2700 gives the test input value of each path of the post-change program PostPrg to the path conditional expression PrePC of the pre-change program PrePrg. When the path conditional expression to which the value is given becomes true, the test case generation device 2700 associates the corresponding path Post with the path Pre corresponding to the given path conditional expression PostPC, and sets it as related information. Note that the test input value of each path of the post-change program PostPrg can be generated by using a constraint solver. Regarding the calculation of the test input value by the constraint solver at this time, since the conditional expression is not a logical product, the processing amount is not large, and the time required for the calculation is short.

たとえば、テストケース生成装置2700は、Pre1のテスト入力値“0”を、Post1のパス条件式〜Post4のパス条件式のそれぞれに与える。図28の例では、Post1PCにX=0を与えると真となるため、テストケース生成装置2700は、テストケース組番号1として、Pre1とPost1とを有する関連情報を生成する。   For example, the test case generation device 2700 gives the Pre1 test input value “0” to each of the Post1 path condition expression to the Post4 path condition expression. In the example of FIG. 28, since it becomes true when X = 0 is given to Post1PC, the test case generation device 2700 generates related information having Pre1 and Post1 as the test case group number 1.

関連情報が生成された結果として、図28では、パス関連付け結果2803を示す。パス関連付け結果2803は、パス関連付け結果1001と同一のフィールドを有する。パス関連付け結果2803は、レコード2803−1〜レコード2803−5を有する。ここで、図28で示した関連付け手順では、パス関連付け結果1001のレコード1001−3が示すPre3とPost3との関連情報が生成できていない。Pre3とPost3との関連情報を検出して生成する手順については、図30にて後述する。   As a result of generating the related information, FIG. 28 shows a path correlation result 2803. The path association result 2803 has the same fields as the path association result 1001. The path association result 2803 includes records 2803-1 to 2803-5. Here, in the association procedure shown in FIG. 28, the association information between Pre3 and Post3 indicated by the record 1001-3 of the path association result 1001 cannot be generated. The procedure for detecting and generating the related information between Pre3 and Post3 will be described later with reference to FIG.

図29は、実施の形態2におけるパス条件式変更種別の分類結果の一例を示す説明図である。図29では、テストケース生成装置2700が、図11にて示したパス条件式変更種別の分類手順に従って、関連情報のパス条件式変更種別を分類した結果となるパス条件式変更種別結果2901を示す。パス条件式変更種別結果2901は、レコード2901−1〜レコード2901−5を有する。パス条件式変更種別結果2901の各フィールドは、パス条件式変更種別結果1201と同一であるため、説明を省略する。   FIG. 29 is an explanatory diagram of an example of the classification result of the path conditional expression change type in the second embodiment. In FIG. 29, the test condition generation device 2700 shows a path condition expression change type result 2901 that is a result of classifying the path condition expression change type of the related information in accordance with the path condition expression change type classification procedure shown in FIG. . The path conditional expression change type result 2901 has records 2901-1 to 2901-5. Since each field of the path conditional expression change type result 2901 is the same as the path conditional expression change type result 1201, description thereof will be omitted.

図30は、未生成の変更前後のパス関連付けの作成手順の一例を示す説明図である。図30では、図29から得たパス条件式変更種別結果2901を用いて、未生成の変更前後のパス関連付けを検出して、関連情報を生成する手順について説明する。   FIG. 30 is an explanatory diagram illustrating an example of a procedure for creating a path association before and after an ungenerated change. In FIG. 30, a procedure for generating related information by detecting path association before and after an ungenerated change using the path conditional expression change type result 2901 obtained from FIG. 29 will be described.

表3001は、Pre1PC〜Pre3PCと、Post1PC〜Post4PCとの組合せを示す。まず、Pre1PC〜Pre3PCはそれぞれ排他の関係となる。同様に、Post1PC〜Post4PCもそれぞれ排他の関係となる。また、テストケース生成装置2700は、パス条件式変更種別結果2901から特定される組を取り除いた残余の組に対して、充足可能性を判定する。たとえば、パス条件式変更種別が“重複”を示すレコード2901−2とレコード2901−4とについて、既にテストケース組となった組合せは、充足可能であることが明らかであるため、制約ソルバを使用しなくてよい。   A table 3001 shows combinations of Pre1PC to Pre3PC and Post1PC to Post4PC. First, Pre1PC to Pre3PC have an exclusive relationship. Similarly, Post1PC to Post4PC also have an exclusive relationship. Further, the test case generation device 2700 determines satisfiability with respect to the remaining group obtained by removing the group specified from the path conditional expression change type result 2901. For example, for the records 2901-2 and 2901-4 whose path conditional expression change type indicates “duplicate”, it is clear that the combinations that have already become test case pairs can be satisfied, so the constraint solver is used. You don't have to.

たとえば、パス条件式変更種別が“拡大”を示すレコード2901−1より、Post1PCがPre1PCの拡大の関係となることから、Pre1PCが、Post2PC〜Post4PCと関連することはない。したがって、Pre1PC∧Post2PCの充足可能性と、Pre1PC∧Post3PCの充足可能性と、Pre1PC∧Post4PCの充足可能性とは、全て充足不可能であることが明らかである。これにより、表3001の(1)の矢印が示すように、Pre1PCと、Post1PC〜Post4PCとの制約ソルバによる充足可能性の判定を行わなくてよい。   For example, from the record 2901-1 in which the path conditional expression change type indicates “expanded”, Post1PC has a relationship of expanding Pre1PC, so Pre1PC is not related to Post2PC to Post4PC. Therefore, it is clear that the satisfiability of Pre1PC∧Post2PC, the satisfiability of Pre1PC∧Post3PC, and the satisfiability of Pre1PC∧Post4PC are all unsatisfiable. Thereby, as indicated by the arrow (1) in the table 3001, it is not necessary to determine the satisfiability by the constraint solver between Pre1PC and Post1PC to Post4PC.

また、パス条件式変更種別が“縮小”を示すレコード2901−3より、Post2PCがPre2PCの縮小の関係となることから、Post2PCが、Pre1PCとPre3PCと関連することはない。したがって、Pre2PC∧Post1PCの充足可能性と、Pre2PC∧Post3PCの充足可能性とは、全て充足不可能であることが明らかである。これにより、表3001の(2)の矢印が示すように、Post2PCと、Pre1PC〜Pre3PCとの制約ソルバによる充足可能性の判定を行わなくてよい。   Further, from the record 2901-3 in which the path conditional expression change type indicates “reduction”, Post2PC has a relationship of reduction of Pre2PC, so that Post2PC is not related to Pre1PC and Pre3PC. Therefore, it is clear that the satisfiability of Pre2PC∧Post1PC and the satisfiability of Pre2PC∧Post3PC are all unsatisfiable. As a result, as indicated by the arrow (2) in the table 3001, it is not necessary to determine the satisfiability by the constraint solver between Post2PC and Pre1PC to Pre3PC.

さらに、パス条件式変更種別が“縮小”を示すレコード2901−5より、Post4PCがPre3PCの縮小の関係となることから、Post4PCが、Pre1PCとPre2PCと関連することはない。したがって、Pre1PC∧Post4PCの充足可能性と、Pre2PC∧Post4PCの充足可能性とは、全て充足不可能であることが明らかである。これにより、表3001の(3)の矢印が示すように、Post4PCと、Pre1PC〜Pre3PCとの制約ソルバによる充足可能性の判定を行わなくてよい。   Furthermore, from the record 2901-5 in which the path conditional expression change type indicates “reduction”, Post4PC has a relationship of reduction of Pre3PC, so that Post4PC is not related to Pre1PC and Pre2PC. Therefore, it is clear that the satisfiability of Pre1PC∧Post4PC and the satisfiability of Pre2PC∧Post4PC are all unsatisfiable. As a result, as indicated by the arrow (3) in the table 3001, determination of satisfiability by the constraint solver between Post4PC and Pre1PC to Pre3PC does not have to be performed.

以上より、充足可能か否かを判定できていない組合せは、表3001にて、ハッチを付与した、Pre3PC∧Post1PCと、Pre3PC∧Post3PCとなる。テストケース生成装置2700は、制約ソルバを利用して、Pre3PC∧Post1PCの充足可能性と、Pre3PC∧Post3PCの充足可能性を判定する。判定した結果、Pre3PC∧Post1PCが充足不可能となり、Pre3PC∧Post3PCが充足可能となったため、テストケース生成装置2700は、Pre3PCとPost3PCとの関連情報を作成し、パス条件式変更種別を分類する。   As described above, combinations that have not been determined whether or not they can be satisfied are Pre3PC∧Post1PC and Pre3PC∧Post3PC with hatching in Table 3001. The test case generation apparatus 2700 uses the constraint solver to determine the satisfaction of Pre3PC∧Post1PC and the satisfaction of Pre3PC∧Post3PC. As a result of the determination, Pre3PC∧Post1PC becomes unsatisfiable and Pre3PC 可能 Post3PC becomes unsatisfactory. Therefore, the test case generation device 2700 creates related information between Pre3PC and Post3PC, and classifies the path conditional expression change type.

図30では示さなかったが、パス条件式変更種別が“不変”となった、あるPrePCとあるPostPCがある場合には、あるPrePCと他のPostPCとが関連することはないし、他のPrePCとあるPostPCとが関連することもない。したがって、あるPrePC∧他のPostPCの充足可能性と、他のPrePC∧あるPostPCとは、全て充足不可能であることが明らかであり、制約ソルバを使用しなくてよい。また、上述にて、パス条件式変更種別が“不変”、“拡大”、“縮小”、“重複”それぞれの場合に取り除く組を示したが、取り除く組は、“不変”、“拡大”、“縮小”、“重複”のうちの少なくともいずれか一つであってもよい。   Although not shown in FIG. 30, when there is a certain PrePC and a certain PostPC whose path conditional expression change type is “invariant”, there is no relation between a certain PrePC and another PostPC, It is not related to a certain PostPC. Therefore, it is clear that the satisfaction of a certain PrePC∧other PostPC and the other PrePC∧PostPC are all unsatisfiable, and it is not necessary to use a constraint solver. Further, in the above description, the group to be removed is shown when the path conditional expression change type is “invariant”, “enlarge”, “reduce”, and “duplicate”. It may be at least one of “reduction” and “overlap”.

ここで、実施の形態1における制約ソルバの実行回数と、実施の形態2における制約ソルバの実行回数とを比較する。実施の形態1における制約ソルバは、変更前後のパスの関連付け時に行われる条件式(1)と、作成した関連情報に対する条件式(2−1)、(2−2)と、の充足可能性の判定に使用される。具体的に、テストケース生成装置2700は、制約ソルバを、条件式(1)の充足可能性の判定に3×4=12[回]使用し、6つの関連情報に対して、条件式(2−1)と条件式(2−2)の充足可能性の判定に、6×2=12[回]使用する。以上より、実施の形態1における制約ソルバの合計の使用回数は、12+12=24[回]となる。   Here, the number of executions of the constraint solver in the first embodiment is compared with the number of executions of the constraint solver in the second embodiment. The constraint solver in the first embodiment has a possibility of satisfying the conditional expression (1) performed when the paths before and after the change are associated and the conditional expressions (2-1) and (2-2) for the created related information. Used for judgment. Specifically, the test case generation device 2700 uses the constraint solver 3 × 4 = 12 [times] in the determination of the satisfiability of the conditional expression (1), and the conditional expression (2 −1) and 6 × 2 = 12 [times] are used to determine the satisfaction of the conditional expression (2-2). From the above, the total number of times the constraint solver is used in Embodiment 1 is 12 + 12 = 24 [times].

一方、実施の形態2における制約ソルバは、テスト入力値を用いて生成した関連情報に対する条件式(2−1)、(2−2)と、残余の組に対する条件式(1)と、作成した関連情報に対する条件式(2−1)、(2−2)と、の充足可能性の判定に使用される。具体的に、テストケース生成装置2700は、制約ソルバを、生成した関連情報に対する条件式(2−1)、(2−2)の充足可能性の判定に、5×2=10[回]使用する。そして、テストケース生成装置2700は、制約ソルバを、残余の組に対する条件式(1)の充足可能性の判定に2[回]使用し、作成した関連情報に対する条件式(2−1)と、(2−2)の充足可能性の判定に、1×2=2[回]使用する。以上より、実施の形態2における制約ソルバの合計の使用回数は、10+2+2=14[回]となる。   On the other hand, the constraint solver in the second embodiment is created with the conditional expressions (2-1) and (2-2) for the related information generated using the test input values, and the conditional expression (1) for the remaining set. It is used to determine whether or not the conditional expressions (2-1) and (2-2) for the related information are satisfied. Specifically, the test case generation device 2700 uses the constraint solver 5 × 2 = 10 [times] to determine the satisfaction of the conditional expressions (2-1) and (2-2) for the generated related information. To do. Then, the test case generation device 2700 uses the constraint solver 2 times to determine the satisfaction of the conditional expression (1) for the remaining set, and the conditional expression (2-1) for the created related information, 1 × 2 = 2 [times] is used to determine the sufficiency of (2-2). From the above, the total number of times the constraint solver is used in Embodiment 2 is 10 + 2 + 2 = 14 [times].

したがって、実施の形態2における制約ソルバの合計の使用回数は、実施の形態1における制約ソルバの合計の使用回数より10回分少なくなる。次に、図31〜図34を用いて、実施の形態2におけるテストケース生成処理のフローチャートを説明する。   Therefore, the total number of times the constraint solver is used in the second embodiment is 10 times less than the total number of times the constraint solver is used in the first embodiment. Next, a flowchart of the test case generation process according to the second embodiment will be described with reference to FIGS.

図31は、実施の形態2におけるテストケース生成処理手順の一例を示すフローチャート(その1)である。また、図32は、実施の形態2におけるテストケース生成処理手順の一例を示すフローチャート(その2)である。   FIG. 31 is a flowchart (part 1) illustrating an example of a test case generation processing procedure according to the second embodiment. FIG. 32 is a flowchart (part 2) illustrating an example of a test case generation processing procedure according to the second embodiment.

テストケース生成装置2700は、変更前プログラムPrePrgと変更後プログラムPostPrgとのシンボリック実行結果を取得する(ステップS3101)。次に、テストケース生成装置2700は、変更前プログラムPrePrgのテストケースから、テスト入力値を取得する(ステップS3102)。続けて、テストケース生成装置2700は、変更後プログラムPostPrgのパス条件式を制約ソルバに与えることにより、テスト入力値を生成する(ステップS3103)。次に、テストケース生成装置2700は、テスト入力値による変更前後パス関連付け処理を実行する(ステップS3104)。テスト入力値による変更前後パス関連付け処理の詳細は、図33にて後述する。また、テスト入力値による変更前後パス関連付け処理により、L1個の関連情報を作成したものとする。   The test case generation device 2700 acquires symbolic execution results of the pre-change program PrePrg and the post-change program PostPrg (step S3101). Next, the test case generation device 2700 acquires a test input value from the test case of the pre-change program PrePrg (step S3102). Subsequently, the test case generation device 2700 generates a test input value by giving the path condition expression of the post-change program PostPrg to the constraint solver (step S3103). Next, the test case generation device 2700 executes a before / after change path association process based on the test input value (step S3104). Details of the path association process before and after the change based on the test input value will be described later with reference to FIG. In addition, it is assumed that L1 pieces of related information are created by the path association process before and after the change based on the test input value.

続けて、テストケース生成装置2700は、1をiに代入する(ステップS3105)。次に、テストケース生成装置2700は、i番目の関連情報のパス条件式を、文字列として比較する(ステップS3106)。続けて、テストケース生成装置2700は、比較結果が文字列の一致を示すか否かを判断する(ステップS3107)。   Subsequently, the test case generation device 2700 substitutes 1 for i (step S3105). Next, the test case generation device 2700 compares the path condition expressions of the i-th related information as character strings (step S3106). Subsequently, the test case generation device 2700 determines whether or not the comparison result indicates that the character strings match (step S3107).

比較結果が文字列の一致を示す場合(ステップS3107:Yes)、テストケース生成装置2700は、i番目の関連情報のパス条件式の変更種別を、“不変”に特定する(ステップS3108)。比較結果が文字列の不一致を示す場合(ステップS3107:No)、テストケース生成装置2700は、i番目の関連情報に対して、パス条件式の変更種別特定処理を実行する(ステップS3109)。   If the comparison result indicates that the character strings match (step S3107: YES), the test case generation device 2700 identifies the change type of the path condition expression of the i-th related information as “invariant” (step S3108). When the comparison result indicates that the character strings do not match (step S3107: NO), the test case generation device 2700 executes the path condition expression change type specifying process for the i-th related information (step S3109).

ステップS3108、またはステップS3109の処理終了後、テストケース生成装置2700は、i+1をiに代入する(ステップS3110)。次に、テストケース生成装置2700は、iがL1より大きいか否かを判断する(ステップS3111)。iがL1以下である場合(ステップS3111:No)、テストケース生成装置2700は、ステップS3106の処理に移行する。   After the process of step S3108 or step S3109 is completed, the test case generation device 2700 substitutes i + 1 for i (step S3110). Next, the test case generation device 2700 determines whether i is greater than L1 (step S3111). When i is L1 or less (step S3111: No), the test case generation device 2700 proceeds to the process of step S3106.

iがL1より大きい場合(ステップS3111:Yes)、テストケース生成装置2700は、未検出の変更前後パス関連付け処理を実行する(ステップS3112)。未検出の変更前後パス関連付け処理の詳細は、図34にて後述する。また、未検出の変更前後パス関連付け処理により、L2個の関連情報を作成したものとする。また、L1+L2が、図22で作成した関連情報の個数Lと同一の値となる。ステップS3112の処理終了後、テストケース生成装置2700は、図32に示すステップS3201の処理を実行する。   When i is larger than L1 (step S3111: Yes), the test case generation device 2700 executes an undetected pre-change path association process (step S3112). Details of the undetected before-and-after-change path association processing will be described later with reference to FIG. In addition, it is assumed that L2 pieces of related information are created by the undetected before and after change path association processing. Also, L1 + L2 is the same value as the number L of related information created in FIG. After the process of step S3112 is completed, the test case generation device 2700 executes the process of step S3201 shown in FIG.

ステップS3112の処理終了後、テストケース生成装置2700は、1をiに代入する(ステップS3201)。次に、テストケース生成装置2700は、新たに追加されたL2個の関連情報のうちのi番目の関連情報に対して、パス条件式変更種別分類処理を実行する(ステップS3202)。続けて、テストケース生成装置2700は、i+1をiに代入する(ステップS3203)。次に、テストケース生成装置2700は、iがL2より大きいか否かを判断する(ステップS3204)。iがL2以下である場合(ステップS3204:No)、テストケース生成装置2700は、ステップS3202の処理に移行する。iがL2より大きい場合(ステップS3204:Yes)、テストケース生成装置2700は、1をiに代入する(ステップS3205)。   After the process of step S3112 ends, the test case generation device 2700 substitutes 1 for i (step S3201). Next, the test case generation device 2700 executes a path conditional expression change type classification process on the i-th related information among the newly added L2 related information (step S3202). Subsequently, the test case generation device 2700 substitutes i + 1 for i (step S3203). Next, the test case generation device 2700 determines whether i is greater than L2 (step S3204). When i is L2 or less (step S3204: NO), the test case generation device 2700 proceeds to the process of step S3202. When i is larger than L2 (step S3204: Yes), the test case generation device 2700 substitutes 1 for i (step S3205).

次に、テストケース生成装置2700は、L1+L2個の関連情報のうちのi番目の関連情報に対して、パス出力数式変更種別分類処理を実行する(ステップS3206)。続けて、テストケース生成装置2700は、L1+L2個の関連情報のうちのi番目の関連情報に対して、テストケース分類処理を実行する(ステップS3207)。次に、テストケース生成装置2700は、i+1をiに代入する(ステップS3208)。続けて、テストケース生成装置2700は、iがL1+L2より大きいか否かを判断する(ステップS3209)。iがL1+L2以下である場合(ステップS3209:No)、テストケース生成装置2700は、ステップS3206の処理に移行する。   Next, the test case generation device 2700 executes a path output formula change type classification process for the i-th related information among the L1 + L2 pieces of related information (step S3206). Subsequently, the test case generation device 2700 performs a test case classification process on the i-th related information among the L1 + L2 pieces of related information (step S3207). Next, the test case generation device 2700 substitutes i + 1 for i (step S3208). Subsequently, the test case generation device 2700 determines whether i is larger than L1 + L2 (step S3209). If i is equal to or smaller than L1 + L2 (step S3209: NO), the test case generation device 2700 proceeds to the process of step S3206.

iがL1+L2より大きい場合(ステップS3209:Yes)、テストケース生成装置2700は、テストケース分類結果を出力する(ステップS3210)。次に、テストケース生成装置2700は、テストケースのテスト入力値生成処理を実行する(ステップS3211)。続けて、テストケース生成装置2700は、テスト入力値を生成したテストケースを出力する(ステップS3212)。   When i is larger than L1 + L2 (step S3209: Yes), the test case generation device 2700 outputs a test case classification result (step S3210). Next, the test case generation device 2700 executes test case test input value generation processing (step S3211). Subsequently, the test case generation device 2700 outputs the test case that generated the test input value (step S3212).

ステップS3212の終了後、テストケース生成装置2700は、実施の形態2におけるテストケース生成処理を終了する。実施の形態2におけるテストケース生成処理を実行することにより、テストケース生成装置2700は、変更後プログラムPostPrgの動作をテストするテストケースを生成することができる。さらに、実施の形態2におけるテストケース生成処理を実行することにより、テストケース生成装置2700は、制約ソルバの実行回数を実施の形態2におけるテストケース生成処理より少なくすることができる。   After the end of step S3212, the test case generation device 2700 ends the test case generation process in the second embodiment. By executing the test case generation process in the second embodiment, the test case generation apparatus 2700 can generate a test case for testing the operation of the post-change program PostPrg. Furthermore, by executing the test case generation process in the second embodiment, the test case generation apparatus 2700 can reduce the number of executions of the constraint solver compared to the test case generation process in the second embodiment.

図33は、テスト入力値による変更前後パス関連付け処理手順の一例を示すフローチャートである。テスト入力値による変更前後パス関連付け処理は、テスト入力値を利用して、関連するパス同士を検出して関連情報を生成する処理である。また、図33では、変更前プログラムPrePrgのi番目のパスをPre(i)と表現し、i番目のパスの条件式をPrePC(i)と表現し、i番目のパスをテストするテストケースの入力値をPreIn(i)と表現する。同様に、変更後プログラムPostPrgのk番目のパスをPost(k)と表現し、k番目のパスの条件式を、PostPC(k)と表現し、k番目のパスをテストするテストケースの入力値をPostIn(k)と表現する。   FIG. 33 is a flowchart illustrating an example of a pre-change path association processing procedure based on a test input value. The path association process before and after the change by the test input value is a process for generating related information by detecting related paths using the test input value. In FIG. 33, the i-th path of the pre-change program PrePrg is expressed as Pre (i), the conditional expression of the i-th path is expressed as PrePC (i), and the i-th path is tested. The input value is expressed as PreIn (i). Similarly, the kth path of the post-change program PostPrg is expressed as Post (k), the conditional expression of the kth path is expressed as PostPC (k), and the input value of the test case for testing the kth path Is expressed as PostIn (k).

テストケース生成装置2700は、1をiに代入し、1をkに代入する(ステップS3301)。次に、テストケース生成装置2700は、PreIn(i)を与えたPostPC(k)が真となるか否かを判断する(ステップS3302)。PreIn(i)を与えたPostPC(k)が真となる場合(ステップS3302:Yes)、テストケース生成装置2700は、Pre(i)とPost(k)とをテストケース組とする関連情報を生成する(ステップS3303)。   The test case generation device 2700 substitutes 1 for i and substitutes 1 for k (step S3301). Next, the test case generation device 2700 determines whether PostPC (k) given PreIn (i) is true (step S3302). When PostPC (k) given PreIn (i) is true (step S3302: Yes), the test case generation device 2700 generates related information using Pre (i) and Post (k) as a test case group. (Step S3303).

ステップS3303の処理終了後、または、PreIn(i)を与えたPostPC(k)が偽となる場合(ステップS3302:No)、テストケース生成装置2700は、PostIn(k)を与えたPrePC(i)が真となるか否かを判断する(ステップS3304)。PostIn(k)を与えたPrePC(i)が真となる場合(ステップS3304:Yes)、テストケース生成装置2700は、Pre(i)とPost(k)とをテストケース組とする関連情報を生成する(ステップS3305)。   After the processing of step S3303 or when PostPC (k) given PreIn (i) becomes false (step S3302: No), the test case generation device 2700 gives PrePC (i) given PostIn (k). Is determined to be true (step S3304). When PrePC (i) given PostIn (k) is true (step S3304: Yes), the test case generation device 2700 generates related information using Pre (i) and Post (k) as a test case group. (Step S3305).

ステップS3305の処理終了後、または、PostIn(k)を与えたPrePC(i)が偽となる場合(ステップS3304:No)、テストケース生成装置2700は、k+1をkに代入する(ステップS3306)。次に、テストケース生成装置2700は、kがNより大きいか否かを判断する(ステップS3307)。kがN以下である場合(ステップS3307:No)、テストケース生成装置2700は、ステップS3302の処理に移行する。kがNより大きい場合(ステップS3307:Yes)、テストケース生成装置2700は、i+1をiに代入し、1をkに代入する(ステップS3308)。次に、テストケース生成装置2700は、iがMより大きいか否かを判断する(ステップS3309)。   After the processing of step S3305 is completed, or when PrePC (i) given PostIn (k) becomes false (step S3304: No), the test case generation device 2700 substitutes k + 1 for k (step S3306). Next, the test case generation device 2700 determines whether k is greater than N (step S3307). When k is N or less (step S3307: No), the test case generation device 2700 proceeds to the process of step S3302. When k is larger than N (step S3307: Yes), the test case generation device 2700 substitutes i + 1 into i and substitutes 1 into k (step S3308). Next, the test case generation device 2700 determines whether i is greater than M (step S3309).

iがM以下である場合(ステップS3309:No)、テストケース生成装置2700は、ステップS3302の処理に移行する。iがMより大きい場合(ステップS3309:Yes)、テストケース生成装置2700は、関連情報を出力する(ステップS3310)。ステップS3310の処理終了後、テストケース生成装置2700は、テスト入力値による変更前後パス関連付け処理を終了する。テスト入力値による変更前後パス関連付け処理を実行することにより、テストケース生成装置2700は、制約ソルバを用いずに、関連情報を作成することができる。   When i is M or less (step S3309: No), the test case generation device 2700 proceeds to the process of step S3302. When i is larger than M (step S3309: Yes), the test case generation device 2700 outputs related information (step S3310). After the process of step S3310 ends, the test case generation device 2700 ends the pre-change path association process using the test input value. By executing the before-and-after-change path association processing based on the test input value, the test case generation apparatus 2700 can create the related information without using the constraint solver.

図34は、未検出の変更前後パス関連付け処理手順の一例を示すフローチャートである。未検出の変更前後パス関連付け処理は、テスト入力値によるテストケース関連付け処理により検出されなかった関連情報を検出して、関連情報を生成する処理である。また、図34では、変更前プログラムPrePrgのi番目のパスをPre(i)と表現し、i番目のパスの条件式をPrePC(i)と表現する。同様に、変更後プログラムPostPrgのk番目のパスをPost(k)と表現し、k番目のパスの条件式を、PostPC(k)と表現する。   FIG. 34 is a flowchart illustrating an example of an undetected before / after change path association processing procedure. The undetected pre-change path association process is a process of generating related information by detecting related information that has not been detected by the test case association process based on the test input value. In FIG. 34, the i-th path of the pre-change program PrePrg is expressed as Pre (i), and the conditional expression of the i-th path is expressed as PrePC (i). Similarly, the kth path of the post-change program PostPrg is expressed as Post (k), and the conditional expression of the kth path is expressed as PostPC (k).

テストケース生成装置2700は、1をiに代入する(ステップS3401)。次に、テストケース生成装置2700は、PrePC(i)が、PostPC(k)、k=1,…,Nのいずれかと“不変”または“拡大”の関係か否かを判断する(ステップS3402)。PrePC(i)が、PostPC(k)、k=1,…,Nのいずれかと“不変”または“拡大”の関係でない場合(ステップS3402:No)、テストケース生成装置2700は、1をkに代入する(ステップS3403)。   The test case generation device 2700 substitutes 1 for i (step S3401). Next, the test case generation apparatus 2700 determines whether PrePC (i) is in the “invariant” or “enlarged” relationship with any of PostPC (k), k = 1,..., N (step S3402). . If PrePC (i) is not “invariant” or “enlarged” with any of PostPC (k), k = 1,..., N (step S3402: No), the test case generation apparatus 2700 sets 1 to k. Substitute (step S3403).

次に、テストケース生成装置2700は、PrePCを先頭から末尾まで走査するための変数jを使って、PrePC(j),j=1,…,Mのいずれかが、PostPC(k)と“不変”または“縮小”の関係か否かを判断する(ステップS3404)。PrePC(j),j=1,…,Mのいずれかが、PostPC(k)と“不変”または“縮小”の関係でない場合(ステップS3404:No)、テストケース生成装置2700は、Pre(i)とPost(k)が既にテストケース組か否かを判断する(ステップS3405)。Pre(i)とPost(k)が既にテストケース組でない場合(ステップS3405:No)、テストケース生成装置2700は、PrePC(i)∧PostPC(k)が充足可能か否かを判断する(ステップS3406)。   Next, the test case generation apparatus 2700 uses a variable j for scanning PrePC from the beginning to the end, and any of PrePC (j), j = 1,. It is determined whether the relationship is “reduction” or “reduction” (step S3404). If any of PrePC (j), j = 1,..., M is not in the “invariant” or “reduced” relationship with PostPC (k) (step S3404: No), the test case generation device 2700 uses Pre (i ) And Post (k) are already determined as test case pairs (step S3405). If Pre (i) and Post (k) are not already a test case pair (step S3405: No), the test case generation device 2700 determines whether PrePC (i) ∧PostPC (k) can be satisfied (step). S3406).

PrePC(i)∧PostPC(k)が充足可能である場合(ステップS3406:Yes)、テストケース生成装置2700は、Pre(i)とPost(k)とをテストケース組とする関連情報を作成する(ステップS3407)。   If PrePC (i) ∧PostPC (k) is satisfiable (step S3406: YES), the test case generation device 2700 creates related information that uses Pre (i) and Post (k) as a test case group. (Step S3407).

ステップS3407の実行後、または、PrePC(i)∧PostPC(k)が充足可能でない場合(ステップS3406:No)、テストケース生成装置2700は、k+1をkに代入する(ステップS3408)。また、PrePC(j),j=1,…,Mのいずれかが、PostPC(k)と“不変”または“縮小”の関係である場合(ステップS3404:Yes)、Pre(i)とPost(k)が既にテストケース組である場合(ステップS3405:Yes)、テストケース生成装置2700は、ステップS3408の処理を実行する。   After execution of step S3407 or when PrePC (i) ∧PostPC (k) is not satisfiable (step S3406: No), the test case generation device 2700 substitutes k + 1 for k (step S3408). Further, if any of PrePC (j), j = 1,..., M has a relationship of “invariant” or “reduction” with PostPC (k) (step S3404: Yes), Pre (i) and Post ( If k) is already a test case group (step S3405: YES), the test case generation device 2700 executes the process of step S3408.

ステップS3408の処理終了後、テストケース生成装置2700は、kがNより大きいか否かを判断する(ステップS3409)。kがN以下である場合(ステップS3409:No)、テストケース生成装置2700は、ステップS3404の処理に移行する。   After the process of step S3408 is completed, the test case generation device 2700 determines whether k is greater than N (step S3409). When k is N or less (step S3409: No), the test case generation device 2700 proceeds to the process of step S3404.

PrePC(i)が、PostPC(k)、k=1,…,Nのいずれかと“不変”または“拡大”の関係である場合(ステップS3402:Yes)、または、kがNより大きい場合(ステップS3409:Yes)、テストケース生成装置2700は、i+1をiに代入する(ステップS3410)。次に、テストケース生成装置2700は、iがMより大きいか否かを判断する(ステップS3411)。   When PrePC (i) has a relationship of “invariant” or “enlargement” with any of PostPC (k), k = 1,..., N (step S3402: Yes), or when k is larger than N (step (S3409: Yes), the test case generation device 2700 substitutes i + 1 into i (step S3410). Next, the test case generation device 2700 determines whether i is greater than M (step S3411).

iがM以下である場合(ステップS3411:No)、テストケース生成装置2700は、ステップS3402の処理に移行する。iがMより大きい場合(ステップS3411:Yes)、テストケース生成装置2700は、生成した関連情報を新たな関連情報として追加する(ステップS3412)。ステップS3412の処理終了後、テストケース生成装置2700は、未検出の変更前後パス関連付け処理を終了する。未検出の変更前後パス関連付け処理を実行することにより、テストケース生成装置2700は、テスト入力値による変更前後パス関連付け処理により検出されなかった関連情報を検出することができる。   When i is M or less (step S3411: NO), the test case generation device 2700 proceeds to the process of step S3402. When i is larger than M (step S3411: Yes), the test case generation device 2700 adds the generated related information as new related information (step S3412). After the process of step S3412 is completed, the test case generation device 2700 ends the undetected pre-change path association process. By executing the undetected pre-change path association process, the test case generation device 2700 can detect related information that has not been detected by the pre-change path association process using the test input value.

以上説明したように、テストケース生成装置2700によれば、テスト入力値を用いて関連情報を作成してもよい。これにより、テストケース生成装置2700は、制約ソルバを用いずに、関連情報を作成することができ、制約ソルバの実行回数を削減することができる。   As described above, according to the test case generation device 2700, related information may be created using a test input value. Thereby, the test case generation device 2700 can create related information without using the constraint solver, and can reduce the number of times the constraint solver is executed.

また、テストケース生成装置2700によれば、変更前プログラムPrePrgに含まれる各パスと変更後プログラムPostPrgに含まれる各パスとの組合せの組から、関連情報のパス条件式変更種別から特定される組を取り除く。続けて、テストケース生成装置2700は、取り除いた残余の組に対して、変更前プログラムPrePrgに含まれる各パスと変更後プログラムPostPrgに含まれる各パスが関連するか否かを判断してもよい。これにより、テストケース生成装置2700は、テストケース生成装置100が制約ソルバを利用する回数よりも少ない回数で、関連情報を特定することができる。   Further, according to the test case generation device 2700, a combination identified from the combination of each path included in the pre-change program PrePrg and each path included in the post-change program PostPrg from the path condition expression change type of the related information. Remove. Subsequently, the test case generation apparatus 2700 may determine whether or not each path included in the pre-change program PrePrg and each path included in the post-change program PostPrg are related to the removed remaining set. . Thereby, the test case generation device 2700 can specify the related information with a number of times smaller than the number of times that the test case generation device 100 uses the constraint solver.

なお、本実施の形態で説明したテストケース生成方法は、予め用意されたプログラムをパーソナル・コンピュータやワークステーション等のコンピュータで実行することにより実現することができる。本テストケース生成プログラムは、ハードディスク、フレキシブルディスク、CD−ROM、MO、DVD等のコンピュータで読み取り可能な記録媒体に記録され、コンピュータによって記録媒体から読み出されることによって実行される。また本テストケース生成プログラムは、インターネット等のネットワークを介して配布してもよい。   Note that the test case 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 case 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 case generation program may be distributed via a network such as the Internet.

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

(付記1)コンピュータが、
第1のプログラムをシンボリック実行することにより、前記第1のプログラムに含まれる入力変数が取り得る値のうちの前記第1のプログラムに含まれる第1のパスが実行される条件となる前記入力変数の値を表す第1の条件式と、前記第1のパスが実行された場合に出力される前記第1のプログラムに含まれる出力変数を表す第1の数式と、を含む第1の実行結果を取得し、
前記第1のプログラムの一部が変更された第2のプログラムをシンボリック実行することにより、前記入力変数の取り得る値のうちの前記第2のプログラムに含まれる第2のパスが実行される条件となる前記入力変数の値を表す第2の条件式と、前記第2のパスが実行された場合に出力される前記第2のプログラムに含まれる出力変数を表す第2の数式と、を含む第2の実行結果を取得し、
前記入力変数が取り得る値のうちの、取得した前記第1の条件式と取得した前記第2の条件式との論理積を真とする値の有無に基づいて、前記第2のパスが前記第1のパスに関連するか否かを判断し、
取得した前記第1の数式と、取得した前記第2の数式とが一致するか否かを判定し、
判断結果と判定結果とに基づいて、前記第2のパスの動作をテストするテストケースを生成すべきか否かを判定する、
処理を実行することを特徴とするテストケース生成方法。
(Supplementary note 1)
The input variable which becomes a condition for executing the first pass included in the first program out of the possible values of the input variable included in the first program by performing symbolic execution of the first program A first execution result including a first conditional expression representing the value of the first expression and a first mathematical expression representing an output variable included in the first program that is output when the first pass is executed Get
Conditions for executing a second pass included in the second program among possible values of the input variable by executing symbolically the second program in which a part of the first program is changed A second conditional expression representing the value of the input variable, and a second mathematical expression representing an output variable included in the second program that is output when the second pass is executed. Get the second execution result,
Of the possible values of the input variable, based on the presence or absence of a value that makes the logical product of the acquired first conditional expression and the acquired second conditional expression true, the second path is Determine if it is related to the first pass,
Determining whether the acquired first mathematical formula and the acquired second mathematical formula match,
Determining whether to generate a test case for testing the operation of the second path based on the determination result and the determination result;
A test case generation method characterized by executing processing.

(付記2)前記コンピュータが、
前記第2のパスの動作をテストするテストケースを生成すべきであると判定した場合、前記第2の条件式を真とする前記入力変数の値を算出し、
算出した前記値を前記入力変数の値とする前記第2のパスの動作をテストするテストケースを生成する、
処理を実行することを特徴とする付記1に記載のテストケース生成方法。
(Appendix 2) The computer
If it is determined that a test case for testing the operation of the second path should be generated, the value of the input variable that makes the second conditional expression true is calculated;
Generating a test case for testing the operation of the second pass using the calculated value as the value of the input variable;
The test case generation method according to attachment 1, wherein the process is executed.

(付記3)前記コンピュータが、
前記第2のパスが前記第1のパスに関連すると判断し、かつ、前記第1の数式と前記第2の数式とが一致すると判定した場合、前記入力変数が取り得る値のうちの前記第1の条件式と前記第2の条件式の否定との論理積を真とする値の有無を特定するとともに、前記入力変数が取り得る値のうちの前記第1の条件式の否定と前記第2の条件式との論理積を真とする値の有無を特定する、処理を実行し、
前記テストケースを生成すべきか否かを判定する処理は、
特定結果に基づいて、前記第2のパスの動作をテストするテストケースを生成すべきか否かを判定することを特徴とする付記1または2に記載のテストケース生成方法。
(Supplementary note 3)
When it is determined that the second path is related to the first path, and the first mathematical expression and the second mathematical expression match, the first of the possible values of the input variable The presence or absence of a value that is true of the logical product of the conditional expression 1 and the negation of the second conditional expression, and the negation of the first conditional expression and the first Execute the process of specifying the presence or absence of a value that is the logical product of the conditional expression 2 and
The process of determining whether to generate the test case is as follows:
3. The test case generation method according to appendix 1 or 2, wherein it is determined whether or not a test case for testing the operation of the second path should be generated based on a specific result.

(付記4)前記コンピュータが、
前記第2のパスが前記第1のパスに関連すると判断し、かつ、前記第1の数式と前記第2の数式とが一致すると判定した場合、前記入力変数が取り得る値のうちの前記第1の条件式の否定と前記第2の条件式との論理積を真とする値の有無を特定する、処理を実行し、
前記テストケースを生成すべきか否かを判定する処理は、
前記第1の条件式の否定と前記第2の条件式との論理積を真とする値が有ると特定した場合、前記第2のパスの動作をテストするテストケースを生成すべきであると判定し、
前記算出する処理は、
前記第2のパスの動作をテストするテストケースを生成すべきであると判定した場合、前記第1の条件式の否定と前記第2の条件式との論理積を真とする前記入力変数の値を算出することを特徴とする付記2に記載のテストケース生成方法。
(Appendix 4) The computer
When it is determined that the second path is related to the first path, and the first mathematical expression and the second mathematical expression match, the first of the possible values of the input variable Specifying the presence or absence of a value that is the logical product of the negation of the conditional expression 1 and the second conditional expression,
The process of determining whether to generate the test case is as follows:
When it is specified that there is a value that is the logical product of the negation of the first conditional expression and the second conditional expression, a test case for testing the operation of the second pass should be generated. Judgment,
The calculation process is as follows:
If it is determined that a test case for testing the operation of the second path should be generated, the input variable that is the logical product of the negation of the first conditional expression and the second conditional expression is true. The test case generation method according to appendix 2, wherein a value is calculated.

(付記5)前記判断する処理は、
前記第1のパスの動作をテストするテストケースの入力値を、前記第2のパスの条件式に与えた場合に前記第2の条件式が真となるか否かに基づいて、前記第2のパスが前記第1のパスに関連するか否かを判断することを特徴とする付記1〜4のいずれか一つに記載のテストケース生成方法。
(Supplementary Note 5)
Based on whether or not the second conditional expression is true when an input value of a test case for testing the operation of the first path is given to the conditional expression of the second path, The test case generation method according to any one of appendices 1 to 4, wherein it is determined whether or not the path is related to the first path.

(付記6)前記コンピュータが、
前記第2のパスが前記第1のパスに関連すると判断した場合、前記入力変数が取り得る値のうちの前記第1の条件式と前記第2の条件式の否定との論理積を真とする値の有無を特定するとともに、前記入力変数が取り得る値のうちの前記第1の条件式の否定と前記第2の条件式との論理積を真とする値の有無を特定し、
特定結果に基づいて、前記第2のパスが前記第1のプログラムに含まれるパス群のうちの前記第1のパスとは異なるパスに関連しないことを判断する、
処理を実行することを特徴とする付記1〜5のいずれか一つに記載のテストケース生成方法。
(Appendix 6) The computer
If it is determined that the second path is related to the first path, the logical product of the first conditional expression and the negation of the second conditional expression among the possible values of the input variable is true. Specifying the presence or absence of a value to be determined, and specifying the presence or absence of a value that makes the logical product of the negation of the first conditional expression and the second conditional expression out of the possible values of the input variable,
Determining that the second path is not related to a path different from the first path in the path group included in the first program based on the specific result;
The test case generation method according to any one of appendices 1 to 5, wherein the process is executed.

(付記7)前記コンピュータが、
前記第2のパスが前記第1のパスに関連すると判断した場合、前記入力変数が取り得る値のうちの前記第1の条件式と前記第2の条件式の否定との論理積を真とする値の有無を特定するとともに、前記入力変数が取り得る値のうちの前記第1の条件式の否定と前記第2の条件式との論理積を真とする値の有無を特定し、
特定結果に基づいて、前記第2のプログラムに含まれるパス群のうちの前記第2のパスとは異なるパスが前記第1のパスに関連しないことを判断する、
処理を実行することを特徴とする付記1〜6のいずれか一つに記載のテストケース生成方法。
(Supplementary note 7)
If it is determined that the second path is related to the first path, the logical product of the first conditional expression and the negation of the second conditional expression among the possible values of the input variable is true. Specifying the presence or absence of a value to be determined, and specifying the presence or absence of a value that makes the logical product of the negation of the first conditional expression and the second conditional expression out of the possible values of the input variable,
Based on the specific result, it is determined that a path different from the second path in the path group included in the second program is not related to the first path.
The test case generation method according to any one of appendices 1 to 6, wherein the process is executed.

(付記8)前記入力変数が取り得る値のうちの前記各々のパスが実行される条件となる前記入力変数の値を表す条件式と、前記各々のパスが実行された場合に出力される前記第1のプログラムに含まれる出力変数を表す数式とを含み、
前記コンピュータが、
前記第1の実行結果に含まれるパスと前記第2のパスとの組ごとに、前記入力変数が取り得る値のうちの前記パスの条件式と前記第2の条件式との論理積を真とする値の有無に基づいて、前記第2のパスが前記パスに関連するか否かを判断する、処理を実行し、
前記数式を判定する処理は、
前記組ごとに、取得した前記第1の実行結果に含まれる数式と、取得した前記第2の数式とが一致するか否かを判定し、
前記テストケースを生成すべきか否かを判定する処理は、
前記組ごとの判断情報と前記組ごとの判定結果とに基づいて、前記第2のパスの動作をテストするテストケースを生成すべきか否かを判定することを特徴とする付記1〜4のいずれか一つに記載のテストケース生成方法。
(Additional remark 8) The conditional expression showing the value of the said input variable used as the condition for each said path | pass being executed among the values which the said input variable can take, and the said output when each said path | pass is performed A mathematical expression representing an output variable included in the first program,
The computer is
For each pair of the path and the second path included in the first execution result, the logical product of the conditional expression of the path and the second conditional expression among the possible values of the input variable is true. Performing a process of determining whether the second path is related to the path based on the presence of a value of
The process of determining the formula is as follows:
For each set, it is determined whether the mathematical expression included in the acquired first execution result matches the acquired second mathematical expression;
The process of determining whether to generate the test case is as follows:
Any one of appendices 1 to 4, wherein it is determined whether or not a test case for testing the operation of the second path should be generated based on the determination information for each set and the determination result for each set. The test case generation method according to any one of the above.

(付記9)前記第2の実行結果は、前記第2のプログラムに含まれるパス群の各々のパスごとの、前記入力変数が取り得る値のうちの前記各々のパスが実行される条件となる前記入力変数の値を表す条件式と、前記各々のパスが実行された場合に出力される前記第2のプログラムに含まれる出力変数を表す数式とを含み、
前記判断する処理は、
前記第1の実行結果に含まれるパスと前記第2の実行結果に含まれる各パスとの組ごとに、前記入力変数が取り得る値のうちの前記第1の実行結果に含まれるパスの条件式と前記第2の実行結果に含まれるパスとの論理積を真とする値の有無に基づいて、前記第2の実行結果に含まれるパスが前記第1の実行結果に含まれるパスに関連するか否かを判断し、
前記数式を判定する処理は、
前記第1の実行結果に含まれる各パスと前記第2の実行結果に含まれる各パスとの組合せの組ごとに、取得した前記第1の実行結果に含まれる数式と、取得した前記第2の実行結果に含まれる数式とが一致するか否かを判定し、
前記テストケースを生成すべきか否かを判定する処理は、
前記組ごとの判断結果と、前記組ごとの判定結果と、に基づいて、前記第2の実行結果に含まれるパスの動作をテストするテストケースを生成すべきか否かを判定することを特徴とする付記8に記載のテストケース生成方法。
(Supplementary Note 9) The second execution result is a condition for executing each of the paths that can be taken by the input variable for each path of the path group included in the second program. A conditional expression representing the value of the input variable, and a mathematical expression representing an output variable included in the second program that is output when each of the passes is executed,
The determination process is as follows:
A condition of the path included in the first execution result among the possible values of the input variable for each set of the path included in the first execution result and each path included in the second execution result. The path included in the second execution result is related to the path included in the first execution result based on the presence / absence of a value that makes the logical product of the expression and the path included in the second execution result true. Decide whether or not to
The process of determining the formula is as follows:
For each set of combinations of each path included in the first execution result and each path included in the second execution result, the mathematical expression included in the acquired first execution result, and the acquired second It is determined whether or not the mathematical expression included in the execution result of
The process of determining whether to generate the test case is as follows:
Determining whether to generate a test case for testing the operation of a path included in the second execution result based on the determination result for each set and the determination result for each set; The test case generation method according to appendix 8.

(付記10)第1のプログラムをシンボリック実行することにより、前記第1のプログラムに含まれる入力変数が取り得る値のうちの前記第1のプログラムに含まれる第1のパスが実行される条件となる前記入力変数の値を表す第1の条件式と、前記第1のパスが実行された場合に出力される前記第1のプログラムに含まれる出力変数を表す第1の数式と、を含む第1の実行結果を取得する第1取得部と、
前記第1のプログラムの一部が変更された第2のプログラムをシンボリック実行することにより、前記入力変数の取り得る値のうちの前記第2のプログラムに含まれる第2のパスが実行される条件となる前記入力変数の値を表す第2の条件式と、前記第2のパスが実行された場合に出力される前記第2のプログラムに含まれる出力変数を表す第2の数式と、を含む第2の実行結果を取得する第2取得部と、
前記入力変数が取り得る値のうちの、前記第1取得部によって取得された前記第1の条件式と前記第2取得部によって取得された前記第2の条件式との論理積を真とする値の有無に基づいて、前記第2のパスが前記第1のパスに関連するか否かを判断するパス関連判断部と、
前記第1取得部によって取得された前記第1の数式と、前記第2取得部によって取得された前記第2の数式とが一致するか否かを判定する数式判定部と、
前記パス関連判断部による判断結果と前記数式判定部による判定結果とに基づいて、前記第2のパスの動作をテストするテストケースを生成すべきか否かを判定する生成判定部と、
を有することを特徴とするテストケース生成装置。
(Supplementary Note 10) Conditions for executing the first pass included in the first program out of the possible values of the input variable included in the first program by executing the first program symbolically. A first conditional expression that represents the value of the input variable and a first mathematical expression that represents the output variable included in the first program that is output when the first pass is executed. A first acquisition unit that acquires an execution result of 1;
Conditions for executing a second pass included in the second program among possible values of the input variable by executing symbolically the second program in which a part of the first program is changed A second conditional expression representing the value of the input variable, and a second mathematical expression representing an output variable included in the second program that is output when the second pass is executed. A second acquisition unit for acquiring a second execution result;
Of the possible values of the input variable, the logical product of the first conditional expression acquired by the first acquisition unit and the second conditional expression acquired by the second acquisition unit is true. A path-related determination unit that determines whether the second path is related to the first path based on the presence or absence of a value;
A formula determination unit that determines whether or not the first formula acquired by the first acquisition unit matches the second formula acquired by the second acquisition unit;
A generation determination unit that determines whether to generate a test case for testing the operation of the second path, based on a determination result by the path relation determination unit and a determination result by the formula determination unit;
A test case generation device characterized by comprising:

(付記11)第1のプログラムをシンボリック実行することにより、前記第1のプログラムに含まれる入力変数が取り得る値のうちの前記第1のプログラムに含まれる第1のパスが実行される条件となる前記入力変数の値を表す第1の条件式と、前記第1のパスが実行された場合に出力される前記第1のプログラムに含まれる出力変数を表す第1の数式と、を含む第1の実行結果を取得する第1取得部と、
前記第1のプログラムの一部が変更された第2のプログラムをシンボリック実行することにより、前記入力変数の取り得る値のうちの前記第2のプログラムに含まれる第2のパスが実行される条件となる前記入力変数の値を表す第2の条件式と、前記第2のパスが実行された場合に出力される前記第2のプログラムに含まれる出力変数を表す第2の数式と、を含む第2の実行結果を取得する第2取得部と、
前記入力変数が取り得る値のうちの、前記第1取得部によって取得された前記第1の条件式と前記第2取得部によって取得された前記第2の条件式との論理積を真とする値の有無に基づいて、前記第2のパスが前記第1のパスに関連するか否かを判断するパス関連判断部と、
前記第1取得部によって取得された前記第1の数式と、前記第2取得部によって取得された前記第2の数式とが一致するか否かを判定する数式判定部と、
前記パス関連判断部による判断結果と前記数式判定部による判定結果とに基づいて、前記第2のパスの動作をテストするテストケースを生成すべきか否かを判定する生成判定部と、
を有するコンピュータを含むことを特徴とするテストケース生成装置。
(Supplementary Note 11) Conditions for executing the first pass included in the first program among the possible values of the input variable included in the first program by performing symbolic execution of the first program A first conditional expression that represents the value of the input variable and a first mathematical expression that represents the output variable included in the first program that is output when the first pass is executed. A first acquisition unit that acquires an execution result of 1;
Conditions for executing a second pass included in the second program among possible values of the input variable by executing symbolically the second program in which a part of the first program is changed A second conditional expression representing the value of the input variable, and a second mathematical expression representing an output variable included in the second program that is output when the second pass is executed. A second acquisition unit for acquiring a second execution result;
Of the possible values of the input variable, the logical product of the first conditional expression acquired by the first acquisition unit and the second conditional expression acquired by the second acquisition unit is true. A path-related determination unit that determines whether the second path is related to the first path based on the presence or absence of a value;
A formula determination unit that determines whether or not the first formula acquired by the first acquisition unit matches the second formula acquired by the second acquisition unit;
A generation determination unit that determines whether or not to generate a test case for testing the operation of the second path based on a determination result by the path relation determination unit and a determination result by the formula determination unit;
A test case generation apparatus including a computer having

(付記12)コンピュータに、
第1のプログラムをシンボリック実行することにより、前記第1のプログラムに含まれる入力変数が取り得る値のうちの前記第1のプログラムに含まれる第1のパスが実行される条件となる前記入力変数の値を表す第1の条件式と、前記第1のパスが実行された場合に出力される前記第1のプログラムに含まれる出力変数を表す第1の数式と、を含む第1の実行結果を取得し、
前記第1のプログラムの一部が変更された第2のプログラムをシンボリック実行することにより、前記入力変数の取り得る値のうちの前記第2のプログラムに含まれる第2のパスが実行される条件となる前記入力変数の値を表す第2の条件式と、前記第2のパスが実行された場合に出力される前記第2のプログラムに含まれる出力変数を表す第2の数式と、を含む第2の実行結果を取得し、
前記入力変数が取り得る値のうちの、取得した前記第1の条件式と取得した前記第2の条件式との論理積を真とする値の有無に基づいて、前記第2のパスが前記第1のパスに関連するか否かを判断し、
取得した前記第1の数式と、取得した前記第2の数式とが一致するか否かを判定し、
判断結果と判定結果とに基づいて、前記第2のパスの動作をテストするテストケースを生成すべきか否かを判定する、
処理を実行させることを特徴とするテストケース生成プログラム。
(Supplementary note 12)
The input variable which becomes a condition for executing the first pass included in the first program out of the possible values of the input variable included in the first program by performing symbolic execution of the first program A first execution result including a first conditional expression representing the value of the first expression and a first mathematical expression representing an output variable included in the first program that is output when the first pass is executed Get
Conditions for executing a second pass included in the second program among possible values of the input variable by executing symbolically the second program in which a part of the first program is changed A second conditional expression representing the value of the input variable, and a second mathematical expression representing an output variable included in the second program that is output when the second pass is executed. Get the second execution result,
Of the possible values of the input variable, based on the presence or absence of a value that makes the logical product of the acquired first conditional expression and the acquired second conditional expression true, the second path is Determine if it is related to the first pass,
Determining whether the acquired first mathematical formula and the acquired second mathematical formula match,
Determining whether to generate a test case for testing the operation of the second path based on the determination result and the determination result;
A test case generation program characterized by causing a process to be executed.

(付記13)第1のプログラムをシンボリック実行することにより、前記第1のプログラムに含まれる入力変数が取り得る値のうちの前記第1のプログラムに含まれる第1のパスが実行される条件となる前記入力変数の値を表す第1の条件式と、前記第1のパスが実行された場合に出力される前記第1のプログラムに含まれる出力変数を表す第1の数式と、を含む第1の実行結果を取得し、
前記第1のプログラムの一部が変更された第2のプログラムをシンボリック実行することにより、前記入力変数の取り得る値のうちの前記第2のプログラムに含まれる第2のパスが実行される条件となる前記入力変数の値を表す第2の条件式と、前記第2のパスが実行された場合に出力される前記第2のプログラムに含まれる出力変数を表す第2の数式と、を含む第2の実行結果を取得し、
前記入力変数が取り得る値のうちの、取得した前記第1の条件式と取得した前記第2の条件式との論理積を真とする値の有無に基づいて、前記第2のパスが前記第1のパスに関連するか否かを判断し、
取得した前記第1の数式と、取得した前記第2の数式とが一致するか否かを判定し、
判断結果と判定結果とに基づいて、前記第2のパスの動作をテストするテストケースを生成すべきか否かを判定する、
処理をコンピュータに実行させるテストケース生成プログラムを記録したことを特徴する記録媒体。
(Supplementary note 13) Conditions for executing the first pass included in the first program out of the possible values of the input variables included in the first program by performing symbolic execution of the first program A first conditional expression that represents the value of the input variable and a first mathematical expression that represents the output variable included in the first program that is output when the first pass is executed. Get the execution result of 1,
Conditions for executing a second pass included in the second program among possible values of the input variable by executing symbolically the second program in which a part of the first program is changed A second conditional expression representing the value of the input variable, and a second mathematical expression representing an output variable included in the second program that is output when the second pass is executed. Get the second execution result,
Of the possible values of the input variable, based on the presence or absence of a value that makes the logical product of the acquired first conditional expression and the acquired second conditional expression true, the second path is Determine if it is related to the first pass,
Determining whether the acquired first mathematical formula and the acquired second mathematical formula match,
Determining whether to generate a test case for testing the operation of the second path based on the determination result and the determination result;
A recording medium on which a test case generation program for causing a computer to execute processing is recorded.

100、2700 テストケース生成装置
701、801 シンボリック実行結果
901、2701 第1取得部
902、2702 第2取得部
903、2707 パス関連判断部
904、2708 関連情報作成部
905、2705 特定部
906、2709 数式判定部
907、2710 生成判定部
908 算出部
909 テストケース生成部
2703 テスト入力値判断部
2704 関連情報生成部
2706 組作成部
100, 2700 Test case generation device 701, 801 Symbolic execution result 901, 2701 First acquisition unit 902, 2702 Second acquisition unit 903, 2707 Path related determination unit 904, 2708 Related information creation unit 905, 2705 Identification unit 906, 2709 Formula Determination unit 907, 2710 Generation determination unit 908 Calculation unit 909 Test case generation unit 2703 Test input value determination unit 2704 Related information generation unit 2706 Set generation unit

Claims (9)

コンピュータが、
第1のプログラムをシンボリック実行することにより、前記第1のプログラムに含まれる入力変数が取り得る値のうちの前記第1のプログラムに含まれる第1のパスが実行される条件となる前記入力変数の値を表す第1の条件式と、前記第1のパスが実行された場合に出力される前記第1のプログラムに含まれる出力変数を表す第1の数式と、を含む第1の実行結果を取得し、
前記第1のプログラムの一部が変更された第2のプログラムをシンボリック実行することにより、前記入力変数の取り得る値のうちの前記第2のプログラムに含まれる第2のパスが実行される条件となる前記入力変数の値を表す第2の条件式と、前記第2のパスが実行された場合に出力される前記第2のプログラムに含まれる出力変数を表す第2の数式と、を含む第2の実行結果を取得し、
前記入力変数が取り得る値のうちの、取得した前記第1の条件式と取得した前記第2の条件式との論理積を真とする値の有無に基づいて、前記第2のパスが前記第1のパスに関連するか否かを判断し、
取得した前記第1の数式と、取得した前記第2の数式とが一致するか否かを判定し、
判断結果と判定結果とに基づいて、前記第2のパスの動作をテストするテストケースを生成すべきか否かを判定する、
処理を実行することを特徴とするテストケース生成方法。
Computer
The input variable which becomes a condition for executing the first pass included in the first program out of the possible values of the input variable included in the first program by performing symbolic execution of the first program A first execution result including a first conditional expression representing the value of the first expression and a first mathematical expression representing an output variable included in the first program that is output when the first pass is executed Get
Conditions for executing a second pass included in the second program among possible values of the input variable by executing symbolically the second program in which a part of the first program is changed A second conditional expression representing the value of the input variable, and a second mathematical expression representing an output variable included in the second program that is output when the second pass is executed. Get the second execution result,
Of the possible values of the input variable, based on the presence or absence of a value that makes the logical product of the acquired first conditional expression and the acquired second conditional expression true, the second path is Determine if it is related to the first pass,
Determining whether the acquired first mathematical formula and the acquired second mathematical formula match,
Determining whether to generate a test case for testing the operation of the second path based on the determination result and the determination result;
A test case generation method characterized by executing processing.
前記コンピュータが、
前記第2のパスの動作をテストするテストケースを生成すべきであると判定した場合、前記第2の条件式を真とする前記入力変数の値を算出し、
算出した前記値を前記入力変数の値とする前記第2のパスの動作をテストするテストケースを生成する、
処理を実行することを特徴とする請求項1に記載のテストケース生成方法。
The computer is
If it is determined that a test case for testing the operation of the second path should be generated, the value of the input variable that makes the second conditional expression true is calculated;
Generating a test case for testing the operation of the second pass using the calculated value as the value of the input variable;
The test case generation method according to claim 1, wherein the process is executed.
前記コンピュータが、
前記第2のパスが前記第1のパスに関連すると判断し、かつ、前記第1の数式と前記第2の数式とが一致すると判定した場合、前記入力変数が取り得る値のうちの前記第1の条件式と前記第2の条件式の否定との論理積を真とする値の有無を特定するとともに、前記入力変数が取り得る値のうちの前記第1の条件式の否定と前記第2の条件式との論理積を真とする値の有無を特定する、処理を実行し、
前記テストケースを生成すべきか否かを判定する処理は、
特定結果に基づいて、前記第2のパスの動作をテストするテストケースを生成すべきか否かを判定することを特徴とする請求項1または2に記載のテストケース生成方法。
The computer is
When it is determined that the second path is related to the first path, and the first mathematical expression and the second mathematical expression match, the first of the possible values of the input variable The presence or absence of a value that is true of the logical product of the conditional expression 1 and the negation of the second conditional expression, and the negation of the first conditional expression and the first Execute the process of specifying the presence or absence of a value that is the logical product of the conditional expression 2 and
The process of determining whether to generate the test case is as follows:
The test case generation method according to claim 1, wherein it is determined whether or not a test case for testing the operation of the second path should be generated based on a specific result.
前記コンピュータが、
前記第2のパスが前記第1のパスに関連すると判断し、かつ、前記第1の数式と前記第2の数式とが一致すると判定した場合、前記入力変数が取り得る値のうちの前記第1の条件式の否定と前記第2の条件式との論理積を真とする値の有無を特定する、処理を実行し、
前記テストケースを生成すべきか否かを判定する処理は、
前記第1の条件式の否定と前記第2の条件式との論理積を真とする値が有ると特定した場合、前記第2のパスの動作をテストするテストケースを生成すべきであると判定し、
前記算出する処理は、
前記第2のパスの動作をテストするテストケースを生成すべきであると判定した場合、前記第1の条件式の否定と前記第2の条件式との論理積を真とする前記入力変数の値を算出することを特徴とする請求項2に記載のテストケース生成方法。
The computer is
When it is determined that the second path is related to the first path, and the first mathematical expression and the second mathematical expression match, the first of the possible values of the input variable Specifying the presence or absence of a value that is the logical product of the negation of the conditional expression 1 and the second conditional expression,
The process of determining whether to generate the test case is as follows:
When it is specified that there is a value that is the logical product of the negation of the first conditional expression and the second conditional expression, a test case for testing the operation of the second pass should be generated. Judgment,
The calculation process is as follows:
If it is determined that a test case for testing the operation of the second path should be generated, the input variable that is the logical product of the negation of the first conditional expression and the second conditional expression is true. The test case generation method according to claim 2, wherein a value is calculated.
前記判断する処理は、
前記第1のパスの動作をテストするテストケースの入力値を、前記第2のパスの条件式に与えた場合に前記第2の条件式が真となるか否かに基づいて、前記第2のパスが前記第1のパスに関連するか否かを判断することを特徴とする請求項1〜4のいずれか一つに記載のテストケース生成方法。
The determination process is as follows:
Based on whether or not the second conditional expression is true when an input value of a test case for testing the operation of the first path is given to the conditional expression of the second path, 5. The test case generation method according to claim 1, wherein it is determined whether or not the first path is related to the first path.
前記コンピュータが、
前記第2のパスが前記第1のパスに関連すると判断した場合、前記入力変数が取り得る値のうちの前記第1の条件式と前記第2の条件式の否定との論理積を真とする値の有無を特定するとともに、前記入力変数が取り得る値のうちの前記第1の条件式の否定と前記第2の条件式との論理積を真とする値の有無を特定し、
特定結果に基づいて、前記第2のパスが前記第1のプログラムに含まれるパス群のうちの前記第1のパスとは異なるパスに関連しないことを判断する、
処理を実行することを特徴とする請求項1〜5のいずれか一つに記載のテストケース生成方法。
The computer is
If it is determined that the second path is related to the first path, the logical product of the first conditional expression and the negation of the second conditional expression among the possible values of the input variable is true. Specifying the presence or absence of a value to be determined, and specifying the presence or absence of a value that makes the logical product of the negation of the first conditional expression and the second conditional expression out of the possible values of the input variable,
Determining that the second path is not related to a path different from the first path in the path group included in the first program based on the specific result;
6. The test case generation method according to claim 1, wherein the process is executed.
前記コンピュータが、
前記第2のパスが前記第1のパスに関連すると判断した場合、前記入力変数が取り得る値のうちの前記第1の条件式と前記第2の条件式の否定との論理積を真とする値の有無を特定するとともに、前記入力変数が取り得る値のうちの前記第1の条件式の否定と前記第2の条件式との論理積を真とする値の有無を特定し、
特定結果に基づいて、前記第2のプログラムに含まれるパス群のうちの前記第2のパスとは異なるパスが前記第1のパスに関連しないことを判断する、
処理を実行することを特徴とする請求項1〜6のいずれか一つに記載のテストケース生成方法。
The computer is
If it is determined that the second path is related to the first path, the logical product of the first conditional expression and the negation of the second conditional expression among the possible values of the input variable is true. Specifying the presence or absence of a value to be determined, and specifying the presence or absence of a value that makes the logical product of the negation of the first conditional expression and the second conditional expression out of the possible values of the input variable,
Based on the specific result, it is determined that a path different from the second path in the path group included in the second program is not related to the first path.
The test case generation method according to claim 1, wherein the process is executed.
第1のプログラムをシンボリック実行することにより、前記第1のプログラムに含まれる入力変数が取り得る値のうちの前記第1のプログラムに含まれる第1のパスが実行される条件となる前記入力変数の値を表す第1の条件式と、前記第1のパスが実行された場合に出力される前記第1のプログラムに含まれる出力変数を表す第1の数式と、を含む第1の実行結果を取得する第1取得部と、
前記第1のプログラムの一部が変更された第2のプログラムをシンボリック実行することにより、前記入力変数の取り得る値のうちの前記第2のプログラムに含まれる第2のパスが実行される条件となる前記入力変数の値を表す第2の条件式と、前記第2のパスが実行された場合に出力される前記第2のプログラムに含まれる出力変数を表す第2の数式と、を含む第2の実行結果を取得する第2取得部と、
前記入力変数が取り得る値のうちの、前記第1取得部によって取得された前記第1の条件式と前記第2取得部によって取得された前記第2の条件式との論理積を真とする値の有無に基づいて、前記第2のパスが前記第1のパスに関連するか否かを判断するパス関連判断部と、
前記第1取得部によって取得された前記第1の数式と、前記第2取得部によって取得された前記第2の数式とが一致するか否かを判定する数式判定部と、
前記パス関連判断部による判断結果と前記数式判定部による判定結果とに基づいて、前記第2のパスの動作をテストするテストケースを生成すべきか否かを判定する生成判定部と、
を有することを特徴とするテストケース生成装置。
The input variable which becomes a condition for executing the first pass included in the first program out of the possible values of the input variable included in the first program by performing symbolic execution of the first program A first execution result including a first conditional expression representing the value of the first expression and a first mathematical expression representing an output variable included in the first program that is output when the first pass is executed A first acquisition unit for acquiring
Conditions for executing a second pass included in the second program among possible values of the input variable by executing symbolically the second program in which a part of the first program is changed A second conditional expression representing the value of the input variable, and a second mathematical expression representing an output variable included in the second program that is output when the second pass is executed. A second acquisition unit for acquiring a second execution result;
Of the possible values of the input variable, the logical product of the first conditional expression acquired by the first acquisition unit and the second conditional expression acquired by the second acquisition unit is true. A path-related determination unit that determines whether the second path is related to the first path based on the presence or absence of a value;
A formula determination unit that determines whether or not the first formula acquired by the first acquisition unit matches the second formula acquired by the second acquisition unit;
A generation determination unit that determines whether or not to generate a test case for testing the operation of the second path based on a determination result by the path relation determination unit and a determination result by the formula determination unit;
A test case generation device characterized by comprising:
コンピュータに、
第1のプログラムをシンボリック実行することにより、前記第1のプログラムに含まれる入力変数が取り得る値のうちの前記第1のプログラムに含まれる第1のパスが実行される条件となる前記入力変数の値を表す第1の条件式と、前記第1のパスが実行された場合に出力される前記第1のプログラムに含まれる出力変数を表す第1の数式と、を含む第1の実行結果を取得し、
前記第1のプログラムの一部が変更された第2のプログラムをシンボリック実行することにより、前記入力変数の取り得る値のうちの前記第2のプログラムに含まれる第2のパスが実行される条件となる前記入力変数の値を表す第2の条件式と、前記第2のパスが実行された場合に出力される前記第2のプログラムに含まれる出力変数を表す第2の数式と、を含む第2の実行結果を取得し、
前記入力変数が取り得る値のうちの、取得した前記第1の条件式と取得した前記第2の条件式との論理積を真とする値の有無に基づいて、前記第2のパスが前記第1のパスに関連するか否かを判断し、
取得した前記第1の数式と、取得した前記第2の数式とが一致するか否かを判定し、
判断結果と判定結果とに基づいて、前記第2のパスの動作をテストするテストケースを生成すべきか否かを判定する、
処理を実行させることを特徴とするテストケース生成プログラム。
On the computer,
The input variable which becomes a condition for executing the first pass included in the first program out of the possible values of the input variable included in the first program by performing symbolic execution of the first program A first execution result including a first conditional expression representing the value of the first expression and a first mathematical expression representing an output variable included in the first program that is output when the first pass is executed Get
Conditions for executing a second pass included in the second program among possible values of the input variable by executing symbolically the second program in which a part of the first program is changed A second conditional expression representing the value of the input variable, and a second mathematical expression representing an output variable included in the second program that is output when the second pass is executed. Get the second execution result,
Of the possible values of the input variable, based on the presence or absence of a value that makes the logical product of the acquired first conditional expression and the acquired second conditional expression true, the second path is Determine if it is related to the first pass,
Determining whether the acquired first mathematical formula and the acquired second mathematical formula match,
Determining whether to generate a test case for testing the operation of the second path based on the determination result and the determination result;
A test case generation program characterized by causing a process to be executed.
JP2013067571A 2013-03-27 2013-03-27 Test case generation method, test case generation apparatus, and test case generation program Expired - Fee Related JP6032095B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013067571A JP6032095B2 (en) 2013-03-27 2013-03-27 Test case generation method, test case generation apparatus, and test case generation program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013067571A JP6032095B2 (en) 2013-03-27 2013-03-27 Test case generation method, test case generation apparatus, and test case generation program

Publications (2)

Publication Number Publication Date
JP2014191652A true JP2014191652A (en) 2014-10-06
JP6032095B2 JP6032095B2 (en) 2016-11-24

Family

ID=51837826

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013067571A Expired - Fee Related JP6032095B2 (en) 2013-03-27 2013-03-27 Test case generation method, test case generation apparatus, and test case generation program

Country Status (1)

Country Link
JP (1) JP6032095B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106326125A (en) * 2016-08-26 2017-01-11 上海合福信息科技有限公司 Test case generating method
US20170046252A1 (en) * 2014-06-30 2017-02-16 Hitachi Automotive Systems, Ltd. Test case generation system and recording medium wherein test case is recorded
JP2018147106A (en) * 2017-03-02 2018-09-20 富士通株式会社 Program analyzer, program analysis method and program analysis program
KR20200098078A (en) * 2019-02-11 2020-08-20 현대자동차주식회사 Apparatus and method for managing testcase for testing software

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112181833A (en) * 2020-09-28 2021-01-05 全球能源互联网研究院有限公司 Intelligent fuzzy test method, device and system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11110257A (en) * 1997-10-03 1999-04-23 Fujitsu Ltd Device and method for updatin database, and storage medium stored with database update program
JP2013003854A (en) * 2011-06-16 2013-01-07 Fujitsu Ltd Test data generation program, test data generation method and test data generation device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11110257A (en) * 1997-10-03 1999-04-23 Fujitsu Ltd Device and method for updatin database, and storage medium stored with database update program
JP2013003854A (en) * 2011-06-16 2013-01-07 Fujitsu Ltd Test data generation program, test data generation method and test data generation device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JPN6015037816; 吉田 雅年: '仕様記述を必要としない有界レグレッション検知フレームワークの提案' レクチャーノート/ソフトウェア学36 ソフトウェア工学の基礎XVII , 20101130, pp.181-182, 株式会社近代科学社 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170046252A1 (en) * 2014-06-30 2017-02-16 Hitachi Automotive Systems, Ltd. Test case generation system and recording medium wherein test case is recorded
US10162739B2 (en) * 2014-06-30 2018-12-25 Hitachi Automotive Systems, Ltd Test case generation system and recording medium wherein test case is recorded
CN106326125A (en) * 2016-08-26 2017-01-11 上海合福信息科技有限公司 Test case generating method
JP2018147106A (en) * 2017-03-02 2018-09-20 富士通株式会社 Program analyzer, program analysis method and program analysis program
KR20200098078A (en) * 2019-02-11 2020-08-20 현대자동차주식회사 Apparatus and method for managing testcase for testing software
KR102610756B1 (en) * 2019-02-11 2023-12-07 현대자동차주식회사 Apparatus and method for managing testcase for testing software

Also Published As

Publication number Publication date
JP6032095B2 (en) 2016-11-24

Similar Documents

Publication Publication Date Title
Ciccozzi et al. Execution of UML models: a systematic review of research and practice
US9298453B2 (en) Source code analytics platform using program analysis and information retrieval
JP6032095B2 (en) Test case generation method, test case generation apparatus, and test case generation program
US20200133662A1 (en) Automatic generation of documentation and aggregation of community content
Osman et al. Automatic feature selection by regularization to improve bug prediction accuracy
CN104969188B (en) A method for modeling source code having code segments that lack source location
McBurney et al. Towards prioritizing documentation effort
US9311077B2 (en) Identification of code changes using language syntax and changeset data
Sae‐Lim et al. Context‐based approach to prioritize code smells for prefactoring
Wang et al. Lightweight global and local contexts guided method name recommendation with prior knowledge
Torunski et al. Code style analytics for the automatic setting of formatting rules in ides: A solution to the tabs vs. spaces debate
Ma'ayan The quality of junit tests: an empirical study report
Siddiq et al. A Lightweight Framework for High-Quality Code Generation
US10073764B1 (en) Method for instruction sequence execution analysis and visualization
Kozik et al. Q-Rapids framework for advanced data analysis to improve rapid software development
JP2010102620A (en) User operation scenario generating device, method and program
Walunj et al. Defect prediction using deep learning with Network Portrait Divergence for software evolution
Aho et al. Automated extraction of GUI models for testing
KR20150128711A (en) Method and system for analyzing a trace timeline of computer system activity
Mendonça et al. Test2feature: Feature-based test traceability tool for highly configurable software
Pinto et al. TOM: a model-based GUI testing framework
JP7380851B2 (en) Test script generation device, test script generation method and program
GB2397905A (en) Method for automatically generating and ordering test scripts
Alvin et al. StaticGen: static generation of UML sequence diagrams
Kodhai et al. Method-Level code clone modification using refactoring techniques for clone maintenance

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20151204

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160908

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: 20160927

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20161010

R150 Certificate of patent or registration of utility model

Ref document number: 6032095

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees