JP5971116B2 - Test data generation method, program, and apparatus - Google Patents

Test data generation method, program, and apparatus Download PDF

Info

Publication number
JP5971116B2
JP5971116B2 JP2012284450A JP2012284450A JP5971116B2 JP 5971116 B2 JP5971116 B2 JP 5971116B2 JP 2012284450 A JP2012284450 A JP 2012284450A JP 2012284450 A JP2012284450 A JP 2012284450A JP 5971116 B2 JP5971116 B2 JP 5971116B2
Authority
JP
Japan
Prior art keywords
execution
symbolic execution
storage unit
instruction
test data
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
JP2012284450A
Other languages
Japanese (ja)
Other versions
JP2014127091A (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 JP2012284450A priority Critical patent/JP5971116B2/en
Publication of JP2014127091A publication Critical patent/JP2014127091A/en
Application granted granted Critical
Publication of JP5971116B2 publication Critical patent/JP5971116B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Description

本発明は、プログラムのテストに使用するテストデータの生成技術に関する。   The present invention relates to a technique for generating test data used for testing a program.

シンボリック実行とは、プログラム内の変数を具体化せず、変数をシンボル化して(すなわち、記号のまま)プログラムを実行する技術である。シンボル化される変数は、シンボル変数と呼ばれる。シンボリック実行中においては、具体値ではなくシンボル変数が満たすべき条件(以下、パス条件と呼ぶ)がシンボル変数の値としてメモリ等に保持される。そして、シンボリック実行が完了すると、プログラムにおける各パスについてパス条件が得られるため、パス条件を満たすシンボル変数の具体値を求めることで、プログラムをテストするためのテストデータを得ることができる。   Symbolic execution is a technique for executing a program by converting variables into symbols (that is, with symbols) without embodying variables in the program. Variables that are symbolized are called symbol variables. During symbolic execution, not a specific value but a condition to be satisfied by a symbol variable (hereinafter referred to as a path condition) is held in a memory or the like as a symbol variable value. When the symbolic execution is completed, a path condition is obtained for each path in the program. Therefore, test data for testing the program can be obtained by obtaining a specific value of the symbol variable that satisfies the path condition.

例えば、図1に示した、絶対値取得関数として問題があるプログラムについてシンボリック実行を行うことを考える。図1には、シンボリック実行の対象になるプログラムのコードと、そのプログラムの制御構造とが示されている。このプログラムには変数Xが含まれている。このプログラムを対象としてシンボリック実行を行うと、X=−2というテストデータ(パス条件はX<0)と、X=1234というテストデータ(パス条件はX≧0且つX=1234)と、X=3というテストデータ(パス条件はX≧0且つX≠1234)とを得ることができる。   For example, consider symbolic execution of a program having a problem as an absolute value acquisition function shown in FIG. FIG. 1 shows the code of a program to be symbolically executed and the control structure of the program. This program contains a variable X. When symbolic execution is performed on this program, test data X = −2 (pass condition is X <0), test data X = 1234 (pass condition is X ≧ 0 and X = 1234), and X = 3 (pass conditions are X ≧ 0 and X ≠ 1234).

但し、上で述べたように、通常のシンボリック実行はプログラム内の全パスを対象範囲としているため、無駄な実行をしてしまうことがある。例えば、プログラム内の全パスを対象範囲としなくても、プログラム内の全命令を対象範囲とすればよいという場合には、通常のシンボリック実行を行うと、命令カバレッジの向上に寄与しないパスを実行することになる。その結果、シンボリック実行の完了までに余計な時間がかかり、またメモリ等の資源を無駄に消費する。   However, as described above, normal symbolic execution covers all paths in the program, and may execute uselessly. For example, if you do not want to include all paths in the program as a target range, but only need to target all instructions in the program, executing a symbolic execution will execute a path that does not contribute to improving instruction coverage. Will do. As a result, extra time is required to complete symbolic execution, and resources such as memory are wasted.

このような問題に着目した従来技術は存在する。しかしながら、従来技術においては、複数のシンボル変数が存在することを前提としているため、シンボル変数が1つしか存在しないような場合は考慮されていない。また、場合によっては、この従来技術を利用したとしてもテストデータの生成を効率的に行えないことがある。   There are conventional techniques that focus on such problems. However, in the prior art, since it is assumed that there are a plurality of symbol variables, the case where there is only one symbol variable is not considered. In some cases, even if this conventional technique is used, test data cannot be generated efficiently.

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

1つの側面では、本発明の目的は、網羅性があるテストデータを効率的に生成するための技術を提供することである。   In one aspect, an object of the present invention is to provide a technique for efficiently generating exhaustive test data.

本発明に係るテストデータ生成方法は、シンボリック実行の対象範囲のうち一部の範囲を省略してシンボリック実行を行い、当該シンボリック実行について網羅率を算出する第1処理と、算出された網羅率が所定の値を超えたか判断する第2処理と、算出された網羅率が所定の値を超えていない場合、省略された一部の範囲のうち少なくとも一部が省略の対象外になるように設定し、第1処理以降の処理を再度実行する第3処理と、算出された網羅率が所定の値を超えた場合に、シンボリック実行により得られたパスの条件を満たす値を、第1データ格納部に格納する第4処理とを含む。   The test data generation method according to the present invention includes a first process for performing symbolic execution while omitting a part of a target range of symbolic execution, and calculating a coverage rate for the symbolic execution, and a calculated coverage rate. The second process for determining whether or not the predetermined value has been exceeded, and if the calculated coverage rate does not exceed the predetermined value, at least a part of the omitted part of the range is set to be excluded. Then, a third process for executing the process after the first process again, and a value satisfying the path condition obtained by the symbolic execution when the calculated coverage rate exceeds a predetermined value are stored in the first data. 4th process stored in a part.

網羅性があるテストデータを効率的に生成できるようになる。   Comprehensive test data can be generated efficiently.

図1は、シンボリック実行について説明するための図である。FIG. 1 is a diagram for explaining symbolic execution. 図2は、シンボリック実行装置の機能ブロック図である。FIG. 2 is a functional block diagram of the symbolic execution device. 図3は、メインの処理フローを示す図である。FIG. 3 is a diagram showing a main processing flow. 図4は、対象プログラムの一例を示す図である。FIG. 4 is a diagram illustrating an example of the target program. 図5は、目標カバレッジ格納部に格納されるデータの一例を示す図である。FIG. 5 is a diagram illustrating an example of data stored in the target coverage storage unit. 図6は、シンボリック実行の処理フローを示す図である。FIG. 6 is a diagram illustrating a processing flow of symbolic execution. 図7は、第2命令データ格納部に格納されるデータの一例を示す図である。FIG. 7 is a diagram illustrating an example of data stored in the second instruction data storage unit. 図8は、コールグラフの一例を示す図である。FIG. 8 is a diagram illustrating an example of a call graph. 図9は、シンボリック実行の処理フローを示す図である。FIG. 9 is a diagram illustrating a processing flow of symbolic execution. 図10は、第1関数データ格納部に格納されるデータの一例を示す図である。FIG. 10 is a diagram illustrating an example of data stored in the first function data storage unit. 図11は、判定処理の処理フローを示す図である。FIG. 11 is a diagram illustrating a process flow of the determination process. 図12は、判定処理の処理フローを示す図である。FIG. 12 is a diagram illustrating a processing flow of determination processing. 図13は、第1命令データ格納部に格納されるデータの一例を示す図である。FIG. 13 is a diagram illustrating an example of data stored in the first instruction data storage unit. 図14は、第2関数データ格納部に格納されるデータの一例を示す図である。FIG. 14 is a diagram illustrating an example of data stored in the second function data storage unit. 図15は、基準になる葉ノードの特定方法について説明するための図である。FIG. 15 is a diagram for explaining a leaf node identification method as a reference. 図16は、再帰呼び出しに対する対処方法について説明するための図である。FIG. 16 is a diagram for explaining a coping method for recursive calls. 図17は、本実施の形態の処理によるパス刈りについて説明するための図である。FIG. 17 is a diagram for explaining path pruning by the processing of the present embodiment. 図18は、パス刈りの範囲を制御しない場合におけるメインの処理フローを示す図である。FIG. 18 is a diagram illustrating a main processing flow when the range of path pruning is not controlled. 図19は、パス刈りの範囲を制御しない場合におけるシンボリック実行の処理フローを示す図である。FIG. 19 is a diagram illustrating a processing flow of symbolic execution when the range of path pruning is not controlled. 図20は、対象プログラムの他の例を示す図である。FIG. 20 is a diagram illustrating another example of the target program. 図21は、パス刈りの範囲を制御しない場合における結果を示す図である。FIG. 21 is a diagram illustrating a result when the range of path pruning is not controlled. 図22は、パス刈りの範囲を制御しない場合における結果を示す図である。FIG. 22 is a diagram illustrating a result when the range of path pruning is not controlled. 図23は、コンピュータの機能ブロック図である。FIG. 23 is a functional block diagram of a computer.

図2に、本実施の形態におけるシンボリック実行装置1の機能ブロック図を示す。シンボリック実行装置1は、入力部100と、目標カバレッジ格納部101と、対象プログラム格納部102と、範囲制御部103と、実行部112及び生成部113を含む実行エンジン104と、判定部105と、第1命令データ格納部106と、第2命令データ格納部107と、状態データ格納部108と、第1関数データ格納部109と、第2関数データ格納部110と、コールグラフデータ格納部111と、テストデータ格納部114とを含む。   FIG. 2 shows a functional block diagram of the symbolic execution device 1 in the present embodiment. The symbolic execution device 1 includes an input unit 100, a target coverage storage unit 101, a target program storage unit 102, a range control unit 103, an execution engine 104 including an execution unit 112 and a generation unit 113, a determination unit 105, First instruction data storage unit 106, second instruction data storage unit 107, state data storage unit 108, first function data storage unit 109, second function data storage unit 110, call graph data storage unit 111, And a test data storage unit 114.

入力部100は、対象プログラムの入力をユーザから受け付け、対象プログラム格納部102に格納する。また、入力部100は、目標のカバレッジの入力をユーザから受け付け、目標カバレッジ格納部101に格納する。   The input unit 100 receives an input of the target program from the user and stores it in the target program storage unit 102. The input unit 100 receives an input of target coverage from the user and stores it in the target coverage storage unit 101.

範囲制御部103は、第2関数データ格納部110におけるパス刈りを実施した関数のリスト及びコールグラフデータ格納部111に格納されているコールグラフのデータに基づき処理を行い、処理結果を第1関数データ格納部109に格納する。なお、本実施の形態において、「パス刈りを実施する」とは、パスについてのシンボリック実行を途中で終了する(すなわち、パスについてそれ以上シンボリック実行を行わない)ことを意味する。   The range control unit 103 performs processing based on the list of functions that have undergone path pruning in the second function data storage unit 110 and the data of the call graph stored in the call graph data storage unit 111, and the processing result is displayed as the first function. Store in the data storage unit 109. In the present embodiment, “perform path pruning” means that the symbolic execution for the path is terminated halfway (that is, no more symbolic execution is performed for the path).

実行エンジン104は、シンボリック実行を行うモジュールであり、例えばJava(登録商標) PathFinderである。実行部112は、対象プログラム格納部102に格納されている、シンボリック実行の対象になるプログラムに対してシンボリック実行を行い、実行済みである命令を第2命令データ格納部107に格納する。また、実行部112は、プログラムの実行状態に関するデータ(例えば、実行位置を示すプログラムカウンタの値、コールスタックの内容、シンボル変数についての情報、及びパス条件等)を状態データ格納部108において管理する。また、実行部112は、パス刈りを実施した関数を第2関数データ格納部110に格納する。また、実行部112は、コールグラフのデータを生成し、コールグラフデータ格納部111に格納する。生成部113は、シンボリック実行により得られるパス条件を満たすテストデータを生成し、テストデータ格納部114に格納する。   The execution engine 104 is a module that performs symbolic execution, and is, for example, Java (registered trademark) PathFinder. The execution unit 112 performs symbolic execution on the program stored in the target program storage unit 102 and subjected to symbolic execution, and stores the executed instruction in the second instruction data storage unit 107. Further, the execution unit 112 manages data related to the execution state of the program (for example, the value of the program counter indicating the execution position, the contents of the call stack, the information about the symbol variable, and the path condition) in the state data storage unit 108. . In addition, the execution unit 112 stores the function that has performed the path pruning in the second function data storage unit 110. The execution unit 112 also generates call graph data and stores it in the call graph data storage unit 111. The generation unit 113 generates test data that satisfies a path condition obtained by symbolic execution, and stores the test data in the test data storage unit 114.

判定部105は、第2命令データ格納部107に格納されている実行済みである命令のリスト及び状態データ格納部108に格納されているデータに基づき、分岐先において未実行の命令が有るか否かを判定する処理を実行する。また、判定部105は、探索済みである分岐の命令を第1命令データ格納部106に格納する。   The determination unit 105 determines whether there is an unexecuted instruction at the branch destination based on the list of executed instructions stored in the second instruction data storage unit 107 and the data stored in the state data storage unit 108. The process which determines is performed. In addition, the determination unit 105 stores the searched branch instruction in the first instruction data storage unit 106.

次に、図3乃至図17を用いて、シンボリック実行装置1の動作について説明する。まず、シンボリック実行装置1における入力部100は、シンボリック実行の対象になる対象プログラム及び目標カバレッジの入力をユーザから受け付ける(図3:ステップS1)。入力部100は、対象プログラムを対象プログラム格納部102に格納し、目標カバレッジを目標カバレッジ格納部101に格納する。目標カバレッジは、例えば、命令カバレッジ、条件カバレッジ及び分岐カバレッジの少なくともいずれかについての目標値である。   Next, the operation of the symbolic execution device 1 will be described with reference to FIGS. First, the input unit 100 in the symbolic execution device 1 receives an input of a target program and target coverage to be subjected to symbolic execution from the user (FIG. 3: step S1). The input unit 100 stores the target program in the target program storage unit 102 and stores the target coverage in the target coverage storage unit 101. The target coverage is, for example, a target value for at least one of instruction coverage, condition coverage, and branch coverage.

図4に、対象プログラムの一例を示す。図4に示す対象プログラムは、メインの処理を表すコードにおいて関数「int chk2nd(s)」を呼び出し、関数「int chk2nd(s)」において関数「int strlen(char*s)」を呼び出すプログラムである。命令の数は19である。   FIG. 4 shows an example of the target program. The target program shown in FIG. 4 is a program that calls the function “int chk2nd (s)” in the code representing the main process and calls the function “int strlen (char * s)” in the function “int chk2nd (s)”. . The number of instructions is 19.

目標カバレッジ格納部101には、例えば図5に示すように目標カバレッジが格納される。なお、異なる種類の目標カバレッジが複数格納される(例えば、命令カバレッジについての目標値と分岐カバレッジについての目標値とが格納される)場合もある。   For example, as shown in FIG. 5, the target coverage is stored in the target coverage storage unit 101. A plurality of different types of target coverage may be stored (for example, a target value for instruction coverage and a target value for branch coverage may be stored).

実行エンジン104における実行部112は、対象プログラム格納部102に対象プログラムが格納されると、コールグラフにおける階層を特定するための整数n(初期値は0)をインクリメントする(ステップS3)。   When the target program is stored in the target program storage unit 102, the execution unit 112 in the execution engine 104 increments an integer n (initial value is 0) for specifying a hierarchy in the call graph (step S3).

実行部112は、状態データ格納部108に格納されている実行状態に関するデータを初期化することにより、実行状態pを初期化する(ステップS5)。初期化とは、例えば、プログラムカウンタの値を1に戻し、コールスタックの内容をクリアし、メモリにおけるシンボル変数の状態についての情報をクリアし、またパス条件をクリアすることである。   The execution unit 112 initializes the execution state p by initializing data relating to the execution state stored in the state data storage unit 108 (step S5). The initialization is, for example, returning the value of the program counter to 1, clearing the contents of the call stack, clearing information about the state of symbol variables in the memory, and clearing the path condition.

実行部112は、シンボリック実行(null,p)を行う(ステップS7)。シンボリック実行(s,p)については、図6乃至図14を用いて説明する。なお、括弧内における1番目の文字列は実行済みである命令のリストを表しており、括弧内における2番目の文字列は実行状態を表す文字列である。ここでは、(null,p)は、実行済みである命令のリスト(すなわち、第2命令データ格納部107におけるリスト)が空である場合において、実行状態pが初期の状態からシンボリック実行を行うことを表している。   The execution unit 112 performs symbolic execution (null, p) (step S7). The symbolic execution (s, p) will be described with reference to FIGS. Note that the first character string in parentheses represents a list of executed instructions, and the second character string in parentheses is a character string representing an execution state. Here, (null, p) is to execute symbolic execution from the initial execution state p when the list of executed instructions (that is, the list in the second instruction data storage unit 107) is empty. Represents.

まず、実行部112は、実行状態pのプログラムカウンタに基づき1つの命令を対象プログラム格納部102に格納されている対象プログラムから読み出し、第2命令データ格納部107に追加する(図6:S21)。第2命令データ格納部107には、例えば図7に示すように、実行済みである命令のリストが格納される。   First, the execution unit 112 reads one instruction from the target program stored in the target program storage unit 102 based on the program counter in the execution state p, and adds it to the second instruction data storage unit 107 (FIG. 6: S21). . The second instruction data storage unit 107 stores a list of executed instructions, for example, as shown in FIG.

実行部112は、読み出した命令が関数の呼び出しの命令であるか判断する(ステップS23)。   The execution unit 112 determines whether the read instruction is a function call instruction (step S23).

関数の呼び出しの命令ではない場合(ステップS23:Noルート)、ステップS27の処理に移行する。関数の呼び出しの命令である場合(ステップS23:Yesルート)、実行部112は、コールグラフデータ格納部111に格納されているデータに基づき特定されるコールグラフに、呼び出す関数を追加する(ステップS25)。   If it is not a function call instruction (step S23: No route), the process proceeds to step S27. When it is a function call instruction (step S23: Yes route), the execution unit 112 adds the function to be called to the call graph specified based on the data stored in the call graph data storage unit 111 (step S25). ).

図8に、コールグラフの一例を示す。図8の例は、図4に示したプログラムについて生成されたコールグラフを示している。コールグラフは、関数の呼び出し関係を表している。以下では、コールグラフにおける各関数のことをノードと呼び、最も新しく呼び出された関数を葉ノードと呼ぶ。図8の例では、関数「int strlen(char*s)」が葉ノードである。コールグラフにおいては、葉ノードを最も下の階層のノードとする。   FIG. 8 shows an example of a call graph. The example of FIG. 8 shows a call graph generated for the program shown in FIG. The call graph represents a function call relationship. In the following, each function in the call graph is called a node, and the most recently called function is called a leaf node. In the example of FIG. 8, the function “int string (char * s)” is a leaf node. In the call graph, the leaf node is a node in the lowest hierarchy.

実行部112は、読み出した命令がシンボル変数に関わる分岐であるか判断する(ステップS27)。シンボル変数に関わる分岐は、例えば、図4における行番号が9における「if(strlen(s)<=1)」である。   The execution unit 112 determines whether the read instruction is a branch related to a symbol variable (step S27). The branch related to the symbol variable is, for example, “if (string (s) <= 1)” with the row number 9 in FIG.

シンボル変数に関わる分岐である場合(ステップS27:Yesルート)、処理は端子Aを介して図9のステップS41に移行する。   If it is a branch related to the symbol variable (step S27: Yes route), the process proceeds to step S41 in FIG.

図9の説明に移行し、実行部112は、実行状態Pに実行状態pをコピーし、分岐において未処理の分岐先(実行状態をPとする)を1つ特定する(図9:ステップS41)。なお、例えば分岐がif文である場合、分岐先としてYesのパスとNoのパスとがある。   Shifting to the description of FIG. 9, the execution unit 112 copies the execution state p to the execution state P, and specifies one unprocessed branch destination (execution state is P) in the branch (FIG. 9: Step S41). ). For example, when the branch is an if statement, there are Yes paths and No paths as branch destinations.

実行部112は、実行中の関数(すなわち、コールグラフにおいて最も新しく呼び出された関数)はパス刈りの対象外であるか判断する(ステップS43)。ステップS43における判断は、第1関数データ格納部109におけるパス刈りの対象外になる関数のリストに実行中の関数が含まれるか否かによって行う。第1関数データ格納部109には、例えば図10に示すようなデータが格納される。   The execution unit 112 determines whether the function being executed (that is, the function most recently called in the call graph) is not subject to path pruning (step S43). The determination in step S43 is performed based on whether or not the function being executed is included in the list of functions that are not subject to path pruning in the first function data storage unit 109. For example, data as shown in FIG. 10 is stored in the first function data storage unit 109.

パス刈りの対象外である場合(ステップS43:Yesルート)、パスについてシンボリック実行を終了させなくてもよいので、実行部112は、シンボリック実行(s,P)を行う(ステップS51)。ここでは、(s,P)は、実行済みである命令のリスト(すなわち、第2命令データ格納部107におけるリスト)がsという状態である場合において、実行状態Pについてシンボリック実行を行うことを表している。   If the path is not subject to path pruning (step S43: Yes route), the execution of the symbolic execution (s, P) is not performed because the symbolic execution does not have to be terminated for the path (step S51). Here, (s, P) indicates that symbolic execution is performed for the execution state P when the list of executed instructions (that is, the list in the second instruction data storage unit 107) is in the state s. ing.

一方、実行中の関数はパス刈りの対象外ではない場合(ステップS43:Noルート)、実行部112は、判定部105に判定処理の実行を要求する。これに応じ、判定部105は、判定処理(s,P,null)を実行する(ステップS45)。判定処理については、図11乃至図13を用いて説明する。なお、括弧内における1番目の文字列は実行済みである命令のリストを表しており、括弧内における2番目の文字列は実行状態を表す文字列であり、括弧内における3番目の文字列は探索済みである分岐の命令のリストを表す文字列である。ここでは、(s,P,null)は、実行済みである命令のリスト(すなわち、第2命令データ格納部107におけるリスト)がsという状態であり且つ探索済みである分岐の命令のリスト(すなわち、第1命令データ格納部106におけるリスト)が空である状態において、実行状態Pについて判定処理を行うことを表している。   On the other hand, if the function being executed is not excluded from path pruning (step S43: No route), the execution unit 112 requests the determination unit 105 to execute a determination process. In response, the determination unit 105 executes determination processing (s, P, null) (step S45). The determination process will be described with reference to FIGS. The first character string in the parentheses represents a list of instructions that have been executed, the second character string in the parentheses is a character string indicating an execution state, and the third character string in the parentheses is A character string representing a list of branch instructions that have been searched. Here, (s, P, null) is a list of instructions that have been executed (that is, a list in the second instruction data storage unit 107) that is already executed (ie, a list in the second instruction data storage unit 107) and that has already been searched (that is, In the state where the list in the first instruction data storage unit 106 is empty, the execution state P is determined.

まず、判定部105は、実行状態pの命令を1つ読み出す(図11:ステップS61)。   First, the determination unit 105 reads one instruction in the execution state p (FIG. 11: step S61).

判定部105は、読み出した命令が第2命令データ格納部107における実行済みである命令のリストに格納されているか判断する(ステップS63)。含まれていない場合(ステップS63:Noルート)、処理は端子Cを介して図12のステップS81に移行する。そして、判定部105は、分岐先のパスにおける命令が「未実行」であることを示す値を返り値に設定する(図12:ステップS81)。そして元の処理に戻る。   The determination unit 105 determines whether the read instruction is stored in the list of executed instructions in the second instruction data storage unit 107 (step S63). If not included (step S63: No route), the process proceeds to step S81 in FIG. Then, the determination unit 105 sets a value indicating that the instruction in the branch destination path is “unexecuted” as a return value (FIG. 12: step S81). Then, the process returns to the original process.

一方、読み出した命令が第2命令データ格納部107における実行済みである命令のリストに格納されている場合(ステップS63:Yesルート)、読み出した命令が「リターン」であるか判断する(ステップS65)。「リターン」である場合(ステップS65:Yesルート)、パスの全ての命令を実行済みであると考えられるので、処理は端子Dを介して図12のステップS83に移行する。そして、判定部105は、分岐先のパスにおける命令が「実行済み」であることを示す値を返り値に設定する(図12:ステップS83)。そして元の処理に戻る。   On the other hand, when the read instruction is stored in the list of executed instructions in the second instruction data storage unit 107 (step S63: Yes route), it is determined whether the read instruction is “return” (step S65). ). If it is “return” (step S65: Yes route), it is considered that all the instructions of the path have been executed, so the processing shifts to step S83 in FIG. Then, the determination unit 105 sets a value indicating that the instruction in the branch destination path is “executed” as a return value (FIG. 12: step S83). Then, the process returns to the original process.

一方、読み出した命令が「リターン」ではない場合(ステップS65:Noルート)、判定部105は、読み出した命令は分岐の命令であり且つ探索済みである分岐の命令のリストに含まれていないか判断する(ステップS67)。探索済みである分岐の命令のリストに含まれていないか判断するのは、ループを防ぐためである。第1命令データ格納部106における探索済みである分岐の命令のリストには、例えば図13に示すようなデータが格納される。   On the other hand, when the read instruction is not “return” (step S65: No route), the determination unit 105 determines whether the read instruction is a branch instruction and is not included in the list of branch instructions that have been searched. Judgment is made (step S67). The reason for determining whether or not it is included in the list of branch instructions that have been searched is to prevent a loop. For example, data as shown in FIG. 13 is stored in the list of branch instructions that have been searched in the first instruction data storage unit 106.

読み出した命令は分岐であり且つ探索済みである分岐の命令のリストに含まれていない場合(ステップS67:Yesルート)、判定部105は、第1命令データ格納部106における、探索済みである分岐の命令のリストに読み出した命令を追加する(ステップS71)。   When the read instruction is a branch and is not included in the list of branch instructions that have been searched (step S67: Yes route), the determination unit 105 determines that the branch has been searched in the first instruction data storage unit 106. The read command is added to the command list (step S71).

判定部105は、分岐において未処理の分岐先(実行状態をPとする)を1つ特定する(ステップS73)。   The determination unit 105 identifies one unprocessed branch destination (execution state is P) in the branch (step S73).

判定部105は、判定処理(s,P,b)を実行する(ステップS75)。ここでは、(s,P,b)は、実行済みである命令のリスト(すなわち、第2命令データ格納部107におけるリスト)がsという状態であり且つ探索済みである分岐の命令のリスト(すなわち、第1命令データ格納部106におけるリスト)がbという状態である場合において、実行状態Pについて判定処理を行うことを表している。   The determination unit 105 executes determination processing (s, P, b) (step S75). Here, (s, P, b) is a list of instructions that have already been executed (that is, a list in the second instruction data storage unit 107) is in a state of s and has been searched (ie, a list of instructions that have been searched). In the case where the list in the first instruction data storage unit 106 is in a state of b, the execution state P is determined.

判定処理の結果、実行状態Pのパスにおける命令を実行済みではないと判定された場合(ステップS77:Noルート)、処理は端子Cを介して図12のステップS81に移行する。   As a result of the determination process, when it is determined that the instruction in the path in the execution state P has not been executed (step S77: No route), the process proceeds to step S81 in FIG.

実行状態Pのパスにおける命令を実行済みであると判定された場合(ステップS77:Yesルート)、判定部105は、未処理の分岐先が有るか判断する(ステップS79)。未処理の分岐先が有る場合(ステップS79:Yesルート)、次の分岐先について処理するため、ステップS73の処理に戻る。一方、未処理の分岐先が無い場合(ステップS79:Noルート)、ステップS69の処理に移行する。   When it is determined that the instruction in the path in the execution state P has been executed (step S77: Yes route), the determination unit 105 determines whether there is an unprocessed branch destination (step S79). If there is an unprocessed branch destination (step S79: Yes route), the process returns to step S73 to process the next branch destination. On the other hand, when there is no unprocessed branch destination (step S79: No route), the process proceeds to step S69.

一方、ステップS67において、読み出した命令は分岐ではない又は探索済みである分岐の命令のリストに含まれると判断された場合(ステップS67:Noルート)、判定部105は、実行状態pの次の命令が有るか判断する(ステップS69)。実行状態pの次の命令が無い場合(ステップS69:Noルート)、処理は端子Dを介して図12のステップS83に移行する。一方、実行状態pの次の命令が有る場合(ステップS69:Yesルート)、次の命令について処理するため、ステップS61の処理に戻る。   On the other hand, if it is determined in step S67 that the read instruction is not a branch or is included in the list of branch instructions that have been searched (step S67: No route), the determination unit 105 determines the next of the execution state p. It is determined whether there is an instruction (step S69). If there is no instruction next to the execution state p (step S69: No route), the process proceeds to step S83 in FIG. On the other hand, if there is a next instruction in the execution state p (step S69: Yes route), the process returns to the process of step S61 in order to process the next instruction.

以上のような処理を実行すれば、分岐先において未実行の命令が有るか否かがわかるので、パス刈りを実施してもよいか(すなわち、パスについてのシンボリック実行を途中で終了してもよいか)否かがわかるようになる。   If the above processing is executed, it can be determined whether or not there is an unexecuted instruction at the branch destination, so path pruning may be performed (that is, symbolic execution on the path may be terminated halfway). You can tell whether or not

図9の説明に戻り、実行エンジン104における実行部112は、判定処理の結果が、実行状態Pのパスにおける命令を「実行済み」であることを表しているか判断する(ステップS47)。実行状態Pのパスにおける命令を実行済みではない場合(ステップS47:Noルート)、ステップS51の処理に移行する。   Returning to the description of FIG. 9, the execution unit 112 in the execution engine 104 determines whether the result of the determination process indicates that the instruction in the path of the execution state P is “executed” (step S47). When the instruction in the path of the execution state P has not been executed (step S47: No route), the process proceeds to step S51.

一方、実行状態Pのパスを実行済みである場合(ステップS47:Yesルート)、実行部112は、パスについてシンボリック実行を終了し、実行中の関数を、第2関数データ格納部110に追加する(ステップS49)。第2関数データ格納部110には、例えば図14に示すように、パス刈りを実施した関数のリストが格納される。   On the other hand, when the path in the execution state P has been executed (step S47: Yes route), the execution unit 112 ends the symbolic execution for the path and adds the function being executed to the second function data storage unit 110. (Step S49). For example, as illustrated in FIG. 14, the second function data storage unit 110 stores a list of functions that have undergone path pruning.

実行部112は、未処理の分岐先が有るか判断する(ステップS53)。未処理の分岐先が有る場合(ステップS53:Yesルート)、次の分岐先について処理するため、ステップS41の処理に戻る。一方、未処理の分岐先が無い場合(ステップS53:Noルート)、処理は端子Bを介して図6の処理に戻る。   The execution unit 112 determines whether there is an unprocessed branch destination (step S53). When there is an unprocessed branch destination (step S53: Yes route), the processing returns to step S41 in order to process the next branch destination. On the other hand, when there is no unprocessed branch destination (step S53: No route), the process returns to the process of FIG.

一方、ステップS27において、読み出した命令はシンボル変数に関わる分岐ではないと判断された場合(ステップS27:Noルート)、実行部112は、命令を実行し、プログラムカウンタを進める(すなわち、インクリメントする)(ステップS29)。   On the other hand, when it is determined in step S27 that the read instruction is not a branch related to the symbol variable (step S27: No route), the execution unit 112 executes the instruction and advances (ie, increments) the program counter. (Step S29).

実行部112は、実行状態pは終了の状態であるか判断する(ステップS31)。終了の状態とは、例えば、プログラムカウンタの値がプログラムにおける最後の行の番号に達している状態である。終了の状態ではない場合(ステップS31:Noルート)、次の命令について処理するため、ステップS21の処理に戻る。   The execution unit 112 determines whether the execution state p is an end state (step S31). The end state is, for example, a state where the value of the program counter has reached the number of the last line in the program. If it is not in an end state (step S31: No route), the process returns to step S21 to process the next command.

一方、実行状態pは終了の状態である場合(ステップS31:Yesルート)、生成部113は、シンボリック実行により得られたパス条件を満たす具体値をテストデータとして生成し(ステップS33)、メインメモリ等の記憶装置に格納する。そして元の処理に戻る。   On the other hand, when the execution state p is an end state (step S31: Yes route), the generation unit 113 generates a specific value that satisfies the path condition obtained by the symbolic execution as test data (step S33), and the main memory Or the like in a storage device. Then, the process returns to the original process.

以上のような処理を実行すれば、諸条件が満たされた場合にパス刈りを実行するので、全パスを対象範囲としてシンボリック実行を行うことはなくなり、シンボリック実行に要する時間を減らすことができると共に、メモリ等の資源の消費を抑制できる。   If the above processing is executed, path pruning is executed when various conditions are satisfied, so symbolic execution is not performed for all paths as a target range, and the time required for symbolic execution can be reduced. The consumption of resources such as memory can be suppressed.

図3の説明に戻り、実行エンジン104における実行部112は、カバレッジを算出する(ステップS9)。例えば目標カバレッジとして命令カバレッジについての目標値の入力を受け付けた場合には、ステップS9においては命令カバレッジを算出する。   Returning to the description of FIG. 3, the execution unit 112 in the execution engine 104 calculates coverage (step S9). For example, when an input of a target value for instruction coverage is accepted as the target coverage, the instruction coverage is calculated in step S9.

実行部112は、算出されたカバレッジが目標カバレッジより大きいか判断する(ステップS11)。目標カバレッジ以下である場合(ステップS11:Noルート)、実行部112は、範囲制御部103にシンボリック実行の対象範囲の拡大を要求する。これに応じ、範囲制御部103は、コールグラフデータ格納部111に格納されているデータに基づき特定されるコールグラフにおける葉ノードから(n−1)段上の階層に属するノードであり且つ前回のパス刈りの対象である関数を、第1関数データ格納部109におけるパス刈りの対象外になる関数のリストに追加する(ステップS13)。また、範囲制御部103は、実行エンジン104に、再度シンボリック実行を行うことを要求する。そしてステップS3の処理に戻る。   The execution unit 112 determines whether the calculated coverage is larger than the target coverage (step S11). When it is below the target coverage (step S11: No route), the execution unit 112 requests the range control unit 103 to expand the target range of symbolic execution. In response to this, the range control unit 103 is a node that belongs to the (n−1) stage hierarchy from the leaf node in the call graph specified based on the data stored in the call graph data storage unit 111 and the previous time. The function that is the target of path pruning is added to the list of functions that are not the target of path pruning in the first function data storage unit 109 (step S13). Further, the range control unit 103 requests the execution engine 104 to perform symbolic execution again. Then, the process returns to step S3.

なお、例えば図15に示すようなコールグラフが得られたとする。図15におけるfunc1のように、階層が異なる複数の関数を呼び出す関数が存在する場合には、葉ノードから(n−1)段上の階層に属するノードを特定する方法が複数存在することになる。このような場合には、最も下の階層に属する葉ノードを基準として考えることにする。図15の例では、func4ではなくfunc3を基準として考えることにするので、func1は葉ノードから2段上の階層に属するノードであるということになる。   For example, assume that a call graph as shown in FIG. 15 is obtained. When there is a function that calls a plurality of functions having different hierarchies as in func1 in FIG. 15, there are a plurality of methods for specifying a node belonging to the (n-1) stage hierarchy from the leaf node. . In such a case, the leaf node belonging to the lowest hierarchy is considered as a reference. In the example of FIG. 15, since func3 is considered as a reference instead of func4, func1 is a node belonging to a hierarchy two levels higher than the leaf node.

また、プログラム内に再帰呼び出しが存在する場合には、図16の左に示すように、コールグラフに葉ノードが無くなる。そこで、再帰呼び出しが存在することを検出した場合には、図16の右に示すように、再帰呼び出しに相当するエッジを削除する。再帰呼び出しが存在することを検出するには、例えば、コールグラフの生成時にコールスタック中にこれから呼び出す関数がないか確認すればよい。   If there is a recursive call in the program, there are no leaf nodes in the call graph, as shown on the left side of FIG. Therefore, when it is detected that a recursive call exists, an edge corresponding to the recursive call is deleted as shown on the right side of FIG. In order to detect the presence of a recursive call, for example, it is only necessary to check whether there is a function to be called in the call stack when the call graph is generated.

一方、目標カバレッジより大きい場合(ステップS11:Yesルート)、実行エンジン104における生成部113は、ステップS33において生成されたテストデータをテストデータ格納部114に格納する(ステップS15)。テストデータ格納部114に格納されたテストデータが、最終的に採用されるテストデータとなる。そして処理を終了する。   On the other hand, when larger than the target coverage (step S11: Yes route), the generation unit 113 in the execution engine 104 stores the test data generated in step S33 in the test data storage unit 114 (step S15). The test data stored in the test data storage unit 114 is the test data that is finally adopted. Then, the process ends.

以上のような処理を実行すれば、パス刈りの範囲を徐々に縮小しつつ繰り返しシンボリック実行を行い、カバレッジが目標カバレッジを越えた時点におけるテストデータを採用できる。これにより、網羅性があるテストデータを効率的に生成できるようになる。   By executing the processing as described above, it is possible to repeatedly perform symbolic execution while gradually reducing the range of path pruning and employ test data at the time when the coverage exceeds the target coverage. This makes it possible to efficiently generate test data with completeness.

ここで、図4に示したプログラムを対象プログラムとして本実施の形態の処理を実行した場合について具体的に説明する。目標カバレッジは、命令カバレッジの目標値であり、90%であるとする。   Here, a specific description will be given of a case where the processing of this embodiment is executed with the program shown in FIG. 4 as a target program. The target coverage is a target value of instruction coverage, and is assumed to be 90%.

最初のシンボリック実行においては、パス刈りの対象外にする関数のリストが空であるため、プログラムにおける全パスがパス刈りの対象範囲になる。そして、シンボリック実行の途中において行番号15乃至19の命令は全て実行済みになるため、「int strlen(char*s)」についてパス刈りが実施される。この結果、行番号11乃至14の命令は実行されなくなる。ここで命令カバレッジを計算すると、命令カバレッジは「(19−4)/19*100≒79(%)になり、目標カバレッジ以下である。従って、パス刈りの対象範囲を狭めて再度シンボリック実行を行うことになる。   In the first symbolic execution, since the list of functions to be excluded from the path pruning is empty, all paths in the program become the path pruning target range. Since all the instructions of line numbers 15 to 19 are already executed in the middle of symbolic execution, path pruning is performed for “int string (char * s)”. As a result, the instructions of line numbers 11 to 14 are not executed. When the instruction coverage is calculated here, the instruction coverage becomes “(19-4) / 19 * 100≈79 (%), which is below the target coverage. Therefore, the target range of the path pruning is narrowed and symbolic execution is performed again. It will be.

パス刈りの対象外になる関数は、コールグラフ(図8)において葉ノード(int strlen(char*s))から(1−1=)0段上の階層に属するノードであり且つ前回パス刈りされている関数であるので、「int strlen(char*s)」である。   The functions that are not subject to path pruning are nodes that belong to the hierarchy (1-1 =) 0 level up from the leaf node (int strlen (char * s)) in the call graph (FIG. 8) and have been pruned the previous time. Since it is a function, it is “int string (char * s)”.

2回目のシンボリック実行においては、「int strlen(char*s)」がパス刈りの対象外になるため、命令11乃至14も実行されるようになる。ここで命令カバレッジを計算すると、命令カバレッジは19/19*100=100(%)になり、目標カバレッジより大きい。従って、2回目のシンボリック実行により得られたパス条件を満たす具体値がテストデータとして採用される。   In the second symbolic execution, since “int strlen (char * s)” is not subject to path pruning, instructions 11 to 14 are also executed. When the instruction coverage is calculated here, the instruction coverage is 19/19 * 100 = 100 (%), which is larger than the target coverage. Therefore, a specific value that satisfies the path condition obtained by the second symbolic execution is adopted as the test data.

なお、目標カバレッジとして分岐カバレッジ又は条件カバレッジの目標値の入力を受け付けた場合も同様である。例えば、分岐カバレッジの目標値が90(%)であるとする。最初のシンボリック実行の後に分岐カバレッジを計算すると、4/6*100≒67(%)になり、目標カバレッジ以下である。従って、命令カバレッジの場合と同様にパス刈りの対象外になる関数を「int strlen(char*s)」として再度シンボリック実行を行う。すると、分岐カバレッジは6/6=100(%)になり、目標カバレッジより大きい。従って、2回目のシンボリック実行により得られたパス条件を満たす具体値がテストデータとして採用される。   The same applies when an input of a target value of branch coverage or condition coverage is received as target coverage. For example, it is assumed that the target value of branch coverage is 90 (%). When the branch coverage is calculated after the first symbolic execution, 4/6 * 100≈67 (%), which is below the target coverage. Accordingly, as in the case of instruction coverage, symbolic execution is performed again with “int strlen (char * s)” as the function that is not subject to path pruning. Then, the branch coverage is 6/6 = 100 (%), which is larger than the target coverage. Therefore, a specific value that satisfies the path condition obtained by the second symbolic execution is adopted as the test data.

図17の左に、図4に示したプログラムの実行木を示す。図17の左に示すように、図4に示したプログラムには6つのパスが存在する。これに対し、本実施の形態の処理を実行すると、図17の右に示すように、2つのパスについてはパス刈りにより途中で終了する。このようにパス刈りを行うとパスカバレッジは100(%)にはならないが、上で説明したように、命令カバレッジは100(%)である。   The execution tree of the program shown in FIG. 4 is shown on the left side of FIG. As shown on the left of FIG. 17, there are six paths in the program shown in FIG. On the other hand, when the processing of the present embodiment is executed, as shown on the right side of FIG. When path pruning is performed in this way, the path coverage does not reach 100 (%), but as described above, the instruction coverage is 100 (%).

以上においては、パス刈りの範囲を制御する方法について説明したが、以下では、パス刈りの範囲を制御せず、プログラムにおける全パスをパス刈りの対象範囲とする場合について検討する。   In the above, the method for controlling the range of path pruning has been described. In the following, a case will be considered in which the range of path pruning is not controlled and all paths in the program are set as the range of path pruning.

図18に、パス刈りの範囲を制御しない場合におけるメインの処理フローを示す。まず、シンボリック実行装置1における入力部100は、シンボリック実行の対象になる対象プログラムの入力をユーザから受け付ける(図18:ステップS91)。入力部100は、対象プログラムを対象プログラム格納部102に格納する。   FIG. 18 shows a main processing flow in the case where the range of path cutting is not controlled. First, the input unit 100 in the symbolic execution device 1 receives an input of a target program to be subjected to symbolic execution from the user (FIG. 18: step S91). The input unit 100 stores the target program in the target program storage unit 102.

実行エンジン104における実行部112は、状態データ格納部108に格納されている実行状態に関するデータを初期化することにより、実行状態pを初期化する(ステップS93)。初期化とは、例えば、プログラムカウンタの値を1に戻し、コールスタックの内容をクリアし、シンボル変数の状態についての情報をメモリからクリアし、またパス条件をクリアすることである。   The execution unit 112 in the execution engine 104 initializes the execution state p by initializing data related to the execution state stored in the state data storage unit 108 (step S93). The initialization means, for example, returning the value of the program counter to 1, clearing the contents of the call stack, clearing information about the state of the symbol variable from the memory, and clearing the pass condition.

実行部112は、シンボリック実行(null,p)を行う(ステップS95)。ここで行われるシンボリック実行(s,p)については、図19を用いて説明する。なお、括弧内における1番目の文字列は実行済みである命令のリストを表しており、括弧内における2番目の文字列は実行状態を表す文字列である。ここでは、(null,p)は、実行済みである命令のリスト(すなわち、第2命令データ格納部107におけるリスト)が空である場合において、実行状態pが初期の状態からシンボリック実行を行うことを表している。   The execution unit 112 performs symbolic execution (null, p) (step S95). The symbolic execution (s, p) performed here will be described with reference to FIG. Note that the first character string in parentheses represents a list of executed instructions, and the second character string in parentheses is a character string representing an execution state. Here, (null, p) is to execute symbolic execution from the initial execution state p when the list of executed instructions (that is, the list in the second instruction data storage unit 107) is empty. Represents.

まず、実行部112は、実行状態pのプログラムカウンタに基づき1つの命令を対象プログラム格納部102に格納されている対象プログラムから読み出し、第2命令データ格納部107に追加する(図19:S101)。   First, the execution unit 112 reads one instruction from the target program stored in the target program storage unit 102 based on the program counter in the execution state p, and adds it to the second instruction data storage unit 107 (FIG. 19: S101). .

実行部112は、読み出した命令がシンボル変数に関わる分岐であるか判断する(ステップS103)。シンボル変数に関わる分岐とは、例えば、図4における行番号が9における「if(strlen(s)<=1)」である。   The execution unit 112 determines whether the read instruction is a branch related to a symbol variable (step S103). The branch related to the symbol variable is, for example, “if (stren (s) <= 1)” in FIG.

シンボル変数に関わる分岐ではない場合(ステップS103:Noルート)、実行部112は、命令を実行し、プログラムカウンタを進める(すなわち、インクリメントする)(ステップS117)。   When the branch is not related to the symbol variable (step S103: No route), the execution unit 112 executes the instruction and advances (ie, increments) the program counter (step S117).

実行部112は、実行状態pは終了の状態であるか判断する(ステップS119)。終了の状態とは、例えば、プログラムカウンタの値がプログラムにおける最後の行の番号に達している状態である。終了の状態ではない場合(ステップS119:Noルート)、次の命令について処理するため、ステップS101の処理に戻る。   The execution unit 112 determines whether the execution state p is an end state (step S119). The end state is, for example, a state where the value of the program counter has reached the number of the last line in the program. If it is not an end state (step S119: No route), the process returns to the process of step S101 in order to process the next instruction.

一方、実行状態pは終了の状態である場合(ステップS119:Yesルート)、生成部113は、シンボリック実行により得られたパス条件を満たす具体値をテストデータとして生成し(ステップS121)、メインメモリ等の記憶装置に格納する。そして元の処理に戻る。   On the other hand, when the execution state p is an end state (step S119: Yes route), the generation unit 113 generates, as test data, a specific value that satisfies the path condition obtained by symbolic execution (step S121). Or the like in a storage device. Then, the process returns to the original process.

一方、ステップS103において、読み出した命令はシンボル変数に関わる分岐であると判断された場合(ステップS103:Yesルート)、実行部112は、分岐において未処理の分岐先(実行状態をPとする)を1つ特定する(ステップS105)。   On the other hand, when it is determined in step S103 that the read instruction is a branch related to the symbol variable (step S103: Yes route), the execution unit 112 determines that the branch destination that has not been processed in the branch (the execution state is P). Is identified (step S105).

実行部112は、判定部105に判定処理の実行を要求する。これに応じ、判定部105は、判定処理(s,P,null)を実行する(ステップS107)。判定処理については、図11乃至図13を用いて説明したとおりである。なお、括弧内における1番目の文字列は実行済みである命令のリストを表しており、括弧内における2番目の文字列は実行状態を表す文字列であり、括弧内における3番目の文字列は探索済みである分岐の命令のリストを表している。ここでは、(s,P,null)は、実行済みである命令のリスト(すなわち、第2命令データ格納部107におけるリスト)がsという状態であり且つ探索済みである分岐の命令のリスト(すなわち、第1命令データ格納部106におけるリスト)が空である状態において、実行状態Pについて判定処理を行うことを表している。   The execution unit 112 requests the determination unit 105 to execute a determination process. In response, the determination unit 105 executes determination processing (s, P, null) (step S107). The determination process is as described with reference to FIGS. The first character string in the parentheses represents a list of instructions that have been executed, the second character string in the parentheses is a character string indicating an execution state, and the third character string in the parentheses is This represents a list of branch instructions that have been searched. Here, (s, P, null) is a list of instructions that have been executed (that is, a list in the second instruction data storage unit 107) that is already executed (ie, a list in the second instruction data storage unit 107) and that has already been searched (that is, In the state where the list in the first instruction data storage unit 106 is empty, the execution state P is determined.

実行エンジン104における実行部112は、判定処理の結果が、実行状態Pのパスにおける命令を「実行済み」であることを表しているか判断する(ステップS109)。実行状態Pのパスにおける命令を実行済みである場合(ステップS109:Yesルート)、実行部112は、パスについてシンボリック実行を終了する(ステップS111)。   The execution unit 112 in the execution engine 104 determines whether the result of the determination process indicates that the instruction in the path of the execution state P is “executed” (step S109). When the instruction in the path in the execution state P has been executed (step S109: Yes route), the execution unit 112 ends the symbolic execution for the path (step S111).

一方、実行状態Pのパスにおける命令を未実行である場合(ステップS109:Noルート)、実行部112は、シンボリック実行(s,P)を行う(ステップS113)。ここでは、(s,P)は、実行済みである命令のリスト(すなわち、第2命令データ格納部107におけるリスト)がsという状態である場合において、実行状態Pについてシンボリック実行を行うことを表している。   On the other hand, when the instruction in the path of the execution state P is not executed (step S109: No route), the execution unit 112 performs symbolic execution (s, P) (step S113). Here, (s, P) indicates that symbolic execution is performed for the execution state P when the list of executed instructions (that is, the list in the second instruction data storage unit 107) is in the state s. ing.

実行部112は、未処理の分岐先が有るか判断する(ステップS115)。未処理の分岐先が有る場合(ステップS115:Yesルート)、次の分岐先について処理するため、ステップS105の処理に戻る。一方、未処理の分岐先が無い場合(ステップS115:Noルート)、処理は図18に戻り終了する。   The execution unit 112 determines whether there is an unprocessed branch destination (step S115). If there is an unprocessed branch destination (step S115: Yes route), the processing returns to step S105 to process the next branch destination. On the other hand, when there is no unprocessed branch destination (step S115: No route), the process returns to FIG. 18 and ends.

以上のようにすれば、パス刈りの範囲を制御せず、プログラムにおける全パスをパス刈りの対象範囲とすることができる。   By doing so, it is possible to set all the paths in the program as the target range of path pruning without controlling the range of path pruning.

このような処理を行ったとしても、命令カバレッジの低下を抑えつつ一部のパスについては省略を実行できる場合がある。例えば図20に示す対象プログラムの場合は、命令カバレッジの低下を抑えつつ一部のパスについては省略を実行できる。図20に示した対象プログラムは、メインの処理を表すコードにおいて関数「int funcA(int a,int b)」を呼び出し、関数「int funcA(int a,int b)」において関数「int abs(int x)」を呼び出すプログラムである。命令の数は19である。なお、命令1乃至7におけるいずれかの命令を実行中におけるコールスタックは「stack3」のようになっており、命令8乃至15におけるいずれかの命令を実行中におけるコールスタックは「stack2」のようになっており、命令16乃至19におけるいずれかの命令を実行中におけるコールスタックは「stack1」のようになっている。   Even if such processing is performed, there is a case where omission can be executed for some paths while suppressing a decrease in instruction coverage. For example, in the case of the target program shown in FIG. 20, omission can be executed for some paths while suppressing a decrease in instruction coverage. The target program shown in FIG. 20 calls the function “int funcA (int a, int b)” in the code representing the main process, and the function “int abs (int a, int b)” in the function “int funcA (int a, int b)”. x) ". The number of instructions is 19. Note that the call stack during execution of any one of the instructions 1 to 7 is “stack3”, and the call stack during execution of any of the instructions 8 to 15 is “stack2”. The call stack during execution of any one of the instructions 16 to 19 is “stack1”.

図21に、図20に示した対象プログラムの実行木を示す。図21における実行木においては、各実行状態について、プログラムカウンタの値、コールスタックの識別情報(図20における識別情報に対応している)、シンボル変数の状態についての情報及びパス条件が示されている。図20に示した対象プログラムに対して図18及び図19で説明した処理によってパス刈りを実行すると、実行状態6及び7に対応するパスについては、a<0という条件に関連するパスによって命令が実行済みとなっているため、パス刈りが実施される。但し、命令カバレッジが低下することはない。   FIG. 21 shows an execution tree of the target program shown in FIG. In the execution tree in FIG. 21, the value of the program counter, the identification information of the call stack (corresponding to the identification information in FIG. 20), the information about the state of the symbol variable, and the path condition are shown for each execution state. Yes. When path pruning is performed on the target program shown in FIG. 20 by the processing described with reference to FIGS. 18 and 19, for paths corresponding to execution states 6 and 7, an instruction is issued by a path related to the condition a <0. Since it has been executed, the path pruning is performed. However, instruction coverage is not reduced.

しかし、対象プログラムの構造によっては、命令カバレッジが低下することがある。例えば、図4に示した対象プログラムの場合には命令カバレッジが低下する。図22の右には、図4に示した対象プログラムに対して図18及び図19で説明した処理によってパス刈りを実行した場合の結果を示す。シンボリック実行中、「!s[0]」のパスにおいて命令15乃至19が実行済みになるため、バツ印を付した部分に対してパス刈りが実施される。そのため、点線で囲った部分に相当するパスについては実行されなくなる。この際の命令カバレッジは、パス刈りの範囲を制御した場合における初回のシンボリック実行についての命令カバレッジと同じであり、「(19−4)/19*100≒79(%)」である。   However, instruction coverage may be reduced depending on the structure of the target program. For example, in the case of the target program shown in FIG. 4, instruction coverage is reduced. The right side of FIG. 22 shows a result when path pruning is executed on the target program shown in FIG. 4 by the processing described in FIGS. 18 and 19. During symbolic execution, since instructions 15 to 19 are already executed in the path “! S [0]”, path pruning is performed on the part marked with a cross. Therefore, the path corresponding to the portion surrounded by the dotted line is not executed. The instruction coverage at this time is the same as the instruction coverage for the first symbolic execution when the range of path pruning is controlled, and is “(19-4) / 19 * 100≈79 (%)”.

このように、パス刈りの範囲を制御せず、プログラムにおける全パスをパス刈りの対象範囲とする場合には、命令カバレッジ(条件カバレッジ及び分岐カバレッジも同様)が低下する場合がある。従って、図3乃至図17を用いて説明したようにパス刈りの対象範囲を制御した方が、命令カバレッジ(条件カバレッジ及び分岐カバレッジも同様)が目標値以上になるようにパス刈りを行うことができるため有効である。   As described above, when the range of path pruning is not controlled and all paths in the program are set as the range of path pruning, instruction coverage (similar to condition coverage and branch coverage) may be reduced. Therefore, as described with reference to FIGS. 3 to 17, when the target range of path pruning is controlled, the path pruning can be performed so that the instruction coverage (same condition coverage and branch coverage) is equal to or greater than the target value. It is effective because it can.

以上本発明の一実施の形態を説明したが、本発明はこれに限定されるものではない。例えば、上で説明したシンボリック実行装置1の機能ブロック構成は実際のプログラムモジュール構成に一致しない場合もある。   Although one embodiment of the present invention has been described above, the present invention is not limited to this. For example, the functional block configuration of the symbolic execution device 1 described above may not match the actual program module configuration.

また、上で説明した各テーブルの構成は一例であって、上記のような構成でなければならないわけではない。さらに、処理フローにおいても、処理結果が変わらなければ処理の順番を入れ替えることも可能である。さらに、並列に実行させるようにしても良い。   Further, the configuration of each table 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.

なお、上で述べたシンボリック実行装置1は、コンピュータ装置であって、図23に示すように、メモリ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 symbolic execution device 1 described above is a computer device, and as shown in FIG. 23, 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) 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 the embodiment of the present invention, an application program for performing the above-described processing is stored in a computer-readable removable disk 2511 and distributed, and installed in the HDD 2505 from the drive device 2513. 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 of the present invention described above is summarized as follows.

本実施の形態に係るテストデータ生成方法は、(A)シンボリック実行の対象範囲のうち一部の範囲を省略してシンボリック実行を行い、当該シンボリック実行について網羅率を算出する第1処理と、(B)算出された網羅率が所定の値を超えたか判断する第2処理と、(C)算出された網羅率が所定の値を超えていない場合、省略された一部の範囲のうち少なくとも一部が省略の対象外になるように設定し、第1処理以降の処理を再度実行する第3処理と、(D)算出された網羅率が所定の値を超えた場合に、シンボリック実行により得られるパスの条件を満たす値を、第1データ格納部に格納する第4処理とを含む。   The test data generation method according to the present embodiment includes (A) a first process for performing symbolic execution while omitting a part of the target range of symbolic execution, and calculating a coverage rate for the symbolic execution; B) a second process for determining whether the calculated coverage rate exceeds a predetermined value; and (C) if the calculated coverage rate does not exceed the predetermined value, at least one of the omitted partial ranges. Obtained by symbolic execution when the calculated coverage rate exceeds a predetermined value, and a third process that executes the process after the first process again. And a fourth process of storing a value satisfying the condition of the path to be stored in the first data storage unit.

このようにすれば、網羅率が所定の値を超えるために最低限のシンボリック実行を行えば済むので、網羅性があるテストデータを効率的に生成できるようになる。   In this way, since the coverage rate exceeds a predetermined value, it is only necessary to perform symbolic execution at a minimum, so that it is possible to efficiently generate test data with completeness.

また、上で述べた第1処理において、(a1)プログラム内の分岐によって生じる複数の分岐先の各々において未実行の命令が無い場合には分岐に関連するパスについてシンボリック実行を終了することにより、一部の範囲を省略してシンボリック実行を行うようにしてもよい。このようにすれば、網羅率の向上に寄与しない可能性が高いパスを省略できるので、シンボリック実行に要する時間を短縮し、またコンピュータの資源の消費を抑制できるようになる。   In the first process described above, (a1) when there is no unexecuted instruction in each of a plurality of branch destinations generated by the branch in the program, the symbolic execution is terminated for the path related to the branch, Some ranges may be omitted and symbolic execution may be performed. In this way, paths that are unlikely to contribute to the improvement of the coverage rate can be omitted, so that the time required for symbolic execution can be shortened and the consumption of computer resources can be suppressed.

また、上で述べた第3処理において、(c1)省略した一部の範囲に含まれる関数のうち所定の方法によって特定された関数を省略の対象外に決定するようにしてもよい。このように、関数の単位で省略の対象外を定めれば、省略の対象外にする範囲を適切に定めることができる。   In the third process described above, (c1) functions specified by a predetermined method among functions included in a part of the omitted range may be determined to be excluded. As described above, if the exclusion target is determined in units of functions, the range to be excluded from the suppression target can be appropriately determined.

また、上で述べた所定の方法が、関数の呼び出し関係に基づき生成されるコールグラフにおいて最も下の階層に属する関数から順に特定するという方法であってもよい。このようにすれば、省略範囲が徐々に減るようにすることができるようになる。   Further, the predetermined method described above may be a method of specifying sequentially from the function belonging to the lowest layer in the call graph generated based on the function call relationship. In this way, the omitted range can be gradually reduced.

また、上で述べた網羅率が、命令網羅率、条件網羅率及び分岐網羅率のうち少なくともいずれかを含むようにしてもよい。通常のシンボリック実行は経路網羅率が100%になるように行われるが、命令網羅率、条件網羅率又は分岐網羅率が所定の値であればよいという場合には、通常のシンボリック実行を行うと無駄が多い。そこで、網羅率として上で述べたような網羅率を採用すれば、無駄にシンボリック実行を行わなくて済む。   The coverage rate described above may include at least one of an instruction coverage rate, a condition coverage rate, and a branch coverage rate. Normal symbolic execution is performed so that the route coverage rate is 100%. However, if the instruction coverage rate, condition coverage rate, or branch coverage rate only needs to be a predetermined value, normal symbolic execution is performed. There is a lot of waste. Therefore, if the coverage rate described above is adopted as the coverage rate, it is not necessary to perform symbolic execution wastefully.

なお、上記方法による処理をコンピュータに行わせるためのプログラムを作成することができ、当該プログラムは、例えばフレキシブルディスク、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. The intermediate processing result is 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処理と、
算出された前記網羅率が所定の値を超えたか判断する第2処理と、
算出された前記網羅率が前記所定の値を超えていない場合、省略された前記一部の範囲のうち少なくとも一部が省略の対象外になるように設定し、前記第1処理以降の処理を再度実行する第3処理と、
算出された前記網羅率が前記所定の値を超えた場合に、前記シンボリック実行により得られたパスの条件を満たす値を、第1データ格納部に格納する第4処理と、
をコンピュータが実行するテストデータ生成方法。
(Appendix 1)
A first process of performing a symbolic execution while omitting a part of a target range of the symbolic execution, and calculating a coverage rate for the symbolic execution;
A second process for determining whether the calculated coverage ratio exceeds a predetermined value;
If the calculated coverage ratio does not exceed the predetermined value, set so that at least a part of the omitted partial range is not subject to omission, and the processes after the first process are performed. A third process to be executed again;
A fourth process of storing, in the first data storage unit, a value that satisfies a path condition obtained by the symbolic execution when the calculated coverage rate exceeds the predetermined value;
A test data generation method in which a computer executes.

(付記2)
前記第1処理において、
プログラム内の分岐によって生じる複数の分岐先の各々において未実行の命令が無い場合には前記分岐に関連するパスについて前記シンボリック実行を終了することにより、前記一部の範囲を省略して前記シンボリック実行を行う
ことを特徴とする付記1記載のテストデータ生成方法。
(Appendix 2)
In the first process,
When there is no unexecuted instruction in each of a plurality of branch destinations generated by a branch in the program, the symbolic execution is omitted by ending the symbolic execution for the path related to the branch, thereby omitting the partial range. The test data generation method according to appendix 1, wherein:

(付記3)
前記第3処理において、
省略した前記一部の範囲に含まれる関数のうち所定の方法によって特定された関数を省略の対象外に決定する
ことを特徴とする付記1又は2記載のテストデータ生成方法。
(Appendix 3)
In the third process,
The test data generation method according to appendix 1 or 2, wherein a function specified by a predetermined method among the functions included in the omitted partial range is determined to be excluded.

(付記4)
前記所定の方法が、
関数の呼び出し関係に基づき生成されるコールグラフにおいて最も下の階層に属する関数から順に特定するという方法である
ことを特徴とする付記3記載のテストデータ生成方法。
(Appendix 4)
The predetermined method is:
4. The test data generation method according to appendix 3, wherein the test graph is specified in order from a function belonging to the lowest layer in a call graph generated based on a function call relationship.

(付記5)
前記網羅率が、
命令網羅率、条件網羅率及び分岐網羅率のうち少なくともいずれかを含む
ことを特徴とする付記1乃至4のいずれか1つ記載のテストデータ生成方法。
(Appendix 5)
The coverage rate is
The test data generation method according to any one of appendices 1 to 4, wherein the test data generation method includes at least one of an instruction coverage rate, a condition coverage rate, and a branch coverage rate.

(付記6)
シンボリック実行の対象範囲のうち一部の範囲を省略して前記シンボリック実行を行い、当該シンボリック実行について網羅率を算出する第1処理と、
算出された前記網羅率が所定の値を超えたか判断する第2処理と、
算出された前記網羅率が前記所定の値を超えていない場合、省略された前記一部の範囲のうち少なくとも一部が省略の対象外になるように設定し、前記第1処理以降の処理を再度実行する第3処理と、
算出された前記網羅率が前記所定の値を超えた場合に、前記シンボリック実行により得られたパスの条件を満たす値を、第1データ格納部に格納する第4処理と、
をコンピュータに実行させるためのテストデータ生成プログラム。
(Appendix 6)
A first process of performing a symbolic execution while omitting a part of a target range of the symbolic execution, and calculating a coverage rate for the symbolic execution;
A second process for determining whether the calculated coverage ratio exceeds a predetermined value;
If the calculated coverage ratio does not exceed the predetermined value, set so that at least a part of the omitted partial range is not subject to omission, and the processes after the first process are performed. A third process to be executed again;
A fourth process of storing, in the first data storage unit, a value that satisfies a path condition obtained by the symbolic execution when the calculated coverage rate exceeds the predetermined value;
A test data generation program for causing a computer to execute.

(付記7)
シンボリック実行の対象範囲のうち一部の範囲を省略して前記シンボリック実行を行い、当該シンボリック実行について網羅率を算出すると共に、算出された前記網羅率が所定の値を超えたか判断する第1処理部と、
算出された前記網羅率が前記所定の値を超えていない場合、省略された前記一部の範囲のうち少なくとも一部が省略の対象外になるように設定し、前記第1処理部に処理を再度実行させる第2処理部と、
算出させた前記網羅率が前記所定の値を超えた場合に、前記シンボリック実行により得られたパスの条件を満たす値を、第1データ格納部に格納する第3処理部と、
を有するテストデータ生成装置。
(Appendix 7)
First processing for performing symbolic execution while omitting a part of the target range of symbolic execution, calculating a coverage rate for the symbolic execution, and determining whether the calculated coverage rate exceeds a predetermined value And
If the calculated coverage ratio does not exceed the predetermined value, at least a part of the omitted part of the range is set so as not to be omitted, and the first processing unit performs processing. A second processing unit to be executed again;
A third processing unit that stores, in the first data storage unit, a value that satisfies a path condition obtained by the symbolic execution when the calculated coverage rate exceeds the predetermined value;
A test data generating apparatus having

1 シンボリック実行装置 100 入力部
101 目標カバレッジ格納部 102 対象プログラム格納部
103 範囲制御部 104 実行エンジン
105 判定部 106 第1命令データ格納部
107 第2命令データ格納部 108 状態データ格納部
109 第1関数データ格納部 110 第2関数データ格納部
111 コールグラフデータ格納部 112 実行部
113 生成部 114 テストデータ格納部
DESCRIPTION OF SYMBOLS 1 Symbolic execution apparatus 100 Input part 101 Target coverage storage part 102 Target program storage part 103 Range control part 104 Execution engine 105 Judgment part 106 1st command data storage part 107 2nd command data storage part 108 State data storage part 109 1st function Data storage unit 110 Second function data storage unit 111 Call graph data storage unit 112 Execution unit 113 Generation unit 114 Test data storage unit

Claims (6)

シンボリック実行の対象範囲のうち一部の範囲を省略して前記シンボリック実行を行い、当該シンボリック実行について網羅率を算出する第1処理と、
算出された前記網羅率が所定の値を超えたか判断する第2処理と、
算出された前記網羅率が前記所定の値を超えていない場合、省略された前記一部の範囲のうち少なくとも一部が省略の対象外になるように設定し、前記第1処理以降の処理を再度実行する第3処理と、
算出された前記網羅率が前記所定の値を超えた場合に、前記シンボリック実行により得られたパスの条件を満たす値を、第1データ格納部に格納する第4処理と、
をコンピュータが実行するテストデータ生成方法。
A first process of performing a symbolic execution while omitting a part of a target range of the symbolic execution, and calculating a coverage rate for the symbolic execution;
A second process for determining whether the calculated coverage ratio exceeds a predetermined value;
If the calculated coverage ratio does not exceed the predetermined value, set so that at least a part of the omitted partial range is not subject to omission, and the processes after the first process are performed. A third process to be executed again;
A fourth process of storing, in the first data storage unit, a value that satisfies a path condition obtained by the symbolic execution when the calculated coverage rate exceeds the predetermined value;
A test data generation method in which a computer executes.
前記第1処理において、
プログラム内の分岐によって生じる複数の分岐先の各々において未実行の命令が無い場合には前記分岐に関連するパスについて前記シンボリック実行を終了することにより、前記一部の範囲を省略して前記シンボリック実行を行う
ことを特徴とする請求項1記載のテストデータ生成方法。
In the first process,
When there is no unexecuted instruction in each of a plurality of branch destinations generated by a branch in the program, the symbolic execution is omitted by ending the symbolic execution for the path related to the branch, thereby omitting the partial range. The test data generation method according to claim 1, wherein:
前記第3処理において、
省略した前記一部の範囲に含まれる関数のうち所定の方法によって特定された関数を省略の対象外に決定する
ことを特徴とする請求項1又は2記載のテストデータ生成方法。
In the third process,
3. The test data generation method according to claim 1, wherein a function specified by a predetermined method among the functions included in the omitted partial range is determined to be excluded.
前記所定の方法が、
関数の呼び出し関係に基づき生成されるコールグラフにおいて最も下の階層に属する関数から順に特定するという方法である
ことを特徴とする請求項3記載のテストデータ生成方法。
The predetermined method is:
4. The test data generation method according to claim 3, wherein the test data is specified in order from a function belonging to the lowest layer in a call graph generated based on a function call relationship.
シンボリック実行の対象範囲のうち一部の範囲を省略して前記シンボリック実行を行い、当該シンボリック実行について網羅率を算出する第1処理と、
算出された前記網羅率が所定の値を超えたか判断する第2処理と、
算出された前記網羅率が前記所定の値を超えていない場合、省略された前記一部の範囲のうち少なくとも一部が省略の対象外になるように設定し、前記第1処理以降の処理を再度実行する第3処理と、
算出された前記網羅率が前記所定の値を超えた場合に、前記シンボリック実行により得られたパスの条件を満たす値を、第1データ格納部に格納する第4処理と、
をコンピュータに実行させるためのテストデータ生成プログラム。
A first process of performing a symbolic execution while omitting a part of a target range of the symbolic execution, and calculating a coverage rate for the symbolic execution;
A second process for determining whether the calculated coverage ratio exceeds a predetermined value;
If the calculated coverage ratio does not exceed the predetermined value, set so that at least a part of the omitted partial range is not subject to omission, and the processes after the first process are performed. A third process to be executed again;
A fourth process of storing, in the first data storage unit, a value that satisfies a path condition obtained by the symbolic execution when the calculated coverage rate exceeds the predetermined value;
A test data generation program for causing a computer to execute.
シンボリック実行の対象範囲のうち一部の範囲を省略して前記シンボリック実行を行い、当該シンボリック実行について網羅率を算出すると共に、算出された前記網羅率が所定の値を超えたか判断する第1処理部と、
算出された前記網羅率が前記所定の値を超えていない場合、省略された前記一部の範囲のうち少なくとも一部が省略の対象外になるように設定し、前記第1処理部に処理を再度実行させる第2処理部と、
算出させた前記網羅率が前記所定の値を超えた場合に、前記シンボリック実行により得られたパスの条件を満たす値を、第1データ格納部に格納する第3処理部と、
を有するテストデータ生成装置。
First processing for performing symbolic execution while omitting a part of the target range of symbolic execution, calculating a coverage rate for the symbolic execution, and determining whether the calculated coverage rate exceeds a predetermined value And
If the calculated coverage ratio does not exceed the predetermined value, at least a part of the omitted part of the range is set so as not to be omitted, and the first processing unit performs processing. A second processing unit to be executed again;
A third processing unit that stores, in the first data storage unit, a value that satisfies a path condition obtained by the symbolic execution when the calculated coverage rate exceeds the predetermined value;
A test data generating apparatus having
JP2012284450A 2012-12-27 2012-12-27 Test data generation method, program, and apparatus Expired - Fee Related JP5971116B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012284450A JP5971116B2 (en) 2012-12-27 2012-12-27 Test data generation method, program, and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012284450A JP5971116B2 (en) 2012-12-27 2012-12-27 Test data generation method, program, and apparatus

Publications (2)

Publication Number Publication Date
JP2014127091A JP2014127091A (en) 2014-07-07
JP5971116B2 true JP5971116B2 (en) 2016-08-17

Family

ID=51406511

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012284450A Expired - Fee Related JP5971116B2 (en) 2012-12-27 2012-12-27 Test data generation method, program, and apparatus

Country Status (1)

Country Link
JP (1) JP5971116B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10176086B2 (en) * 2016-10-03 2019-01-08 Fujitsu Limited Event-driven software test sequence determination
CN111026665B (en) * 2019-12-09 2023-02-28 建信金融科技有限责任公司 Test range analysis method, device and equipment
JP7474132B2 (en) 2020-06-24 2024-04-24 株式会社日立製作所 PROGRAM VERIFICATION DATA GENERATION SUPPORT DEVICE AND PROGRAM VERIFICATION DATA GENERATION SUPPORT METHOD

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5505227B2 (en) * 2010-09-22 2014-05-28 富士通株式会社 Repetitive symbolic execution method, program, and apparatus
US8869113B2 (en) * 2011-01-20 2014-10-21 Fujitsu Limited Software architecture for validating C++ programs using symbolic execution

Also Published As

Publication number Publication date
JP2014127091A (en) 2014-07-07

Similar Documents

Publication Publication Date Title
Xie et al. Quantitative fault-tolerance for reliable workflows on heterogeneous IaaS clouds
JP6003699B2 (en) Test data generation program, method and apparatus
Zhang et al. FastSV: A distributed-memory connected component algorithm with fast convergence
CN110362388B (en) Resource scheduling method and device
JP5971116B2 (en) Test data generation method, program, and apparatus
KR20150042874A (en) Sorting
KR20200062299A (en) Transaction selection device for selecting blockchain transactions
JP2017134582A (en) Graphic index search device and operation method for graphic index search device
CN110941451A (en) Data stream processor instruction mapping method, system and device
JP6323101B2 (en) Arrangement control program, method and apparatus
Choi et al. {EnvPipe}: Performance-preserving {DNN} training framework for saving energy
CN105701128A (en) Query statement optimization method and apparatus
KR20200128702A (en) Branch instruction trace
US20160196156A1 (en) Simulation apparatus, simulation method, and computer product
JP5505227B2 (en) Repetitive symbolic execution method, program, and apparatus
Ibrahim et al. Improving mapreduce performance with progress and feedback based speculative execution
JP3863544B1 (en) Arithmetic processing device and arithmetic processing method
US8984259B2 (en) Method, system, and computer program product for optimizing runtime branch selection in a flow process
JP2008171153A (en) Task management apparatus
CN115509926A (en) Multi-task scheduling cloud testing method based on improved particle swarm optimization
KR101470695B1 (en) Method and system of biogeography based optimization for grid computing scheduling
US8965826B2 (en) Dynamic backjumping in constraint satisfaction problem solving
Wu et al. Modeling the virtual machine launching overhead under fermicloud
JP6135466B2 (en) Test case extraction program, method and apparatus
JP6179524B2 (en) Execution control method and information processing apparatus

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150804

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160513

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20160627

R150 Certificate of patent or registration of utility model

Ref document number: 5971116

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees