Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP5884657B2 - Program, test case generation method, and test case generation apparatus - Google Patents
[go: Go Back, main page]

JP5884657B2 - Program, test case generation method, and test case generation apparatus - Google Patents

Program, test case generation method, and test case generation apparatus Download PDF

Info

Publication number
JP5884657B2
JP5884657B2 JP2012140947A JP2012140947A JP5884657B2 JP 5884657 B2 JP5884657 B2 JP 5884657B2 JP 2012140947 A JP2012140947 A JP 2012140947A JP 2012140947 A JP2012140947 A JP 2012140947A JP 5884657 B2 JP5884657 B2 JP 5884657B2
Authority
JP
Japan
Prior art keywords
condition
test
variable
execution
test case
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2012140947A
Other languages
Japanese (ja)
Other versions
JP2014006643A (en
Inventor
翔一朗 藤原
翔一朗 藤原
忠弘 上原
忠弘 上原
一樹 宗像
一樹 宗像
前田 芳晴
芳晴 前田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2012140947A priority Critical patent/JP5884657B2/en
Publication of JP2014006643A publication Critical patent/JP2014006643A/en
Application granted granted Critical
Publication of JP5884657B2 publication Critical patent/JP5884657B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Description

本技術は、プログラムのテストデータの生成技術に関する。   The present technology relates to a technology for generating test data for a program.

プログラムをテストするために準備されるテストケースには、テスト対象のプログラムへ入力するデータ(テスト入力という。)と期待結果が含まれる。期待結果は、テスト対象のプログラムの仕様に基づいて求められる。例えば、期待結果は、テスト対象のプログラムの出力データの値として設定される。   Test cases prepared for testing a program include data (referred to as test input) to be input to the test target program and expected results. Expected results are obtained based on the specifications of the program to be tested. For example, the expected result is set as the value of the output data of the test target program.

テストケースの生成では、テスト中にプログラム中の命令、分岐あるいは実行パスを網羅的に実行するようにテスト入力を生成することが望まれる。つまり、コードカバレッジを高めることが課題となる。   In test case generation, it is desirable to generate test inputs so that instructions, branches, or execution paths in a program are comprehensively executed during a test. In other words, increasing code coverage is an issue.

人的な判断に基づくテスト入力の生成の他に、ランダムにテスト入力を生成する方法や所定ルール(データの範囲やデータの形式)に従ってテスト入力を生成する方法もある。しかし、これらの方法では、プログラムのコードや仕様を反映してテスト入力を生成するわけではないので、コードカバレッジが上がりにくいという問題がある。また、コードカバレッジを上げるためにテストケースを増やすと、重複するテストケースが多くなる。   In addition to test input generation based on human judgment, there are a method of generating test inputs randomly and a method of generating test inputs according to predetermined rules (data range and data format). However, these methods have a problem that code coverage is difficult to increase because test input is not generated by reflecting the code and specifications of the program. In addition, if the number of test cases is increased in order to increase code coverage, the number of duplicate test cases increases.

ホワイトボックステストを前提とした場合に、ソースコードを静的に解析して分岐条件を抽出し、その分岐条件に基づいてテスト入力を生成する方法もある。この方法によれば、プログラムのソースコードの実際の条件に従ってテスト入力を決めることができるので、テストケースの重複は避けやすい。しかし、実際にプログラムを実行するわけではないので、テストケースの欠落が生じる。   If a white box test is assumed, there is a method of statically analyzing the source code to extract a branch condition and generating a test input based on the branch condition. According to this method, the test input can be determined according to the actual conditions of the program source code, so that it is easy to avoid duplication of test cases. However, since the program is not actually executed, test cases are lost.

これに対して、プログラムを実行させながらテスト入力を生成するシンボリック実行という方法がある。この方法では、プログラム中の変数に具体的な値を設定せずに、シンボル値という特殊な値を持たせたままプログラムを実行する。   On the other hand, there is a method called symbolic execution that generates a test input while executing a program. In this method, the program is executed with a special value called a symbol value, without setting a specific value for a variable in the program.

ここで、クラスをテスト対象とする例を示す。図1に、テスト対象クラスの例を示す。クラス「TargetClass」に含まれるメソッド「method1」をテストすることを想定する。   Here, an example in which a class is a test target is shown. FIG. 1 shows an example of a test target class. Assume that the method “method1” included in the class “TargetClass” is to be tested.

メソッド「method1」に入力する変数は、int型の「a」とint型の「b」である。いずれの入力変数も、プリミティブ型の変数である。処理コードは、「if(a!=0)」101の判断による分岐処理と、「if(a>5)」103の判断による分岐処理と、「if(a!=0)」105の判断による分岐処理と、「if(b<=0)」109の判断による分岐処理を含んでいる。また、処理コードは、「b=b+1;」107の演算処理と、「a=b/a;」111の演算処理を含んでいる。   The variables input to the method “method1” are int type “a” and int type “b”. Each input variable is a primitive type variable. The processing code is determined by “if (a! = 0)” 101 branch processing, “if (a> 5)” 103 branch processing, and “if (a! = 0)” 105 determination. Branch processing and branch processing based on the determination of “if (b <= 0)” 109 are included. The processing code includes an arithmetic process “b = b + 1;” 107 and an arithmetic process “a = b / a;” 111.

図1の処理を模式化したフローを図2に示す。前半のフローは、201から207の4つのルートを含んでいる。ルート201は、条件「a==0」を満たす場合に通過する。ルート203は、条件「a!=0」と条件「a>5」と条件「a==0」を満たす場合に通過する。ルート205は、条件「a!=0」と条件「a>5」と条件「a!=0」を満たす場合に通過する。ルート207は、条件「a!=0」と条件「a<=5」と条件「b=b+1」を満たす場合に通過する。また、ルート207は、「b=b+1」の演算処理を含んでいる。   A flow diagram schematically showing the processing of FIG. 1 is shown in FIG. The first half flow includes four routes 201 to 207. The route 201 passes when the condition “a == 0” is satisfied. The route 203 passes when the condition “a! = 0”, the condition “a> 5”, and the condition “a == 0” are satisfied. The route 205 passes when the condition “a! = 0”, the condition “a> 5”, and the condition “a! = 0” are satisfied. The route 207 passes when the condition “a! = 0”, the condition “a <= 5”, and the condition “b = b + 1” are satisfied. The route 207 includes a calculation process of “b = b + 1”.

後半のフローは、209と211の2つのルートを含んでいる。ルート209は、条件「b>0」を満たす場合に通過する。ルート211は、条件「b<=0」を満たす場合に通過する。また、ルート209は、「a=b/a」の演算処理を含んでいる。   The latter half flow includes two routes 209 and 211. The route 209 passes when the condition “b> 0” is satisfied. The route 211 passes when the condition “b <= 0” is satisfied. The route 209 includes a calculation process of “a = b / a”.

形式的には、前半のフローの4ルートと後半のフローの2ルートを任意に組み合わせることが可能なので、全体としては8通りのルートが考えられる。この例においてテストケースを動的に生成するために、入力変数aと入力変数bにシンボル値を持たせることが考えられる。   Formally, since four routes of the first half flow and two routes of the second half flow can be arbitrarily combined, eight routes are considered as a whole. In this example, in order to dynamically generate a test case, it is conceivable that the input variable a and the input variable b have symbol values.

シンボリック実行を行う場合には、シンボリック実行の対象となるメソッドを呼び出すためのドライバ(シンボル実行用ドライバという。)を用意する。シンボリック実行部は、シンボル実行用ドライバを起動し、シンボル実行用ドライバを介してシンボリック実行の対象となるプログラムの処理コードを実行する。   When performing symbolic execution, a driver (referred to as a symbol execution driver) for invoking a method to be subjected to symbolic execution is prepared. The symbolic execution unit activates the symbol execution driver and executes the processing code of the program to be symbolically executed via the symbol execution driver.

図1に示したメソッド「method1」を呼び出すシンボル実行用ドライバの例を、図3に示す。シンボル実行用ドライバのクラス「SymbolicDriver」について説明する。301は、シンボル変数の宣言に関するコードである。シンボル変数は、シンボル値を保持する変数である。この宣言により、int型の「P1」とint型の「P2」がシンボル変数となる。「testFunc();」303は、実行開始位置を示すコードである。「target.method1(P1, P2);」305は、対象メソッドを呼び出すコードである。引数に、「P1」と「P2」を設定することにより、入力変数「a」には、シンボル変数「P1」が割り当てられ、入力変数「b」には、シンボル変数「P2」が割り当てられる。   FIG. 3 shows an example of a symbol execution driver that calls the method “method1” shown in FIG. The symbol execution driver class “SymbolicDriver” will be described. Reference numeral 301 denotes a code relating to the declaration of the symbol variable. A symbol variable is a variable that holds a symbol value. With this declaration, int type “P1” and int type “P2” become symbol variables. “TestFunc ();” 303 is a code indicating the execution start position. “Target.method1 (P1, P2);” 305 is code for calling the target method. By setting “P1” and “P2” as arguments, the symbol variable “P1” is assigned to the input variable “a”, and the symbol variable “P2” is assigned to the input variable “b”.

対象となるプログラムにシンボル変数に関する分岐処理が含まれている場合には、複数の実行パターンに分けることにより、分岐可能なパスを網羅的に実行する。そして、実行パターンを実行する際に、その実行パターンを導いた判定が成立するためにシンボル値が満たさなければならない条件(パス条件という)を生成する。例えば、分岐処理がニ分岐型の場合に、シンボル変数に関する条件式が真となる実行パターンと、シンボル変数に関する条件式が偽となる実行パターンを別に実行する。そして、条件式が真となる実行パターンを実行する際には、条件式が真となるためのパス条件を生成し、条件式が偽となる実行パターンを実行する際には、条件式が偽となるためのパス条件を生成する。また、分岐処理が多分岐型の場合に、シンボル変数に関する条件式の選択候補毎に別の実行パターンを実行する。そして、条件式が選択候補となるためのパス条件を生成する。   If the target program includes branch processing related to symbol variables, the paths that can be branched are comprehensively executed by dividing them into a plurality of execution patterns. Then, when executing the execution pattern, a condition (referred to as a path condition) that the symbol value must satisfy in order to establish the determination that led to the execution pattern is generated. For example, when the branch process is a bi-branch type, an execution pattern in which the conditional expression related to the symbol variable is true and an execution pattern in which the conditional expression related to the symbol variable is false are executed separately. When executing an execution pattern for which the conditional expression is true, a path condition is generated for the conditional expression to be true. When executing an execution pattern for which the conditional expression is false, the conditional expression is false. Generate a path condition to become When the branch process is a multi-branch type, another execution pattern is executed for each selection candidate of the conditional expression related to the symbol variable. Then, a path condition for the conditional expression to be a selection candidate is generated.

図4に、図1に示したメソッド「method1」をテスト対象として、シンボリック実行により生成したテストケースの例を示す。   FIG. 4 shows an example of a test case generated by symbolic execution with the method “method1” shown in FIG. 1 as a test target.

ケース番号1のパス条件(P1==0)とパス条件(P2>0)は、図2に示したルート201とルート209を組み合わせた実行パターンにより得られる。そして、これらのパス条件を充足する値として、テスト入力「P1=0、P2=1」が得られる。このテストケースに従って入力変数aに0を設定し、入力変数bに1を設定して、メソッド「method1」を実行するとルート201とルート209を通過することになる。   The path condition (P1 == 0) and path condition (P2> 0) of case number 1 are obtained by the execution pattern combining the route 201 and the route 209 shown in FIG. Then, test inputs “P1 = 0, P2 = 1” are obtained as values satisfying these path conditions. According to this test case, when the input variable a is set to 0, the input variable b is set to 1 and the method “method1” is executed, the route 201 and the route 209 are passed.

ケース番号2のパス条件(P1==0)とパス条件(P2<=0)は、図2に示したルート201とルート211を組み合わせた実行パターンにより得られる。そして、これらのパス条件を充足する値として、テスト入力「P1=0、P2=0」が得られる。このテストケースに従って入力変数aに0を設定し、入力変数bに0を設定して、メソッド「method1」を実行するとルート201とルート211を通過することになる。   The path condition (P1 == 0) and the path condition (P2 <= 0) of case number 2 are obtained by the execution pattern combining the route 201 and the route 211 shown in FIG. Then, test inputs “P1 = 0, P2 = 0” are obtained as values satisfying these path conditions. According to this test case, when the input variable a is set to 0, the input variable b is set to 0, and the method “method1” is executed, the route 201 and the route 211 are passed.

ケース番号3のパス条件(P1!=0)とパス条件(P1>5)とパス条件(P2<=0)は、図2に示したルート205とルート211を組み合わせた実行パターンにより得られる。そして、これらのパス条件を充足する値として、テスト入力「P1=6、P2=0」が得られる。このテストケースに従って入力変数aに6を設定し、入力変数bに0を設定して、メソッド「method1」を実行するとルート205とルート211を通過することになる。   The path condition (P1! = 0), path condition (P1> 5), and path condition (P2 <= 0) of case number 3 are obtained by the execution pattern combining the route 205 and the route 211 shown in FIG. Then, test inputs “P1 = 6, P2 = 0” are obtained as values satisfying these path conditions. According to this test case, when the input variable a is set to 6 and the input variable b is set to 0 and the method “method1” is executed, the route 205 and the route 211 are passed.

ケース番号4のパス条件(P1!=0)とパス条件(P1>5)とパス条件(P2>0)は、図2に示したルート205とルート209を組み合わせた実行パターンにより得られる。そして、これらのパス条件を充足する値として、テスト入力「P1=6、P2=1」が得られる。このテストケースに従って入力変数aに6を設定し、入力変数bに1を設定して、メソッド「method1」を実行するとルート205とルート209を通過することになる。   The path condition (P1! = 0), path condition (P1> 5), and path condition (P2> 0) of case number 4 are obtained by the execution pattern combining the route 205 and the route 209 shown in FIG. Then, test inputs “P1 = 6, P2 = 1” are obtained as values satisfying these path conditions. According to this test case, when the input variable a is set to 6 and the input variable b is set to 1 and the method “method1” is executed, the route 205 and the route 209 are passed.

ケース番号5のパス条件(P1!=0)とパス条件(P1<=5)とパス条件(P2+1<=0)は、図2に示したルート207とルート211を組み合わせた実行パターンにより得られる。そして、これらのパス条件を充足する値として、テスト入力「P1=1、P2=−1」が得られる。このテストケースに従って入力変数aに1を設定し、入力変数bに−1を設定して、メソッド「method1」を実行するとルート207とルート211を通過することになる。この例では、ルート207の演算処理「b=b+1」の結果がその後の条件判断に反映されている。   The path condition (P1! = 0), path condition (P1 <= 5), and path condition (P2 + 1 <= 0) of case number 5 are obtained by the execution pattern combining the route 207 and the route 211 shown in FIG. . Then, test inputs “P1 = 1, P2 = −1” are obtained as values satisfying these path conditions. According to this test case, when the input variable a is set to 1 and the input variable b is set to −1 and the method “method1” is executed, the route 207 and the route 211 are passed. In this example, the result of the arithmetic processing “b = b + 1” of the route 207 is reflected in the subsequent condition determination.

ケース番号6のパス条件(P1!=0)とパス条件(P1<=5)とパス条件(P2+1>0)は、図2に示したルート207とルート209を組み合わせた実行パターンにより得られる。そして、これらのパス条件を充足する値として、テスト入力「P1=1、P2=0」が得られる。このテストケースに従って入力変数aに1を設定し、入力変数bに0を設定して、メソッド「method1」を実行するとルート207とルート209を通過することになる。この例でも、ルート207の演算処理「b=b+1」の結果がその後の条件判断に反映されている。   The path condition (P1! = 0), path condition (P1 <= 5), and path condition (P2 + 1> 0) of case number 6 are obtained by an execution pattern in which the route 207 and the route 209 shown in FIG. A test input “P1 = 1, P2 = 0” is obtained as a value satisfying these path conditions. According to this test case, when the input variable a is set to 1 and the input variable b is set to 0 and the method “method1” is executed, the route 207 and the route 209 are passed. Also in this example, the result of the arithmetic processing “b = b + 1” of the route 207 is reflected in the subsequent condition determination.

尚、a!=0の条件を満たし、かつa==0の条件を満たすaの値は存在しないので、ルート203に至ることはない。つまり、ルート203とルート209を組み合わせた実行パターンと、ルート203とルート211を組み合わせた実行パターンは、パス条件を充足するような値がシンボル変数に対して存在しないことになる。このような実行パターンについては、実行不可能なのでテストケースとならない。   A! Since there is no value of a that satisfies the condition of = 0 and satisfies the condition of a == 0, the route 203 is not reached. That is, the execution pattern combining the route 203 and the route 209 and the execution pattern combining the route 203 and the route 211 do not have a value that satisfies the path condition for the symbol variable. Such an execution pattern is not a test case because it cannot be executed.

パス条件を充足可能な場合には、ケース番号1からケース番号6のようにテストケースが生成できる。このようにして、プログラムを実行しながらテストケースを生成することによって、高いコードカバレッジが期待できる。   When the pass condition can be satisfied, test cases such as case number 1 to case number 6 can be generated. Thus, high code coverage can be expected by generating test cases while executing a program.

しかし、シンボリック実行でシンボル変数として扱えるのは、主として数値や真偽値などのプリミティブ型変数である。オブジェクト指向プログラミング言語により記述されたプログラムについては、一般にオブジェクト型変数を用いており、そのような変数をテスト入力とするプログラムに対しては、シンボリック実行によりテストケースを生成することはできない。   However, what can be handled as symbolic variables in symbolic execution is mainly primitive variables such as numeric values and boolean values. An object type variable is generally used for a program written in an object-oriented programming language, and a test case cannot be generated by symbolic execution for a program that uses such a variable as a test input.

特開2011−191985号公報Japanese Unexamined Patent Publication No. 2011-191985 特開2012−068869号公報JP 2012-068869 A 特開2009−087355号公報JP 2009-087355 A

従って、本技術の目的は、一側面では、オブジェクト型変数を用いたプログラムに適したテストデータを生成することである。   Accordingly, an object of the present technology is, in one aspect, to generate test data suitable for a program using object type variables.

本実施の形態に係るテストケース生成方法は、(A)テスト対象のプログラムへ入力されるオブジェクト型変数の状態を示す制御変数を含む一又は複数のシンボル変数を用いて、制御変数に応じたオブジェクト型変数の初期化とテスト対象のプログラムの呼び出しを行うためのドライバ及び呼び出されるテスト対象のプログラムにおける実行パターン毎に、ドライバ及びテスト対象のプログラムの実行において一又は複数のシンボル変数が満たすべき第1のパス条件を計算し、第1のパス条件と第1のパス条件に対する一又は複数のシンボル変数の充足値とを含む第1のテストケースを生成するシンボリック実行処理と、(B)実行パターン毎に、テスト対象のプログラムの実行において状態としてオブジェクト型変数が満たすべき第2のパス条件を生成する第1の生成処理と、(C)実行パターン毎に、第1のテストケースに含まれる第1のパス条件から、制御変数が満たすべき条件を省き、第2のパス条件を加えた第3のパス条件を求め、第3のパス条件と一又は複数のシンボル変数の充足値とを含む第2のテストケースを生成する第2の生成処理と、(D)第3のパス条件が同義である第2のテストケースが複数ある場合に、第3のパス条件が同義である複数の第2のテストケースのうち、いずれかの第2のテストケースを省き、残った第2のテストケースを抽出する抽出処理とを含む。   The test case generation method according to the present embodiment uses (A) one or a plurality of symbol variables including a control variable indicating a state of an object type variable input to a test target program, and an object corresponding to the control variable For each execution pattern in the driver for invoking the type variable initialization and the test target program and the test target program to be called, the first one or more symbol variables to be satisfied in the execution of the driver and the test target program A symbolic execution process for generating a first test case including the first pass condition and a satisfaction value of one or more symbol variables for the first pass condition; and (B) for each execution pattern In addition, the second parameter that the object type variable should satisfy as the state in the execution of the program under test is First generation processing for generating a condition, and (C) for each execution pattern, a condition to be satisfied by a control variable is omitted from the first path condition included in the first test case, and a second path condition is added. A second generation process for determining a third path condition and generating a second test case including the third path condition and a satisfaction value of one or more symbol variables; and (D) a third path condition. When there are a plurality of second test cases having the same meaning, the second test case among the plurality of second test cases having the same third pass condition is omitted, and the remaining second test case is omitted. And an extraction process for extracting a test case.

オブジェクト型変数を用いたプログラムに適したテストデータを生成できるようになる。   Test data suitable for programs using object type variables can be generated.

図1は、テスト対象クラスの例を示す図である。FIG. 1 is a diagram illustrating an example of a test target class. 図2は、フローの例を示す図である。FIG. 2 is a diagram illustrating an example of a flow. 図3は、シンボル実行用ドライバの例を示す図である。FIG. 3 is a diagram illustrating an example of a symbol execution driver. 図4は、テストケースの例を示す図である。FIG. 4 is a diagram illustrating an example of a test case. 図5は、テスト対象クラスの例を示す図である。FIG. 5 is a diagram illustrating an example of a test target class. 図6は、ライブラリの例を示す図である。FIG. 6 is a diagram illustrating an example of a library. 図7は、サンプルフォームの例を示す図である。FIG. 7 is a diagram illustrating an example of a sample form. 図8は、シンボル実行用ドライバの例を示す図である。FIG. 8 is a diagram illustrating an example of a symbol execution driver. 図9は、制御変数テーブルの例を示す図である。FIG. 9 is a diagram illustrating an example of a control variable table. 図10は、テストケース生成装置のうち準備処理に係る構成例を示す図である。FIG. 10 is a diagram illustrating a configuration example related to a preparation process in the test case generation apparatus. 図11は、準備処理フローの例を示す図である。FIG. 11 is a diagram illustrating an example of a preparation process flow. 図12は、ドライバ生成処理フローの例を示す図である。FIG. 12 is a diagram illustrating an example of a driver generation processing flow. 図13は、シンボル変数宣言処理フローの例を示す図である。FIG. 13 is a diagram illustrating an example of a symbol variable declaration processing flow. 図14は、制御変数宣言処理フローの例を示す図である。FIG. 14 is a diagram illustrating an example of a control variable declaration processing flow. 図15は、メンバ宣言処理フローの例を示す図である。FIG. 15 is a diagram illustrating an example of a member declaration processing flow. 図16は、初期化コード処理フローの例を示す図である。FIG. 16 is a diagram illustrating an example of an initialization code processing flow. 図17は、null化処理フローの例を示す図である。FIG. 17 is a diagram illustrating an example of a nulling process flow. 図18は、クラス判定処理フローの例を示す図である。FIG. 18 is a diagram illustrating an example of a class determination processing flow. 図19は、オブジェクト型変数初期化処理フローの例を示す図である。FIG. 19 is a diagram illustrating an example of an object type variable initialization process flow. 図20は、オブジェクト指定命令処理フローの例を示す図である。FIG. 20 is a diagram illustrating an example of an object designation command processing flow. 図21は、プリミティブ宣言処理フローの例を示す図である。FIG. 21 is a diagram showing an example of a primitive declaration processing flow. 図22は、対象クラス初期化処理フローの例を示す図である。FIG. 22 is a diagram illustrating an example of a target class initialization process flow. 図23は、対象メソッド呼び出し処理フローの例を示す図である。FIG. 23 is a diagram illustrating an example of a target method call processing flow. 図24は、制御変数テーブル生成処理フローの例を示す図である。FIG. 24 is a diagram illustrating an example of a control variable table generation processing flow. 図25は、テストケース生成装置のうちシンボリック実行処理に係る構成例を示す図である。FIG. 25 is a diagram illustrating a configuration example related to symbolic execution processing in the test case generation device. 図26は、パターンテーブルの例を示す図である。FIG. 26 is a diagram illustrating an example of a pattern table. 図27は、シンボル変数テーブルの例を示す図である。FIG. 27 is a diagram illustrating an example of a symbol variable table. 図28は、オブジェクトテーブルの例を示す図である。FIG. 28 is a diagram illustrating an example of an object table. 図29aは、第1テストケースの例を示す図である。FIG. 29 a is a diagram illustrating an example of the first test case. 図29bは、第1テストケースの例を示す図である。FIG. 29 b is a diagram illustrating an example of the first test case. 図29cは、第1テストケースの例を示す図である。FIG. 29c is a diagram illustrating an example of the first test case. 図30は、オブジェクトパス条件の例を示す図である。FIG. 30 is a diagram illustrating an example of the object path condition. 図31は、シンボリック実行処理フローの例を示す図である。FIG. 31 is a diagram illustrating an example of a symbolic execution process flow. 図32は、初期化処理フローの例を示す図である。FIG. 32 is a diagram illustrating an example of an initialization process flow. 図33は、実行パターン処理フローの例を示す図である。FIG. 33 is a diagram illustrating an example of an execution pattern processing flow. 図34は、実行パターン処理の動作例を示す図である。FIG. 34 is a diagram illustrating an operation example of execution pattern processing. 図35は、オブジェクト特定処理フローの例を示す図である。FIG. 35 is a diagram illustrating an example of an object specifying process flow. 図36は、実行パターン処理の動作例を示す図である。FIG. 36 is a diagram illustrating an operation example of execution pattern processing. 図37は、探索処理フローの例を示す図である。FIG. 37 is a diagram illustrating an example of a search processing flow. 図38は、オブジェクトパス条件生成の動作例を示す図である。FIG. 38 is a diagram illustrating an operation example of object path condition generation. 図39は、オブジェクトパス条件生成処理フローの例を示す図である。FIG. 39 is a diagram illustrating an example of an object path condition generation processing flow. 図40は、オブジェクトパス条件生成の動作例を示す図である。FIG. 40 is a diagram illustrating an operation example of object path condition generation. 図41は、メモリ状態の例を示す図である。FIG. 41 is a diagram illustrating an example of a memory state. 図42は、メモリ状態の例を示す図である。FIG. 42 is a diagram illustrating an example of a memory state. 図43は、テストケース生成装置のうちパス条件更新とテストケース抽出に係る構成例を示す図である。FIG. 43 is a diagram illustrating a configuration example related to path condition update and test case extraction in the test case generation apparatus. 図44は、パス条件更新の概要を示す図である。FIG. 44 is a diagram showing an outline of path condition update. 図45は、第2テストケース生成処理フローの例を示す図である。FIG. 45 is a diagram illustrating an example of a second test case generation process flow. 図46aは、第2テストケースの例を示す図である。FIG. 46 a is a diagram illustrating an example of the second test case. 図46bは、第2テストケースの例を示す図である。FIG. 46 b is a diagram illustrating an example of the second test case. 図46cは、第2テストケースの例を示す図である。FIG. 46c is a diagram illustrating an example of the second test case. 図47は、第3テストケースの例を示す図である。FIG. 47 is a diagram illustrating an example of the third test case. 図48は、テストケース抽出処理フローの例を示す図である。FIG. 48 is a diagram illustrating an example of a test case extraction process flow. 図49は、コンピュータの構成の例を示す図である。FIG. 49 is a diagram illustrating an example of the configuration of a computer.

図5に、テスト対象クラスの例を示す。ここでは、テスト対象のクラス「TargetClass」に含まれるテスト対象メソッド「targetMethod2」の動作をテストすることを想定する。テスト対象メソッド「targetMethod2」は、オブジェクト型変数「obj1」とオブジェクト型変数「obj2」を入力する構成になっている。   FIG. 5 shows an example of the test target class. Here, it is assumed that the operation of the test target method “targetMethod2” included in the test target class “TargetClass” is tested. The test target method “targetMethod2” is configured to input an object type variable “obj1” and an object type variable “obj2”.

図6に、ライブラリの例を示す。クラスAとクラスBとクラスCは、上述のテスト対象のクラス「TargetClass」で用いられる。クラスAは、メンバ変数a1を保持している。クラスBは、クラスAを継承している。つまり、Bは、親クラスAの子クラスである。クラスBは、メンバ変数b1を保持している。クラスCも、クラスAを継承している。つまり、Cも、親クラスAの子クラスである。   FIG. 6 shows an example of a library. Class A, class B, and class C are used in the above-described test target class “TargetClass”. Class A holds member variable a1. Class B inherits class A. That is, B is a child class of the parent class A. Class B holds member variable b1. Class C also inherits class A. That is, C is also a child class of the parent class A.

クラス「SymbolicExecUtil」が保持するメソッド「calcPathCondition(Object obj, String name)」は、オブジェクト指定命令である。オブジェクト指定命令は、パス条件の計算対象となるオブジェクト型変数を指定する命令である。シンボリック実行時にオブジェクト指定命令が呼ばれると、「obj」が参照するインスタンスについて、この命令以後のオブジェクトパス条件を計算する。また、オブジェクト指定命令は、オブジェクトパス条件内でobjを指す変数名としてnameを使うことも指定している。但し、通常のプログラム実行時にオブジェクト指定命令が呼ばれても、何もしない。   The method “calcPathCondition (Object obj, String name)” held by the class “SymbolExecUtil” is an object designation command. The object designation command is a command for designating an object type variable that is a calculation target of a path condition. When an object designation command is called during symbolic execution, the object path condition after this command is calculated for the instance referred to by “obj”. The object designation command also designates the use of name as a variable name indicating obj in the object path condition. However, nothing is done even if an object designation command is called during normal program execution.

テストケース生成装置は、テスト対象クラスとテスト対象クラスが用いるライブラリ(例えば、クラスAとクラスBとクラスC)に基づいて、シンボル実行用ドライバを生成する。シンボル実行用ドライバは、初期設定やテスト対象の呼び出しを行うドライバである。テストケース生成装置は、シンボル実行用ドライバを生成するために、サンプルフォームを用いる。   The test case generation device generates a symbol execution driver based on the test target class and a library used by the test target class (for example, class A, class B, and class C). The symbol execution driver is a driver that performs an initial setting and a test target call. The test case generation apparatus uses a sample form to generate a symbol execution driver.

図7に、シンボル実行用ドライバのサンプルフォームの例を示す。シンボル変数宣言エリア701は、シンボル変数の宣言を設定する領域である。対象クラス初期化エリア703は、対象クラスの初期化を設定する領域である。初期化コードエリア705は、パス条件の計算対象となるオブジェクト型変数を初期化するコードを設定する領域である。オブジェクト指定命令エリア707は、オブジェクト指定命令を設定する領域である。対象メソッドの呼び出しエリア709は、対象メソッド呼び出し命令を設定する領域である。   FIG. 7 shows an example of a symbol execution driver sample form. The symbol variable declaration area 701 is an area for setting a symbol variable declaration. The target class initialization area 703 is an area for setting the initialization of the target class. The initialization code area 705 is an area for setting a code for initializing an object type variable that is a calculation target of a path condition. The object designation command area 707 is an area for setting an object designation command. A target method call area 709 is an area for setting a target method call instruction.

図8に、サンプルフォームを用いて生成されたシンボル実行用ドライバの例を示す。   FIG. 8 shows an example of a symbol execution driver generated using the sample form.

コード801とコード803とコード805とコード807は、オブジェクト型変数P1に関するシンボル変数を宣言するコードである。尚、コード801とコード803は、制御変数の宣言であり、コード805とコード807は、メンバシンボル変数の宣言である。制御変数とメンバシンボル変数は、いずれもシンボル変数である。 A code 801, a code 803, a code 805, and a code 807 are codes for declaring a symbol variable related to the object type variable P1. Codes 801 and 803 are control variable declarations, and codes 805 and 807 are member symbol variable declarations. Both control variables and member symbol variables are symbol variables.

コード809は、シンボリック実行による実行開始位置を示すコードである。コード811は、対象クラスの初期化を行うコードである。コード813は、オブジェクト型変数の宣言を行うコードである。コード815は、オブジェクト型変数のnull判定とnull値の代入を行うコードである。尚、elseにおける処理は、コード819によって閉じている。コード817は、オブジェクト型変数をクラス型に応じて初期化するコードである。コード821は、オブジェクト型変数をパス条件算出の対象とすることを指定するオブジェクト指定命令である。コード823は、テスト対象であるクラスを呼び出すコードである。   A code 809 is a code indicating an execution start position by symbolic execution. A code 811 is a code for initializing the target class. A code 813 is a code for declaring an object type variable. The code 815 is a code that performs null determination of an object type variable and substitution of a null value. The process in else is closed by a code 819. A code 817 is a code for initializing an object type variable according to a class type. A code 821 is an object designation command that designates an object type variable as a path condition calculation target. A code 823 is a code for calling a class to be tested.

また、準備段階において、テスト対象クラスに基づいて制御変数テーブルも生成される。図9に、制御変数テーブルの例を示す。制御変数は、テスト対象メソッドへ入力されるオブジェクト型変数の状態を示している。この例で、制御変数P1_cnullは、オブジェクト型変数P1がnullであるか否かを示している。制御変数P1_cnullの値がtrueである場合には、オブジェクト型変数P1がnullであることを意味しており、意味式「P1==null」と同義である。制御変数P1_cnullの値がfalseである場合には、オブジェクト型変数P1がnullでないことを意味しており、意味式「P1!=null」と同義である。   In the preparation stage, a control variable table is also generated based on the test target class. FIG. 9 shows an example of the control variable table. The control variable indicates the state of the object type variable input to the test target method. In this example, the control variable P1_cull indicates whether or not the object type variable P1 is null. If the value of the control variable P1_cull is true, it means that the object type variable P1 is null, which is synonymous with the semantic expression “P1 == null”. If the value of the control variable P1_cull is false, it means that the object type variable P1 is not null, which is synonymous with the semantic expression “P1! = Null”.

この例で、制御変数P1_cClassは、オブジェクト型変数の実際のクラス型を示している。制御変数P1_cClassの値が0である場合には、オブジェクト型変数P1の実際の型がクラスAであることを意味しており、意味式「P1 instanceof A」と同義である。制御変数P1_cClassの値が1である場合には、オブジェクト型変数P1の実際の型がクラスBであることを意味しており、意味式「P1 instanceof B」と同義である。制御変数P1_cClassの値が0又は1以外である場合には、オブジェクト型変数P1の実際の型がクラスCであることを意味しており、意味式「P1 instanceof C」と同義である。尚、変数の入力方法は、参照可能な形式であればよく、引数形式に限らない。   In this example, the control variable P1_cClass indicates the actual class type of the object type variable. When the value of the control variable P1_cClass is 0, it means that the actual type of the object type variable P1 is class A, which is synonymous with the semantic expression “P1 instance of A”. When the value of the control variable P1_cClass is 1, it means that the actual type of the object type variable P1 is class B, which is synonymous with the semantic expression “P1 instanceof B”. When the value of the control variable P1_cClass is other than 0 or 1, it means that the actual type of the object type variable P1 is class C, which is synonymous with the semantic expression “P1 instanceof C”. Note that the variable input method is not limited to the argument format as long as it can be referred to.

まず、テストケース生成装置によりシンボル実行用ドライバと制御変数テーブルを生成する準備処理について説明する。図10に、テストケース生成装置のうち準備処理に係る構成例を示す。テストケース生成装置は、受付部1001、対象クラス格納部1003、ライブラリ格納部1005、サンプルフォーム格納部1007、ドライバ生成部1009、ドライバ格納部1011、制御変数テーブル生成部1013、及び制御変数テーブル格納部1015を有している。   First, preparation processing for generating a symbol execution driver and a control variable table by the test case generation apparatus will be described. FIG. 10 shows a configuration example related to the preparation process in the test case generation apparatus. The test case generation apparatus includes a reception unit 1001, a target class storage unit 1003, a library storage unit 1005, a sample form storage unit 1007, a driver generation unit 1009, a driver storage unit 1011, a control variable table generation unit 1013, and a control variable table storage unit. 1015.

受付部1001は、対象クラスとライブラリを受け付けるように構成されている。対象クラス格納部1003は、対象クラスを格納するように構成されている。ライブラリ格納部1005は、ライブラリを格納するように構成されている。サンプルフォーム格納部1007は、サンプルフォームを予め格納している。ドライバ生成部1009は、シンボル実行用ドライバを生成するように構成されている。ドライバ格納部1011は、シンボル実行用ドライバを格納するように構成されている。制御変数テーブル生成部1013は、制御変数テーブルを生成するように構成されている。制御変数テーブル格納部1015は、制御変数テーブルを格納するように構成されている。   The receiving unit 1001 is configured to receive a target class and a library. The target class storage unit 1003 is configured to store the target class. The library storage unit 1005 is configured to store a library. The sample form storage unit 1007 stores sample forms in advance. The driver generation unit 1009 is configured to generate a symbol execution driver. The driver storage unit 1011 is configured to store a symbol execution driver. The control variable table generation unit 1013 is configured to generate a control variable table. The control variable table storage unit 1015 is configured to store a control variable table.

図11に、準備処理フローの例を示す。受付部1001は、対象クラスとライブラリを受け付ける(S1101)。そして、ドライバ生成部1009は、ドライバ生成処理を行う(S1103)。続いて、制御変数テーブル生成部1013は、制御変数テーブル生成処理を行う(S1105)。制御変数テーブル生成処理(S1105)については、図24を用いて後述する。   FIG. 11 shows an example of a preparation process flow. The accepting unit 1001 accepts the target class and the library (S1101). Then, the driver generation unit 1009 performs driver generation processing (S1103). Subsequently, the control variable table generation unit 1013 performs control variable table generation processing (S1105). The control variable table generation process (S1105) will be described later with reference to FIG.

図12に、ドライバ生成処理フローの例を示す。ドライバ生成部1009は、まずサンプルフォーム格納部1007からサンプルフォームを読み出す(S1201)。そして、ドライバ生成部1009は、シンボル変数宣言処理を行う(S1203)。   FIG. 12 shows an example of a driver generation processing flow. The driver generation unit 1009 first reads a sample form from the sample form storage unit 1007 (S1201). Then, the driver generation unit 1009 performs symbol variable declaration processing (S1203).

図13に、シンボル変数宣言処理フローの例を示す。ドライバ生成部1009は、対象メソッドの入力変数を特定する(S1301)。例えば、図5では、「A obj1」と「A obj2」が入力変数である。尚、図1の例であれば、入力変数は「int a」と「int b」が入力変数である。   FIG. 13 shows an example of a symbol variable declaration processing flow. The driver generation unit 1009 identifies an input variable of the target method (S1301). For example, in FIG. 5, “A obj1” and “A obj2” are input variables. In the example of FIG. 1, “int a” and “int b” are input variables as input variables.

そして、ドライバ生成部1009は、入力変数毎に以下の処理を繰り返す(S1303)   Then, the driver generation unit 1009 repeats the following process for each input variable (S1303).

ドライバ生成部1009は、入力変数の型がオブジェクト型であるか、あるいはプリミティブ型であるかを判定する(S1305)。例えば、入力変数が「A obj1」であれば、オブジェクト型であると判定し、入力変数が「int a」であれば、プリミティブ型であると判定する。 The driver generation unit 1009 determines whether the type of the input variable is an object type or a primitive type (S1305). For example, if the input variable is “A obj1”, it is determined to be an object type, and if the input variable is “int a”, it is determined to be a primitive type.

まず、入力変数の型がオブジェクト型と判定された場合について説明する。ドライバ生成部1009は、制御変数宣言処理を行う(S1307)。   First, a case where the input variable type is determined to be an object type will be described. The driver generation unit 1009 performs control variable declaration processing (S1307).

図14に、制御変数宣言処理フローの例を示す。ドライバ生成部1009は、規約に従ってnull制御変数名を決める(S1401)。この例で、i番目の入力変数に対するnull制御変数名は、「Pi_cnull」となる。そして、ドライバ生成部1009は、サンプルフォームのシンボル変数宣言エリア701に「@Symbolic(”true”)」の行を追加し(S1403)、更に「public static boolean;」の行を加える(S1405)。そして、ドライバ生成部1009は、boolean型のnull制御変数名を挿入する(S1407)。更に、ドライバ生成部1009は、null制御変数に具体値を代入するようにしてもよい。このようにして、例えば図8に示した801の宣言が生成される。   FIG. 14 shows an example of a control variable declaration process flow. The driver generation unit 1009 determines a null control variable name according to the convention (S1401). In this example, the null control variable name for the i-th input variable is “Pi_cull”. Then, the driver generation unit 1009 adds a line of “@Symbolic (“ true ”)” to the symbol variable declaration area 701 of the sample form (S1403), and further adds a line of “public static Boolean;” (S1405). Then, the driver generation unit 1009 inserts a Boolean type null control variable name (S1407). Furthermore, the driver generation unit 1009 may substitute a specific value for the null control variable. In this way, for example, the declaration 801 shown in FIG. 8 is generated.

続いて、ドライバ生成部1009は、規約に従って実際型制御変数名を決める(S1409)。この例で、i番目の入力変数に対する実際型制御変数名は、「Pi_cClass」となる。ドライバ生成部1009は、サンプルフォームのシンボル変数宣言エリア701に「@Symbolic(”true”)」の行を追加し(S1411)、更に、「public static int;」の行を加え(S1413)。そして、ドライバ生成部1009は、int型の実際型制御変数名を挿入する(S1415)。ドライバ生成部1009は、実際型制御変数に具体値を代入するようにしてもよい。このようにして、例えば図8に示した803の宣言が生成される。   Subsequently, the driver generation unit 1009 determines an actual type control variable name according to the convention (S1409). In this example, the actual control variable name for the i-th input variable is “Pi_cClass”. The driver generation unit 1009 adds a line “@Symbolic (“ true ”)” to the symbol variable declaration area 701 of the sample form (S1411), and further adds a line “public static int;” (S1413). Then, the driver generation unit 1009 inserts an int type actual control variable name (S1415). The driver generation unit 1009 may substitute a specific value for the actual control variable. In this way, for example, the declaration 803 shown in FIG. 8 is generated.

図13の処理に戻って、ドライバ生成部1009は、メンバ宣言処理を行う(S1309)。   Returning to the processing of FIG. 13, the driver generation unit 1009 performs member declaration processing (S1309).

図15に、メンバ宣言処理フローの例を示す。ドライバ生成部1009は、オブジェクト型変数として保持し得るメンバ変数毎に以下の処理を繰り返す(S1501)。ドライバ生成部1009は、規約に従ってメンバシンボル変数名を決める(S1503)。この例で、i番目の入力変数のメンバ変数Mに対するメンバシンボル変数名は、「Pi_mM」となる。ドライバ生成部1009は、サンプルフォームのシンボル変数宣言エリア701に「@Symbolic(”true”)」の行を追加し(S1505)、更に、「public static ;」の行を加える(S1507)。そして、ドライバ生成部1009は、データの型を挿入し(S1509)、メンバシンボル変数名を挿入する(S1511)。ドライバ生成部1009は、メンバシンボル変数に具体値を代入するようにしてもよい。このようにして、例えば図8に示した805と807の宣言が生成される。ドライバ生成部1009は、すべてのメンバ変数について処理したか否かを判定する(S1513)。処理していないメンバ変数があると判定した場合には、S1501へ戻る。すべてのメンバ変数について処理したと判定した場合には、ドライバ生成部1009は処理を終え、図13のS1311へ戻る。   FIG. 15 shows an example of the member declaration processing flow. The driver generation unit 1009 repeats the following processing for each member variable that can be held as an object type variable (S1501). The driver generation unit 1009 determines a member symbol variable name according to the convention (S1503). In this example, the member symbol variable name for the member variable M of the i-th input variable is “Pi_mM”. The driver generation unit 1009 adds a line of “@Symbolic (“ true ”)” to the symbol variable declaration area 701 of the sample form (S1505), and further adds a line of “public static;” (S1507). Then, the driver generation unit 1009 inserts a data type (S1509), and inserts a member symbol variable name (S1511). The driver generation unit 1009 may substitute a specific value for the member symbol variable. In this way, for example, declarations 805 and 807 shown in FIG. 8 are generated. The driver generation unit 1009 determines whether all member variables have been processed (S1513). If it is determined that there is a member variable that has not been processed, the process returns to S1501. If it is determined that all member variables have been processed, the driver generation unit 1009 finishes the process and returns to S1311 in FIG.

図13の処理に戻って、ドライバ生成部1009は、初期化コード処理を行う(S1311)。   Returning to the processing of FIG. 13, the driver generation unit 1009 performs initialization code processing (S1311).

図16に、初期化コード処理フローの例を示す。ドライバ生成部1009は、規約に従ってオブジェクト型変数名を決める(S1601)。この例で、i番目の入力変数名は、プリミティブ型変数であるかオブジェクト型変数であるかを問わず、「Pi」となる。ドライバ生成部1009は、サンプルフォームの初期化コードエリア705にオブジェクト型変数の宣言を追加する(S1603)。具体的には、クラス型とオブジェクト変数名が設定される。このようにして、例えば図8に示した813の宣言が生成される。   FIG. 16 shows an example of an initialization code processing flow. The driver generation unit 1009 determines an object type variable name according to the convention (S1601). In this example, the i-th input variable name is “Pi” regardless of whether it is a primitive type variable or an object type variable. The driver generation unit 1009 adds an object type variable declaration to the initialization code area 705 of the sample form (S1603). Specifically, a class type and an object variable name are set. In this way, for example, the declaration 813 shown in FIG. 8 is generated.

続いて、ドライバ生成部1009は、null化処理を行う(S1605)。図17に、null化処理フローの例を示す。ドライバ生成部1009は、サンプルフォームの初期化コードエリア705に判定制御コードを追加する(S1701)。この例では、判定制御コードとして図8の815と819に示した「if(){}else{}」(改行省略)を追加する。ドライバ生成部1009は、null判定条件を挿入する(S1703)。この例では、if文の()内にnull制御変数名を挿入する。ドライバ生成部1009は、if文の判定が真の場合に、null制御変数名へnullを代入する命令を追加し(S1705)、処理を終える。   Subsequently, the driver generation unit 1009 performs null processing (S1605). FIG. 17 shows an example of a nulling process flow. The driver generation unit 1009 adds a determination control code to the initialization code area 705 of the sample form (S1701). In this example, “if () {} else {}” (line feed omitted) shown in 815 and 819 in FIG. 8 is added as a determination control code. The driver generation unit 1009 inserts a null determination condition (S1703). In this example, a null control variable name is inserted in () of the if statement. If the determination of the “if” statement is true, the driver generation unit 1009 adds an instruction to assign null to the null control variable name (S1705), and ends the process.

図16の処理に戻って、ドライバ生成部1009は、クラス判定処理を行う(S1607)。ドライバ生成部1009は、クラス判定処理で(S1607)、例えば図8の817のコードを設定する。   Returning to the processing of FIG. 16, the driver generation unit 1009 performs class determination processing (S1607). The driver generation unit 1009 sets, for example, a code 817 in FIG. 8 in the class determination process (S1607).

図18に、クラス判定処理フローの例を示す。ドライバ生成部1009は、サンプルフォームの初期化コードエリア705に分岐制御コードを追加する(S1801)。この例では、if文の判定が偽の場合の分岐制御コードとして「switch(){case:break;case:break;default:break;}」(改行省略)を追加する。ドライバ生成部1009は、分岐条件を挿入し(S1803)、処理を終える。この例では、switch文の()内に実際型制御変数名「P1_cClass」を挿入し、各caseの後に「0」と「1」を挿入する。   FIG. 18 shows an example of the class determination processing flow. The driver generation unit 1009 adds a branch control code to the initialization code area 705 of the sample form (S1801). In this example, “switch () {case: break; case: break; default: break;}” (line feed omitted) is added as a branch control code when the determination of the if statement is false. The driver generation unit 1009 inserts a branch condition (S1803) and ends the process. In this example, the actual control variable name “P1_cClass” is inserted in () of the switch statement, and “0” and “1” are inserted after each case.

図16の処理に戻って、ドライバ生成部1009は、オブジェクト型変数初期化処理を行う(S1609)。ドライバ生成部1009は、オブジェクト型変数初期化処理(S1609)で、オブジェクト型変数の型の候補となるクラス型毎の初期化のコードを設定する。   Returning to the processing of FIG. 16, the driver generation unit 1009 performs object type variable initialization processing (S1609). In the object type variable initialization process (S1609), the driver generation unit 1009 sets an initialization code for each class type that is a candidate for the type of the object type variable.

図19に、オブジェクト型変数初期化処理フローの例を示す。ドライバ生成部1009は、候補となるクラス型毎に以下の処理を繰り返す(S1901)。ドライバ生成部1009は、オブジェクト型変数生成の命令を追加する(S1903)。例えばクラス型がAの場合には、「(オブジェクト型変数)=new A();」のコードを追加する。ドライバ生成部1009は、更に候補のクラス型で保持し得るメンバ変数についてメンバ初期化の命令を追加する(S1905)。具体的には、「(メンバ変数)=(メンバシンボル変数名);」のコードを追加する。ドライバ生成部1009は、すべての候補となるクラス型について処理したか否かを判定する(S1907)。処理していないクラス型があると判定した場合には、ドライバ生成部1009はS1901に戻る。すべての候補となるクラス型について処理したと判定した場合には、ドライバ生成部1009は処理を終え、図16の処理へ戻る。このようにして、例えば図8に示した817のコードが設定される。更に、ドライバ生成部1009は図16の処理を終え、図13のS1313へ戻る。   FIG. 19 shows an example of an object type variable initialization process flow. The driver generation unit 1009 repeats the following processing for each candidate class type (S1901). The driver generation unit 1009 adds an object type variable generation instruction (S1903). For example, when the class type is A, a code of “(object type variable) = new A ();” is added. The driver generation unit 1009 further adds a member initialization command for member variables that can be held in the candidate class type (S1905). Specifically, a code of “(member variable) = (member symbol variable name);” is added. The driver generation unit 1009 determines whether or not all candidate class types have been processed (S1907). If it is determined that there is an unprocessed class type, the driver generation unit 1009 returns to S1901. If it is determined that all candidate class types have been processed, the driver generation unit 1009 finishes the process and returns to the process of FIG. In this way, for example, the code 817 shown in FIG. 8 is set. Further, the driver generation unit 1009 finishes the process of FIG. 16 and returns to S1313 of FIG.

図13の処理に戻って、ドライバ生成部1009は、オブジェクト指定命令処理を行う(S1313)。ドライバ生成部1009は、オブジェクト指定命令処理(S1313)で、例えば、図8に示した821のコードを設定する。   Returning to the processing of FIG. 13, the driver generation unit 1009 performs an object designation command process (S1313). The driver generation unit 1009 sets, for example, the code 821 shown in FIG. 8 in the object designation command processing (S1313).

図20に、オブジェクト指定命令処理フローの例を示す。ドライバ生成部1009は、サンプルフォームのオブジェクト指定命令エリア707にオブジェクト指定命令「SymbolicExecUtil.calcPathCondition();」の行を追加する(S2001)。ドライバ生成部1009は、オブジェクト指定命令の引数にオブジェクト型変数名を挿入する(S2003)。   FIG. 20 shows an example of an object designation command processing flow. The driver generation unit 1009 adds a line of an object designation command “SymbolExecUtil.calcPathCondition ();” to the object designation command area 707 of the sample form (S2001). The driver generation unit 1009 inserts the object type variable name into the argument of the object designation command (S2003).

また、ドライバ生成部1009は、パス条件用変数名を特定する(S2005)。パス条件用変数名は、このオブジェクト型変数についてのパス条件を生成する際に用いる変数名である。この例では、パス条件用変数名は、オブジェクト型変数名と同じである。ドライバ生成部1009は、オブジェクト指定命令の引数にパス条件用変数名を挿入する(S2007)。ドライバ生成部1009は図20の処理を終え、図13のS1317へ戻る。   In addition, the driver generation unit 1009 identifies a path condition variable name (S2005). The path condition variable name is a variable name used when generating a path condition for the object type variable. In this example, the path condition variable name is the same as the object type variable name. The driver generation unit 1009 inserts the path condition variable name into the argument of the object designation command (S2007). The driver generation unit 1009 finishes the process of FIG. 20, and returns to S1317 of FIG.

次に、図13の処理に戻って、S1305で入力変数の型がプリミティブ型と判定された場合について説明する。   Next, returning to the processing of FIG. 13, the case where the type of the input variable is determined to be a primitive type in S1305 will be described.

S1305で入力変数の型がプリミティブ型と判定された場合には、ドライバ生成部1009は、プリミティブ宣言処理を行う(S1315)。図21に、プリミティブ宣言処理フローの例を示す。ドライバ生成部1009は、規約に従ってプリミティブ型変数名を決める(S2101)。この例で、i番目の入力変数名は、プリミティブ型変数であるかオブジェクト型変数であるかを問わず、「Pi」となる。ドライバ生成部1009は、サンプルフォームのシンボル変数宣言エリア701に「@Symbolic(”true”)」の行を追加する(S2103)。ドライバ生成部1009は、「public static ;」の行を加える(S2105)。ドライバ生成部1009は、プリミティブ型変数のデータ型を挿入する(S2107)。ドライバ生成部1009は、シンボル変数名を挿入する(S2109)。このようにして、例えば図3の301のコードが設定される。ドライバ生成部1009は図21の処理を終えると、図13のS1317へ戻る。   If the input variable type is determined to be a primitive type in S1305, the driver generation unit 1009 performs a primitive declaration process (S1315). FIG. 21 shows an example of a primitive declaration processing flow. The driver generation unit 1009 determines a primitive variable name according to the convention (S2101). In this example, the i-th input variable name is “Pi” regardless of whether it is a primitive type variable or an object type variable. The driver generation unit 1009 adds a line of “@Symbolic (“ true ”)” to the symbol variable declaration area 701 of the sample form (S2103). The driver generation unit 1009 adds a line “public static;” (S2105). The driver generation unit 1009 inserts the data type of the primitive type variable (S2107). The driver generation unit 1009 inserts a symbol variable name (S2109). In this way, for example, the code 301 in FIG. 3 is set. When the driver generation unit 1009 finishes the process of FIG. 21, the process returns to S1317 of FIG.

図13の処理に戻って、ドライバ生成部1009は、すべての引数について処理したか否かを判定する(S1317)。処理していない引数があると判定した場合には、ドライバ生成部1009はS1301へ戻る。すべての引数について処理したと判定した場合には、ドライバ生成部1009は図13の処理を終え、図12のS1205へ戻る。   Returning to the processing of FIG. 13, the driver generation unit 1009 determines whether or not all the arguments have been processed (S1317). If it is determined that there is an argument that has not been processed, the driver generation unit 1009 returns to S1301. If it is determined that all the arguments have been processed, the driver generation unit 1009 finishes the process in FIG. 13 and returns to S1205 in FIG.

図12の処理に戻って、ドライバ生成部1009は、対象クラス初期化処理(S1205)で、対象クラスを初期化するコードを設定する。   Returning to the process of FIG. 12, the driver generation unit 1009 sets a code for initializing the target class in the target class initialization process (S1205).

図22は、対象クラス初期化処理フローの例を示す図である。ドライバ生成部1009は、図7に示したサンプルフォームの対象クラス初期化エリア703に「TargetClass target = new ();」の行を追加する(S2201)。ドライバ生成部1009は、対象クラス名を特定し(S2203)、「()」の前に挿入し(S2205)、処理を終える。このようにして、図8に示した811のコードが設定される。   FIG. 22 is a diagram illustrating an example of a target class initialization process flow. The driver generation unit 1009 adds a line “TargetClass target = new ();” to the target class initialization area 703 of the sample form shown in FIG. 7 (S2201). The driver generation unit 1009 identifies the target class name (S2203), inserts it before “()” (S2205), and ends the process. In this way, the code 811 shown in FIG. 8 is set.

図22の処理を終えると、図12の処理に戻って、ドライバ生成部1009は、対象メソッド呼び出し処理を行う(S1207)。   When the process of FIG. 22 is completed, the process returns to the process of FIG. 12, and the driver generation unit 1009 performs a target method call process (S1207).

図23に、対象メソッド呼び出し処理フローの例を示す。ドライバ生成部1009は、図7に示したサンプルフォームの対象メソッドの呼び出しエリア709に「target.();」 の行を追加する(S2301)。ドライバ生成部1009は、対象メソッド名を特定し(S2303)、「.」の後に挿入する(S2305)。更に、ドライバ生成部1009は、引数に設定する変数名を挿入し(S2307)、処理を終える。ドライバ生成部1009は図12の対象メソッド呼び出し処理(S1207)を終え、更に図11のドライバ生成処理(S1103)を終える。   FIG. 23 shows an example of the target method call processing flow. The driver generation unit 1009 adds a line “target. ();” To the target method call area 709 of the sample form shown in FIG. 7 (S2301). The driver generation unit 1009 identifies the target method name (S2303) and inserts it after “.” (S2305). Further, the driver generation unit 1009 inserts a variable name to be set as an argument (S2307) and ends the process. The driver generation unit 1009 finishes the target method call process (S1207) of FIG. 12, and further finishes the driver generation process (S1103) of FIG.

続いて、図11の処理に戻って、S1105に示した制御変数テーブル生成処理について説明する。制御変数テーブル生成部1013は、制御変数テーブル生成処理で、例えば図9に示した制御変数テーブルを生成する。   Next, returning to the process of FIG. 11, the control variable table generation process shown in S1105 will be described. The control variable table generation unit 1013 generates, for example, the control variable table shown in FIG. 9 in the control variable table generation process.

図24に、制御変数テーブル生成処理フローの例を示す。制御変数テーブル生成部1013は、対象メソッドの入力変数を特定し(S2401)、入力変数毎に以下の処理を繰り返す(S2403)。制御変数テーブル生成部1013は、入力変数の型がオブジェクト型であるか、あるいはプリミティブ型であるかを判定する(S2405)。入力変数の型がプリミティブ型であると判定した場合には、制御変数テーブル生成部1013はS2417を行う。   FIG. 24 shows an example of a control variable table generation processing flow. The control variable table generation unit 1013 identifies the input variable of the target method (S2401), and repeats the following processing for each input variable (S2403). The control variable table generation unit 1013 determines whether the type of the input variable is an object type or a primitive type (S2405). If it is determined that the type of the input variable is a primitive type, the control variable table generation unit 1013 performs S2417.

入力変数の型がオブジェクト型であると判定した場合には、制御変数テーブル生成部1013は、図14のS1401で決めたnull制御変数名を設定する(S2407)。そして、制御変数テーブル生成部1013は、trueと意味式を設定する(S2409)。意味式は、「(オブジェクト型変数名)==null」となる。制御変数テーブル生成部1013は、更にfalseと意味式を設定する(S2411)。意味式は、「(オブジェクト型変数名)!=null」となる。   If it is determined that the type of the input variable is an object type, the control variable table generation unit 1013 sets the null control variable name determined in S1401 of FIG. 14 (S2407). Then, the control variable table generating unit 1013 sets true and a semantic expression (S2409). The semantic expression is “(object type variable name) == null”. The control variable table generation unit 1013 further sets false and a semantic expression (S2411). The semantic expression is “(object type variable name)! = Null”.

次に、制御変数テーブル生成部1013は、図14のS1409で決めた実際型制御変数名を設定する(S2413)。更に、制御変数テーブル生成部1013は、候補クラスを示す値と意味式を設定する(S2415)。値に応じて、「(オブジェクト型変数名) instanceof (候補クラス名)」とする。制御変数テーブル生成部1013は、すべての入力変数について処理した否かを判定する(S2417)。処理していない入力変数があると判定した場合には、制御変数テーブル生成部1013はS2403に戻る。すべての入力変数について処理したと判定した場合には、制御変数テーブル生成部1013は処理を終え、図11に戻り、準備処理を終える。   Next, the control variable table generation unit 1013 sets the actual control variable name determined in S1409 of FIG. 14 (S2413). Further, the control variable table generation unit 1013 sets a value indicating a candidate class and a semantic expression (S2415). According to the value, “(object type variable name) instanceof (candidate class name)”. The control variable table generating unit 1013 determines whether all input variables have been processed (S2417). If it is determined that there is an input variable that has not been processed, the control variable table generation unit 1013 returns to S2403. If it is determined that all input variables have been processed, the control variable table generation unit 1013 finishes the process, returns to FIG. 11, and ends the preparation process.

このように準備処理において、シンボル実行用ドライバと制御変数テーブルを生成することにより、テストケース生成作業の省力化が図られる。   In this way, in the preparation process, by generating the symbol execution driver and the control variable table, it is possible to save labor in the test case generation work.

続いて、シンボリック実行処理について説明する。図25は、テストケース生成装置のうちシンボリック実行処理に係る構成例を示す図である。テストケース生成装置は、更に、実行部1017、パターンテーブル格納部1019、シンボル変数テーブル記憶部1021、特定部1023、オブジェクトテーブル記憶部1025、第1テストケース格納部1027、第1生成部1029及びオブジェクトパス条件記憶部1031を有している。   Next, symbolic execution processing will be described. FIG. 25 is a diagram illustrating a configuration example related to symbolic execution processing in the test case generation device. The test case generation apparatus further includes an execution unit 1017, a pattern table storage unit 1019, a symbol variable table storage unit 1021, a specification unit 1023, an object table storage unit 1025, a first test case storage unit 1027, a first generation unit 1029, and an object. A path condition storage unit 1031 is included.

実行部1017は、シンボリック実行を行い、第1テストケースを生成するように構成されている。パターンテーブル格納部1019は、プログラムパターンとメモリ条件パターンとパス条件パターンを対応付けるパターンテーブルを記憶するように構成されている。パターンテーブル格納部1019については、図26を用いて後述する。   The execution unit 1017 is configured to perform symbolic execution and generate a first test case. The pattern table storage unit 1019 is configured to store a pattern table that associates program patterns, memory condition patterns, and path condition patterns. The pattern table storage unit 1019 will be described later with reference to FIG.

シンボル変数テーブル記憶部1021は、シンボル変数とその型を対応付けるシンボル変数テーブルを記憶するように構成されている。特定部1023は、オブジェクト型変数の実体が格納されている位置を特定したオブジェクトテーブルを生成する処理を行うように構成されている。オブジェクトテーブル記憶部1025は、オブジェクトテーブルを記憶するように構成されている。第1テストケース格納部1027は、第1テストケースの集合である第1テストケースセットを記憶するように構成されている。第1生成部1029は、オブジェクトテーブルに基づいて、オブジェクト型変数が満たすべきオブジェクトパス条件を生成する処理を行うように構成されている。オブジェクトパス条件記憶部1031は、オブジェクトパス条件を記憶するように構成されている。   The symbol variable table storage unit 1021 is configured to store a symbol variable table that associates a symbol variable with its type. The specifying unit 1023 is configured to perform a process of generating an object table specifying the position where the entity of the object type variable is stored. The object table storage unit 1025 is configured to store an object table. The first test case storage unit 1027 is configured to store a first test case set that is a set of first test cases. The first generation unit 1029 is configured to perform processing for generating an object path condition that the object type variable should satisfy based on the object table. The object path condition storage unit 1031 is configured to store object path conditions.

図26に、パターンテーブルの例を示す。パターンテーブルは、パターン番号、プログラムパターン、メモリ条件パターン及びパス条件パターンを対応付けている。プログラムに含まれる式のパターンにより導かれるオブジェクトパス条件のパターンを定めている。更に、プログラムに含まれる式のパターンに加えて、メモリの条件も加えて判断する場合のメモリ条件のパターンも定めている。   FIG. 26 shows an example of the pattern table. The pattern table associates pattern numbers, program patterns, memory condition patterns, and path condition patterns. The object path condition pattern derived from the expression pattern included in the program is defined. Furthermore, in addition to the pattern of formulas included in the program, a memory condition pattern is also defined in the case of determining by adding a memory condition.

メモリ条件パターンが設定されていない場合には、プログラムパターンからパス条件パターンが導かれ、メモリ条件パターンが設定されている場合には、プログラムパターン及びメモリ条件パターンからパス条件パターンが導かれる。   When the memory condition pattern is not set, the path condition pattern is derived from the program pattern. When the memory condition pattern is set, the path condition pattern is derived from the program pattern and the memory condition pattern.

「OBJX」と「OBJY」は、オブジェクトパス条件を計算する対象となるオブジェクト変数を示している。例えば、パターン番号1に示したように、プログラム中の命令に「OBJX==null」の式が含まれる場合には、パス条件として「OBJX==null」が導かれる。   “OBJX” and “OBJY” indicate object variables for which object path conditions are calculated. For example, as shown in pattern number 1, when an instruction in the program includes an expression “OBJX == null”, “OBJX == null” is derived as a path condition.

また、「TX」は、型を示している。例えば、パターン番号3に示したように、プログラム中の命令に「OBJX instanceof TX」の式が含まれる場合には、パス条件として「OBJX instanceof TX」が導かれる。   “TX” indicates a type. For example, as shown in pattern number 3, when an instruction in the program includes an expression “OBJX instance of TX”, “OBJX instance of TX” is derived as a path condition.

「.member」は、メンバ変数へのアクセスを示している。例えば、パターン番号5に示したように、プログラム中の命令に「OBJX.member」の式が含まれる場合には、パス条件として「OBJX!=null」が導かれる。   “.Member” indicates access to a member variable. For example, as shown in pattern number 5, when an instruction in the program includes an expression “OBJX.member”, “OBJX! = Null” is derived as a path condition.

「.method()」は、メソッドの呼び出しを示している。例えば、パターン番号6に示したように、プログラム中の命令に「OBJX.method()」の式が含まれる場合には、パス条件として「OBJX!=null」が導かれる。   “.Method ()” indicates a method call. For example, as shown in pattern number 6, when an instruction in the program includes an expression “OBJX.method ()”, “OBJX! = Null” is derived as a path condition.

「VX」と「VY」は、オブジェクトパス条件を計算する対象とならない変数を示している。例えば、パターン番号7に示したように、プログラム中の命令に「OBJX==VX」の式が含まれ、更にメモリの状態が「VX==null」であれば、パス条件として「OBJX==null」が導かれる。   “VX” and “VY” indicate variables that are not targets for calculating the object path condition. For example, as shown in the pattern number 7, if the instruction in the program includes the expression “OBJX == VX” and the memory state is “VX == null”, the path condition is “OBJX == null "is derived.

図27に、シンボル変数テーブル記憶部1021で記憶されるシンボル変数テーブルの例を示す。このように、シンボル変数テーブル記憶部1021は、シンボル変数とその型を対応付ける。   FIG. 27 shows an example of a symbol variable table stored in the symbol variable table storage unit 1021. Thus, the symbol variable table storage unit 1021 associates the symbol variable with its type.

図28に、オブジェクトテーブル記憶部1025で記憶されるオブジェクトテーブルの例を示す。図28に示したように、オブジェクトパス条件を計算する対象となるオブジェクト型変数名と、参照用IDと、パス条件用変数名を対応付けている。参照用IDは、オブジェクト型変数のインスタンスを参照するための情報である。パス条件用変数名は、オブジェクトパス条件で用いるオブジェクト型変数の変数名である。オブジェクト型変数名は、省略してもよい。   FIG. 28 shows an example of an object table stored in the object table storage unit 1025. As shown in FIG. 28, the object type variable name for which the object path condition is calculated, the reference ID, and the path condition variable name are associated with each other. The reference ID is information for referring to an instance of an object type variable. The path condition variable name is a variable name of an object type variable used in the object path condition. The object type variable name may be omitted.

図29a乃至図29cに、第1テストケース格納部1027で記憶される第1テストケースセットの例を示す。テストケースを識別するケース番号と、テスト入力と、シンボルパス条件を対応付けている。第1テストケースは、シンボリック実行処理により生成される。   FIGS. 29 a to 29 c show examples of the first test case set stored in the first test case storage unit 1027. A case number for identifying a test case, a test input, and a symbol path condition are associated with each other. The first test case is generated by symbolic execution processing.

図30に、オブジェクトパス条件記憶部1031で記憶されるオブジェクトパス条件の例を示す。テストケースを識別するケース番号とオブジェクトパス条件を対応付けている。例えば、ケース番号1の場合、「P1_cnull==true∧P2_cnull ==true」がオブジェクトパス条件となることを示している。オブジェクトパス条件は、第1生成部1029により生成される。   FIG. 30 shows an example of object path conditions stored in the object path condition storage unit 1031. A case number for identifying a test case is associated with an object path condition. For example, case number 1 indicates that “P1_cnull == true = P2_cnull == true” is an object path condition. The object path condition is generated by the first generation unit 1029.

続いて、シンボリック実行処理について説明する。図31に、シンボリック実行処理フローの例を示す。実行部1017は、まず初期化処理を行う(S3101)。   Next, symbolic execution processing will be described. FIG. 31 shows an example of a symbolic execution process flow. The execution unit 1017 first performs initialization processing (S3101).

図32に、初期化処理フローの例を示す。実行部1017は、シンボル変数テーブルを生成する(S3201)。シンボル変数テーブルは、シンボル実行用ドライバのシンボル変数宣言から抽出される。シンボル変数テーブルは、シンボル変数を特定するために用いられる。実行部1017は、実行開始位置を特定する(S3203)。実行開始位置は、図8の809のコードにより特定される。実行部1017は、第1テストケースに新規レコードを割り当てる(S3205)。このとき、ケース番号も割り振られる。実行部1017は処理を終了し、図31のS3103へ戻る。   FIG. 32 shows an example of an initialization process flow. The execution unit 1017 generates a symbol variable table (S3201). The symbol variable table is extracted from the symbol variable declaration of the symbol execution driver. The symbol variable table is used to specify symbol variables. The execution unit 1017 identifies the execution start position (S3203). The execution start position is specified by the code 809 in FIG. The execution unit 1017 assigns a new record to the first test case (S3205). At this time, a case number is also assigned. The execution unit 1017 ends the process and returns to S3103 in FIG.

図31の処理に戻って、実行部1017は、実行パターン処理を行う(S3103)。実行パターン処理では、実行パターン毎の処理を行う。図33に、実行パターン処理フローの例を示す。実行部1017は、実行開始位置から順に命令を特定する(S3301)。実行部1017は、命令が有るか否かを判定する(S3303)。命令が無いと判定した場合には、実行パターンの終点であるので、実行部1017は、処理結果を完了として処理を終了する(S3305)。実行部1017が処理を終えると、図31のS3105へ戻る。   Returning to the processing of FIG. 31, the execution unit 1017 performs execution pattern processing (S3103). In the execution pattern process, a process for each execution pattern is performed. FIG. 33 shows an example of an execution pattern processing flow. The execution unit 1017 specifies commands in order from the execution start position (S3301). The execution unit 1017 determines whether there is an instruction (S3303). If it is determined that there is no command, it is the end point of the execution pattern, so the execution unit 1017 completes the processing result and ends the processing (S3305). When the execution unit 1017 finishes the process, the process returns to S3105 in FIG.

図33のS3303で命令が有ると判定した場合には、実行部1017は、命令がオブジェクト指定命令であるか否かを判定する(S3307)。オブジェクト指定命令は、例えば図8に示した821のコードである。命令がオブジェクト指定命令でないと判定した場合には、実行部1017はS3311へ処理を移す。命令がオブジェクト指定命令であると判定した場合には、特定部1023は、オブジェクト特定処理を行う(S3309)。   If it is determined in S3303 in FIG. 33 that there is an instruction, the execution unit 1017 determines whether the instruction is an object designation instruction (S3307). The object designation command is, for example, the code 821 shown in FIG. If it is determined that the instruction is not an object designation instruction, the execution unit 1017 moves the process to S3311. If it is determined that the command is an object designation command, the specifying unit 1023 performs an object specifying process (S3309).

ここで、オブジェクト指定命令を判定する実行パターン処理の動作例を説明する。図34に、実行パターン処理の動作例を示す。シンボル実行用ドライバと対象メソッド中の命令の遷移を、矢印で示している。「if(P1_cnull)」の条件判断で、「true」と判断され、シンボルパス条件「P1_cnull==true」が生成される。また、「if(P2_cnull)」の条件判断で、「true」と判断され、シンボルパス条件「P2_cnull==true」が生成される。   Here, an example of execution pattern processing for determining an object designation command will be described. FIG. 34 shows an operation example of execution pattern processing. The transition of instructions in the symbol execution driver and the target method is indicated by arrows. In the condition determination of “if (P1_cull)”, “true” is determined, and the symbol path condition “P1_cull == true” is generated. Further, in the condition determination of “if (P2_cull)”, “true” is determined, and a symbol path condition “P2_cull == true” is generated.

「SymbolicExecUtil.calcPathCondition(P1, “P1”);」と「SymbolicExecUtil.calcPathCondition(P2, “P2”);」の行で、オブジェクト指定命令と判定され、オブジェクト特定処理が行われる。   In the lines of “SymbolicExecUil.calcPathCondition (P1,“ P1 ”);” and “SymbolicExecUil.calcPathCondition (P2,“ P2 ”);”, the object specifying command is determined, and the object specifying process is performed.

続けて、図33のオブジェクト特定処理(S3309)の説明をする。図35に、オブジェクト特定処理フローの例を示す。特定部1023は、オブジェクト指定命令の引数であるオブジェクト型変数名を特定する(S3501)。図34の例では、それぞれ「P1」と「P2」がオブジェクト型変数名である。特定部1023は、オブジェクト型変数名を実行部1017へ渡し、実行部1017からオブジェクト型変数のインスタンスを参照するための参照用IDを取得する(S3503)。このとき、実行部1017は、オブジェクト型変数名を受け、そのオブジェクト型変数のインスタンスを参照するための参照用IDを返すように動作する。特定部1023は、オブジェクト指定命令の引数であるパス条件用変数名を特定する(S3505)。図34の例では、それぞれ「“P1”」と「“P2”」がパス条件用変数名である。特定部1023は、オブジェクト型変数名と参照用IDとパス条件用変数名を対象テーブルのレコードに追加する(S3507)。特定部1023は処理を終え、図33のS3311へ戻る。   Subsequently, the object specifying process (S3309) of FIG. 33 will be described. FIG. 35 shows an example of an object specifying process flow. The identifying unit 1023 identifies an object type variable name that is an argument of the object designation command (S3501). In the example of FIG. 34, “P1” and “P2” are object type variable names, respectively. The specifying unit 1023 passes the object type variable name to the execution unit 1017, and acquires a reference ID for referring to the object type variable instance from the execution unit 1017 (S3503). At this time, the execution unit 1017 operates to receive an object type variable name and return a reference ID for referring to the instance of the object type variable. The identifying unit 1023 identifies the path condition variable name that is an argument of the object designation command (S3505). In the example of FIG. 34, “P1” and “P2” are path condition variable names, respectively. The specifying unit 1023 adds the object type variable name, the reference ID, and the path condition variable name to the record of the target table (S3507). The identification unit 1023 finishes the process and returns to S3311 of FIG.

図33の処理に戻って、実行部1017は、S3301で特定した命令を解析し(S3311)、その命令が分岐命令であるか否かを判定する。(S3313)。その命令が分岐命令でないと判定した場合には、S3317へ移る。その命令が分岐命令であると判定した場合には、実行部1017は、未だパスとして選択していない分岐を選択する(S3315)。そして、実行部1017は、選択した分岐についてのシンボルパス条件を計算する(S3317)。但し、S3313で分岐命令でないと判定し、シンボルパス条件の計算を行なわない場合もある。シンボルパス条件の計算については、従来のシンボリック実行の場合と同様であるので、説明を省略する。   Returning to the processing of FIG. 33, the execution unit 1017 analyzes the instruction specified in S3301 (S3311), and determines whether or not the instruction is a branch instruction. (S3313). If it is determined that the instruction is not a branch instruction, then the flow shifts to S3317. If it is determined that the instruction is a branch instruction, the execution unit 1017 selects a branch that has not yet been selected as a path (S3315). Then, the execution unit 1017 calculates a symbol path condition for the selected branch (S3317). However, there are cases where it is determined in S3313 that the instruction is not a branch instruction and the symbol path condition is not calculated. Since the calculation of the symbol path condition is the same as in the case of conventional symbolic execution, description thereof is omitted.

続いて、第1生成部1029は、オブジェクトパス条件生成処理を行う(S3319)。オブジェクトパス条件生成処理については、図38から図40を用いて後述する。   Subsequently, the first generation unit 1029 performs an object path condition generation process (S3319). The object path condition generation process will be described later with reference to FIGS.

実行部1017は、パス条件の充足は可能であるか否かを判定する(S3321)。パス条件を充足できないと判定した場合には、実行不可能なパス(例えば、図2の203)を含むので、実行部1017は、処理結果を中断とする(S3323)。パス条件を充足できると判定した場合には、実行部1017は、命令を実行し(S3325)、S3301へ戻る。   The execution unit 1017 determines whether the path condition can be satisfied (S3321). When it is determined that the path condition cannot be satisfied, since the path that cannot be executed (for example, 203 in FIG. 2) is included, the execution unit 1017 interrupts the processing result (S3323). If it is determined that the path condition can be satisfied, the execution unit 1017 executes the command (S3325) and returns to S3301.

図36に、図34の次の実行パターン処理の動作例を示す。図34で「return 0」に至り、図33のS3303とS3305で示したように次の命令が無いと判定すると、処理結果を完了として一旦実行パターン処理を終える。そして、未実行パスを選択する。具体的には、バックトラックにより未選択の分岐がある分岐点までもどり、未選択の分岐を次のパスの実行開始位置とする。図36の例では、次の実行開始位置「if(P2_cnull)」の判断結果「false」を選択する。このとき、実行開始位置「if(P2_cnull)」までに得られている既知のシンボルパス条件「P1_cnull==true」が特定され、新しいシンボルパス条件に設定される。そして、シンボルパス条件「P2_cnull==false」が生成される。   FIG. 36 shows an operation example of the next execution pattern process of FIG. When it reaches “return 0” in FIG. 34 and determines that there is no next instruction as shown in S3303 and S3305 in FIG. 33, the processing result is completed and the execution pattern processing is once completed. Then, an unexecuted path is selected. Specifically, the backtrack returns to the branch point where there is an unselected branch, and the unselected branch is set as the execution start position of the next path. In the example of FIG. 36, the determination result “false” of the next execution start position “if (P2_cull)” is selected. At this time, a known symbol path condition “P1_cull == true” obtained up to the execution start position “if (P2_cull)” is specified and set as a new symbol path condition. Then, a symbol path condition “P2_cull == false” is generated.

図31の処理に戻って、実行部1017は、S3103の実行パターン処理における処理結果が中断であるか、あるいは完了であるかを判定する(S3105)。処理結果が中断であると判定した場合には、実行部1017はテストケースを生成しない。処理結果が完了であると判定した場合には、実行部1017はテストケースを生成する(S3107)。具体的には、実行部1017は、シンボリックパス条件の充足値を求めて、その充足値をテスト入力に設定する。   Returning to the processing of FIG. 31, the execution unit 1017 determines whether the processing result in the execution pattern processing of S3103 is interrupted or complete (S3105). If it is determined that the processing result is interruption, the execution unit 1017 does not generate a test case. If it is determined that the processing result is complete, the execution unit 1017 generates a test case (S3107). Specifically, the execution unit 1017 obtains a satisfaction value of the symbolic path condition and sets the satisfaction value as a test input.

次に、実行部1017は、探索処理を行う(S3109)。探索処理では、次のパスを探索する。   Next, the execution unit 1017 performs a search process (S3109). In the search process, the next path is searched.

図37に、探索処理フローの例を示す。実行部1017は、未実行パスを選択する(S3701)。具体的には、実行部1017は、図36に示したように、バックトラックにより未選択の分岐がある分岐点までもどり、未選択の分岐を次のパスの実行開始位置とする。実行部1017は、未実行パスあったか否かを判定する(S3703)。バックトラックにより未選択の分岐が見つけられなかった場合には、実行部1017は未実行パスがないと判定して、処理結果をパスなしとする(S3705)。そして、実行部1017は処理を終え、図31のS3111へ戻る。   FIG. 37 shows an example of a search processing flow. The execution unit 1017 selects an unexecuted path (S3701). Specifically, as shown in FIG. 36, the execution unit 1017 returns to the branch point where there is an unselected branch by backtracking, and sets the unselected branch as the execution start position of the next path. The execution unit 1017 determines whether or not there is an unexecuted path (S3703). When an unselected branch is not found by backtracking, the execution unit 1017 determines that there is no unexecuted path, and sets the processing result as no path (S3705). Then, the execution unit 1017 ends the process and returns to S3111 in FIG.

バックトラックにより未選択の分岐が見つかった場合には、実行部1017は未実行パスがあると判定して、第1テストケースの新規レコードを割り当てる(S3707)。そして、実行部1017は、分岐点より上位の既知であるシンボリックパス条件を特定し、新たな第1テストケースのシンボリックパス条件に加える(S3709)。そして、実行部1017は、処理結果をパスありとして(S3711)、処理を終了する。そして、図31のS3111へ戻る。   If an unselected branch is found by backtracking, the execution unit 1017 determines that there is an unexecuted path and allocates a new record for the first test case (S3707). Then, the execution unit 1017 identifies a known symbolic path condition above the branch point, and adds it to the new symbolic path condition of the first test case (S3709). Then, the execution unit 1017 determines that the processing result has a path (S3711), and ends the processing. Then, the process returns to S3111 in FIG.

図31の処理に戻って、実行部1017は、探索処理(S3109)の処理結果がパスありであるか、あるいはパスなしであるかを判定する(S3111)。探索処理(S3109)の処理結果がパスありであると判定すると、実行部1017はS3103の処理に戻り、シンボリック実行処理を続行する。探索処理(S3109)の処理結果がパスなしであると判定すると、実行部1017はシンボリック実行処理を終える。   Returning to the processing of FIG. 31, the execution unit 1017 determines whether the processing result of the search processing (S3109) is a path or no path (S3111). If it is determined that the processing result of the search process (S3109) is “pass”, the execution unit 1017 returns to the process of S3103 and continues the symbolic execution process. If it is determined that the processing result of the search process (S3109) is that there is no path, the execution unit 1017 ends the symbolic execution process.

次に、前述のオブジェクトパス条件生成処理(図33のS3319)について説明する。   Next, the above-described object path condition generation process (S3319 in FIG. 33) will be described.

ここで、図38にオブジェクトパス条件生成の動作例を示す。図38の例では、条件判断命令「if(obj1!=null)」から選択した分岐を示す式「obj1!=null」を得る。そして、オペランド「obj1」を参照先となるID「100」を特定する。この参照先ID「100」は、オブジェクトテーブルの参照用ID「100」と一致するので、このオペランドの変数はオブジェクトパス条件の計算対象であると判定される。そして、式「obj1!=null」に相当するプログラムパターン「OBJX!=null」をパターンテーブルで特定し、プログラムパターンに対応するパス条件パターン「OBJX!=null」に基づいて、オブジェクトパス条件「P1!=null」を生成している。その際、参照用ID「100」に対応するパス条件用変数名「P1」を用いている。尚、この例では、メモリ条件パターンは設定されていないので、メモリの状態については判定しない。   Here, FIG. 38 shows an operation example of object path condition generation. In the example of FIG. 38, an expression “obj1! = Null” indicating a branch selected from the condition determination instruction “if (obj1! = Null)” is obtained. Then, the ID “100” that is the reference destination of the operand “obj1” is specified. Since this reference destination ID “100” matches the reference ID “100” in the object table, it is determined that the variable of this operand is a calculation target of the object path condition. Then, the program pattern “OBJX! = Null” corresponding to the expression “obj1! = Null” is specified in the pattern table, and the object path condition “P1” is based on the path condition pattern “OBJX! = Null” corresponding to the program pattern. ! = Null "is generated. At this time, the path condition variable name “P1” corresponding to the reference ID “100” is used. In this example, since the memory condition pattern is not set, the state of the memory is not determined.

図39に、オブジェクトパス条件生成処理フローの例を示す。第1生成部1029は、命令から式を特定し(S3901)、第1生成部1029は、オペランドの変数を特定する(S3903)。条件判断命令の場合には、第1生成部1029は選択した分岐を示す式を特定する。   FIG. 39 shows an example of an object path condition generation process flow. The first generation unit 1029 specifies an expression from the instruction (S3901), and the first generation unit 1029 specifies an operand variable (S3903). In the case of a condition determination instruction, the first generation unit 1029 specifies an expression indicating the selected branch.

そして、第1生成部1029は、変数の参照先IDを実行部1017から取得する(S3905)。このとき、第1生成部1029は変数名を実行部1017に渡す。これに対して、実行部1017はその変数名によるインスタンスを参照するためのIDを返すように動作する。第1生成部1029は、取得した参照先IDがオブジェクトテーブルのいずれかの参照用IDと一致するか否かを判定する(S3907)。取得した参照先IDがオブジェクトテーブルのいずれの参照用IDとも一致しないと判定した場合には、第1生成部1029は処理を終え、図33のS3321へ戻る。   The first generation unit 1029 acquires the reference destination ID of the variable from the execution unit 1017 (S3905). At this time, the first generation unit 1029 passes the variable name to the execution unit 1017. On the other hand, the execution unit 1017 operates so as to return an ID for referring to the instance by the variable name. The first generation unit 1029 determines whether or not the acquired reference destination ID matches any reference ID in the object table (S3907). If it is determined that the acquired reference destination ID does not match any reference ID in the object table, the first generation unit 1029 ends the process and returns to S3321 in FIG.

図39のS3907で、取得した参照先IDがオブジェクトテーブルのいずれかの参照用IDと一致すると判定した場合には、第1生成部1029は、S3901で特定した式に対応するプログラムパターンを特定する(S3909)。S3901で特定した式が否定形式の場合には、肯定形式の式に置き換えてプログラムパターンと対比するようにしてもよい。第1生成部1029は、パターンテーブルにプログラムパターンに対応するメモリ条件パターンがあるか否かを判定する(S3911)。パターンテーブルにプログラムパターンに対応するメモリ条件パターンないと判定した場合には、第1生成部1029はS3917へ移る。   If it is determined in S3907 in FIG. 39 that the acquired reference destination ID matches any reference ID in the object table, the first generation unit 1029 specifies a program pattern corresponding to the formula specified in S3901. (S3909). If the expression specified in S3901 is negative, it may be replaced with an affirmative expression and compared with the program pattern. The first generation unit 1029 determines whether there is a memory condition pattern corresponding to the program pattern in the pattern table (S3911). If it is determined that there is no memory condition pattern corresponding to the program pattern in the pattern table, the first generation unit 1029 moves to S3917.

パターンテーブルにプログラムパターンに対応するメモリ条件パターンあると判定した場合には、第1生成部1029は、メモリ条件パターンに関するメモリ情報を取得する(S3913)。例えば、第1生成部1029は「VX」に相当する変数名を実行部1017へ渡し、実行部1017はメモリに格納されている変数の値又はnullを返す。あるいは、別の例で第1生成部1029は「OBJX」に相当するオブジェクト型変数がnullであるか否かを問い合わせる要求を実行部1017へ渡し、実行部1017は「OBJX」に相当するオブジェクト型変数がnullであるか否かを示す回答を返す。   If it is determined that there is a memory condition pattern corresponding to the program pattern in the pattern table, the first generation unit 1029 acquires memory information related to the memory condition pattern (S3913). For example, the first generation unit 1029 passes the variable name corresponding to “VX” to the execution unit 1017, and the execution unit 1017 returns the value of the variable stored in the memory or null. Alternatively, in another example, the first generation unit 1029 passes a request for inquiring whether or not the object type variable corresponding to “OBJX” is null to the execution unit 1017, and the execution unit 1017 receives the object type corresponding to “OBJX”. Returns an answer indicating whether the variable is null.

そして、第1生成部1029は、メモリ情報がメモリ条件パターンに合致するか否かを判定する(S3915)。メモリ情報がメモリ条件パターンに合致しないと判定した場合には、第1生成部1029は処理を終了し、図33のS3321へ戻る。   Then, the first generation unit 1029 determines whether or not the memory information matches the memory condition pattern (S3915). If it is determined that the memory information does not match the memory condition pattern, the first generation unit 1029 ends the process and returns to S3321 in FIG.

メモリ情報がメモリ条件パターンに合致すると判定した場合には、第1生成部1029は、オブジェクトパス条件を生成する(S3917)。具体的には、プログラムパターンに対応するパス条件パターンを特定し、パス条件パターンに基づいて、オブジェクトパス条件を生成する。その際、パス条件パターン中のオブジェクト変数(例えば「OBJX」)を、そのオブジェクト変数に相当するオブジェクト変数(「例えば、P1」)に対応するパス条件用変数名(例えば、「”P1”」)に変換する。尚、前述のように、特定した式が否定形式の場合であり、式を肯定形式に置き換えてプログラムパターンを特定した場合には、オブジェクトパス条件も肯定形式から否定形式に変換する。そして、第1生成部1029は、生成したオブジェクトパス条件をオブジェクトテーブル記憶部1025にケース番号に対応付けて記憶させる(S3919)。   If it is determined that the memory information matches the memory condition pattern, the first generation unit 1029 generates an object path condition (S3917). Specifically, a path condition pattern corresponding to the program pattern is specified, and an object path condition is generated based on the path condition pattern. At this time, an object variable (for example, “OBJX”) in the path condition pattern is replaced with a path condition variable name (for example, ““ P1 ””) corresponding to the object variable (“for example, P1”) corresponding to the object variable. Convert to As described above, the specified expression is in the negative form. When the program pattern is specified by replacing the expression with the positive form, the object path condition is also converted from the positive form to the negative form. Then, the first generation unit 1029 stores the generated object path condition in the object table storage unit 1025 in association with the case number (S3919).

図40に、図38に続くオブジェクトパス条件生成の動作例を示す。図40の例では、条件判断命令「if(obj1 instanceof B)」で偽が選択されたと想定し、分岐を示す式「!(obj1 instanceof B)」を得る。そして、オペランド「obj1」の参照先となるID「100」を特定する。この参照先ID「100」は、オブジェクトテーブルの参照用ID「100」と一致するので、このオペランドの変数はオブジェクトパス条件の計算対象であると判定される。そして、式「obj1 instanceof B」に相当するプログラムパターン「OBJX instanceof TX」をパターンテーブルで特定し、プログラムパターンに対応するパス条件パターン「OBJX instanceof TX」に基づいて、オブジェクトパス条件「!(P1 instanceof B)」を生成する。その際、参照用ID「100」に対応するパス条件用変数名「P1」を用いている。また、「TX」は対応する「B」に置き換えている。この例では、式が否定形式であるので、オブジェクトパス条件も否定形式となっている。   FIG. 40 shows an operation example of object path condition generation following FIG. In the example of FIG. 40, assuming that false is selected by the condition determination instruction “if (obj1 instance of B)”, an expression “! (Obj 1 instance of B)” indicating a branch is obtained. Then, the ID “100” that is the reference destination of the operand “obj1” is specified. Since this reference destination ID “100” matches the reference ID “100” in the object table, it is determined that the variable of this operand is a calculation target of the object path condition. Then, the program pattern “OBJX instance of TX” corresponding to the expression “obj1 instance of B” is specified in the pattern table, and the object path condition “! (P1 instance of TX) is determined based on the path condition pattern“ OBJX instance of TX ”corresponding to the program pattern. B) ". At this time, the path condition variable name “P1” corresponding to the reference ID “100” is used. Also, “TX” is replaced with the corresponding “B”. In this example, since the expression is in negative form, the object path condition is also in negative form.

前述の参照用IDは、オブジェクト変数のインスタンスを参照する情報である。図41に、メモリ状態の例を示す。スタックでは、変数毎に変数名と型と参照用IDを記憶している。ヒープでは、インスタンスを格納している。インスタンスは、参照用IDによって特定できるように構成されている。例えば、「obj1.a1」のメンバ変数の値を取得する場合には、スタックの情報に基づいて「obj1」の変数名に対応する参照用ID「100」を特定し、更に参照用ID「100」で特定されるインスタンスから、メンバ変数の値を取得する。通常の実行においては、メンバ変数には具体的な値が設定されているが、シンボリック実行においては、シンボル変数として宣言されているメンバ変数には、シンボル値が設定されている。図中、「symbol_P1_ma1」と「symbol_P2_ma1」は、シンボル値の例である。   The aforementioned reference ID is information for referring to an instance of an object variable. FIG. 41 shows an example of the memory state. In the stack, a variable name, a type, and a reference ID are stored for each variable. Instances are stored in the heap. The instance is configured to be identified by the reference ID. For example, when acquiring the value of the member variable “obj1.a1”, the reference ID “100” corresponding to the variable name “obj1” is specified based on the stack information, and the reference ID “100” is further specified. The value of the member variable is acquired from the instance specified by “”. In normal execution, a specific value is set for the member variable. In symbolic execution, a symbol value is set for the member variable declared as a symbol variable. In the figure, “symbol_P1_ma1” and “symbol_P2_ma1” are examples of symbol values.

複数の変数から同じインスタンスを参照する場合もある。図42に、複数の変数から同じインスタンスを参照する場合の例を示す。例えば、「(B)obj1.b1」のメンバ変数の値を取得する場合には、内部処理によってスタックに「obj1」と同じインスタンスを指すクラスB型の変数「tmp1」を用意する。そして、「tmp1」の変数名に対応する参照用ID「100」を特定し、更に参照用ID「100」で特定されるインスタンスから、メンバ変数の値を取得する。この場合も、シンボル変数として宣言されているメンバ変数にはシンボル値が設定されている。図中、「symbol_P1_mb1」は、シンボル値の例である。   The same instance may be referenced from multiple variables. FIG. 42 shows an example of referring to the same instance from a plurality of variables. For example, when acquiring the value of the member variable “(B) obj1.b1”, a class B type variable “tmp1” indicating the same instance as “obj1” is prepared in the stack by internal processing. Then, the reference ID “100” corresponding to the variable name “tmp1” is specified, and the value of the member variable is acquired from the instance specified by the reference ID “100”. In this case as well, symbol values are set for the member variables declared as symbol variables. In the figure, “symbol_P1_mb1” is an example of a symbol value.

上述のようにシンボリック実行処理により、第1テストケースセットとオブジェクトパス条件が生成される。図29a〜図29cに示した26の第1テストケースセットは、想定されるオブジェクト型変数の状態の組合せを網羅している。制御情報である「P1_cnull」、「P2_cnull」、「P1_cClass」、あるいは「P2_cClass」を含むシンボルパス条件により、想定されるオブジェクト型変数の状態を読み取ることができる。   As described above, the first test case set and the object path condition are generated by the symbolic execution process. The first test case set of 26 shown in FIGS. 29a to 29c covers possible combinations of states of object type variables. The state of an assumed object type variable can be read according to a symbol path condition including “P1_cull”, “P2_cull”, “P1_cClass”, or “P2_cClass” as control information.

但し、これらの制御情報を含むシンボルパス条件は、シンボル実行用ドライバの初期化コード(例えば、図8の815と817)での分岐により生成されたものであって、テスト対象のプログラムにおける分岐に基づくものではない。従って、これらの制御情報を含むパス条件は、テストケースを欠落させることなく抽出するためには役立つが、テスト対象のプログラムに対するコードカバレッジを判断するためには不適切なデータであると言える。   However, the symbol path condition including these control information is generated by branching in the initialization code of the symbol execution driver (for example, 815 and 817 in FIG. 8), and is used for branching in the program under test. Not based. Therefore, it can be said that the path condition including the control information is inappropriate data for determining the code coverage for the test target program, although it is useful for extracting the test cases without missing them.

一方、オブジェクトパス条件は、テスト対象のプログラムにおけるオブジェクト型変数の状態に関する分岐によるパス条件であり、テスト対象のプログラムに対するコードカバレッジを判断するのに適切なデータであると言える。   On the other hand, the object path condition is a path condition by branching regarding the state of the object type variable in the test target program, and can be said to be appropriate data for determining the code coverage for the test target program.

以下で説明するパス条件更新処理では、第1テストケースに含まれる制御変数を含むシンボルパス条件を除き、オブジェクトパス条件を加えた第2テストケースを生成する。第2テストケースは、テスト対象のプログラムに対するコードカバレッジの判断に適した対象内パス条件を備える。   In the path condition update process described below, a second test case with the object path condition added is generated except for the symbol path condition including the control variable included in the first test case. The second test case has an in-target path condition suitable for determining code coverage for the program to be tested.

また、パス条件更新処理に続くテストケース抽出処理では、第2テストケースセットから重複するテストケースを排除した第3テストケースセットを生成する。第3テストケースセットによるコードカバレッジは、第2テストケースセットによるコードカバレッジと等しい。   In the test case extraction process following the path condition update process, a third test case set is generated by excluding duplicate test cases from the second test case set. The code coverage by the third test case set is equal to the code coverage by the second test case set.

続いて、パス条件更新処理とテストケース抽出処理について説明する。図43は、テストケース生成装置のうちパス条件更新とテストケース抽出に係る構成例を示す図である。テストケース生成装置は、更に、第2生成部1033、第2テストケース格納部1035、抽出部1037、第3テストケース格納部1039及びテストケース出力部1041を有している。第2生成部1033は、パス条件を更新し、第2テストケースを生成するように動作する。第2テストケース格納部1035は、第2テストケースセットを記憶するように構成されている。抽出部1037は、第2テストケースセットから第3テストケースを抽出するように動作する。第3テストケース格納部1039は、第3テストケースの集合である第3テストケースセットを記憶するように構成されている。テストケース出力部1041は、第3テストケースセットを出力するように動作する。   Next, the path condition update process and the test case extraction process will be described. FIG. 43 is a diagram illustrating a configuration example related to path condition update and test case extraction in the test case generation apparatus. The test case generation apparatus further includes a second generation unit 1033, a second test case storage unit 1035, an extraction unit 1037, a third test case storage unit 1039, and a test case output unit 1041. The second generation unit 1033 operates to update the path condition and generate a second test case. The second test case storage unit 1035 is configured to store the second test case set. The extraction unit 1037 operates to extract the third test case from the second test case set. The third test case storage unit 1039 is configured to store a third test case set that is a set of third test cases. The test case output unit 1041 operates to output the third test case set.

図44に、パス条件更新の概要を示す。第1テストケースのシンボルパス条件のうち、制御変数を含まないシンボルパス条件のみが第2テストケースの対象内パス条件にコピーされる。図44の例では、シンボルパス条件「(P2_ma1>P1_ma1)」が対象内パス条件にコピーされている。シンボルパス条件「P1_cnull==false」は、制御変数「P1_cnull」を含んでいるので、対象内パス条件にコピーされない。同様に、シンボルパス条件「P1_cClass==0」は、制御変数「P1_cClass」を含んでいるので、対象内パス条件にコピーされない。同様に、シンボルパス条件「P2_cnull==false」は、制御変数「P2_cnull」を含んでいるので、対象内パス条件にコピーされない。同様に、シンボルパス条件「P2_cClass==0」は、制御変数「P2_cClass」を含んでいるので、対象内パス条件にコピーされない。   FIG. 44 shows an outline of path condition update. Of the symbol path conditions of the first test case, only the symbol path condition not including the control variable is copied to the in-target path condition of the second test case. In the example of FIG. 44, the symbol path condition “(P2_ma1> P1_ma1)” is copied to the in-target path condition. Since the symbol path condition “P1_cull == false” includes the control variable “P1_cull”, it is not copied to the in-target path condition. Similarly, since the symbol path condition “P1_cClass == 0” includes the control variable “P1_cClass”, it is not copied to the in-target path condition. Similarly, since the symbol path condition “P2_cull == false” includes the control variable “P2_cull”, it is not copied to the in-target path condition. Similarly, since the symbol path condition “P2_cClass == 0” includes the control variable “P2_cClass”, it is not copied to the in-target path condition.

また、オブジェクトパス条件が第2テストケースの対象内パス条件にコピーされる。オブジェクトパス条件は、コピーの際に制御変数が満たすべき条件の形式に変換される。図44の例では、オブジェクトパス条件「P1!= null」は、対象内パス条件「P1_cnull==false」に変換されている。オブジェクトパス条件「!(P1 instanceof B)」は、対象内パス条件「P1_cClass!=1」に変換されている。オブジェクトパス条件「P2!=null」は、対象内パス条件「P2_cnull==false」に変換されている。オブジェクトパス条件「(P2.ma1>P1.ma1)」は、対象内パス条件「(P2_ma1>P1_ma1)」に変換されている。対象内パス条件「(P2_ma1>P1_ma1)」は、シンボルパス条件と重複しているので、1つの対象内パス条件のみ設定される。このように、オブジェクトパス条件とシンボルパス条件の一部が重複することも想定される。   Further, the object path condition is copied to the in-target path condition of the second test case. The object path condition is converted into a condition format to be satisfied by the control variable at the time of copying. In the example of FIG. 44, the object path condition “P1! = Null” is converted into the in-target path condition “P1_cull == false”. The object path condition “! (P1 instance of B)” is converted into the in-target path condition “P1_cClass! = 1”. The object path condition “P2! = Null” is converted into the in-target path condition “P2_cnull == false”. The object path condition “(P2.ma1> P1.ma1)” is converted into the in-target path condition “(P2_ma1> P1_ma1)”. Since the in-target path condition “(P2_ma1> P1_ma1)” overlaps with the symbol path condition, only one in-target path condition is set. In this way, it is assumed that part of the object path condition and the symbol path condition overlap.

制御変数が満たすべき条件の形式に変換することによって、テスト入力との関係を把握しやすくなる。   By converting to the format of the condition that the control variable should satisfy, it becomes easier to grasp the relationship with the test input.

更に、第1テストケースのテスト入力が第2テストケースのテスト入力にコピーされる。   Further, the test input of the first test case is copied to the test input of the second test case.

テスト入力「P1_cnull=false」と、テスト入力「P1_cClass=0」と、テスト入力「P1_ma1=0」と、テスト入力「P2_cnull=false」と、テスト入力「P2_cClass=0」と、テスト入力「P2_ma1=1」が、第1テストケースから第2テストケースへコピーされている。   Test input “P1_cull = false”, test input “P1_cClass = 0”, test input “P1_ma1 = 0”, test input “P2_cull = false”, test input “P2_cClass = 0”, test input “P2_ma1 = 1 "is copied from the first test case to the second test case.

図45に、第2テストケース生成処理フローの例を示す。第2生成部1033は、ケース番号毎に以下の処理を繰り返す(S4501)。第2生成部1033は、更にシンボルパス条件毎に以下の処理を繰り返す(S4503)。第2生成部1033は、シンボルパス条件が制御変数名を含むか否かを判定する(S4505)。シンボルパス条件が制御変数名を含ないと判定した場合には、第2生成部1033は、シンボルパス条件をコピーする(S4507)。一方、シンボルパス条件が制御変数名を含むと判定した場合には、第2生成部1033は、シンボルパス条件をコピーしない。第2生成部1033は、すべてのシンボルパス条件について処理したか否かを判定する(S4509)。処理していないシンボルパス条件があると判定した場合には、第2生成部1033はS4503へ処理を戻す。すべてのシンボルパス条件について処理したと判定した場合には、第2生成部1033はS4511へ処理を移す。   FIG. 45 shows an example of a second test case generation process flow. The second generation unit 1033 repeats the following process for each case number (S4501). The second generation unit 1033 further repeats the following process for each symbol path condition (S4503). The second generation unit 1033 determines whether the symbol path condition includes a control variable name (S4505). If it is determined that the symbol path condition does not include the control variable name, the second generation unit 1033 copies the symbol path condition (S4507). On the other hand, when it is determined that the symbol path condition includes the control variable name, the second generation unit 1033 does not copy the symbol path condition. The second generation unit 1033 determines whether all symbol path conditions have been processed (S4509). If it is determined that there is an unprocessed symbol path condition, the second generation unit 1033 returns the process to S4503. If it is determined that all symbol path conditions have been processed, the second generation unit 1033 moves the process to S4511.

続いて、第2生成部1033は、オブジェクトパス条件毎に以下の処理を繰り返す(S4511)。第2生成部1033は、制御変数テーブルでオブジェクトパス条件と一致する意味式を特定する(S4513)。第2生成部1033は、意味式に対応する制御変数名と値を特定し、制御変数と値を用いた対象内パス条件を生成し、第2テストケースに加える(S4515)。例えば、図44の例でオブジェクト条件「P1!=null」と一致する意味式「P1!=null」に対応する制御変数名「P1_cnull」と値「false」を特定する。そして、対象内パス条件「P1_cnull==false」を生成する。   Subsequently, the second generation unit 1033 repeats the following process for each object path condition (S4511). The second generation unit 1033 identifies a semantic expression that matches the object path condition in the control variable table (S4513). The second generation unit 1033 identifies the control variable name and value corresponding to the semantic expression, generates an in-target path condition using the control variable and value, and adds it to the second test case (S4515). For example, in the example of FIG. 44, the control variable name “P1_cull” and the value “false” corresponding to the semantic expression “P1! = Null” that matches the object condition “P1! = Null” are specified. Then, the in-target path condition “P1_cull == false” is generated.

オブジェクトパス条件が否定形式である場合であり、オブジェクトパス条件を肯定形式に置き換えて意味式を特定するようにしてもよい。その場合には、制御変数と値を用いたパス条件を否定形式に置き換えることによって対象内パス条件を生成する。   This is a case where the object path condition has a negative form, and the semantic expression may be specified by replacing the object path condition with a positive form. In this case, the in-target path condition is generated by replacing the path condition using the control variable and the value with a negative form.

例えば、図44の例で否定形式のオブジェクトパス条件「!(P1 instanceof B)」を肯定形式「P1 instanceof B」に置き換えて、意味式「P1 instanceof B」を特定する。そして、意味式「P1 instanceof B」に対応する制御変数名「P1_cClass」と値「1」を特定し、パス条件「P1_cClass==1」を生成し、否定形式に置き換えて対象内パス条件「P1_cClass!=1」を生成する。   For example, the semantic expression “P1 instance of B” is identified by replacing the negative form object path condition “! (P1 instance of B)” with the positive form “P1 instance of B” in the example of FIG. Then, the control variable name “P1_cClass” and the value “1” corresponding to the semantic expression “P1 instanceof B” are specified, the path condition “P1_cClass == 1” is generated, and the in-target path condition “P1_cClass” is replaced with the negative form. ! = 1 ”is generated.

尚、制御変数ではないメンバ変数についても、メンバ変数の変換規則に従って対象内パス条件に変換するようにしてもよい。図44の例で、例えば変換規則で、「P2.ma1」が「P2_ma1」に相当し、「P1.ma1」が「P1_ma1」に相当すると規定されている場合には、オブジェクト条件「P2.ma1>P1.ma1」は、対象内パス条件「P2_ma1>P1_ma1」に変換される。   Note that member variables that are not control variables may be converted into the in-target path condition according to the conversion rules for member variables. In the example of FIG. 44, for example, in the conversion rule, it is defined that “P2.ma1” corresponds to “P2_ma1” and “P1.ma1” corresponds to “P1_ma1”, the object condition “P2.ma1”. > P1.ma1 ”is converted into the in-target path condition“ P2_ma1> P1_ma1 ”.

図44に示したように、シンボル変数「P1_ma1」とシンボル変数「P2_ma1」に関するシンボルパス条件「P2_ma1>P1_ma1」も同じ内容である。このように同じ内容である場合には、対象内パス条件には1つだけ設定される。第2生成部1033は、すべてのオブジェクトパス条件について処理したか否かを判定する(S4517)。処理していないオブジェクトパス条件があると判定した場合には、S4511へ戻る。   As shown in FIG. 44, the symbol path condition “P2_ma1> P1_ma1” regarding the symbol variable “P1_ma1” and the symbol variable “P2_ma1” has the same content. When the contents are the same, only one target path condition is set. The second generation unit 1033 determines whether all object path conditions have been processed (S4517). If it is determined that there is an object path condition that has not been processed, the process returns to S4511.

一方、すべてのオブジェクトパス条件について処理したと判定した場合には、第2生成部1033は、第1テストケースのテスト入力を第2テストケースにコピーする(S4519)。第2生成部1033は、すべてのケース番号について処理したか否かを判定する(S4521)。処理していないケース番号があると判定した場合には、第2生成部1033はS4501へ処理を戻す。すべてのケース番号について処理した場合には、第2生成部1033は処理を終了する。   On the other hand, if it is determined that all object path conditions have been processed, the second generation unit 1033 copies the test input of the first test case to the second test case (S4519). The second generation unit 1033 determines whether all case numbers have been processed (S4521). If it is determined that there is a case number that has not been processed, the second generation unit 1033 returns the process to S4501. If all case numbers have been processed, the second generation unit 1033 ends the process.

図46a乃至46cに、第2テストケースの例を示す。第1テストケースに対応する第2テストケースが生成される。例えば、ケース番号1〜ケース番号4の第2テストケースは、同じ対象内パス条件「P1_cnull==true」を有する。ケース番号1〜ケース番号4は、テスト対象のプログラムの同じルートを通ることを示している。ケース番号1のテストケースで、テスト入力「P1_cnull=true」とテスト入力「P2_cnull=true」を入力して図5に示した対象クラスを実行した場合、「if(obj1!=null)」で偽と判定され、「return 0」で終了するルートを通る。更に、ケース番号2のテストケースで、テスト入力「P1_cnull=true」とテスト入力「P2_cnull=false」とテスト入力「P2_cClass=0」を入力して図5に示した対象クラスを実行した場合にも、同様に「if(obj1!=null)」で偽と判定され、「return 0」で終了するルートを通る。更に、ケース番号3のテストケースで、テスト入力「P1_cnull=true」とテスト入力「P2_cnull=false」とテスト入力「P2_cClass=1」を入力して図5に示した対象クラスを実行した場合にも、同様に「if(obj1!=null)」で偽と判定され、「return 0」で終了するルートを通る。更に、ケース番号4のテストケースで、テスト入力「P1_cnull=true」とテスト入力「P2_cnull=false」とテスト入力「P2_cClass=−1」を入力して図5に示した対象クラスを実行した場合にも、同様に「if(obj1!=null)」で偽と判定され、「return 0」で終了するルートを通る。このようにテスト対象のプログラムの同じルートを通る複数のテストケースは冗長であるので、削減することが望ましい。   An example of the second test case is shown in FIGS. 46a to 46c. A second test case corresponding to the first test case is generated. For example, the second test cases of case number 1 to case number 4 have the same in-target path condition “P1_cnull == true”. Case number 1 to case number 4 indicate that the same route of the test target program is passed. In the test case of case number 1, when the test input “P1_cull = true” and the test input “P2_cnull = true” are input and the target class shown in FIG. 5 is executed, “if (obj1! = Null)” is false. And the route that ends with “return 0” is passed. Further, in the test case of case number 2, when the test input “P1_cull = true”, the test input “P2_cull = false” and the test input “P2_cClass = 0” are input and the target class shown in FIG. 5 is executed Similarly, “if (obj1! = Null)” is determined to be false, and a route ending with “return 0” is taken. Furthermore, in the test case of case number 3, when the test input “P1_cull = true”, the test input “P2_cull = false”, and the test input “P2_cClass = 1” are input and the target class shown in FIG. 5 is executed Similarly, “if (obj1! = Null)” is determined to be false, and a route ending with “return 0” is taken. Furthermore, in the test case of case number 4, when the test input “P1_cull = true”, the test input “P2_cull = false”, and the test input “P2_cClass = −1” are input and the target class shown in FIG. 5 is executed Similarly, “if (obj1! = Null)” is determined to be false, and a route ending with “return 0” is passed. As described above, since a plurality of test cases passing through the same route of the program to be tested are redundant, it is desirable to reduce them.

図47に、第3テストケースの例を示す。この例では、同じルートを通る複数の第2テストケースのうち、最も小さいケース番号のテストケースを第3テストケースに移し、それ以外は排除している。例えば、ケース番号1〜ケース番号4の第2テストケースのうち、ケース番号1の第2テストケースは第3テストケースセットに移されるが、ケース番号2〜ケース番号4の第2テストケースは第3テストケースセットに移されない。   FIG. 47 shows an example of the third test case. In this example, the test case with the smallest case number among the plurality of second test cases passing through the same route is moved to the third test case, and the other cases are excluded. For example, among the second test cases of case number 1 to case number 4, the second test case of case number 1 is moved to the third test case set, but the second test case of case number 2 to case number 4 is the second test case. 3 Not transferred to test case set.

図48は、テストケース抽出処理フローの例を示す図である。抽出部1037は、第2テストケース毎に以下の処理を繰り返す(S4801)。抽出部1037は、第2テストケースのパス条件と同じパス条件を有する第3テストケースがあるか否かを判定する(S4803)。つまり、抽出部1037は、第2テストケースのパス条件と同じパス条件を有する第3テストケースが第3テストケース記憶部1039に格納されているか否かを判定する。第2テストケースのパス条件と同じパス条件を有する第3テストケースがあると判定した場合には、抽出部1037はS4807へ処理を進める。   FIG. 48 is a diagram illustrating an example of a test case extraction process flow. The extraction unit 1037 repeats the following process for each second test case (S4801). The extraction unit 1037 determines whether there is a third test case having the same path condition as that of the second test case (S4803). That is, the extraction unit 1037 determines whether or not a third test case having the same pass condition as the second test case pass condition is stored in the third test case storage unit 1039. If it is determined that there is a third test case having the same pass condition as the pass condition of the second test case, the extraction unit 1037 advances the process to S4807.

第2テストケースのパス条件と同じパス条件を有する第3テストケースがないと判定した場合には、抽出部1037は、第2テストケースを第3テストケースに加える(S4805)。つまり、抽出部1037は、第2テストケースを第3テストケース格納部1039に格納する。抽出部1037は、すべての第2テストケースについて処理したか否かを判定する(S4807)。処理していない第2テストケースがあると判定した場合には、S4801に戻る。すべての第2テストケースについて処理したと判定した場合には、抽出部1037は、第3テストケースセットを出力して(S4809)、終了する。   If it is determined that there is no third test case having the same pass condition as the pass condition of the second test case, the extraction unit 1037 adds the second test case to the third test case (S4805). That is, the extraction unit 1037 stores the second test case in the third test case storage unit 1039. The extraction unit 1037 determines whether or not all the second test cases have been processed (S4807). If it is determined that there is a second test case that has not been processed, the process returns to S4801. If it is determined that all the second test cases have been processed, the extraction unit 1037 outputs the third test case set (S4809) and ends.

上述のパス条件更新処理とテストケース抽出処理は、連続して行ってもよく、又は別に行ってもよい。パス条件更新処理とテストケース抽出処理を行うことによって、制御変数を用いたシンボリック実行により高めたコードカバレッジを低下させることなく、テストケースを削減することができる。   The path condition update process and the test case extraction process described above may be performed continuously or separately. By performing the path condition update process and the test case extraction process, it is possible to reduce the number of test cases without reducing the code coverage that has been enhanced by the symbolic execution using the control variable.

以上本技術の一実施の形態を説明したが、本技術はこれに限定されるものではない。例えば、上述の機能ブロック構成は必ずしも実際のプログラムモジュール構成に対応するものではない。   Although one embodiment of the present technology has been described above, the present technology is not limited to this. For example, the functional block configuration described above does not necessarily correspond to the actual program module configuration.

また、上で説明した各記憶領域の構成は一例であって、必ずしも上記のような構成でなければならないわけではない。さらに、処理フローにおいても、処理結果が変わらなければ処理の順番を入れ替えることも可能である。さらに、並列に実行させるようにしても良い。   The configuration of each storage area described above is an example, and the configuration as described above is not necessarily required. Further, in the processing flow, the processing order can be changed if the processing result does not change. Further, it may be executed in parallel.

なお、上で述べたテストケース生成装置は、コンピュータ装置であって、図49に示すように、メモリ2501とCPU(Central Processing Unit)2503とハードディスク・ドライブ(HDD:Hard Disk Drive)2505と表示装置2509に接続される表示制御部2507とリムーバブル・ディスク2511用のドライブ装置2513と入力装置2515とネットワークに接続するための通信制御部2517とがバス2519で接続されている。オペレーティング・システム(OS:Operating System)及び本実施例における処理を実施するためのアプリケーション・プログラムは、HDD2505に格納されており、CPU2503により実行される際にはHDD2505からメモリ2501に読み出される。CPU2503は、アプリケーション・プログラムの処理内容に応じて表示制御部2507、通信制御部2517、ドライブ装置2513を制御して、所定の動作を行わせる。また、処理途中のデータについては、主としてメモリ2501に格納されるが、HDD2505に格納されるようにしてもよい。本技術の実施例では、上で述べた処理を実施するためのアプリケーション・プログラムはコンピュータ読み取り可能なリムーバブル・ディスク2511に格納されて頒布され、ドライブ装置2513からHDD2505にインストールされる。インターネットなどのネットワーク及び通信制御部2517を経由して、HDD2505にインストールされる場合もある。このようなコンピュータ装置は、上で述べたCPU2503、メモリ2501などのハードウエアとOS及びアプリケーション・プログラムなどのプログラムとが有機的に協働することにより、上で述べたような各種機能を実現する。   The test case generation device described above is a computer device, and as shown in FIG. 49, a memory 2501, a CPU (Central Processing Unit) 2503, a hard disk drive (HDD: Hard Disk Drive) 2505, and a display device. A display control unit 2507 connected to 2509, a drive device 2513 for the removable disk 2511, an input device 2515, and a communication control unit 2517 for connecting to a network are connected by a bus 2519. An operating system (OS: Operating System) and an application program for executing the processing in this embodiment are stored in the HDD 2505, and are read from the HDD 2505 to the memory 2501 when executed by the CPU 2503. The CPU 2503 controls the display control unit 2507, the communication control unit 2517, and the drive device 2513 according to the processing content of the application program, and performs a predetermined operation. Further, data in the middle of processing is mainly stored in the memory 2501, but may be stored in the HDD 2505. In an embodiment of the present technology, an application program for performing the above-described processing is stored in a computer-readable removable disk 2511 and distributed, and installed from the drive device 2513 to the HDD 2505. In some cases, the HDD 2505 may be installed via a network such as the Internet and the communication control unit 2517. Such a computer apparatus realizes various functions as described above by organically cooperating hardware such as the CPU 2503 and the memory 2501 described above and programs such as the OS and application programs. .

以上述べた実施の形態をまとめると、以下のようになる。   The embodiment described above is summarized as follows.

第1の実施の形態に係るプログラムは、(A)テスト対象のプログラムへ入力されるオブジェクト型変数の状態を示す制御変数を含む一又は複数のシンボル変数を用いて、制御変数に応じたオブジェクト型変数の初期化とテスト対象のプログラムの呼び出しを行うためのドライバ及び呼び出されるテスト対象のプログラムにおける実行パターン毎に、ドライバ及びテスト対象のプログラムの実行において一又は複数のシンボル変数が満たすべき第1のパス条件を計算し、第1のパス条件と第1のパス条件に対する一又は複数のシンボル変数の充足値とを含む第1のテストケースを生成するシンボリック実行処理と、(B)実行パターン毎に、テスト対象のプログラムの実行において状態としてオブジェクト型変数が満たすべき第2のパス条件を生成する第1の生成処理と、(C)実行パターン毎に、第1のテストケースに含まれる第1のパス条件から、制御変数が満たすべき条件を省き、第2のパス条件を加えた第3のパス条件を求め、第3のパス条件と一又は複数のシンボル変数の充足値とを含む第2のテストケースを生成する第2の生成処理と、(D)第3のパス条件が同義である第2のテストケースが複数ある場合に、第3のパス条件が同義である複数の第2のテストケースのうち、いずれかの第2のテストケースを省き、残った第2のテストケースを抽出する抽出処理とをコンピュータに実行させる。   The program according to the first embodiment uses (A) one or a plurality of symbol variables including a control variable indicating a state of an object type variable input to a test target program, and an object type corresponding to the control variable. For each execution pattern in the driver for initiating the variable and invoking the test target program and in the called test target program, the first variable to be satisfied by one or more symbol variables in the execution of the driver and the test target program A symbolic execution process for calculating a path condition and generating a first test case including a first path condition and a satisfaction value of one or more symbol variables for the first path condition; and (B) for each execution pattern The second path condition to be satisfied by the object type variable as a state in the execution of the test target program The first generation process to be generated, and (C) the first pass condition included in the first test case for each execution pattern, the condition to be satisfied by the control variable is omitted, and the second pass condition is added. And (D) the third path condition is synonymous with the second generation process of generating a second test case including the third path condition and a sufficiency value of one or more symbol variables. When there are a plurality of second test cases, any one of the plurality of second test cases having the same third pass condition is omitted, and the remaining second test case The computer executes an extraction process for extracting.

上で述べたようなシンボリック実行処理を実行するので、オブジェクト型変数の状態に関する分岐処理を含むテスト対象のプログラムにおけるテストケースのカバレッジを向上させることができる。   Since the symbolic execution process as described above is executed, it is possible to improve the coverage of the test case in the test target program including the branch process related to the state of the object type variable.

更に、上で述べたようにテストケースを絞り込んでいるので、カバレッジの向上に寄与しないテストケースを排除することができる。つまり、制御変数が満たすべき条件が異なるテストケース同士でも、もしそれらの第2のパス条件が共通であるならば、テスト対象プログラムにおける実行ルートは同じになる。従って、いずれかのテストケースを省くことにより無駄を減らすことができる。   Furthermore, since test cases are narrowed down as described above, test cases that do not contribute to improvement in coverage can be eliminated. In other words, even among test cases having different conditions to be satisfied by the control variable, if the second path condition is common, the execution route in the test target program is the same. Therefore, waste can be reduced by omitting one of the test cases.

また、上記シンボリック実行処理において、テスト対象のプログラムに含まれる複数の命令のうち、実行すべき命令を特定するようにしてもよい。この場合、上記第1の生成処理において、実行すべき命令に含まれる変数の実体を参照するための位置を特定し、オブジェクト型変数の実体が格納されている位置と参照するための位置が一致する場合に、実行すべき命令に基づいて第2のパス条件を生成するようにしてもよい。   In the symbolic execution process, an instruction to be executed may be specified from among a plurality of instructions included in the test target program. In this case, in the first generation process, the position for referring to the entity of the variable included in the instruction to be executed is specified, and the position for storing the object type variable coincides with the position for reference. In this case, the second path condition may be generated based on the instruction to be executed.

このようにすれば、実行すべき命令に含まれる変数の実体を参照するための位置が、オブジェクト型変数の実体が格納されている位置と一致する場合に、実行すべき命令に基づいて第2のパス条件を生成するので、シンボル変数ではないオブジェクト型変数についてもパス条件を求めることができる。   In this way, when the position for referring to the entity of the variable included in the instruction to be executed matches the position where the entity of the object type variable is stored, the second is determined based on the instruction to be executed. Therefore, it is possible to obtain a path condition for an object type variable that is not a symbol variable.

また、上記シンボリック実行処理において、ドライバに含まれ、且つオブジェクト型変数を含む第1の命令を特定し、更に、第1の命令に基づいてオブジェクト型変数を特定し、特定されたオブジェクト型変数の実体が格納されている位置を特定する特定処理をコンピュータに実行させるようにしてもよい。   In the symbolic execution process, the first instruction included in the driver and including the object type variable is specified, the object type variable is specified based on the first instruction, and the specified object type variable You may make it make a computer perform the specific process which specifies the position where an entity is stored.

このようにすれば、ドライバに含まれる第1の命令に基づいてオブジェクト型変数を特定し、オブジェクト型変数の実体が格納されている位置を特定するので、ドライバから第2のパス条件の生成を指示できるようになる。従って、テスト対象のプログラムに手を加えることを要しない。   In this way, the object type variable is specified based on the first instruction included in the driver, and the position where the entity of the object type variable is stored is specified. Therefore, the driver generates the second path condition. You will be able to give instructions. Therefore, it is not necessary to modify the program to be tested.

また、上記第2の生成処理において、第2のパス条件を制御変数が満たすべき条件の形式に変換するようにしてもよい。   In the second generation process, the second path condition may be converted into a format of a condition that the control variable should satisfy.

このようにすれば、第2のパス条件を制御変数が満たすべき条件の形式に変換するので、オブジェクト型変数の状態に関する分岐におけるパス条件とシンボル変数の充足値を、ともに制御変数で表すことになり、これらの関係が把握されやすくなる。   In this way, since the second path condition is converted into the format of the condition that the control variable should satisfy, the path condition and the satisfaction value of the symbol variable in the branch related to the state of the object type variable are both represented by the control variable. Therefore, it becomes easy to grasp these relationships.

上記状態は、オブジェクト型変数がnullであるか否かにより特定されるものであってもよい。   The state may be specified by whether or not the object type variable is null.

このようにすれば、オブジェクト型変数がnullであるか否かによる分岐を含むプログラムのテストケースを生成することができる。   In this way, it is possible to generate a test case of a program including a branch depending on whether or not the object type variable is null.

上記状態は、オブジェクト型変数のクラス型により特定されるものであってもよい。   The state may be specified by the class type of the object type variable.

このようにすれば、オブジェクト型変数のクラス型による分岐を含むプログラムのテストケースを生成することができる。   In this way, it is possible to generate a test case of a program including a branch by the class type of the object type variable.

上記複数のシンボル変数は、オブジェクト型変数のメンバを示すシンボル変数を含んでもよい。   The plurality of symbol variables may include a symbol variable indicating a member of an object type variable.

このようにすれば、オブジェクト型変数のメンバによる分岐を含むプログラムのテストケースを生成することができる。   In this way, it is possible to generate a test case for a program including a branch by a member of an object type variable.

上記複数のシンボル変数は、テスト対象のプログラムへ入力されるプリミティブ型変数を示すシンボル変数を含んでもよい。   The plurality of symbol variables may include a symbol variable indicating a primitive type variable input to a test target program.

このようにすれば、プリミティブ型変数による分岐を含むプログラムのテストケースを生成することができる。   In this way, it is possible to generate a test case for a program including a branch by a primitive type variable.

上記抽出処理は、第3のパス条件が同義である複数の第2のテストケースのうち、一つの第2のテストケース以外を省くようにしてもよい。   In the extraction process, a plurality of second test cases having the same third pass condition may be omitted except for one second test case.

このようにすれば、テストケースを少なくすることができる。   In this way, the number of test cases can be reduced.

なお、上記方法による処理をコンピュータに行わせるためのプログラムを作成することができ、当該プログラムは、例えばフレキシブルディスク、CD−ROM、光磁気ディスク、半導体メモリ、ハードディスク等のコンピュータ読み取り可能な記憶媒体又は記憶装置に格納される。尚、中間的な処理結果はメインメモリ等の記憶装置に一時保管される   A program for causing a computer to perform the processing according to the above method can be created. The program can be a computer-readable storage medium such as a flexible disk, a CD-ROM, a magneto-optical disk, a semiconductor memory, a hard disk, or the like. It is stored in a storage device. Note that intermediate processing results are temporarily stored in a storage device such as a main memory.

以上の実施例を含む実施形態に関し、さらに以下の付記を開示する。   The following supplementary notes are further disclosed with respect to the embodiments including the above examples.

(付記1)
テスト対象のプログラムへ入力されるオブジェクト型変数の状態を示す制御変数を含む一又は複数のシンボル変数を用いて、前記制御変数に応じた前記オブジェクト型変数の初期化と前記テスト対象のプログラムの呼び出しを行うためのドライバ及び呼び出される前記テスト対象のプログラムにおける実行パターン毎に、前記ドライバ及び前記テスト対象のプログラムの実行において前記一又は複数のシンボル変数が満たすべき第1のパス条件を計算し、前記第1のパス条件と前記第1のパス条件に対する前記一又は複数のシンボル変数の充足値とを含む第1のテストケースを生成するシンボリック実行処理と、
前記実行パターン毎に、前記テスト対象のプログラムの実行において前記状態として前記オブジェクト型変数が満たすべき第2のパス条件を生成する第1の生成処理と、
前記実行パターン毎に、前記第1のテストケースに含まれる前記第1のパス条件から、前記制御変数が満たすべき条件を省き、前記第2のパス条件を加えた第3のパス条件を求め、前記第3のパス条件と前記一又は複数のシンボル変数の前記充足値とを含む第2のテストケースを生成する第2の生成処理と、
前記第3のパス条件が同義である前記第2のテストケースが複数ある場合に、前記第3のパス条件が同義である複数の前記第2のテストケースのうち、いずれかの前記第2のテストケースを省き、残った前記第2のテストケースを抽出する抽出処理と、
をコンピュータに実行させるためのプログラム。
(Appendix 1)
Using one or a plurality of symbol variables including a control variable indicating the state of the object type variable input to the test target program, initialization of the object type variable according to the control variable and calling of the test target program For each execution pattern in the driver and the test target program to be called, calculate a first path condition that the one or more symbol variables should satisfy in the execution of the driver and the test target program, and A symbolic execution process for generating a first test case including a first pass condition and a sufficiency value of the one or more symbol variables with respect to the first pass condition;
For each execution pattern, a first generation process for generating a second path condition that the object type variable should satisfy as the state in the execution of the test target program;
For each execution pattern, from the first path condition included in the first test case, a condition that the control variable should satisfy is omitted, and a third path condition is obtained by adding the second path condition; A second generation process for generating a second test case including the third pass condition and the sufficiency value of the one or more symbol variables;
When there are a plurality of the second test cases in which the third pass condition is synonymous, any one of the second test cases in which the third pass condition is synonymous. An extraction process for omitting the test case and extracting the remaining second test case;
A program that causes a computer to execute.

(付記2)
前記シンボリック実行処理において、前記テスト対象のプログラムに含まれる複数の命令のうち、実行すべき命令を特定し、
前記第1の生成処理において、前記実行すべき命令に含まれる変数の実体を参照するための位置を特定し、前記オブジェクト型変数の実体が格納されている位置と前記参照するための位置が一致する場合に、前記実行すべき命令に基づいて前記第2のパス条件を生成する
付記1記載のプログラム。
(Appendix 2)
In the symbolic execution process, an instruction to be executed is specified from among a plurality of instructions included in the test target program,
In the first generation process, the position for referring to the entity of the variable included in the instruction to be executed is specified, and the position where the entity of the object type variable is stored matches the position for referring The program according to claim 1, wherein the second path condition is generated based on the instruction to be executed.

(付記3)
前記シンボリック実行処理において、前記ドライバに含まれ、且つ前記オブジェクト型変数を含む第1の命令を特定し、
更に、前記第1の命令に基づいて前記オブジェクト型変数を特定し、特定された前記オブジェクト型変数の前記実体が格納されている前記位置を特定する特定処理をコンピュータに実行させる
付記2記載のプログラム。
(Appendix 3)
In the symbolic execution process, a first instruction included in the driver and including the object type variable is specified,
The program according to claim 2, further comprising: specifying the object type variable based on the first instruction, and causing the computer to execute a specifying process for specifying the position where the entity of the specified object type variable is stored. .

(付記4)
前記第2の生成処理において、前記第2のパス条件を前記制御変数が満たすべき条件の形式に変換する
付記1乃至3のいずれか1つ記載のプログラム。
(Appendix 4)
The program according to any one of additions 1 to 3, wherein, in the second generation process, the second path condition is converted into a format of a condition to be satisfied by the control variable.

(付記5)
前記状態は、前記オブジェクト型変数がnullであるか否かにより特定される
付記1乃至4のいずれか1つ記載のプログラム。
(Appendix 5)
The program according to any one of appendices 1 to 4, wherein the state is specified by whether or not the object type variable is null.

(付記6)
前記状態は、前記オブジェクト型変数のクラス型により特定される
付記1乃至4のいずれか1つ記載のプログラム。
(Appendix 6)
The program according to any one of appendices 1 to 4, wherein the state is specified by a class type of the object type variable.

(付記7)
前記複数のシンボル変数は、前記オブジェクト型変数のメンバを示すシンボル変数を含む
付記1乃至6のいずれか1つ記載のプログラム。
(Appendix 7)
The program according to any one of appendices 1 to 6, wherein the plurality of symbol variables include a symbol variable indicating a member of the object type variable.

(付記8)
前記複数のシンボル変数は、前記テスト対象のプログラムへ入力されるプリミティブ型変数を示すシンボル変数を含む
付記1乃至7のいずれか1つ記載のプログラム。
(Appendix 8)
The program according to any one of appendices 1 to 7, wherein the plurality of symbol variables include a symbol variable indicating a primitive type variable input to the test target program.

(付記9)
前記抽出処理は、前記第3のパス条件が同義である前記複数の第2のテストケースのうち、一つの前記第2のテストケース以外を省く
付記1乃至8のいずれか1つ記載のプログラム。
(Appendix 9)
The program according to any one of appendices 1 to 8, wherein the extraction process excludes a plurality of second test cases other than the second test case among the plurality of second test cases having the same third pass condition.

(付記10)
テスト対象のプログラムへ入力されるオブジェクト型変数の状態を示す制御変数を含む一又は複数のシンボル変数を用いて、前記制御変数に応じた前記オブジェクト型変数の初期化と前記テスト対象のプログラムの呼び出しを行うためのドライバ及び呼び出される前記テスト対象のプログラムにおける実行パターン毎に、前記ドライバ及び前記テスト対象のプログラムの実行において前記一又は複数のシンボル変数が満たすべき第1のパス条件を計算し、前記第1のパス条件と前記第1のパス条件に対する前記一又は複数のシンボル変数の充足値とを含む第1のテストケースを生成するシンボリック実行処理と、
前記実行パターン毎に、前記テスト対象のプログラムの実行において前記状態として前記オブジェクト型変数が満たすべき第2のパス条件を生成する第1の生成処理と、
前記実行パターン毎に、前記第1のテストケースに含まれる前記第1のパス条件から、前記制御変数が満たすべき条件を省き、前記第2のパス条件を加えた第3のパス条件を求め、前記第3のパス条件と前記一又は複数のシンボル変数の前記充足値とを含む第2のテストケースを生成する第2の生成処理と、
前記第3のパス条件が同義である前記第2のテストケースが複数ある場合に、前記第3のパス条件が同義である複数の前記第2のテストケースのうち、いずれかの前記第2のテストケースを省き、残った前記第2のテストケースを抽出する抽出処理と、
を含みコンピュータが実行するテストケース生成方法。
(Appendix 10)
Using one or a plurality of symbol variables including a control variable indicating the state of the object type variable input to the test target program, initialization of the object type variable according to the control variable and calling of the test target program For each execution pattern in the driver and the test target program to be called, calculate a first path condition that the one or more symbol variables should satisfy in the execution of the driver and the test target program, and A symbolic execution process for generating a first test case including a first pass condition and a sufficiency value of the one or more symbol variables with respect to the first pass condition;
For each execution pattern, a first generation process for generating a second path condition that the object type variable should satisfy as the state in the execution of the test target program;
For each execution pattern, from the first path condition included in the first test case, a condition that the control variable should satisfy is omitted, and a third path condition is obtained by adding the second path condition; A second generation process for generating a second test case including the third pass condition and the sufficiency value of the one or more symbol variables;
When there are a plurality of the second test cases in which the third pass condition is synonymous, any one of the second test cases in which the third pass condition is synonymous. An extraction process for omitting the test case and extracting the remaining second test case;
A test case generation method executed by a computer.

(付記11)
テスト対象のプログラムへ入力されるオブジェクト型変数の状態を示す制御変数を含む一又は複数のシンボル変数を用いて、前記制御変数に応じた前記オブジェクト型変数の初期化と前記テスト対象のプログラムの呼び出しを行うためのドライバ及び呼び出される前記テスト対象のプログラムにおける実行パターン毎に、前記ドライバ及び前記テスト対象のプログラムの実行において前記一又は複数のシンボル変数が満たすべき第1のパス条件を計算し、前記第1のパス条件と前記第1のパス条件に対する前記一又は複数のシンボル変数の充足値とを含む第1のテストケースを生成するシンボリック実行を行う実行部と、
前記実行パターン毎に、前記テスト対象のプログラムの実行において前記状態として前記オブジェクト型変数が満たすべき第2のパス条件を生成する第1の生成部と、
前記実行パターン毎に、前記第1のテストケースに含まれる前記第1のパス条件から、前記制御変数が満たすべき条件を省き、前記第2のパス条件を加えた第3のパス条件を求め、前記第3のパス条件と前記一又は複数のシンボル変数の前記充足値とを含む第2のテストケースを生成する第2の生成部と、
前記第3のパス条件が同義である前記第2のテストケースが複数ある場合に、前記第3のパス条件が同義である複数の前記第2のテストケースのうち、いずれかの前記第2のテストケースを省き、残った前記第2のテストケースを抽出する抽出部と、
を有するテストケース生成装置。
(Appendix 11)
Using one or a plurality of symbol variables including a control variable indicating the state of the object type variable input to the test target program, initialization of the object type variable according to the control variable and calling of the test target program For each execution pattern in the driver and the test target program to be called, calculate a first path condition that the one or more symbol variables should satisfy in the execution of the driver and the test target program, and An execution unit that performs symbolic execution to generate a first test case including a first pass condition and a satisfaction value of the one or more symbol variables with respect to the first pass condition;
A first generation unit that generates, for each execution pattern, a second path condition that the object type variable should satisfy as the state in the execution of the test target program;
For each execution pattern, from the first path condition included in the first test case, a condition that the control variable should satisfy is omitted, and a third path condition is obtained by adding the second path condition; A second generation unit that generates a second test case including the third pass condition and the sufficiency value of the one or more symbol variables;
When there are a plurality of the second test cases in which the third pass condition is synonymous, any one of the second test cases in which the third pass condition is synonymous. An extraction unit for omitting the test case and extracting the remaining second test case;
A test case generation device having:

701 シンボル変数宣言エリア 703 対象クラス初期化エリア
705 初期化コードエリア 707 オブジェクト指定命令エリア
709 対象メソッドの呼び出しエリア 1001 受付部
1003 対象クラス格納部 1005 ライブラリ格納部
1007 サンプルフォーム格納部 1009 ドライバ生成部
1011 ドライバ格納部 1013 制御変数テーブル生成部
1015 制御変数テーブル格納部 1017 実行部
1019 パターンテーブル格納部 1021 シンボル変数テーブル記憶部
1023 特定部 1025 オブジェクトテーブル記憶部
1027 第1テストケース格納部 1029 第1生成部
1031 オブジェクトパス条件記憶部 1033 第2生成部
1035 第2テストケース格納部 1037 抽出部
1039 第3テストケース格納部 1041 テストケース出力部
701 Symbol variable declaration area 703 Target class initialization area 705 Initialization code area 707 Object specification instruction area 709 Target method call area 1001 Reception unit 1003 Target class storage unit 1005 Library storage unit 1007 Sample form storage unit 1009 Driver generation unit 1011 Driver Storage unit 1013 Control variable table generation unit 1015 Control variable table storage unit 1017 Execution unit 1019 Pattern table storage unit 1021 Symbol variable table storage unit 1023 Identification unit 1025 Object table storage unit 1027 First test case storage unit 1029 First generation unit 1031 Object Pass condition storage unit 1033 Second generation unit 1035 Second test case storage unit 1037 Extraction unit 1039 Third test case Storage unit 1041 Test case output unit

Claims (6)

テスト対象のプログラムへ入力されるオブジェクト型変数の状態を示す制御変数を含む一又は複数のシンボル変数を用いて、前記制御変数に応じた前記オブジェクト型変数の初期化と前記テスト対象のプログラムの呼び出しを行うためのドライバ及び呼び出される前記テスト対象のプログラムにおける実行パターン毎に、前記ドライバ及び前記テスト対象のプログラムの実行において前記一又は複数のシンボル変数が満たすべき第1のパス条件を計算し、前記第1のパス条件と前記第1のパス条件に対する前記一又は複数のシンボル変数の充足値とを含む第1のテストケースを生成するシンボリック実行処理と、
前記実行パターン毎に、前記テスト対象のプログラムの実行において前記状態として前記オブジェクト型変数が満たすべき第2のパス条件を生成する第1の生成処理と、
前記実行パターン毎に、前記第1のテストケースに含まれる前記第1のパス条件から、前記制御変数が満たすべき条件を省き、前記第2のパス条件を加えた第3のパス条件を求め、前記第3のパス条件と前記一又は複数のシンボル変数の前記充足値とを含む第2のテストケースを生成する第2の生成処理と、
前記第3のパス条件が同義である前記第2のテストケースが複数ある場合に、前記第3のパス条件が同義である複数の前記第2のテストケースのうち、いずれかの前記第2のテストケースを省き、残った前記第2のテストケースを抽出する抽出処理と、
をコンピュータに実行させるためのプログラム。
Using one or a plurality of symbol variables including a control variable indicating the state of the object type variable input to the test target program, initialization of the object type variable according to the control variable and calling of the test target program For each execution pattern in the driver and the test target program to be called, calculate a first path condition that the one or more symbol variables should satisfy in the execution of the driver and the test target program, and A symbolic execution process for generating a first test case including a first pass condition and a sufficiency value of the one or more symbol variables with respect to the first pass condition;
For each execution pattern, a first generation process for generating a second path condition that the object type variable should satisfy as the state in the execution of the test target program;
For each execution pattern, from the first path condition included in the first test case, a condition that the control variable should satisfy is omitted, and a third path condition is obtained by adding the second path condition; A second generation process for generating a second test case including the third pass condition and the sufficiency value of the one or more symbol variables;
When there are a plurality of the second test cases in which the third pass condition is synonymous, any one of the second test cases in which the third pass condition is synonymous. An extraction process for omitting the test case and extracting the remaining second test case;
A program that causes a computer to execute.
前記シンボリック実行処理において、前記テスト対象のプログラムに含まれる複数の命令のうち、実行すべき命令を特定し、
前記第1の生成処理において、前記実行すべき命令に含まれる変数の実体を参照するための位置を特定し、前記オブジェクト型変数の実体が格納されている位置と前記参照するための位置が一致する場合に、前記実行すべき命令に基づいて前記第2のパス条件を生成する
請求項1記載のプログラム。
In the symbolic execution process, an instruction to be executed is specified from among a plurality of instructions included in the test target program,
In the first generation process, the position for referring to the entity of the variable included in the instruction to be executed is specified, and the position where the entity of the object type variable is stored matches the position for referring The program according to claim 1, wherein the second path condition is generated based on the instruction to be executed.
前記シンボリック実行処理において、前記ドライバに含まれ、且つ前記オブジェクト型変数を含む第1の命令を特定し、
更に、前記第1の命令に基づいて前記オブジェクト型変数を特定し、特定された前記オブジェクト型変数の前記実体が格納されている前記位置を特定する特定処理をコンピュータに実行させる
請求項2記載のプログラム。
In the symbolic execution process, a first instruction included in the driver and including the object type variable is specified,
3. The computer according to claim 2, further comprising: specifying the object type variable based on the first instruction, and causing the computer to execute a specifying process for specifying the position where the entity of the specified object type variable is stored. program.
前記第2の生成処理において、前記第2のパス条件を前記制御変数が満たすべき条件の形式に変換する
請求項1乃至3のいずれか1つ記載のプログラム。
The program according to any one of claims 1 to 3, wherein, in the second generation process, the second path condition is converted into a format of a condition to be satisfied by the control variable.
テスト対象のプログラムへ入力されるオブジェクト型変数の状態を示す制御変数を含む一又は複数のシンボル変数を用いて、前記制御変数に応じた前記オブジェクト型変数の初期化と前記テスト対象のプログラムの呼び出しを行うためのドライバ及び呼び出される前記テスト対象のプログラムにおける実行パターン毎に、前記ドライバ及び前記テスト対象のプログラムの実行において前記一又は複数のシンボル変数が満たすべき第1のパス条件を計算し、前記第1のパス条件と前記第1のパス条件に対する前記一又は複数のシンボル変数の充足値とを含む第1のテストケースを生成するシンボリック実行処理と、
前記実行パターン毎に、前記テスト対象のプログラムの実行において前記状態として前記オブジェクト型変数が満たすべき第2のパス条件を生成する第1の生成処理と、
前記実行パターン毎に、前記第1のテストケースに含まれる前記第1のパス条件から、前記制御変数が満たすべき条件を省き、前記第2のパス条件を加えた第3のパス条件を求め、前記第3のパス条件と前記一又は複数のシンボル変数の前記充足値とを含む第2のテストケースを生成する第2の生成処理と、
前記第3のパス条件が同義である前記第2のテストケースが複数ある場合に、前記第3のパス条件が同義である複数の前記第2のテストケースのうち、いずれかの前記第2のテストケースを省き、残った前記第2のテストケースを抽出する抽出処理と、
を含みコンピュータが実行するテストケース生成方法。
Using one or a plurality of symbol variables including a control variable indicating the state of the object type variable input to the test target program, initialization of the object type variable according to the control variable and calling of the test target program For each execution pattern in the driver and the test target program to be called, calculate a first path condition that the one or more symbol variables should satisfy in the execution of the driver and the test target program, and A symbolic execution process for generating a first test case including a first pass condition and a sufficiency value of the one or more symbol variables with respect to the first pass condition;
For each execution pattern, a first generation process for generating a second path condition that the object type variable should satisfy as the state in the execution of the test target program;
For each execution pattern, from the first path condition included in the first test case, a condition that the control variable should satisfy is omitted, and a third path condition is obtained by adding the second path condition; A second generation process for generating a second test case including the third pass condition and the sufficiency value of the one or more symbol variables;
When there are a plurality of the second test cases in which the third pass condition is synonymous, any one of the second test cases in which the third pass condition is synonymous. An extraction process for omitting the test case and extracting the remaining second test case;
A test case generation method executed by a computer.
テスト対象のプログラムへ入力されるオブジェクト型変数の状態を示す制御変数を含む一又は複数のシンボル変数を用いて、前記制御変数に応じた前記オブジェクト型変数の初期化と前記テスト対象のプログラムの呼び出しを行うためのドライバ及び呼び出される前記テスト対象のプログラムにおける実行パターン毎に、前記ドライバ及び前記テスト対象のプログラムの実行において前記一又は複数のシンボル変数が満たすべき第1のパス条件を計算し、前記第1のパス条件と前記第1のパス条件に対する前記一又は複数のシンボル変数の充足値とを含む第1のテストケースを生成するシンボリック実行を行う実行部と、
前記実行パターン毎に、前記テスト対象のプログラムの実行において前記状態として前記オブジェクト型変数が満たすべき第2のパス条件を生成する第1の生成部と、
前記実行パターン毎に、前記第1のテストケースに含まれる前記第1のパス条件から、前記制御変数が満たすべき条件を省き、前記第2のパス条件を加えた第3のパス条件を求め、前記第3のパス条件と前記一又は複数のシンボル変数の前記充足値とを含む第2のテストケースを生成する第2の生成部と、
前記第3のパス条件が同義である前記第2のテストケースが複数ある場合に、前記第3のパス条件が同義である複数の前記第2のテストケースのうち、いずれかの前記第2のテストケースを省き、残った前記第2のテストケースを抽出する抽出部と、
を有するテストケース生成装置。
Using one or a plurality of symbol variables including a control variable indicating the state of the object type variable input to the test target program, initialization of the object type variable according to the control variable and calling of the test target program For each execution pattern in the driver and the test target program to be called, calculate a first path condition that the one or more symbol variables should satisfy in the execution of the driver and the test target program, and An execution unit that performs symbolic execution to generate a first test case including a first pass condition and a satisfaction value of the one or more symbol variables with respect to the first pass condition;
A first generation unit that generates, for each execution pattern, a second path condition that the object type variable should satisfy as the state in the execution of the test target program;
For each execution pattern, from the first path condition included in the first test case, a condition that the control variable should satisfy is omitted, and a third path condition is obtained by adding the second path condition; A second generation unit that generates a second test case including the third pass condition and the sufficiency value of the one or more symbol variables;
When there are a plurality of the second test cases in which the third pass condition is synonymous, any one of the second test cases in which the third pass condition is synonymous. An extraction unit for omitting the test case and extracting the remaining second test case;
A test case generation device having:
JP2012140947A 2012-06-22 2012-06-22 Program, test case generation method, and test case generation apparatus Expired - Fee Related JP5884657B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012140947A JP5884657B2 (en) 2012-06-22 2012-06-22 Program, test case generation method, and test case generation apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012140947A JP5884657B2 (en) 2012-06-22 2012-06-22 Program, test case generation method, and test case generation apparatus

Publications (2)

Publication Number Publication Date
JP2014006643A JP2014006643A (en) 2014-01-16
JP5884657B2 true JP5884657B2 (en) 2016-03-15

Family

ID=50104317

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012140947A Expired - Fee Related JP5884657B2 (en) 2012-06-22 2012-06-22 Program, test case generation method, and test case generation apparatus

Country Status (1)

Country Link
JP (1) JP5884657B2 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6245006B2 (en) * 2014-03-13 2017-12-13 富士通株式会社 Test case generation apparatus, method, and program
JP6287447B2 (en) * 2014-03-26 2018-03-07 富士通株式会社 Test case generation program, apparatus, and method
JP6364263B2 (en) * 2014-07-08 2018-07-25 株式会社エヌ・ティ・ティ・データ Verification support method, verification support apparatus, and program
JP6583033B2 (en) * 2016-02-12 2019-10-02 富士通株式会社 Driver generation program, apparatus, and method
CN107038119B (en) * 2017-03-31 2019-12-03 上海东软载波微电子有限公司 Automatic example generation method and device
CN113468065B (en) * 2021-07-19 2024-08-16 京东科技控股股份有限公司 Test case operation method and device
KR102851995B1 (en) * 2022-05-27 2025-08-29 쿠팡 주식회사 Code coverage information providing method and electronic device for the same
WO2024232193A1 (en) * 2023-05-09 2024-11-14 ソニーグループ株式会社 Information processing device, information processing method, and computer program

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5561135B2 (en) * 2010-12-02 2014-07-30 富士通株式会社 Data generation method, program, and apparatus

Also Published As

Publication number Publication date
JP2014006643A (en) 2014-01-16

Similar Documents

Publication Publication Date Title
JP5884657B2 (en) Program, test case generation method, and test case generation apparatus
JP7045357B2 (en) Data processing methods and related products
CA3062949C (en) Conversion method, apparatus, computer device, and storage medium
CN100555218C (en) Apparatus and method for improving simulation speed of advanced language in simulation system on chip
US9152389B2 (en) Trace generating unit, system, and program of the same
EP2804099B1 (en) Apparatus and method managing power based on data
US9734033B2 (en) Implementing processor functional verification by generating and running constrained random irritator tests for multiple processor system and processor core with multiple threads
US8752056B2 (en) Running native code across single or multi-core hybrid processor achitecture
CN113885877B (en) Compiling method, device, equipment and medium
Yamato Study and evaluation of automatic offloading method in mixed offloading destination environment
Yamato Proposal and evaluation of adjusting resource amount for automatically offloaded applications
CN113934632A (en) Code detection method and device
Katagiri et al. Early experiences for adaptation of auto-tuning by ppOpen-AT to an explicit method
JPWO2018042520A1 (en) Program editing apparatus, program editing method, and program editing program
JP6759851B2 (en) Program generation program, program generation method, program generator and compilation program
US12106076B2 (en) Method for generating program for use in accelerator for deep learning
Popov et al. Piecewise holistic autotuning of compiler and runtime parameters
Yi et al. Optimizing DNN compilation for distributed training with joint OP and tensor fusion
CN118069200B (en) Multilingual programming method and system
US20230096849A1 (en) Offload server, offload control method, and offload program
Shuai et al. Software vulnerability detection based on code coverage and test cost
CN116048903B (en) Methods and devices for generating multi-threaded test cases, electronic devices, and storage media
CN114041116A (en) Method and device for optimizing data movement task
CN116795515A (en) Execution method, equipment, chip and storage medium of cyclic tasks
JP6176380B2 (en) Information processing apparatus, method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150319

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20151211

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20160125

R150 Certificate of patent or registration of utility model

Ref document number: 5884657

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees