JP6748357B2 - Analysis device, analysis program, and analysis method - Google Patents

Analysis device, analysis program, and analysis method Download PDF

Info

Publication number
JP6748357B2
JP6748357B2 JP2016185100A JP2016185100A JP6748357B2 JP 6748357 B2 JP6748357 B2 JP 6748357B2 JP 2016185100 A JP2016185100 A JP 2016185100A JP 2016185100 A JP2016185100 A JP 2016185100A JP 6748357 B2 JP6748357 B2 JP 6748357B2
Authority
JP
Japan
Prior art keywords
test
decision tree
node
result
mutation
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.)
Active
Application number
JP2016185100A
Other languages
Japanese (ja)
Other versions
JP2018049492A (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 JP2016185100A priority Critical patent/JP6748357B2/en
Publication of JP2018049492A publication Critical patent/JP2018049492A/en
Application granted granted Critical
Publication of JP6748357B2 publication Critical patent/JP6748357B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は解析装置、解析プログラムおよび解析方法に関する。 The present invention relates to an analysis device, an analysis program, and an analysis method.

ソフトウェア開発の現場では、ソフトウェアの品質向上を図るため、ソフトウェアのプログラムに対するテストが行われることがある。また、テスト自体の有効性が評価されることもある。例えば、テストの評価指標としてカバレッジ(網羅率)が挙げられる。カバレッジは、プログラム内の所定の箇所(行、分岐または条件など)がテストにより実行された割合である。カバレッジを向上させることで、テスト未実行のコードを減らせる。 In the field of software development, in order to improve the quality of software, the software program may be tested. In addition, the effectiveness of the test itself may be evaluated. For example, coverage (coverage rate) is an evaluation index of the test. Coverage is the percentage of times a test executed a given location (line, branch, condition, etc.) in a program. Improve coverage to reduce untested code.

例えば、カバレッジを向上させるために入力データを自動生成する検証支援装置の提案がある。この提案では、検証支援装置がソースコードを構文解析してデータ処理ノードおよび分岐処理ノードを含むグラフ構造を生成し、グラフ構造に基づいてプログラムの実行経路を抽出し、当該実行経路をプログラムに実行させるための入力データを生成する。 For example, there is a proposal of a verification support device that automatically generates input data in order to improve coverage. In this proposal, a verification support device parses a source code to generate a graph structure including a data processing node and a branch processing node, extracts a program execution path based on the graph structure, and executes the execution path to the program. Input data for generating is generated.

また、ソースコードが提供されずにバイナリデータしか手元にないソフトウェアに対しても、デバッガなどの装置を用いずに網羅試験を可能にする網羅試験装置の提案もある。
ところで、テストの他の評価手法として、ミューテーション解析と呼ばれる手法が用いられることがある。ミューテーション解析は、プログラムの1以上の要素を意図的に変化させることでプログラムにバグを埋め込み、テストが該当のバグをどの程度検出できるかを調べる手法である。ミューテーション解析では、例えば、プログラムにバグを埋め込んだ状態で所定の入力を与えたときの出力を確認し、テストがバグを検出できるかを確認することがある。
Further, there is also a proposal of an exhaustive testing apparatus that enables exhaustive testing without using a device such as a debugger, even for software in which source code is not provided and only binary data is available.
By the way, as another evaluation method of the test, a method called mutation analysis may be used. Mutation analysis is a method of embedding a bug in a program by intentionally changing one or more elements of the program and checking how much the test can detect the bug. In the mutation analysis, for example, the output when a predetermined input is given in a state where the bug is embedded in the program is checked, and it may be checked whether the test can detect the bug.

特開2016−18390号公報JP, 2016-18390, A 特開2016−146032号公報JP, 2016-146032, A

ミューテーション解析を行うために、ソースコードの変更箇所に対して変更内容を適用した変更後のソースコードをコンパイルし、コンパイル後のプログラムによりテストを実行することが考えられる。しかし、変更箇所(ミューテーション箇所)の組合せ毎に変更内容(ミューテーション内容)を適用したソースコードのコンパイルおよびテスト実行を個別に行っていると、解析に時間がかかるという問題がある。 In order to perform mutation analysis, it is possible to compile the modified source code in which the modified content is applied to the modified part of the source code and execute the test by the compiled program. However, if the source code to which the changed contents (mutation contents) are applied is separately compiled and the test is executed individually for each combination of changed parts (mutation parts), there is a problem that analysis takes time.

1つの側面では、本発明は、解析を高速化することを目的とする。 In one aspect, the invention aims to speed up the analysis.

1つの態様では、解析装置が提供される。解析装置は、記憶部と演算部とを有する。記憶部は、プログラムの入力に対する出力を確認する複数のテストケースを含むテストを行う際のプログラムの複数の変更箇所および複数の変更箇所それぞれの変更内容の情報を記憶する。演算部は、変更箇所の第1の組合せに対して変更内容を適用してテストを実行し、実行された変更箇所を終端ノード以外のノード、変更箇所の変更内容をエッジ、実行結果を終端ノードとした決定木の情報をテストケース毎に生成し、生成された複数の決定木に基づいて、テスト結果を未取得である変更箇所の第2の組合せに対して変更内容を適用した場合のテスト結果を決定する。 In one aspect, an analysis device is provided. The analysis device has a storage unit and a calculation unit. The storage unit stores a plurality of changed portions of the program when performing a test including a plurality of test cases for confirming the output with respect to the input of the program, and information on the changed contents of each of the plurality of changed portions. The arithmetic unit applies the change contents to the first combination of the changed parts and executes the test, and executes the executed changed part on a node other than the end node, the changed contents of the changed part on the edge, and the execution result on the end node. A test in which the information of the decision tree is generated for each test case, and the change contents are applied to the second combination of the changed portions for which the test result has not been acquired, based on the plurality of generated decision trees. Determine the result.

1つの側面では、解析を高速化できる。 In one aspect, the analysis can be speeded up.

第1の実施の形態の解析装置を示す図である。It is a figure which shows the analysis apparatus of 1st Embodiment. 第2の実施の形態の解析装置のハードウェア例を示す図である。It is a figure which shows the hardware example of the analysis apparatus of 2nd Embodiment. ミューテーション解析の例を示す図である。It is a figure which shows the example of mutation analysis. 解析装置の機能例を示す図である。It is a figure showing an example of a function of an analysis device. ソースコードの例を示す図である。It is a figure which shows the example of a source code. 置換後ソースコードの例を示す図である。It is a figure which shows the example of the source code after substitution. テストプログラムの例を示す図である。It is a figure which shows the example of a test program. ミューテーションオペレータリストの例を示す図である。It is a figure which shows the example of a mutation operator list. メタミューテーション情報の例を示す図である。It is a figure which shows the example of metamutation information. 中間コードの例を示す図である。It is a figure which shows the example of an intermediate code. 実行状態集合の例を示す図である。It is a figure which shows the example of an execution state set. ミュータント一覧の例を示す図である。It is a figure which shows the example of a mutant list. テスト結果テーブルの例を示す図である。It is a figure which shows the example of a test result table. 決定木の例を示す図である。It is a figure which shows the example of a decision tree. 各決定木のマージ結果の例を示す図である。It is a figure which shows the example of the merge result of each decision tree. ノード・エッジのコード例を示す図である。It is a figure which shows the code example of a node edge. 決定木のデータ例を示す図である。It is a figure which shows the data example of a decision tree. 結果レポートの出力例を示す図である。It is a figure which shows the output example of a result report. 解析装置の処理例を示すフローチャートである。It is a flow chart which shows the example of processing of an analysis device. 決定木作成処理例を示すフローチャートである。It is a flow chart which shows an example of decision tree creation processing. 初期化処理例を示すフローチャートである。6 is a flowchart showing an example of initialization processing. 決定木内部ノード追加処理例を示すフローチャートである。It is a flow chart which shows an example of a decision tree internal node addition processing. 決定木葉ノード追加処理例を示すフローチャートである。It is a flow chart which shows an example of decision tree leaf node addition processing. 決定木の現在位置特定処理例を示すフローチャートである。It is a flow chart which shows the current position specific processing example of a decision tree. 決定木マージ処理例を示すフローチャートである。It is a flow chart which shows an example of decision tree merge processing. 結果レポート出力処理例を示すフローチャートである。It is a flow chart which shows an example of result report output processing. 決定木の作成例(その1)を示す図である。It is a figure which shows the example (1) of creation of a decision tree. 決定木の作成例(その2)を示す図である。It is a figure which shows the example (2) of creation of a decision tree. 決定木の作成例(その3)を示す図である。It is a figure which shows the example (3) of creation of a decision tree. 決定木の作成例(その4)を示す図である。It is a figure which shows the example (4) of creation of a decision tree. 決定木の作成例(その5)を示す図である。It is a figure which shows the example of a decision tree creation (the 5). 決定木の作成例(その6)を示す図である。It is a figure which shows the example (6) of creation of a decision tree. 決定木の作成例(その7)を示す図である。It is a figure which shows the example of a decision tree creation (the 7). 決定木の作成例(その8)を示す図である。It is a figure which shows the example of a decision tree creation (the 8). 決定木の作成例(その9)を示す図である。It is a figure which shows the example (the 9) of creation of a decision tree. 決定木の作成例(その10)を示す図である。It is a figure which shows the example (10) of creation of a decision tree. 決定木のマージ例(その1)を示す図である。It is a figure which shows the merge example (the 1) of a decision tree. 決定木のマージ例(その2)を示す図である。It is a figure which shows the merge example (the 2) of a decision tree. 決定木のマージ例(その3)を示す図である。It is a figure which shows the merge example (the 3) of a decision tree. 決定木のマージ例(その4)を示す図である。It is a figure which shows the merge example (the 4) of a decision tree. 決定木を辿る例(その1)を示す図である。It is a figure which shows the example (the 1) which traces a decision tree. 決定木を辿る例(その2)を示す図である。It is a figure which shows the example (the 2) which traces a decision tree. テスト結果の取得例を示す図である。It is a figure which shows the acquisition example of a test result. SSEでは実行されないミュータントの例を示す図である。It is a figure which shows the example of the mutant which is not performed in SSE. テスト結果取得の比較例を示す図である。It is a figure which shows the comparative example of test result acquisition.

以下、本実施の形態について図面を参照して説明する。
[第1の実施の形態]
図1は、第1の実施の形態の解析装置を示す図である。解析装置1は、ソフトウェアのプログラムに対するテストを行う。解析装置1は、テストを行うとともに、ミューテーション解析の手法によりテスト自体の評価も行う。解析装置1は、テストの評価結果をユーザ(ソフトウェアの開発者)に提供し、ユーザによるテストの改善を支援する。
Hereinafter, the present embodiment will be described with reference to the drawings.
[First Embodiment]
FIG. 1 is a diagram showing an analyzing apparatus according to the first embodiment. The analysis apparatus 1 tests a software program. The analysis device 1 performs a test and also evaluates the test itself by a mutation analysis method. The analysis apparatus 1 provides the user (software developer) with the evaluation result of the test and assists the user in improving the test.

解析装置1は、記憶部1aおよび演算部1bを有する。
記憶部1aは、RAM(Random Access Memory)などの揮発性記憶装置でもよいし、HDD(Hard Disk Drive)やフラッシュメモリなどの不揮発性記憶装置でもよい。演算部1bは、CPU(Central Processing Unit)、DSP(Digital Signal Processor)、ASIC(Application Specific Integrated Circuit)、FPGA(Field Programmable Gate Array)などを含み得る。演算部1bはプログラムを実行するプロセッサでもよい。プロセッサは、複数のプロセッサの集合(マルチプロセッサ)を含み得る。解析装置1は、「コンピュータ」と呼ばれてもよい。
The analysis device 1 includes a storage unit 1a and a calculation unit 1b.
The storage unit 1a may be a volatile storage device such as a RAM (Random Access Memory) or a non-volatile storage device such as an HDD (Hard Disk Drive) or a flash memory. The calculation unit 1b may include a CPU (Central Processing Unit), a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), and the like. The calculation unit 1b may be a processor that executes a program. The processor may include a set of multiple processors (multiprocessor). The analysis device 1 may be called a “computer”.

記憶部1aは、ソースコードP1を記憶する。ソースコードP1は、テスト対象となるソフトウェアのプログラムの一例である。ソースコードP1は、例えば、整数型の関数funcを含む。関数funcには、整数型の値(x)が入力される。 The storage unit 1a stores the source code P1. The source code P1 is an example of a software program to be tested. The source code P1 includes, for example, an integer type function func. An integer type value (x) is input to the function func.

記憶部1aは、ソースコードP1において、バグを埋め込む変更箇所(ミューテーション箇所)を、ミューテーションを行う所定のメタミューテーション関数(以下、単にメタ関数と称することがある)で置換したソースコードP2を記憶する。このように変更箇所をメタ関数に置換し、事後的にミューテーション情報を与える手法は、MSG(Mutant Schema Generation)と呼ばれることもある。図1の例では各メタ関数は、3つの引数をもつ。第1引数は変更箇所の識別子である。第2引数は入力値(この例では何れも“x”)である。第3引数は演算に用いられる値である。例えば、ソースコードP2は、ソースコードP1に基づいて、演算部1bにより生成される。 The storage unit 1a has a source code P2 in which a changed portion (mutation portion) in which a bug is embedded in the source code P1 is replaced with a predetermined metamutation function (hereinafter, may be simply referred to as a metafunction) for performing a mutation. Memorize Such a method of replacing the changed portion with the meta function and subsequently providing the mutation information is also called MSG (Mutant Schema Generation). In the example of FIG. 1, each metafunction has three arguments. The first argument is the identifier of the changed part. The second argument is an input value (“x” in this example). The third argument is a value used in the calculation. For example, the source code P2 is generated by the calculation unit 1b based on the source code P1.

具体的には、ソースコードP2では、ソースコードP1の2行目の“x<0”という記述が、“bop_lt(1,x,0)”というメタ関数の記述に置換されている。メタ関数bop_lt(1,x,0)の第1引数“1”は変更箇所の識別子である。同第2引数“x”は入力値である。同第3引数“0”は入力値に対する比較演算に用いられる値である。例えば、メタ関数bop_ltは、関係演算子(比較演算子と呼ばれてもよい)“<”を“>=”に変更する。変更箇所“1”の変更内容は“<”を“>=”とすること、および、変更箇所“1”を変更しないこと(ここでは、“<”を“<”のままとすること)である。ここで、変更しないことを“nop”(Non-OPeration)と表記する。 Specifically, in the source code P2, the description "x<0" on the second line of the source code P1 is replaced with the description of the meta function "bop_lt(1,x,0)". The first argument “1” of the meta function bop_lt(1, x, 0) is the identifier of the changed part. The second argument “x” is an input value. The third argument “0” is a value used for a comparison operation on the input value. For example, the meta-function bop_lt changes a relational operator (which may also be called a comparison operator) “<” into “>=”. The change content of the changed part "1" is that "<" is set to ">=", and the changed part "1" is not changed (here, "<" remains "<"). is there. Here, not changing is referred to as “nop” (Non-OPeration).

また、ソースコードP2では、ソースコードP1の3行目の“x+1”という記述が、“bop_add(2,x,1)”というメタ関数の記述に置換されている。メタ関数bop_addは、算術演算子“+”(加算)を“−”(減算)に変更する。すなわち、変更箇所“2”の変更内容は“+”を“−”にすること、および、“nop”である。 In the source code P2, the description "x+1" on the third line of the source code P1 is replaced with the description of the meta function "bop_add(2, x, 1)". The meta function bop_add changes the arithmetic operator "+" (addition) to "-" (subtraction). That is, the changed contents of the changed portion "2" are "+" to "-" and "nop".

また、ソースコードP2では、ソースコードP1の4行目の“x>0”という記述が、“bop_gt(3,x,0)”というメタ関数の記述に置換されている。メタ関数bop_gtは、関係演算子“>”を“<=”に変更する。すなわち、変更箇所“3”の変更内容は“>”を“<=”に変更すること、および、“nop”である。 In the source code P2, the description "x>0" on the fourth line of the source code P1 is replaced with the description of the meta function "bop_gt(3,x,0)". The meta function bop_gt changes the relational operator “>” to “<=”. That is, the changed contents of the changed portion “3” are “>” is changed to “<=” and “nop”.

更に、ソースコードP2では、ソースコードP1の5行目の“x*2”という記述が、“bop_mul(4,x,2)”というメタ関数の記述に置換されている。メタ関数bop_mulは、算術演算子“*”(乗算)を“/”(除算)または“%”(剰余演算)に変更する。すなわち、変更箇所“4”の変更内容は、“*”を“/”や“%”に変更すること、および、“nop”である。ここで、関数funcのreturn命令による返り値は、整数に丸められることに注意されたい(例えば、演算“−1/2”の結果は整数“0”に丸められる)。 Further, in the source code P2, the description "x*2" on the fifth line of the source code P1 is replaced with the description of the meta function "bop_mul(4,x,2)". The meta-function bop_mul changes the arithmetic operator “*” (multiplication) to “/” (division) or “%” (modulo operation). That is, the changed contents of the changed portion “4” are “*” is changed to “/” and “%”, and “nop”. Note that the return value of the function func's return instruction is rounded to an integer (for example, the result of the operation "-1/2" is rounded to an integer "0").

上記のように、記憶部1aは、プログラムのテストを行う際のプログラムの複数の変更箇所および複数の変更箇所それぞれの変更内容の情報を記憶する。演算部1bは、ソースコードP2を用いてテストを実行することで、ソースコードP2のうち、実行経路に応じた変更箇所に変更内容が適用される。このため、実行経路に沿った変更箇所の組合せ(1以上の変更箇所を要素とする)に対して変更内容が適用されることになる。演算部1bは、ソースコードP2をコンパイルして生成された中間コードによりテストを実行してもよい(当該手法はBitcode Mutationと呼ばれることもある)。また、中間コードによるプログラムの実行状態に動的にミューテーション情報を与える手法は、Online Adaptation Techniqueと呼ばれることもある。更に、実行箇所で実行状態を分割し、当該実行箇所までの実行を共通化することで実行コストを減らす手法は、SSE(Split-Stream Execution)と呼ばれることもある。 As described above, the storage unit 1a stores information on a plurality of changed portions of the program when the program is tested and the change contents of each of the plurality of changed portions. The calculation unit 1b executes the test using the source code P2, so that the changed content is applied to the changed portion of the source code P2 according to the execution path. Therefore, the changed content is applied to a combination of changed portions along the execution path (one or more changed portions are elements). The calculation unit 1b may execute the test using the intermediate code generated by compiling the source code P2 (the method may be referred to as Bitcode Mutation). In addition, the technique of dynamically providing the mutation information to the execution state of the program by the intermediate code is also called Online Adaptation Technique. Further, a method of dividing the execution state at the execution location and sharing the execution up to the execution location to reduce the execution cost is also called SSE (Split-Stream Execution).

記憶部1aは、テストの内容を記述したテストプログラム(図1では図示を省略している)も記憶する。テストは、プログラムの入力に対する出力を確認する複数のテストケースを含む。図1では、テストは一例として3つのテストケースを含む。 The storage unit 1a also stores a test program (not shown in FIG. 1) that describes the contents of the test. The test includes a plurality of test cases that confirm the output to the input of the program. In FIG. 1, the test includes, by way of example, three test cases.

第1のテストケース(testcase1)は、func(0)==0である。すなわち、第1のテストケースは、関数funcにx=0を入力したとき、出力が確認値0になるか否かの確認である。 The first test case (testcase1) is func(0)==0. That is, the first test case is confirmation whether or not the output becomes the confirmation value 0 when x=0 is input to the function func.

第2のテストケース(testcase2)は、func(1)==2である。すなわち、第2のテストケースは、関数funcにx=1を入力したとき、出力が確認値2になるか否かの確認である。 The second test case (testcase2) is func(1)==2. That is, the second test case is confirmation whether the output becomes the confirmation value 2 when x=1 is input to the function func.

第3のテストケース(testcase3)は、func(−1)==0である。すなわち、第3のテストケースは、関数funcにx=−1を入力したとき、出力が確認値0になるか否かの確認である。 In the third test case (testcase3), func(-1)==0. That is, the third test case is confirmation whether the output becomes the confirmation value 0 when x=−1 is input to the function func.

演算部1bは、ソースコードP2を用いてテストを実行し、ミューテーション解析によりテストの評価を行う。
例えば、ある変更箇所の組合せに対して変更内容を適用したとき、3つのテストケースの少なくとも1つで確認値と異なる出力(Fail)となれば、当該テストにより、該当の変更箇所の組合せに対してバグを適切に検出できることになる。また、ある変更箇所の組合せに対して変更内容を適用したとき、3つのテストケースの何れも確認値と同じ出力(Pass)となれば、当該テストでは、該当の変更箇所の組合せに対してバグを適切に検出できないことになる。なお、バグを検出できることを示すテスト結果を“Killed”、バグを検出できないことを示すテスト結果を“Unkilled”と表記する。
The calculation unit 1b executes the test using the source code P2 and evaluates the test by mutation analysis.
For example, when the change content is applied to a certain combination of changed parts, if at least one of the three test cases produces an output (Fail) different from the confirmation value, the test causes the combination of the corresponding changed parts to be changed. Therefore, the bug can be properly detected. Also, when the change contents are applied to a certain combination of changed parts and all three test cases have the same output (Pass) as the confirmation value, in the test, a bug is generated for the combination of the corresponding changed parts. Will not be detected properly. A test result indicating that a bug can be detected is referred to as "Killed", and a test result indicating that a bug cannot be detected is referred to as "Unkilled".

演算部1bは、記憶部1aを参照して、変更箇所の第1の組合せに対して変更内容を適用してテストを実行する。演算部1bは、テストを実行しながら、実行された変更箇所を終端ノード以外のノード、変更箇所の変更内容(変更しない場合(nopの場合)を含む)をエッジ、実行結果を終端ノードとした決定木の情報をテストケース毎に生成する。すなわち、演算部1bは、各テストケースの実行中に、プログラム中の経由した変更箇所で変更内容毎(変更しなかった場合はnop)に枝分かれし、終端ノードに実行結果が格納される決定木を生成する。実行結果は、確認値と同じこと(すなわち、Pass)、または、確認値と異なること(すなわち、Fail)の何れかを示す。決定木は、有向グラフで表される。 The calculation unit 1b refers to the storage unit 1a, applies the changed content to the first combination of changed portions, and executes the test. While executing the test, the computing unit 1b sets the executed changed portion as a node other than the terminal node, the changed content of the changed portion (including the case of not changing (including nop)) as the edge, and the execution result as the terminal node. Information on the decision tree is generated for each test case. That is, the operation unit 1b branches during the execution of each test case into each change content (nop if no change is made) at the changed place in the program, and the execution result is stored in the terminal node. To generate. The execution result indicates either the same as the confirmation value (that is, Pass) or the difference from the confirmation value (that is, Fail). The decision tree is represented by a directed graph.

前述の例によれば、演算部1bは、第1のテストケースに対して、決定木T1の情報を生成する。演算部1bは、第2のテストケースに対して、決定木T2の情報を生成する。演算部1bは、第3のテストケースに対して、決定木T3の情報を生成する。例えば、識別情報“1”の変更箇所に対応するノードをノードm1とする。識別情報“2”の変更箇所に対応するノードをノードm2とする。識別情報“3”の変更箇所に対応するノードをノードm3とする。識別情報“4”の変更箇所に対応するノードをノードm4とする。以下、決定木T1の構造を具体的に説明する。 According to the above example, the calculation unit 1b generates information on the decision tree T1 for the first test case. The calculation unit 1b generates information on the decision tree T2 for the second test case. The calculation unit 1b generates information on the decision tree T3 for the third test case. For example, the node corresponding to the changed portion of the identification information “1” is the node m1. The node corresponding to the changed portion of the identification information “2” is node m2. A node corresponding to the changed portion of the identification information “3” is a node m3. A node corresponding to the changed portion of the identification information “4” is a node m4. The structure of the decision tree T1 will be specifically described below.

ノードm1は、“nop”に対応するエッジ、および、“>=”に対応するエッジを有する。決定木T1において、ノードm1の“nop”に対応するエッジの先は、ノードm3である。ノードm1の“>=”に対応するエッジの先はノードm2である。 The node m1 has an edge corresponding to “nop” and an edge corresponding to “>=”. In the decision tree T1, the edge of the edge corresponding to “nop” of the node m1 is the node m3. The tip of the edge corresponding to “>=” of the node m1 is the node m2.

ノードm2は、“nop”に対応するエッジ、および、“−”に対応するエッジを有する。決定木T1において、ノードm2の“nop”に対応するエッジの先、および、“−”に対応するエッジの先は、“Fail”に対応する終端ノードである。 The node m2 has an edge corresponding to “nop” and an edge corresponding to “−”. In the decision tree T1, the end of the edge corresponding to “nop” and the end of the edge corresponding to “−” of the node m2 are the end nodes corresponding to “Fail”.

ノードm3は、“nop”に対応するエッジ、および、“<=”に対応するエッジを有する。決定木T1において、ノードm3の“nop”に対応するエッジの先は、“Pass”に対応する終端ノードである。ノードm3の“<=”に対応するエッジの先は、ノードm4である。 The node m3 has an edge corresponding to “nop” and an edge corresponding to “<=”. In the decision tree T1, the tip of the edge corresponding to “nop” of the node m3 is the terminal node corresponding to “Pass”. The tip of the edge corresponding to “<=” of the node m3 is the node m4.

ノードm4は、“nop”に対応するエッジ、“/”に対応するエッジ、および、“%”に対応するエッジを有する。決定木T1において、ノードm4の“nop”に対応するエッジの先、“/”に対応するエッジの先、および、“%”に対応するエッジの先は、何れも“Pass”に対応する終端ノードである。 The node m4 has an edge corresponding to "nop", an edge corresponding to "/", and an edge corresponding to "%". In the decision tree T1, the end of the edge corresponding to “nop” of the node m4, the end of the edge corresponding to “/”, and the end of the edge corresponding to “%” are all terminations corresponding to “Pass”. It is a node.

決定木T2,T3も、第2,第3のテストケースによる実行経路に応じた構造をもつ。
なお、上記のテスト実行により、演算部1bは、変更箇所の幾つかの組合せに対しては、“Killed”または“Unkilled”を示すテスト結果を得られる。ただし、何れかのテストケースまたは全てのテストケースで実行されない経路に対する変更箇所の組合せも存在する。あるテストケースで実行されない経路に対する変更箇所の組合せがある場合、別のテストケースの実行結果が何れも“Pass”であると、該当の組合せに対するテスト結果が“Killed”なのか“Unkilled”なのか不明になる。また、全てのテストケースで実行されない経路に対する変更箇所の組合せがある場合、該当の組合せに対するテスト結果が“Killed”なのか“Unkilled”なのか不明になる。
The decision trees T2 and T3 also have a structure according to the execution paths by the second and third test cases.
By the above test execution, the calculation unit 1b can obtain a test result indicating "Killed" or "Unkilled" for some combinations of changed portions. However, there is also a combination of changed parts for paths that are not executed in any test case or all test cases. If there is a combination of changed parts for a route that is not executed in a certain test case, and the execution results of other test cases are all "Pass", whether the test result for that combination is "Killed" or "Unkilled" Become unknown. Further, when there is a combination of changed parts for a route that is not executed in all the test cases, it is unclear whether the test result for that combination is "Killed" or "Unkilled".

図1の例において、演算部1bは、上記のテスト実行では、例えば識別情報“1”,“2”の変更箇所を“nop”、識別情報“3”の変更箇所を“<=”、識別情報“4”の変更箇所を“/”とする組合せ(組合せAとする)に対するテスト結果を得られない。なぜなら、第1のテストケースでは、ソースコードP1(または、ソースコードP2)に組合せAの変更内容を適用した場合に実行結果が“Pass”となり、第2,第3のテストケースでは、組合せAの変更内容が同時に適用されることはないからである。 In the example of FIG. 1, in the test execution described above, the computing unit 1b identifies, for example, "nop" for the changed portions of the identification information "1" and "2", "<=" for the changed portions of the identification information "3", The test result cannot be obtained for the combination (the combination A) in which the changed portion of the information “4” is “/”. This is because, in the first test case, the execution result is “Pass” when the change content of the combination A is applied to the source code P1 (or the source code P2), and in the second and third test cases, the combination A This is because the changes in the above are not applied at the same time.

また、演算部1bは、例えば識別情報“1”の変更箇所を“>=”、識別情報“2”の変更箇所を“nop”、識別情報“3”の変更箇所を“<=”、識別情報“4”の変更箇所を“/”とする組合せ(組合せBとする)に対するテスト結果を得られない。なぜなら、第1,第2のテストケースでは、組合せBの変更内容が同時に適用されることはなく、第3のテストケースではソースコードP1(または、ソースコードP2)に組合せBの変更内容を適用した場合に実行結果が“Pass”となるからである。 Further, the calculation unit 1b, for example, identifies the changed portion of the identification information “1” as “>=”, the changed portion of the identification information “2” as “nop”, the changed portion of the identification information “3” as “<=”, and identifies the changed portion. The test result cannot be obtained for the combination (the combination B) in which the changed portion of the information “4” is “/”. This is because, in the first and second test cases, the changed contents of the combination B are not applied at the same time, and in the third test case, the changed contents of the combination B are applied to the source code P1 (or source code P2). This is because the execution result will be "Pass" when doing so.

演算部1bは、生成された複数の決定木(すなわち、決定木T1,T2,T3)に基づいて、テスト結果を未取得である変更箇所の第2の組合せに対して変更内容を適用した場合のテスト結果を決定する。具体的には、演算部1bは、Failを“0”、Passを“1”として扱い、決定木T1,T2,T3を論理積で統合(マージ)することで、統合後(マージ後)の決定木T4を生成する。演算部1bは、決定木T1,T2,T3のマージ処理に、二分決定図(OBDD:Ordered Binary Decision Diagram)のマージアルゴリズムを活用できる。例えば、演算部1bは、まず、決定木T2,T3をマージしてマージ後の決定木を生成し、更に作成したマージ後の決定木と決定木T1とをマージすることで、決定木T4を生成する。 When the calculation unit 1b applies the change content to the second combination of the changed portions for which the test result has not been acquired, based on the plurality of generated decision trees (that is, the decision trees T1, T2, T3) Determine the test results of. Specifically, the arithmetic unit 1b treats Fail as “0” and Pass as “1”, and integrates (merges) the decision trees T1, T2, and T3 with a logical product, so that after integration (after merging). A decision tree T4 is generated. The operation unit 1b can utilize the merge algorithm of the binary decision diagram (OBDD) for the merge processing of the decision trees T1, T2, T3. For example, the calculation unit 1b first merges the decision trees T2 and T3 to generate a merged decision tree, and further merges the created merged decision tree and the decision tree T1 to obtain the decision tree T4. To generate.

決定木T4は、決定木T1,T2,T3と同様に、ノードm1,m2,m3,m4と、“Pass”や“Fail”に対応するノードとを有する。ただし、図1中、決定木T4において、識別情報“2”の変更箇所に対応するノード(ノードm2)は2つ存在する(以下ではノードm2(1)、ノードm2(2)と表記して区別する)。決定木T4において、ノードm1の“nop”に対応するエッジの先は、ノードm2(1)である。ノードm1の“>=”に対応するエッジの先は、ノードm2(2)である。 The decision tree T4 has nodes m1, m2, m3, m4 and nodes corresponding to “Pass” and “Fail”, like the decision trees T1, T2, T3. However, in FIG. 1, in the decision tree T4, there are two nodes (node m2) corresponding to the changed portion of the identification information “2” (hereinafter referred to as node m2(1) and node m2(2). Distinguish). In the decision tree T4, the edge of the edge corresponding to the "nop" of the node m1 is the node m2(1). The tip of the edge corresponding to “>=” of the node m1 is the node m2(2).

決定木T4において、ノードm2(1)の“nop”に対応するエッジの先は、ノードm3である。ノードm2(1)の“−”に対応するエッジの先は“Fail”に対応する終端ノードである。また、ノードm2(2)の“nop”に対応するエッジの先、および、ノードm2(2)の“−”に対応するエッジの先は何れも“Fail”に対応する終端ノードである。 In the decision tree T4, the tip of the edge corresponding to “nop” of the node m2(1) is the node m3. The tip of the edge corresponding to "-" of the node m2(1) is the terminal node corresponding to "Fail". Further, both the tip of the edge corresponding to “nop” of the node m2(2) and the tip of the edge corresponding to “−” of the node m2(2) are end nodes corresponding to “Fail”.

決定木T4において、ノードm3の“nop”に対応するエッジの先は、ノードm4である。ノードm3の“<=”に対応するエッジの先は、“Fail”に対応する終端ノードである。 In the decision tree T4, the edge of the edge corresponding to the "nop" of the node m3 is the node m4. The end of the edge corresponding to “<=” of the node m3 is the terminal node corresponding to “Fail”.

決定木T4において、ノードm4の“nop”に対応するエッジの先は、“Pass”に対応する終端ノードである。ノードm4の“/”に対応するエッジの先、および、“%”に対応するエッジの先は、何れも“Fail”に対応する終端ノードである。 In the decision tree T4, the edge of the edge corresponding to “nop” of the node m4 is the terminal node corresponding to “Pass”. The tip of the edge corresponding to “/” and the tip of the edge corresponding to “%” of the node m4 are both terminal nodes corresponding to “Fail”.

そして、演算部1bは、決定木T4を辿ることで、テスト結果が未取得である第2の組合せ(例えば、前述の組合せA,B)に対するテスト結果を決定する。
1つの例として、前述の組合せAを考える。演算部1bは、決定木T4において、ノードm1の“nop”に対応するエッジ、ノードm2(1)の“nop”に対応するエッジ、ノードm3の“<=”に対応するエッジを順に辿ることで、“Fail”に対応する終端ノードに達する。よって、演算部1bは、組合せAに対するテスト結果を“Killed”と決定する。
Then, the calculation unit 1b determines the test result for the second combination (for example, the combination A and B described above) for which the test result has not been acquired by tracing the decision tree T4.
As an example, consider the combination A described above. In the decision tree T4, the computing unit 1b sequentially traces the edge corresponding to "nop" of the node m1, the edge corresponding to "nop" of the node m2(1), and the edge corresponding to "<=" of the node m3. Then, the terminal node corresponding to "Fail" is reached. Therefore, the calculation unit 1b determines the test result for the combination A as "Killed".

また、別の例として、前述の組合せBを考える。演算部1bは、決定木T4において、ノードm1の“>=”に対応するエッジ、ノードm2(2)の“nop”に対応するエッジを順に辿ることで、“Fail”に対応する終端ノードに達する。よって、演算部1bは、組合せBに対するテスト結果を“Killed”と決定する。 As another example, consider the combination B described above. In the decision tree T4, the calculation unit 1b sequentially traces the edge corresponding to “>=” of the node m1 and the edge corresponding to “nop” of the node m2(2), thereby obtaining the end node corresponding to “Fail”. Reach Therefore, the calculation unit 1b determines the test result for the combination B as "Killed".

演算部1bは、決定したテスト結果を、記憶部1aに出力(格納)する。演算部1bは、決定したテスト結果を、解析装置1に接続された表示装置(図1では図示を省略している)により表示させてもよい。また、演算部1bは、決定木T4により決定したテスト結果を考慮して、テスト対象とする変更箇所の複数の組合せのうち、テスト結果が“Killed”となる組合せの割合などをテストの評価指標として算出し、出力してもよい。 The calculation unit 1b outputs (stores) the determined test result to the storage unit 1a. The calculation unit 1b may display the determined test result on a display device (not shown in FIG. 1) connected to the analysis device 1. In addition, the calculation unit 1b considers the test result determined by the decision tree T4, and determines the ratio of the combination in which the test result is “Killed” among the plurality of combinations of the changed portions to be tested, as an evaluation index of the test. May be calculated and output.

例えば、上記のようにSSEの手法により、実行経路に応じたミューテーションを行うことも考えられる。この手法では、実行コストを削減できる半面、幾つかの変更箇所の組合せに対する変更が試行されないことがある。このため、ある変更箇所の組合せ(例えば、前述の組合せA,Bなど)に対してテスト結果を得られないことがある。 For example, it is conceivable to carry out the mutation according to the execution path by the SSE method as described above. This method can reduce the execution cost, but may not try to change a combination of some changes. Therefore, a test result may not be obtained for a certain combination of changed parts (for example, the above-mentioned combinations A and B).

この場合、解析装置1は、各テストケースに対して試行されていない変更箇所の組合せについて、個別に変更内容を適用したソースコードを用意し、コンパイルして、テスト実行することで該当の組合せに対するテスト結果を補完することが考えられる。しかし、このようにバグを埋め込んだソースコードを個別にコンパイル(ミュータント生成)し、テスト実行していると、解析に時間がかかるという問題がある。 In this case, the analysis device 1 prepares the source code to which the change contents are individually applied for the combination of the changed portions that has not been tried for each test case, compiles the same, and executes the test to execute the test for the corresponding combination. It is possible to supplement the test results. However, if the source code with the bugs embedded in this way is individually compiled (mutant generation) and the test is executed, there is a problem that analysis takes time.

そこで、解析装置1は、テストの実行時に決定木T1,T2,T3を生成し、決定木T1,T2,T3に基づいて、決定木T4を生成し、決定木T4を辿ることで、テスト結果を未取得である変更箇所の組合せに対するテスト結果を決定する。ここで、解析装置1の処理では、決定木T1,T2,T3の生成、および、マージといった処理コストが生じる。しかし、ミュータントを個別に生成して実行する処理コストと比べると、決定木T1,T2,T3の生成、および、マージの処理コストは十分に小さいと考えられる。 Therefore, the analysis device 1 generates the decision trees T1, T2, T3 at the time of executing the test, generates the decision tree T4 based on the decision trees T1, T2, T3, and traces the decision tree T4 to obtain the test result. Determine the test result for the combination of changes that has not been obtained. Here, in the processing of the analysis device 1, processing costs such as generation of the decision trees T1, T2, T3 and merging occur. However, it is considered that the processing costs of generating and merging the decision trees T1, T2, T3 are sufficiently small as compared with the processing cost of individually generating and executing the mutants.

こうして、解析装置1は、決定木T1,T2,T3に基づいて、テスト結果を未取得である変更箇所の組合せに対するテスト結果を決定することで、ミュータントを個別に生成して実行せずに済み、その分の実行時間を削減できる。これにより、解析装置1は、解析を高速化できる。以下では、より具体的な例を示し、解析装置1の機能を更に詳細に説明する。 In this way, the analysis device 1 determines the test result for the combination of the changed portions for which the test result has not been acquired based on the decision trees T1, T2, T3, and thus does not have to individually generate and execute the mutants. , The execution time can be reduced accordingly. Thereby, the analysis device 1 can speed up the analysis. Below, a more specific example is shown and the function of the analysis apparatus 1 is demonstrated still in detail.

[第2の実施の形態]
図2は、第2の実施の形態の解析装置のハードウェア例を示す図である。解析装置100は、プロセッサ101、RAM102、HDD103、画像信号処理部104、入力信号処理部105、媒体リーダ106および通信インタフェース107を有する。各ユニットは解析装置100のバスに接続されている。
[Second Embodiment]
FIG. 2 is a diagram illustrating a hardware example of the analysis device according to the second embodiment. The analysis device 100 includes a processor 101, a RAM 102, an HDD 103, an image signal processing unit 104, an input signal processing unit 105, a medium reader 106, and a communication interface 107. Each unit is connected to the bus of the analysis device 100.

プロセッサ101は、解析装置100の情報処理を制御する。プロセッサ101は、マルチプロセッサであってもよい。プロセッサ101は、例えばCPU、DSP、ASICまたはFPGAなどである。プロセッサ101は、CPU、DSP、ASIC、FPGAなどのうちの2以上の要素の組合せであってもよい。 The processor 101 controls information processing of the analysis device 100. The processor 101 may be a multiprocessor. The processor 101 is, for example, a CPU, DSP, ASIC, FPGA, or the like. The processor 101 may be a combination of two or more elements among a CPU, DSP, ASIC, FPGA, and the like.

RAM102は、解析装置100の主記憶装置である。RAM102は、プロセッサ101に実行させるOS(Operating System)のプログラムやアプリケーションプログラムの少なくとも一部を一時的に記憶する。また、RAM102は、プロセッサ101による処理に用いる各種データを記憶する。 The RAM 102 is a main storage device of the analysis device 100. The RAM 102 temporarily stores at least part of an OS (Operating System) program and an application program to be executed by the processor 101. The RAM 102 also stores various data used for processing by the processor 101.

HDD103は、解析装置100の補助記憶装置である。HDD103は、内蔵した磁気ディスクに対して、磁気的にデータの書き込みおよび読み出しを行う。HDD103は、OSのプログラム、アプリケーションプログラム、および各種データを記憶する。解析装置100は、フラッシュメモリやSSD(Solid State Drive)などの他の種類の補助記憶装置を備えてもよく、複数の補助記憶装置を備えてもよい。 The HDD 103 is an auxiliary storage device of the analysis device 100. The HDD 103 magnetically writes and reads data to and from the built-in magnetic disk. The HDD 103 stores an OS program, application programs, and various data. The analysis apparatus 100 may include another type of auxiliary storage device such as a flash memory or an SSD (Solid State Drive), or may include a plurality of auxiliary storage devices.

画像信号処理部104は、プロセッサ101からの命令に従って、解析装置100に接続されたディスプレイ11に画像を出力する。ディスプレイ11としては、CRT(Cathode Ray Tube)ディスプレイや液晶ディスプレイなどを用いることができる。 The image signal processing unit 104 outputs an image to the display 11 connected to the analysis device 100 according to an instruction from the processor 101. As the display 11, a CRT (Cathode Ray Tube) display, a liquid crystal display, or the like can be used.

入力信号処理部105は、解析装置100に接続された入力デバイス12から入力信号を取得し、プロセッサ101に出力する。入力デバイス12としては、例えば、マウスやタッチパネルなどのポインティングデバイス、キーボードなどを用いることができる。 The input signal processing unit 105 acquires an input signal from the input device 12 connected to the analysis device 100 and outputs the input signal to the processor 101. As the input device 12, for example, a pointing device such as a mouse or a touch panel, a keyboard or the like can be used.

媒体リーダ106は、記録媒体13に記録されたプログラムやデータを読み取る装置である。記録媒体13として、例えば、フレキシブルディスク(FD:Flexible Disk)やHDDなどの磁気ディスク、CD(Compact Disc)やDVD(Digital Versatile Disc)などの光ディスク、光磁気ディスク(MO:Magneto-Optical disk)を使用できる。また、記録媒体13として、例えば、フラッシュメモリカードなどの不揮発性の半導体メモリを使用することもできる。媒体リーダ106は、例えば、プロセッサ101からの命令に従って、記録媒体13から読み取ったプログラムやデータをRAM102またはHDD103に格納する。 The medium reader 106 is a device that reads a program or data recorded in the recording medium 13. As the recording medium 13, for example, a magnetic disk such as a flexible disk (FD: Flexible Disk) or an HDD, an optical disk such as a CD (Compact Disc) or a DVD (Digital Versatile Disc), or a magneto-optical disk (MO: Magneto-Optical disk). Can be used. Further, as the recording medium 13, for example, a non-volatile semiconductor memory such as a flash memory card can be used. The medium reader 106 stores the program or data read from the recording medium 13 in the RAM 102 or the HDD 103 according to an instruction from the processor 101, for example.

通信インタフェース107は、ネットワーク14を介して他の装置と通信を行う。通信インタフェース107は、有線通信インタフェースでもよいし、無線通信インタフェースでもよい。 The communication interface 107 communicates with other devices via the network 14. The communication interface 107 may be a wired communication interface or a wireless communication interface.

図3は、ミューテーション解析の例を示す図である。ここでは、テスト対象のプログラムP10を用いて、解析装置100によるミューテーション解析を例示する。プログラムP10は、関数absの記述を含む。ここで、ミューテーション解析とは、プログラムの1要素を変化させることでバグを埋め込み、テストが埋め込んだバグをどれだけ検出できるかを調べる手法である。バグが埋め込まれたプログラムは「ミュータント」と呼ばれる。ミュータントは、例えば、(ミューテーション箇所,ミューテーション内容)の組(ミューテーション記述子)で表される。 FIG. 3 is a diagram illustrating an example of mutation analysis. Here, the mutation analysis by the analysis device 100 is illustrated using the program P10 to be tested. The program P10 includes a description of the function abs. Here, the mutation analysis is a method of embedding a bug by changing one element of the program and checking how much the embedded bug can be detected by the test. A program with a bug embedded is called a "mutant". The mutant is represented by, for example, a set (mutation descriptor) of (mutation location, mutation content).

具体的には、プログラムP11は、プログラムP10の2行目に含まれる“<=”の記述を、“>”に変化させたミュータントである。プログラムP11の識別名は“mutant1”である。 Specifically, the program P11 is a mutant in which the description of “<=” included in the second line of the program P10 is changed to “>”. The identification name of the program P11 is "mutant1".

また、プログラムP12は、プログラムP10の2行目に含まれる“0”の記述を、“1”に変化させたミュータントである。プログラムP12の識別名は“mutant2”である。 The program P12 is a mutant in which the description of "0" included in the second line of the program P10 is changed to "1". The identification name of the program P12 is "mutant2".

更に、プログラムP13は、プログラムP10の3行目に含まれる“−”の記述を、“−−”に変化させたミュータントである。プログラムP13の識別名は“mutant3”である。 Further, the program P13 is a mutant in which the description of "-" included in the third line of the program P10 is changed to "---". The identification name of the program P13 is "mutant3".

図3の例では、2つのテストケースを考える。第1のテストケース(Testcase1)は、abs(2)==2である。すなわち、第1のテストケースは、関数absにx=2を入力したとき、出力が“2”になるか否かを確認する。abs(2)==2が成立すれば“Pass”、成立しなければ“Fail”である。 In the example of FIG. 3, consider two test cases. The first test case (Testcase1) is abs(2)==2. That is, the first test case confirms whether or not the output becomes “2” when x=2 is input to the function abs. If abs(2)==2 holds, it is "Pass", and if not, "Fail".

第2のテストケース(Testcase2)は、abs(−2)==2である。すなわち、第2のテストケースは、関数absにx=−2を入力したとき、出力が“2”になるか否かを確認する。abs(−2)==2が成立すれば“Pass”、成立しなければ“Fail”である。 The second test case (Testcase2) is abs(-2)==2. That is, the second test case confirms whether the output becomes “2” when x=−2 is input to the function abs. If abs(−2)==2 is satisfied, it is “Pass”, and if not, “Fail”.

プログラムP11では、第1,第2のテストケースの何れも実行結果はFailである。プログラムP12では、第1のテストケースの実行結果はPass、第2のテストケースの実行結果はPassである。プログラムP13では、第1のテストケースの実行結果はPass、第2のテストケースの実行結果はFailである。 In the program P11, the execution result of both the first and second test cases is Fail. In the program P12, the execution result of the first test case is Pass, and the execution result of the second test case is Pass. In the program P13, the execution result of the first test case is Pass and the execution result of the second test case is Fail.

この場合、第1のテストケースおよび第2のテストケースにより、プログラムP11に埋め込まれたバグを検出できることになる。したがって、プログラムP11に対するテスト結果はKilledである。 In this case, the bugs embedded in the program P11 can be detected by the first test case and the second test case. Therefore, the test result for the program P11 is Killed.

また、第1のテストケースおよび第2のテストケースでは、プログラムP12に埋め込まれたバグを検出できないことになる。したがって、プログラムP12に対するテスト結果はUnkilledである。 Further, in the first test case and the second test case, the bug embedded in the program P12 cannot be detected. Therefore, the test result for the program P12 is Unkilled.

更に、第2のテストケースにより、プログラムP13に埋め込まれたバグを検出できることになる。したがって、プログラムP13に対するテスト結果はKilledである。
例えば、解析装置100は、検出されたバグの割合(ミューテーションスコア(mutation score))を算出し出力する。この場合、ミューテーションスコアは、2/3=0.667である。ソフトウェアの開発者は、ミューテーションスコアを向上させるようにテストケースを改善することで、テストの信頼性を向上させることができる。
In addition, the second test case makes it possible to detect a bug embedded in the program P13. Therefore, the test result for the program P13 is Killed.
For example, the analysis device 100 calculates and outputs the ratio of detected bugs (mutation score). In this case, the mutation score is 2/3=0.667. Software developers can improve test reliability by improving test cases to improve mutation scores.

なお、図3の例では、1つの変更(ミューテーション)が適用されたプログラムP11,P12,P13を例示した。このようなプログラムは、1次ミュータント(FOM:First Order Mutant)と呼ばれる。また、FOMを組み合わせることで、2つ以上のミューテーションが適用されたプログラムを考えることもできる。2つ以上のミューテーションが適用されたプログラムは、高次ミュータント(HOM:High Order Mutant)と呼ばれる。 Note that the example of FIG. 3 illustrates the programs P11, P12, and P13 to which one change (mutation) is applied. Such a program is called a first order mutant (FOM). Further, by combining FOM, it is possible to consider a program to which two or more mutations are applied. A program to which two or more mutations are applied is called a high order mutant (HOM).

ミュータント解析では、ミュータントを網羅的に生成し、テスト実行していると、テストに時間がかかる。例えば、コンパイルやテスト実行に要する時間を考慮すると、複数のミュータントに対するテストの合計時間は次の式で表される。 In the mutant analysis, if the mutants are comprehensively generated and the test is executed, the test takes a long time. For example, considering the time required for compilation and test execution, the total test time for a plurality of mutants is expressed by the following equation.

合計時間=(ミュータント数)*(ミューテーション時間+コンパイル時間)+(ミュータント数)*(テストケース数)*(テストケース1つ当たりの平均実行時間)
そこで、通常のミューテーションの代わりに、プログラムのミューテーション箇所を、ミューテーションを行うメタ関数に置き換え、ミューテーション用のパラメータを事後的に与えることで、コンパイルのコストを抑える手法(MSG)がある。MSGでは、メタ関数に置換後のプログラムを1回コンパイルすればよい。MSGについては、文献“Mutation Analysis Using Mutant Schemata, Untch, Offutt, and Harrold, ISSTA, 1993”が参考になる。
Total time = (number of mutants) * (mutation time + compile time) + (number of mutants) * (number of test cases) * (average execution time per test case)
Therefore, there is a method (MSG) that suppresses the compile cost by replacing the normal mutation by replacing the mutation part of the program with a metafunction that performs the mutation and giving the mutation parameter afterwards. .. In MSG, the program after replacement with the metafunction may be compiled once. For MSG, the document “Mutation Analysis Using Mutant Schemata, Untch, Offutt, and Harrold, ISSTA, 1993” can be referred to.

また、ソースコードからコンパイルされたビットコードに対してミューテーションを行うことでコンパイル回数を減らす手法(Bitcode Mutation)もある。Bitcode Mutationについては、文献“Mujava: An Automated Class Mutation System, Mar, Offutt, and Kwon, STVR, 2005”が参考になる。 There is also a method (Bitcode Mutation) that reduces the number of compilations by performing mutation on the bit code compiled from the source code. For the Bitcode Mutation, refer to the document “Mujava: An Automated Class Mutation System, Mar, Offutt, and Kwon, STVR, 2005”.

更に、Online Adaptation Techniqueと呼ばれる手法により、実行状態に動的にミューテーション情報を与えることで、冗長なミュータントの実行を回避し、実行時間を短縮することもある。特に、SSEでは、プログラムの実行箇所で実行状態を分割し、当該実行箇所までの実行を共通化することで実行コストを減らせる。SSEでは、HOM生成を考慮すると、実行状態は多段に分割されることになる。 Furthermore, a method called Online Adaptation Technique may be used to dynamically provide the execution state with mutation information, thereby avoiding execution of redundant mutants and shortening the execution time. In particular, in SSE, the execution state can be divided at the execution points of the program, and the execution up to the execution points can be shared to reduce the execution cost. In SSE, the execution state is divided into multiple stages in consideration of HOM generation.

ただし、Online AdaptationおよびSSEを用いることで、実行コストを減らせる半面、冗長なHOMが実行されず、当該HOMに対するKilled/Unkilledのテスト結果が不明になることがある。なお、SSEで実行されないミュータントを図44で例示する。ただし、省略されたHOMもkillされる可能性はある。そこで、解析装置100は、テスト結果を得られていないHOMに対して効率的にテスト結果を取得する機能を提供する。 However, by using Online Adaptation and SSE, the execution cost can be reduced, but the redundant HOM is not executed, and the Killed/Unkilled test result for the HOM may become unknown. Note that a mutant that is not executed in SSE is illustrated in FIG. However, the omitted HOM may be killed. Therefore, the analysis apparatus 100 provides a function for efficiently obtaining the test result for the HOM for which the test result has not been obtained.

図4は、解析装置の機能例を示す図である。解析装置100は、記憶部110、メタ関数置換部120、コンパイラ130、決定木作成部140、決定木マージ部150および結果出力部160を有する。 FIG. 4 is a diagram illustrating an example of functions of the analysis device. The analysis device 100 includes a storage unit 110, a metafunction replacement unit 120, a compiler 130, a decision tree creation unit 140, a decision tree merge unit 150, and a result output unit 160.

記憶部110は、RAM102またはHDD103の所定の記憶領域により実現される。メタ関数置換部120、コンパイラ130、決定木作成部140、決定木マージ部150および結果出力部160は、RAM102に記憶されたプログラムをプロセッサ101により実行することで実現される。 The storage unit 110 is realized by a predetermined storage area of the RAM 102 or the HDD 103. The metafunction replacing unit 120, the compiler 130, the decision tree creating unit 140, the decision tree merging unit 150, and the result output unit 160 are realized by the processor 101 executing the programs stored in the RAM 102.

記憶部110は、ソースコードおよび置換後ソースコードを記憶する。置換後ソースコードは、ソースコード内のミューテーション箇所の記述をメタ関数に置換したものである。また、記憶部110は、置換後ソースコードをコンパイルして生成されたプログラムを記憶する。当該プログラムは、例えば、LLVM(Low Level Virtual Machine)ビットコードである。更に、記憶部110は、テスト内容を記述したテストプログラム、および、ミューテーション内容を示すミューテーションオペレータリストを記憶する。なお、ソースコード、置換後ソースコード、LLVMビットコード、テストプログラムおよびミューテーションオペレータリストは、解析装置100の外部の記憶装置に記憶されてもよい。 The storage unit 110 stores the source code and the source code after replacement. The replaced source code is a description in which the description of the mutation portion in the source code is replaced with a metafunction. The storage unit 110 also stores a program generated by compiling the replaced source code. The program is, for example, an LLVM (Low Level Virtual Machine) bit code. Further, the storage unit 110 stores a test program describing the test content and a mutation operator list indicating the mutation content. The source code, the replaced source code, the LLVM bit code, the test program, and the mutation operator list may be stored in a storage device external to the analysis device 100.

記憶部110は、メタミューテーション情報、ミュータント一覧、実行状態集合、決定木およびテスト結果テーブルを記憶する。メタミューテーション情報は、メタ関数に置換されたソースコードの位置を管理するための情報である。ミュータント一覧は、ミュータントの一覧の情報である。実行状態集合は、プログラム実行に伴う実行状態の記録に用いられる情報である。決定木は、テストによるプログラムの実行結果を、実行により辿ったミュータント箇所とともに記録した情報である。テスト結果テーブルは、各ミュータントに対するテスト結果を記録するための情報である。 The storage unit 110 stores metamutation information, a mutant list, an execution state set, a decision tree, and a test result table. The metamutation information is information for managing the position of the source code replaced with the metafunction. The mutant list is information on a list of mutants. The execution state set is information used to record the execution state associated with program execution. The decision tree is information in which the execution result of the program by the test is recorded together with the mutant portion traced by the execution. The test result table is information for recording the test result for each mutant.

メタ関数置換部120は、ソースコードの所定の演算に関する記述を、メタ関数に置換することで、置換後ソースコードを生成し、記憶部110に格納する。また、メタ関数置換部120は、当該置換に応じて、メタミューテーション情報およびミュータント一覧を生成し、記憶部110に格納する。 The meta-function replacing unit 120 replaces the description related to the predetermined operation of the source code with the meta-function to generate the replaced source code and stores it in the storage unit 110. Further, the meta function replacement unit 120 generates meta mutation information and a mutant list according to the replacement, and stores the meta mutation information and the mutant list in the storage unit 110.

コンパイラ130は、記憶部110に記憶された置換後ソースコードをコンパイルして、中間コードのプログラム(LLVMビットコード)を生成し、記憶部110に格納する。 The compiler 130 compiles the source code after replacement stored in the storage unit 110 to generate an intermediate code program (LLVM bit code), and stores the intermediate code program (LLVM bit code) in the storage unit 110.

決定木作成部140は、記憶部110に記憶された中間コードのプログラムに対して、テストプログラムに基づくテストを実行する。決定木作成部140は、SSEの手法を用いてテストを実行する。このとき、決定木作成部140は、記憶部110に記憶されたミューテーションオペレータリストに従って、ミューテーション箇所に対するミューテーションを行いながら、決定木の作成およびプログラムの実行状態の記録を行う。決定木作成部140は、テストケース毎に、決定木の作成を行う。決定木作成部140は、作成した決定木の情報を記憶部110に格納する。 The decision tree creating unit 140 executes a test based on the test program on the intermediate code program stored in the storage unit 110. The decision tree creating unit 140 executes the test using the SSE method. At this time, the decision tree creating unit 140 creates a decision tree and records the execution state of the program while performing mutation on the mutation location according to the mutation operator list stored in the storage unit 110. The decision tree creating unit 140 creates a decision tree for each test case. The decision tree creation unit 140 stores the created decision tree information in the storage unit 110.

決定木マージ部150は、記憶部110に記憶されたテストケース毎の決定木をマージする。決定木マージ部150は、決定木のマージに、OBDDのマージアルゴリズムを用いる。当該マージアルゴリズムについて、文献“Merging Ordered Binary Decision Diagrams, http://www.cs.engr.uky.edu/〜lewis/papers/merge‐alg.pdf, 2016年9月7日検索”が参考になる。決定木マージ部150は、“Fail”を“0”、“Pass”を“1”として扱い、決定木f(m1,m2,・・・mn)(nは正の整数)と決定木g(m1,m2,・・・,mn)とマージして決定木h(m1,m2,・・・,mn)を作成する(mnはノードを示す)。より具体的には、決定木マージ部150は、決定木f,g内のノードを深さ優先で選択してミューテーションオペレータを割当て、その順に決定木hのノードとエッジとを作成する。決定木マージ部150は、決定木fまたは決定木gの少なくとも何れかがFailになったら、決定木hのその時点のノードからFailのノードへのエッジを作成する(詳細は後述される)。決定木マージ部150は、マージにより得られた決定木の情報を、記憶部110に格納する。 The decision tree merging unit 150 merges the decision trees for each test case stored in the storage unit 110. The decision tree merging unit 150 uses the OBDD merge algorithm for merging the decision trees. Regarding the merge algorithm, reference is made to the document “Merging Ordered Binary Decision Diagrams, http://www.cs.engr.uky.edu/~lewis/papers/merge-alg.pdf, September 7, 2016 search”. .. The decision tree merging unit 150 treats “Fail” as “0” and “Pass” as “1”, and determines the decision tree f(m1, m2,... mn) (n is a positive integer) and the decision tree g( , mn) to create a decision tree h(m1, m2,..., mn) (mn indicates a node). More specifically, the decision tree merging unit 150 selects nodes in the decision trees f and g with depth priority, assigns mutation operators, and creates the nodes and edges of the decision tree h in that order. When at least either the decision tree f or the decision tree g becomes Fail, the decision tree merging unit 150 creates an edge from the node of the decision tree h at that point in time to the Fail node (details will be described later). The decision tree merging unit 150 stores information on the decision tree obtained by the merging in the storage unit 110.

結果出力部160は、記憶部110に記憶されたミュータント一覧を参照して、記憶部110に記憶されたマージ後の決定木を辿ることで、各ミュータントに対するテスト結果を決定し、ミューテーションスコアの計算を行う。結果出力部160は、ミューテーションスコアの計算結果を含む結果レポートを、ディスプレイ11に表示させる。結果出力部160は、テストで検出できなかった(killできなかった)ミュータントをディスプレイ11によりリスト表示させる。結果出力部160は、リスト表示されたミュータントのうちの何れかがユーザにより選択されると、記憶部110に記憶されたメタミュータント情報を参照して、選択されたミュータントに対応するソースコードの該当箇所をユーザに提示する。 The result output unit 160 determines the test result for each mutant by referring to the mutant list stored in the storage unit 110 and following the merged decision tree stored in the storage unit 110 to determine the mutation score. Calculate. The result output unit 160 causes the display 11 to display a result report including the calculation result of the mutation score. The result output unit 160 causes the display 11 to display a list of mutants that could not be detected (cannot be killed) in the test. When any one of the mutants displayed in the list is selected by the user, the result output unit 160 refers to the metamutant information stored in the storage unit 110 to find the corresponding source code corresponding to the selected mutant. Present the location to the user.

図5は、ソースコードの例を示す図である。ソースコード111は、ユーザにより解析装置100に入力され、記憶部110に格納される。ソースコード111は、C言語による整数型の関数funcの記述を含む。関数funcは、整数型の入力値(x)に対する演算を行う関数である。 FIG. 5 is a diagram showing an example of the source code. The source code 111 is input to the analysis device 100 by the user and stored in the storage unit 110. The source code 111 includes a description of an integer type function func in C language. The function func is a function that performs an operation on an integer type input value (x).

図6は、置換後ソースコードの例を示す図である。置換後ソースコード112は、ソースコード111に基づいて、メタ関数置換部120により生成され、記憶部110に格納される。置換後ソースコード112は、メタ関数を含む。本例では、メタ関数は、3つの引数をもつ。第1引数は変更箇所の識別子(MMID:Meta Mutation IDentifier)である。第2引数は入力値(この例では何れも“x”)である。第3引数は演算に用いられる値である。 FIG. 6 is a diagram showing an example of the source code after replacement. The replaced source code 112 is generated by the metafunction replacing unit 120 based on the source code 111 and stored in the storage unit 110. The replaced source code 112 includes a metafunction. In this example, the metafunction has three arguments. The first argument is an identifier (MMID: Meta Mutation IDentifier) of the changed part. The second argument is an input value (“x” in this example). The third argument is a value used in the calculation.

具体的には、置換後ソースコード112では、ソースコード111の2行目の“x < 0”という記述が、“bop_lt(1,x,0)”というメタ関数の記述に置換されている。メタ関数bop_lt(1,x,0)の第1引数“1”はMMIDである。同第2引数“x”は入力値である。同第3引数“0”は入力値に対する比較演算に用いられる値である。メタ関数bop_ltは、関係演算子“<”を“>=”へ変更するミューテーションを行う。 Specifically, in the post-replacement source code 112, the description “x<0” on the second line of the source code 111 is replaced with the description of the meta function “bop_lt(1,x,0)”. The first argument “1” of the meta function bop_lt(1,x,0) is the MMID. The second argument “x” is an input value. The third argument “0” is a value used for a comparison operation on the input value. The meta function bop_lt performs a mutation that changes the relational operator “<” to “>=”.

また、置換後ソースコード112では、ソースコード111の3行目の“x + 1”という記述が、“bop_add(2,x,1)”というメタ関数の記述に置換されている。メタ関数bop_addは、算術演算子“+”を“−”へ変更するミューテーションを行う。 In the post-replacement source code 112, the description "x+1" on the third line of the source code 111 is replaced with the description of the metafunction "bop_add(2,x,1)". The meta function bop_add performs a mutation that changes the arithmetic operator "+" to "-".

また、置換後ソースコード112では、ソースコード111の4行目の“x > 0”という記述が、“bop_gt(3,x,0)”というメタ関数の記述に置換されている。メタ関数bop_gtは、関係演算子“>”を“<=”へ変更するミューテーションを行う。 Further, in the post-replacement source code 112, the description “x>0” on the fourth line of the source code 111 is replaced with the description of the metafunction “bop_gt(3,x,0)”. The meta function bop_gt performs a mutation that changes the relational operator “>” to “<=”.

更に、ソースコード112では、ソースコード111の5行目の“x * 2”という記述が、“bop_mul(4,x,2)”というメタ関数の記述に置換されている。メタ関数bop_mulは、算術演算子“*”を“/”および“%”へ変更するミューテーションを行う。 Further, in the source code 112, the description “x*2” on the fifth line of the source code 111 is replaced with the description of the metafunction “bop_mul(4,x,2)”. The meta function bop_mul performs a mutation that changes the arithmetic operator “*” to “/” and “%”.

ここで、関数funcのreturn命令による返り値は、整数に丸められることに注意されたい(例えば、演算“−1/2”の結果は0に丸められる)。
図7は、テストプログラムの例を示す図である。テストプログラム113は、ユーザにより解析装置100に入力され、記憶部110に格納される。テストプログラム113は、3つのテストケースを含む。第1のテストケース(testcase1)は、func(0)==0が成立するか否か(関数funcに0を入力したときの関数funcの出力が確認値0に一致するか否か)を確認することを示す。第2のテストケース(testcase2)は、func(1)==2が成立するか否かを確認することを示す。第3のテストケース(testcase3)は、func(−1)==0が成立するか否かを確認することを示す。
Note that the return value of the function func's return instruction is rounded to an integer (for example, the result of the operation "-1/2" is rounded to 0).
FIG. 7 is a diagram showing an example of a test program. The test program 113 is input to the analysis device 100 by the user and stored in the storage unit 110. The test program 113 includes three test cases. The first test case (testcase1) checks whether func(0)==0 holds (whether the output of the function func when 0 is input to the function func matches the check value 0). Indicates that The second test case (testcase2) indicates checking whether func(1)==2 holds. The third test case (testcase3) indicates checking whether func(-1)==0 holds.

図8は、ミューテーションオペレータリストの例を示す図である。ミューテーションオペレータリスト114は、ユーザにより解析装置100に入力され、記憶部110に格納される。ミューテーションオペレータリスト114は、テスト時に適用するミューテーションオペレータのリストである。 FIG. 8 is a diagram showing an example of a mutation operator list. The mutation operator list 114 is input to the analysis device 100 by the user and stored in the storage unit 110. The mutation operator list 114 is a list of mutation operators applied during the test.

OSSNは、Shift operator mutationであり、シフト演算子のミューテーション(例えば、左シフト演算“<<=”を右シフト演算“>>=”に変更するミューテーション)を行うことを示す。 OSSN is a shift operator mutation, and indicates that a mutation of a shift operator (for example, a mutation that changes a left shift operation “<<=” to a right shift operation “>>>=”) is performed.

ORRNは、Relational operator mutationであり、関係演算子のミューテーション(例えば、“>”を“<=”に変更するミューテーション)を行うことを示す。
OIDOは、Increment/Decrement Replacementであり、加算と減算とを変更するミューテーション(例えば、“++”や“+1”を、“−−”や“−1”に変更するミューテーション)を行うことを示す。
ORRN is Relational operator mutation, and indicates that mutation of a relational operator (for example, mutation that changes “>” to “<=”) is performed.
OIDO is Increment/Decrement Replacement, and performs a mutation that changes addition and subtraction (for example, a mutation that changes “++” or “+1” into “−−” or “−1”). Show.

OAANは、Arithmetic operator mutationであり、乗算を除算や剰余を取得する演算に変更するミューテーション(例えば、“*”を、“/”や“%”に変更するミューテーション)を行うことを示す。 OAAN is Arithmetic operator mutation, and indicates that a mutation that changes multiplication into an operation that obtains a division or a remainder (for example, a mutation that changes “*” to “/” or “%”) is performed.

ミューテーションオペレータリスト114は、テスト時におけるミューテーションの内容を指定するための情報と考えてもよい。
図9は、メタミューテーション情報の例を示す図である。メタミューテーション情報115は、置換後ソースコード112の生成時にメタ関数置換部120により生成され、記憶部110に格納される。メタミューテーション情報115は、MMIDおよびソースコード位置情報の項目を含む。
The mutation operator list 114 may be considered as information for specifying the content of the mutation during the test.
FIG. 9 is a diagram showing an example of metamutation information. The metamutation information 115 is generated by the metafunction replacing unit 120 when the source code 112 after replacement is generated, and is stored in the storage unit 110. The metamutation information 115 includes items of MMID and source code position information.

MMIDの項目には、MMIDが登録される。ソースコード位置情報の項目には、ソースコード111のファイル名、および、ソースコード111においてメタ関数に置換された位置の情報が登録される。ここで、ソースコード111のファイル名は、“a.c”である。 The MMID is registered in the MMID item. In the item of source code position information, the file name of the source code 111 and the position information replaced with the meta function in the source code 111 are registered. Here, the file name of the source code 111 is “ac”.

例えば、メタミューテーション情報115には、MMIDが“1”、ソースコード位置情報が“a.c:2行6桁−2行11桁”という情報が含まれる。これは、ソースコード111における2行6桁−2行11桁に対応する“x < 0”の記述がMMID“1”に対応するメタ関数に置換されたことを示す。 For example, the metamutation information 115 includes information that the MMID is "1" and the source code position information is "ac: 2 lines 6 digits-2 lines 11 digits". This indicates that the description of “x<0” corresponding to 2nd row 6th digit-2nd row 11th digit in the source code 111 is replaced with the metafunction corresponding to the MMID “1”.

メタミューテーション情報115には、他のミューテーション箇所についても同様に、MMIDとソースコード位置情報とが対応付けて登録される。
図10は、中間コードの例を示す図である。中間コード116は、置換後ソースコード112がコンパイラ130によりコンパイルされることで生成され、記憶部110に格納される。中間コード116の1つの行は1つの命令に対応する。中間コード116の命令は、命令ID(IDentifier)によって識別される。中間コード116における“%1”や“%2”などの“%”記号と数値との結合で表される変数はレジスタを示し、各命令の実行結果が格納される。
In the metamutation information 115, the MMID and the source code position information are registered in association with each other in the same manner for other mutation locations.
FIG. 10 is a diagram showing an example of the intermediate code. The intermediate code 116 is generated by the source code 112 after replacement being compiled by the compiler 130, and is stored in the storage unit 110. One line of intermediate code 116 corresponds to one instruction. The instruction of the intermediate code 116 is identified by an instruction ID (IDentifier). A variable represented by a combination of a “%” symbol such as “%1” or “%2” and a numerical value in the intermediate code 116 indicates a register, and the execution result of each instruction is stored.

例えば、命令ID“3”の命令は、置換後ソースコード112の2行目のメタ関数bop_lt(1,x,0)に対応する。“%2”には、ミューテーション内容に応じた演算結果が設定される。“%2”の設定値は、演算結果が真なら“1”、偽なら“0”である。 For example, the instruction with the instruction ID “3” corresponds to the metafunction bop_lt(1, x, 0) on the second line of the source code 112 after replacement. A calculation result according to the mutation content is set in "%2". The set value of "%2" is "1" if the operation result is true, and "0" if it is false.

命令ID“4”の命令は、“%2”の設定値が0に等しくないとき“%3”に“1”を設定し、“%2”の設定値が0に等しいとき“%3”に“0”を設定する。
命令ID“5”の命令は、“%3”の設定値が“1”なら命令ID“6”にジャンプし、また、“%3”の設定値が“0”なら命令ID“10”にジャンプすることを示す。
The instruction with the instruction ID "4" sets "1" to "%3" when the set value of "%2" is not equal to 0, and "%3" when the set value of "%2" is equal to 0 Is set to "0".
The instruction with the instruction ID “5” jumps to the instruction ID “6” if the setting value of “%3” is “1”, and to the instruction ID “10” if the setting value of “%3” is “0”. Indicates jumping.

同様に、中間コード116は、置換後ソースコード112の3行目に対応する命令群(命令ID“6”〜“9”)を含む。中間コード116は、置換後ソースコード112の4行目に対応する命令群(命令ID“10”〜“13”)を含む。中間コード116は、置換後ソースコード112の5行目に対応する命令群(命令ID“14”〜“17”)を含む。ただし、置換後ソースコード112における“return”に対応する命令は、命令ID“21”〜“23”で共通化している。すなわち、実行結果は“%13”のレジスタに格納された値と、テストケースの確認値との比較によって定まる(両値が一致ならPassであり、不一致ならFailである)。 Similarly, the intermediate code 116 includes an instruction group (instruction IDs “6” to “9”) corresponding to the third line of the source code 112 after replacement. The intermediate code 116 includes an instruction group (instruction ID “10” to “13”) corresponding to the fourth line of the source code 112 after replacement. The intermediate code 116 includes an instruction group (instruction ID “14” to “17”) corresponding to the fifth line of the source code 112 after replacement. However, the instruction corresponding to “return” in the replaced source code 112 is shared by the instruction IDs “21” to “23”. That is, the execution result is determined by comparing the value stored in the "%13" register with the confirmation value of the test case (Pass if both values match, Fail if they do not match).

図11は、実行状態集合の例を示す図である。実行状態集合117は、決定木作成部140により生成され、記憶部110に格納される。実行状態集合117は、実行状態ID、命令ID、ミューテーション記述子およびメモリの項目を含む。 FIG. 11 is a diagram showing an example of the execution state set. The execution state set 117 is generated by the decision tree creating unit 140 and stored in the storage unit 110. The execution state set 117 includes an execution state ID, an instruction ID, a mutation descriptor, and a memory item.

実行状態IDの項目には、実行状態の識別情報(実行状態ID)が登録される。実行状態は、レジスタの設定値の組合せによって表される。命令IDは、中間コード116のうち、ミューテーションによる状態分岐が発生している命令の命令IDが登録される。ミューテーション記述子の項目には、該当の命令IDに対応する命令において適用するミューテーションの内容を示すミューテーション記述子が登録される。メモリの項目には、プログラム(中間コード116)の実行状態を表すレジスタの設定値の組合せが登録される。 In the item of execution state ID, identification information of execution state (execution state ID) is registered. The execution state is represented by a combination of register setting values. In the instruction ID, the instruction ID of the instruction in the intermediate code 116 in which the state branch due to mutation occurs is registered. A mutation descriptor indicating the content of the mutation applied to the instruction corresponding to the corresponding instruction ID is registered in the mutation descriptor item. In the memory item, a combination of register setting values representing the execution state of the program (intermediate code 116) is registered.

例えば、実行状態集合117には、実行状態IDが“2”、命令IDが“3”、ミューテーション記述子が“1,>=”、メモリが“%1=0”という情報が登録される。これは、実行状態ID“2”で示される実行状態では、命令ID“3”の命令においてミューテーションによる状態分岐が発生していることを示す。また、実行状態ID“2”で示される実行状態は、レジスタの設定値の組が“%1=0”であること、当該箇所におけるミューテーション記述子が(1,>=)であることを示す。ここで、ミューテーション記述子の左側の数値はMMIDである。ミューテーション記述子の右側の演算子はミューテーション内容を示す。 For example, in the execution state set 117, information that the execution state ID is “2”, the instruction ID is “3”, the mutation descriptor is “1, >=”, and the memory is “%1=0” is registered. .. This indicates that in the execution state indicated by the execution state ID “2”, a state branch due to mutation occurs in the instruction with the instruction ID “3”. The execution state indicated by the execution state ID “2” indicates that the set value of the register is “%1=0” and the mutation descriptor at the location is (1, >=). Show. Here, the numerical value on the left side of the mutation descriptor is the MMID. The operator on the right side of the mutation descriptor indicates the mutation content.

実行状態集合117では、テスト実行に伴って現在生じている複数の状態分岐が記録され得る。図11の例では、実行状態ID“2”の他にも、実行状態ID“3”、“4”、“5”に対応する実行状態が記録されている(後述する図31の実行状態に相当する)。 In the execution state set 117, a plurality of state branches currently occurring in association with the test execution may be recorded. In the example of FIG. 11, in addition to the execution state ID “2”, the execution states corresponding to the execution state IDs “3”, “4”, and “5” are recorded (see the execution state of FIG. 31, which will be described later). Equivalent to).

図12は、ミュータント一覧の例を示す図である。ミュータント一覧118は、メタ関数置換部120により生成され、記憶部110に格納される。ミュータント一覧118は、ミュータントIDおよびミューテーション記述子の項目を含む。 FIG. 12 is a diagram showing an example of the mutant list. The mutant list 118 is generated by the meta function replacement unit 120 and stored in the storage unit 110. The mutant list 118 includes items of mutant ID and mutation descriptor.

ミュータントIDの項目には、ミュータントの識別情報(ミュータントID)が登録される。ミューテーション記述子の項目には、ミューテーション記述子が登録される。ミュータントは、ミューテーション記述子の組合せで表される。テスト対象とするミュータントの最高次数は、ユーザにより指定される。一例として、ミュータントの最高次数“3”が指定されているものとする(3次以下のミュータントを作成することを示す)。 Mutant identification information (mutant ID) is registered in the mutant ID item. A mutation descriptor is registered in the mutation descriptor item. Mutants are represented by a combination of mutation descriptors. The highest order of the mutant to be tested is specified by the user. As an example, it is assumed that the highest order of mutants, “3”, is specified (indicating that a mutant of third order or lower is created).

本例では、5種類のFOMが存在する。ミュータントIDは、文字“M”とFOMを識別する数値の組合せ(1以上の数値を要素とする)を示す添え字との結合によって表される。ミュータントID“M1”のミュータントは、ミューテーション記述子(1,>=)に対応する。ここで、以下では、ミュータントID“M1”のミュータントを、「ミュータントM1」のように表記することがある。 In this example, there are five types of FOM. The mutant ID is represented by a combination of the letter “M” and a subscript indicating a combination of numerical values for identifying the FOM (one or more numerical values are elements). The mutant with the mutant ID “M 1 ”corresponds to the mutation descriptor (1, >=). Here, in the following, the mutant with the mutant ID “M 1 ”may be expressed as “mutant M 1 ”.

ミュータントM2は、ミューテーション記述子(2,−)に対応する。ミュータントM3は、ミューテーション記述子(3,<=)に対応する。ミュータントM4は、ミューテーション記述子(4,/)に対応する。ミュータントM5は、ミューテーション記述子(4,%)に対応する。ミュータントM1,M2,M3,M4,M5は、FOMである。 Mutant M 2 is mutation descriptor (2, -) corresponding to. Mutant M 3 corresponds to mutation descriptor (3,<=). Mutant M 4 corresponds to mutation descriptor (4,/). Mutant M 5 corresponds to the mutation descriptor (4%). Mutants M 1 , M 2 , M 3 , M 4 and M 5 are FOMs.

HOMは、FOMのミューテーション記述子の組合せで表される。例えば、ミュータントM1,2は、ミューテーション記述子{(1,>=),(2,−)}に対応する。また、例えば、ミュータントM1,2,3は、ミューテーション記述子{(1,>=),(2,−),(3,<=)}に対応する。ミュータント一覧118では、他のミュータントも同様にして、ミューテーション記述子に対応付けられている。この例では、ミュータントの合計数は21である。 The HOM is represented by a combination of FOM mutation descriptors. For example, the mutant M 1,2 corresponds to the mutation descriptor {(1, >=), (2, −)}. Further, for example, the mutants M 1,2,3 correspond to mutation descriptors {(1, >=), (2, −), (3, <=)}. In the mutant list 118, other mutants are similarly associated with the mutation descriptor. In this example, the total number of mutants is 21.

例えば、メタ関数置換部120は、ユーザにより入力されたFOMの一覧(ミュータントM1,M2,M3,M4,M5のミュータントIDとミューテーション記述子との対応を示すリスト)および指定次数に基づいて、ミュータント一覧118を作成してもよい。 For example, the meta-function replacing unit 120 specifies a list of FOMs input by the user (a list showing the correspondence between mutant IDs of the mutants M 1 , M 2 , M 3 , M 4 , and M 5 and mutation descriptors) and designation. The mutant list 118 may be created based on the order.

図13は、テスト結果テーブルの例を示す図である。テスト結果テーブル119は、記憶部110に格納され、決定木作成部140および結果出力部160により更新される。テスト結果テーブル119は、ミュータントID、Test1、Test2、Test3およびミュータント生存結果の項目を含む。 FIG. 13 is a diagram showing an example of the test result table. The test result table 119 is stored in the storage unit 110 and updated by the decision tree creating unit 140 and the result output unit 160. The test result table 119 includes items of mutant ID, Test1, Test2, Test3, and mutant survival result.

ミュータントIDの項目には、ミュータントIDが登録される。Test1の項目には、第1のテストケース(testcase1)の実行結果が登録される。Test2の項目には、第2のテストケース(testcase2)の実行結果が登録される。Test3の項目には、第3のテストケース(testcase3)の実行結果が登録される。ミュータント生存結果の項目には、テストプログラム113によりミュータントがkillされたか否かを示す情報(テスト結果)が登録される。前述のように、少なくとも1つのテストケースの実行結果が“Failed”であれば、ミュータント生存結果は“Killed”となる。また、何れのテストケースの実行結果も“Passed”であれば、ミュータント生存結果は“Unkilled”となる。 The mutant ID is registered in the mutant ID item. The execution result of the first test case (testcase1) is registered in the item Test1. The execution result of the second test case (testcase2) is registered in the item Test2. The execution result of the third test case (testcase3) is registered in the Test3 item. Information (test result) indicating whether or not the mutant has been killed by the test program 113 is registered in the mutant survival result item. As described above, if the execution result of at least one test case is “Failed”, the mutant survival result is “Killed”. If the execution result of any test case is “Passed”, the mutant survival result is “Unkilled”.

ここで、テスト結果テーブル119では、通常のSSEによるミュータント解析の結果が登録された状態を示している。
例えば、テスト結果テーブル119には、ミュータントIDが“M1”、Test1が“Failed”、Test2が“Passed”、Test3が“Passed”、ミュータント生存結果が“Killed”という情報が登録される。これは、ミュータントM1がテストプログラム113によって検出されることを示す。
Here, the test result table 119 shows a state in which the result of the normal mutant analysis by SSE is registered.
For example, in the test result table 119, information that the mutant ID is “M 1 ”, Test 1 is “Failed”, Test 2 is “Passed”, Test 3 is “Passed”, and mutant survival result is “Killed” is registered. This indicates that the mutant M 1 is detected by the test program 113.

テスト結果テーブル119には、他のミュータントIDに対しても、同様に各テストケースの実行結果およびミュータント生存結果が登録される。ただし、設定なし“−”(ハイフン記号)となっている箇所は、通常のSSEでは試行されず、該当のテストケースに対する実行結果や、ミュータント生存結果が未取得であることを示す。ミュータント生存結果が未取得の箇所は、後述の手順によって補完されることになる。 In the test result table 119, execution results and mutant survival results of each test case are similarly registered for other mutant IDs. However, a place where "-" (hyphen symbol) is not set indicates that the execution result for the corresponding test case and the mutant survival result have not been acquired because the normal SSE does not try. Locations for which mutant survival results have not been obtained will be supplemented by the procedure described below.

図14は、決定木の例を示す図である。図14(A)は、第1のテストケース(testcase1)に対する決定木T10を示す。図14(B)は、第2のテストケース(testcase2)に対する決定木T20を示す。図14(C)は、第3のテストケース(testcase3)に対する決定木T30を示す。決定木T10,T20,T30は、有向グラフにより表される。 FIG. 14 is a diagram showing an example of a decision tree. FIG. 14A shows a decision tree T10 for the first test case (testcase1). FIG. 14B shows a decision tree T20 for the second test case (testcase2). FIG. 14C shows a decision tree T30 for the third test case (testcase3). The decision trees T10, T20, T30 are represented by a directed graph.

ここで、決定木T10を、Test1(m1,m2,m3,m4)と表す。m1,m2,m3,m4は、ノードの識別子である。例えば、識別子m1のノードを「ノードm1」のように表す。ノードの識別子に付された数値は、MMIDに対応する。各ノードを起点とするエッジは、該当のノードのMMIDで示されるミューテーション箇所におけるミューテーション内容を表す。ミューテーションを行っていない場合は“nop”のエッジに対応する。 Here, the decision tree T10 is represented as Test1(m1, m2, m3, m4). m1, m2, m3 and m4 are node identifiers. For example, the node with the identifier m1 is represented as “node m1”. The numerical value attached to the node identifier corresponds to the MMID. The edge starting from each node represents the mutation content at the mutation location indicated by the MMID of the corresponding node. When no mutation is performed, it corresponds to the edge of "nop".

図15は、各決定木のマージ結果の例を示す図である。決定木T40は、決定木T10,T20,T30を、論理積(Test1(m1,m2,m3,m4)∧Test2(m1,m2,m3,m4)∧Test3(m1,m2,m3,m4))でマージした結果である。決定木マージ部150は、前述のOBDDのマージアルゴリズムを用いて、決定木T40を生成する(決定木のマージ処理の手順の詳細は後述される)。 FIG. 15 is a diagram showing an example of the result of merging decision trees. The decision tree T40 is a logical product of the decision trees T10, T20, T30 (Test1(m1, m2, m3, m4)∧Test2(m1,m2,m3,m4)∧Test3(m1,m2,m3,m4)). It is the result of merging with. The decision tree merging unit 150 generates a decision tree T40 by using the above-mentioned OBDD merge algorithm (details of the decision tree merge processing procedure will be described later).

図16は、ノード・エッジのコード例を示す図である。コードC1は、決定木T10,T20,T30,T40それぞれに属するノードおよびエッジを管理するためのコードである。例えば、ノードは、MMID(図16中のmmidに相当)をもち、ミューテーションオペレータ(コードC1の10行目で定義される“nop”、“lt”、“le”など)に応じた次ノードへのポインタ(エッジに相当)をもつ。終端ノード(葉ノードと称する)は、ブーリアン型の変数“isPassed”により、true(“Pass”に相当)またはfalse(“Fail”に相当)の何れかをもつ。 FIG. 16 is a diagram showing a code example of a node/edge. The code C1 is a code for managing the nodes and edges belonging to the decision trees T10, T20, T30, T40, respectively. For example, the node has the MMI D (corresponding to mmid in FIG. 16) and is the next node according to the mutation operator (“nop”, “lt”, “le”, etc. defined in the 10th line of the code C1). Has a pointer to (corresponding to an edge). The terminal node (referred to as a leaf node) has either true (corresponding to "Pass") or false (corresponding to "Fail") depending on a boolean type variable "isPassed".

図17は、決定木のデータ例を示す図である。データD1は、決定木T10に等価な情報を示している。具体的には、ノードm1では、ミューテーションオペレータ[nop]に対してノードm3へのポインタが設定される。ノードm1では、ミューテーションオペレータ[ge](演算子“>=”に相当)に対してノードm2へのポインタが設定される。 FIG. 17 is a diagram showing a data example of a decision tree. The data D1 indicates information equivalent to the decision tree T10. Specifically, in the node m1, the pointer to the node m3 is set for the mutation operator [nop]. In the node m1, a pointer to the node m2 is set for the mutation operator [ge] (corresponding to the operator “>=”).

ノードm2では、ミューテーションオペレータ[nop]に対して、Failの葉ノードへのポインタが設定される。ノードm2では、ミューテーションオペレータ[sub](演算子“−”に相当)に対して、Failの葉ノードへのポインタが設定される。 At the node m2, a pointer to the leaf node of Fail is set for the mutation operator [nop]. At the node m2, a pointer to the leaf node of Fail is set for the mutation operator [sub] (corresponding to the operator "-").

ノードm3では、ミューテーションオペレータ[nop]に対して、Passの葉ノードへのポインタが設定される。ノードm3では、ミューテーションオペレータ[le](<=)に対して、ノードm4へのポインタが設定される。 In the node m3, a pointer to the leaf node of Pass is set for the mutation operator [nop]. In the node m3, a pointer to the node m4 is set for the mutation operator [le] (<=).

ノードm4では、ミューテーションオペレータ[nop]に対して、Passの葉ノードへのポインタが設定される。ノードm4では、ミューテーションオペレータ[div](演算子“/”に相当)に対して、Passの葉ノードへのポインタが設定される。ノードm4では、ミューテーションオペレータ[rem](演算子“%”に相当)に対して、Passの葉ノードへのポインタが設定される。 In the node m4, a pointer to the leaf node of Pass is set for the mutation operator [nop]. In the node m4, a pointer to the leaf node of Pass is set for the mutation operator [div] (corresponding to the operator “/”). At the node m4, a pointer to the leaf node of Pass is set for the mutation operator [rem] (corresponding to the operator "%").

決定木T20,T30,T40の情報についても、決定木T10と同様のデータ構造により管理される。
図18は、結果レポートの出力例を示す図である。結果レポートR1は、結果出力部160により出力される結果レポートの例である。結果レポートR1は、一例として、関数func1に対するミュータント解析の結果を表す。結果レポートR1は、ミューテーションスコア(Mutation Score)の計算結果(例えば、“75%”(9/12)の表示)や検出されなかったミュータント(Unkilled mutants)のリストを含む。リストの1要素は、ソースコードの位置、オリジナルのコード、および、ミュータントのコードを含む。該当の位置において複数のミュータントを生成した場合は、該当の位置に対する複数のミュータントが表示され得る。ユーザは、リストから任意のミュータントを選択可能である。結果出力部160は、ユーザにより選択されたミュータントに対応するソースコードの該当箇所を結果レポートR1内に表示させる。例えば、結果出力部160は、該当箇所を強調するようハイライト表示したり、該当箇所に下線を付したりすることで、ユーザによる問題箇所の認識を支援する。ユーザは、結果レポートR1を確認して、ミューテーションスコアを向上させるようテスト内容の見直しを行える。
The information of the decision trees T20, T30, T40 is also managed by the same data structure as the decision tree T10.
FIG. 18 is a diagram showing an output example of the result report. The result report R1 is an example of a result report output by the result output unit 160. The result report R1 represents, as an example, the result of the mutant analysis for the function func1. The result report R1 includes a calculation result of a mutation score (for example, "75%" (9/12) is displayed) and a list of undetected mutants (Unkilled mutants). One element of the list includes the source code location, the original code, and the mutant code. When a plurality of mutants are generated at the corresponding position, a plurality of mutants for the corresponding position may be displayed. The user can select any mutant from the list. The result output unit 160 causes the relevant part of the source code corresponding to the mutant selected by the user to be displayed in the result report R1. For example, the result output unit 160 assists the user in recognizing a problematic part by highlighting the corresponding part or by underlining the corresponding part. The user can check the result report R1 and review the test contents to improve the mutation score.

次に、解析装置100によるミューテーション解析の処理手順を説明する。
図19は、解析装置の処理例を示すフローチャートである。以下、図19に示す処理をステップ番号に沿って説明する。
Next, a processing procedure of mutation analysis by the analysis device 100 will be described.
FIG. 19 is a flowchart showing a processing example of the analysis device. Hereinafter, the process illustrated in FIG. 19 will be described in order of step number.

(S1)メタ関数置換部120は、ソースコード111の入力を受け付ける。すると、メタ関数置換部120は、ソースコード111へのメタ関数の埋め込みを行う。具体的には、メタ関数置換部120は、予め定められた所定の演算子を用いた演算に対応するコードを当該演算に対応するメタ関数のコードに置換する。その結果、メタ関数置換部120は、置換後ソースコード112を生成し、記憶部110に格納する。メタ関数置換部120は、埋め込んだメタ関数に応じて、ミュータント一覧118を生成し、記憶部110に格納する。また、メタ関数置換部120は、メタミューテーション情報115を生成し、記憶部110に格納する。このとき、メタ関数置換部120は、ミューテーションオペレータリスト114やFOM一覧およびミューテーションの次数のユーザによる入力を受け付けて、各ミュータントのミューテーション記述子を特定してもよい。 (S1) The meta function replacement unit 120 receives an input of the source code 111. Then, the metafunction replacing unit 120 embeds the metafunction in the source code 111. Specifically, the meta-function replacing unit 120 replaces the code corresponding to the operation using the predetermined operator determined in advance with the code of the meta-function corresponding to the operation. As a result, the meta function replacement unit 120 generates the replaced source code 112 and stores it in the storage unit 110. The meta function replacement unit 120 generates the mutant list 118 according to the embedded meta function and stores it in the storage unit 110. Further, the meta function replacement unit 120 generates meta mutation information 115 and stores it in the storage unit 110. At this time, the meta-function replacement unit 120 may receive the input of the mutation operator list 114, the FOM list, and the order of the mutation by the user, and specify the mutation descriptor of each mutant.

(S2)コンパイラ130は、置換後ソースコード112を中間コード116へコンパイルする。コンパイラ130は、コンパイルによって生成した中間コード116を記憶部110に格納する。 (S2) The compiler 130 compiles the replaced source code 112 into the intermediate code 116. The compiler 130 stores the intermediate code 116 generated by the compilation in the storage unit 110.

(S3)決定木作成部140は、決定木作成処理を行う。具体的には、決定木作成部140は、中間コード116を用いて、テストプログラム113によるテストを実行し、決定木T10,T20,T30の情報を生成する。決定木作成部140は、決定木T10,T20,T30の情報を記憶部110に格納する。決定木作成部140は、テスト実行にSSEの手法を用いる。決定木作成部140は、テスト実行に伴って、記憶部110に記憶されたテスト結果テーブル119を更新する。また、決定木作成部140は、テスト時に機能させるミューテーションの内容を示すミューテーションオペレータリスト114のユーザによる入力を予め受け付け、記憶部110に格納している。本例では、ミューテーションオペレータリスト114により、少なくともORRN、OIDO、OAANが指定されているものとする。決定木作成処理の詳細は、後述される。 (S3) The decision tree creating unit 140 performs a decision tree creating process. Specifically, the decision tree creating unit 140 uses the intermediate code 116 to execute a test by the test program 113 and generate information on the decision trees T10, T20, T30. The decision tree creating unit 140 stores information on the decision trees T10, T20, T30 in the storage unit 110. The decision tree generator 140 uses the SSE technique for test execution. The decision tree creating unit 140 updates the test result table 119 stored in the storage unit 110 along with the test execution. Further, the decision tree creating unit 140 receives in advance a user's input of the mutation operator list 114 indicating the content of the mutation to be made to function at the time of testing, and stores it in the storage unit 110. In this example, it is assumed that at least ORRN, OIDO, and OAAN are specified by the mutation operator list 114. Details of the decision tree creation process will be described later.

(S4)決定木マージ部150は、決定木マージ処理を行う。具体的には、決定木マージ部150は、決定木T10,T20,T30をマージし、決定木T40の情報を生成する。決定木マージ部150は、決定木T40の情報を記憶部110に格納する。決定木マージ処理の詳細は、後述される。 (S4) The decision tree merging unit 150 performs a decision tree merge process. Specifically, the decision tree merging unit 150 merges the decision trees T10, T20, and T30 to generate information on the decision tree T40. The decision tree merging unit 150 stores the information of the decision tree T40 in the storage unit 110. Details of the decision tree merge processing will be described later.

(S5)結果出力部160は、結果レポート出力処理を行う。具体的には、結果出力部160は、記憶部110に記憶された決定木T40の情報を参照して、テスト結果テーブル119の登録内容を補完する。結果出力部160は、テスト結果テーブル119に基づいて、結果レポートを生成し、ディスプレイ11に表示させる。 (S5) The result output unit 160 performs result report output processing. Specifically, the result output unit 160 refers to the information of the decision tree T40 stored in the storage unit 110 and complements the registered content of the test result table 119. The result output unit 160 generates a result report based on the test result table 119 and causes the display 11 to display the result report.

図20は、決定木作成処理例を示すフローチャートである。以下、図20に示す処理をステップ番号に沿って説明する。以下に示す処理は、図19のステップS3に相当する。
(S11)決定木作成部140は、初期化処理を行う。具体的には、決定木作成部140は、新たなテストケースによる決定木を新規に作成する準備を行う。初期化処理の詳細は、後述される。
FIG. 20 is a flowchart showing an example of decision tree creation processing. Hereinafter, the process illustrated in FIG. 20 will be described in order of step number. The process described below corresponds to step S3 in FIG.
(S11) The decision tree creating unit 140 performs initialization processing. Specifically, the decision tree creating unit 140 prepares to newly create a decision tree based on a new test case. Details of the initialization process will be described later.

(S12)決定木作成部140は、記憶部110に記憶された実行状態集合117を参照して、実行状態を選択する。あるテストケースに対して、ステップS12を最初に実行する場合、前述の初期化処理で用意される初期実行状態を選択する。初期実行状態は、実行状態ID“1”であり、当初の命令ID、ミューテーション記述子およびメモリ(レジスタの組)に対する設定はなしである。なお、決定木作成部140は、着目する実行状態IDに対する命令IDおよびメモリに対する記録内容を中間コード116の実行に伴い更新する。 (S12) The decision tree creating unit 140 selects an execution state by referring to the execution state set 117 stored in the storage unit 110. When step S12 is first executed for a certain test case, the initial execution state prepared in the above-described initialization processing is selected. The initial execution state is the execution state ID “1”, and the initial instruction ID, mutation descriptor, and memory (group of registers) are not set. Note that the decision tree creating unit 140 updates the instruction ID for the execution state ID of interest and the recorded content in the memory as the intermediate code 116 is executed.

(S13)決定木作成部140は、記憶部110に記憶された中間コード116から次の命令を取り出す。前述のように、命令は、命令IDによって識別される。
(S14)決定木作成部140は、取り出した命令がメタ関数の呼び出しであるか否かを判定する。メタ関数の呼び出しである場合、処理をステップS16に進める。メタ関数の呼び出しでない場合、処理をステップS15に進める。
(S13) The decision tree creating unit 140 extracts the next instruction from the intermediate code 116 stored in the storage unit 110. As mentioned above, an instruction is identified by an instruction ID.
(S14) The decision tree creating unit 140 determines whether the fetched instruction is a metafunction call. If the call is a meta function, the process proceeds to step S16. If not, the process proceeds to step S15.

(S15)決定木作成部140は、ステップS13で取り出した元の命令を実行する。そして、決定木作成部140は、処理をステップS19に進める。
(S16)決定木作成部140は、メタ関数に含まれるMMIDが現在の実行状態に未記録のMMIDであるか否かを判定する。現在の実行状態に未記録のMMIDである場合、処理をステップS17に進める。現在の実行状態に未記録のMMIDでない場合(すなわち、現在の実行状態に記録済のMMIDである場合)、処理をステップS18に進める。
(S15) The decision tree creating unit 140 executes the original instruction extracted in step S13. Then, the decision tree creating unit 140 advances the process to step S19.
(S16) The decision tree generator 140 determines whether the MMID included in the metafunction is an MMID that has not been recorded in the current execution state. If the MMID is unrecorded in the current execution state, the process proceeds to step S17. If the MMID is not unrecorded in the current execution state (that is, the MMID is recorded in the current execution state), the process proceeds to step S18.

(S17)決定木作成部140は、決定木内部ノード追加処理を行う。決定木内部ノード追加処理の詳細は、後述される。
(S18)決定木作成部140は、取り出した命令に対応するミューテーション記述子(“nop”の場合もある)の命令を実行する。すなわち、決定木作成部140は、ミューテーション記述子で示されるミューテーション内容を、取り出した命令に適用して該当の命令を実行する。“nop”が適用される場合、該当の命令(ステップS13で取り出した元の命令)についてミューテーションを行わずに当該命令が実行されることになる。
(S17) The decision tree creating unit 140 performs decision tree internal node addition processing. Details of the decision tree internal node addition processing will be described later.
(S18) The decision tree creating unit 140 executes the instruction of the mutation descriptor (may be "nop") corresponding to the fetched instruction. That is, the decision tree generator 140 applies the mutation content indicated by the mutation descriptor to the fetched instruction and executes the corresponding instruction. When "nop" is applied, the instruction is executed without performing mutation on the instruction (the original instruction fetched in step S13).

(S19)決定木作成部140は、中間コード116を参照して、次の命令が空であるか否かを判定する。空である(すなわち、命令ID“24”に達した)場合、処理をステップS20に進める。空でない(すなわち、命令ID“24”に達していない)場合、処理をステップS13に進める。 (S19) The decision tree creating unit 140 refers to the intermediate code 116 and determines whether or not the next instruction is empty. If it is empty (that is, the instruction ID “24” is reached), the process proceeds to step S20. If not empty (that is, the instruction ID “24” has not been reached), the process proceeds to step S13.

(S20)決定木作成部140は、決定木葉ノード追加処理を行う。決定木葉ノード追加処理の詳細は、後述される。
(S21)決定木作成部140は、実行状態集合117が空であるか否かを判定する。空である場合、処理をステップS22に進める。空でない場合、処理をステップS12に進める。
(S20) The decision tree creation unit 140 performs decision tree leaf node addition processing. Details of the decision tree leaf node addition processing will be described later.
(S21) The decision tree creating unit 140 determines whether the execution state set 117 is empty. If it is empty, the process proceeds to step S22. If not empty, the process proceeds to step S12.

(S22)決定木作成部140は、次のテストが空であるか否かを判定する。次のテストが空である(すなわち、全てのテストケースを実行した)場合、処理を終了する。次のテストが空でない(すなわち、未実行のテストケースがある)場合、処理をステップS11に進める。 (S22) The decision tree generator 140 determines whether or not the next test is empty. If the next test is empty (ie, all test cases have been executed), the process ends. If the next test is not empty (that is, there is an unexecuted test case), the process proceeds to step S11.

図21は、初期化処理例を示すフローチャートである。以下、図21に示す処理をステップ番号に沿って説明する。以下に示す処理は、図20のステップS11に相当する。
(S31)決定木作成部140は、次のテストを中間コード116へ入力する。次のテストとは、テストプログラム113に含まれる3つのテストケースのうち、次に実行するテストケースを示す。例えば、決定木作成部140は、第1のテストケース(testcase1)、第2のテストケース(testcase2)、第3のテストケース(testcase3)の順に、次のテストを選択する。
FIG. 21 is a flowchart showing an example of initialization processing. Hereinafter, the process illustrated in FIG. 21 will be described in order of step number. The process described below corresponds to step S11 of FIG.
(S31) The decision tree generator 140 inputs the next test to the intermediate code 116. The next test refers to the test case to be executed next among the three test cases included in the test program 113. For example, the decision tree creating unit 140 selects the next test in the order of the first test case (testcase1), the second test case (testcase2), and the third test case (testcase3).

(S32)決定木作成部140は、初期実行状態を用意する。前述のように、初期実行状態は、実行状態ID“1”であり、当初は、命令ID、ミューテーション記述子およびメモリ(レジスタの組)に対する設定をもたない。決定木作成部140は、初期実行状態を実行状態集合117に登録する。 (S32) The decision tree creating unit 140 prepares an initial execution state. As described above, the initial execution state is the execution state ID “1”, and initially, the instruction ID, the mutation descriptor, and the memory (set of registers) are not set. The decision tree creating unit 140 registers the initial execution state in the execution state set 117.

(S33)決定木作成部140は、新たに空の決定木を用意する。用意された決定木は、ステップS33の段階では、ノードやエッジをもたない。
図22は、決定木内部ノード追加処理例を示すフローチャートである。以下、図22に示す処理をステップ番号に沿って説明する。以下に示す処理は、図20のステップS17に相当する。
(S33) The decision tree creating unit 140 newly prepares an empty decision tree. The prepared decision tree does not have a node or an edge at the stage of step S33.
FIG. 22 is a flowchart showing an example of decision tree internal node addition processing. In the following, the process illustrated in FIG. 22 will be described in order of step number. The process described below corresponds to step S17 in FIG.

(S41)決定木作成部140は、メタ関数に対応するミューテーションオペレータの数だけ元の実行状態をコピーし、新しい実行状態を生成して、実行状態集合117に登録する。決定木作成部140は、記憶部110に格納されたミューテーションオペレータリスト114からミューテーションオペレータおよびミューテーションオペレータの数(ここでは“nop”を含まなくてよい)を特定できる。 (S41) The decision tree creating unit 140 copies the original execution state by the number of mutation operators corresponding to the meta function, generates a new execution state, and registers it in the execution state set 117. The decision tree creating unit 140 can specify the mutation operator and the number of mutation operators (here, “nop” may not be included) from the mutation operator list 114 stored in the storage unit 110.

(S42)決定木作成部140は、新しい実行状態のミューテーション記述子に、MMIDと、メタ関数に対応するミューテーションオペレータとを記録する。
(S43)決定木作成部140は、現在の実行状態のミューテーション記述子をMとして、決定木の現在位置特定処理(M)を実行する。決定木の現在位置特定処理の詳細は、後述される。ただし、今回のテストケースにおいて決定木が空の場合、現在位置は決定木の起点を示す。
(S42) The decision tree creating unit 140 records the MMID and the mutation operator corresponding to the metafunction in the mutation descriptor of the new execution state.
(S43) The decision tree creation unit 140 executes the current position identifying process (M) with M as the mutation descriptor of the current execution state. The details of the current position specifying process of the decision tree will be described later. However, if the decision tree is empty in this test case, the current position indicates the starting point of the decision tree.

(S44)決定木作成部140は、決定木の現在位置にMMIDをノードとして加え、対応するミューテーションオペレータをそのノードからのエッジとして追加する。なお、決定木が空のとき、現在位置は決定木の起点となる。その場合、ステップS44において、今回のテストケースに対して最初に(決定木の起点に)追加されたノードが根ノードとなる。それ以降は、決定木の現在位置(エッジの先)に順次内部ノードが追加されることになる。 (S44) The decision tree creating unit 140 adds the MMID as a node to the current position of the decision tree, and adds the corresponding mutation operator as an edge from the node. When the decision tree is empty, the current position is the starting point of the decision tree. In that case, in step S44, the node added first (at the starting point of the decision tree) to the test case this time is the root node. After that, internal nodes are sequentially added to the current position of the decision tree (beyond the edge).

図23は、決定木葉ノード追加処理例を示すフローチャートである。以下、図23に示す処理をステップ番号に沿って説明する。以下に示す処理は、図20のステップS20に相当する。 FIG. 23 is a flowchart showing an example of decision tree leaf node addition processing. The process illustrated in FIG. 23 will be described below in order of step number. The process described below corresponds to step S20 of FIG.

(S51)決定木作成部140は、テスト結果テーブル119に実行結果を記録する。テスト結果テーブル119で例示したように、実行結果は、ミュータントID、テストID(テストケースのID)、テスト合否(PassまたはFail)の組合せにより表される。ただし、決定木作成部140は、今回の葉ノード追加に対して何れのミューテーションも行われていない場合(ミュータントではなく元のプログラムの実行の場合)にはテスト合否をテスト結果テーブル119に記録しなくてもよい。 (S51) The decision tree creating unit 140 records the execution result in the test result table 119. As illustrated in the test result table 119, the execution result is represented by a combination of a mutant ID, a test ID (test case ID), and a test pass/fail (Pass or Fail). However, the decision tree creating unit 140 records the test pass/fail in the test result table 119 when no mutation is performed for the addition of the leaf node this time (when the original program is executed instead of the mutant). You don't have to.

(S52)決定木作成部140は、現在の実行状態のミューテーション記述子をMとして、決定木の現在位置特定処理(M)を実行する。決定木の現在位置特定処理の詳細は、後述される。 (S52) The decision tree creation unit 140 executes the current position identifying process (M) with the mutation descriptor of the current execution state as M. The details of the current position specifying process of the decision tree will be described later.

(S53)決定木作成部140は、テスト合否(PassまたはFail)を表す葉ノードを決定木の現在位置に追加する。
(S54)決定木作成部140は、実行状態集合117から現在の実行状態を削除する。
(S53) The decision tree creation unit 140 adds a leaf node representing a test pass/fail (Pass or Fail) to the current position of the decision tree.
(S54) The decision tree creating unit 140 deletes the current execution state from the execution state set 117.

図24は、決定木の現在位置特定処理例を示すフローチャートである。以下、図24に示す処理をステップ番号に沿って説明する。以下に示す処理は、図22のステップS43および図23のステップS52に相当する(ただし、後述の結果レポート出力時にも用いられる)。 FIG. 24 is a flowchart showing an example of the current position identification processing of a decision tree. In the following, the process illustrated in FIG. 24 will be described in order of step number. The processing described below corresponds to step S43 in FIG. 22 and step S52 in FIG. 23 (however, it is also used when outputting a result report described later).

(S61)決定木作成部140は、現在のテストケースに対応する決定木(着目する決定木)の根ノードを選択する。
(S62)決定木作成部140は、現在選択されているノードのMMIDが入力のミューテーション記述子Mに含まれているか否かを判定する。含まれている場合、処理をステップS63に進める。含まれていない場合、処理をステップS65に進める。
(S61) The decision tree creating unit 140 selects the root node of the decision tree (decision tree of interest) corresponding to the current test case.
(S62) The decision tree generator 140 determines whether or not the MMID of the currently selected node is included in the input mutation descriptor M. If included, the process proceeds to step S63. If not included, the process proceeds to step S65.

(S63)決定木作成部140は、ミューテーション記述子Mから、現在選択されているノードのMMIDに対応するミューテーションオペレータを取得する。
(S64)決定木作成部140は、取得したミューテーションオペレータに対応するエッジを選択する。そして、決定木作成部140は、処理をステップS66に進める。
(S63) From the mutation descriptor M, the decision tree creating unit 140 acquires the mutation operator corresponding to the MMID of the currently selected node.
(S64) The decision tree creating unit 140 selects an edge corresponding to the acquired mutation operator. Then, the decision tree creating unit 140 advances the process to step S66.

(S65)決定木作成部140は、“nop”に対応するエッジを選択する。
(S66)決定木作成部140は、ステップS64またはステップS65で選択したエッジについて、当該エッジの先にノードが存在しない、または、当該エッジの先のノードが葉ノードであるか否かを判定する。該当のエッジの先にノードが存在しない、または、該当のエッジの先のノードが葉ノードである場合、処理をステップS68に進める。該当のエッジの先に葉ノード以外のノードが存在する場合、処理をステップS67に進める。
(S65) The decision tree creating unit 140 selects an edge corresponding to “nop”.
(S66) The decision tree creating unit 140 determines whether the edge selected in step S64 or step S65 has no node ahead of the edge, or whether the node ahead of the edge is a leaf node. .. If there is no node at the end of the corresponding edge or if the node at the end of the corresponding edge is a leaf node, the process proceeds to step S68. When there is a node other than the leaf node at the tip of the relevant edge, the process proceeds to step S67.

(S67)決定木作成部140は、該当のエッジの先のノードを選択する。そして、決定木作成部140は、処理をステップS62に進める。
(S68)決定木作成部140は、該当のエッジの先を現在位置とする。
(S67) The decision tree generator 140 selects the node at the tip of the corresponding edge. Then, the decision tree creating unit 140 advances the process to step S62.
(S68) The decision tree generator 140 sets the tip of the corresponding edge as the current position.

こうして、決定木作成部140は、各テストケースに対する決定木T10,T20,T30を作成する。
図25は、決定木マージ処理例を示すフローチャートである。以下、図25に示す処理をステップ番号に沿って説明する。以下に示す処理は、図19のステップS4に相当する。ここで、決定木マージ処理の入力は、(T1,T2,n)である。T1は、1つ目の決定木(あるいは決定木内の部分木)を表す。T2は、2つ目の決定木(あるいは決定木内の部分木)を表す。部分木が葉ノードのみをもつ場合、T1,T2が葉ノードを表すこともある。nは、MMIDである。本例ではnの初期値は1である。本決定木マージ処理は、以下に示すステップS79,S84において再帰的に呼び出されて実行される。
In this way, the decision tree creation unit 140 creates the decision trees T10, T20, T30 for each test case.
FIG. 25 is a flowchart showing an example of decision tree merge processing. Hereinafter, the process illustrated in FIG. 25 will be described in order of step number. The process described below corresponds to step S4 in FIG. Here, the input of the decision tree merge processing is (T 1 , T 2 , n). T 1 represents the first decision tree (or a subtree within the decision tree). T 2 represents the second decision tree (or a subtree within the decision tree). If the subtree has only leaf nodes, T 1 and T 2 may represent leaf nodes. n is the MMID. In this example, the initial value of n is 1. This decision tree merge processing is recursively called and executed in steps S79 and S84 shown below.

(S71)決定木マージ部150は、出力する決定木Toutを用意する。決定木Toutの初期値は空である。
(S72)決定木マージ部150は、T1またはT2がFailの葉ノードであるか否かを判定する。T1またはT2がFailの葉ノードである場合、処理をステップS73に進める。T1およびT2の何れもFailの葉ノードでない場合、処理をステップS74に進める。
(S71) The decision tree merging unit 150 prepares the decision tree Tout to be output. The initial value of the decision tree Tout is empty.
(S72) The decision tree merging unit 150 determines whether T 1 or T 2 is a leaf node of Fail. If T 1 or T 2 is a Fail leaf node, the process proceeds to step S73. If neither T 1 nor T 2 is a Fail leaf node, the process proceeds to step S74.

(S73)決定木マージ部150は、ToutをFailの葉ノードとする。そして、決定木マージ部150は、処理をステップS86に進める。
(S74)決定木マージ部150は、T1がPassの葉ノードであるか否かを判定する。T1がPassの葉ノードである場合、処理をステップS75に進める。T1がPassの葉ノードでない場合、処理をステップS76に進める。
(S73) The decision tree merging unit 150 sets Tout as a leaf node of Fail. Then, the decision tree merging unit 150 advances the processing to step S86.
(S74) The decision tree merging unit 150 determines whether T 1 is a leaf node of Pass. If T 1 is a Pass leaf node, the process proceeds to step S75. If T 1 is not a Pass leaf node, the process proceeds to step S76.

(S75)決定木マージ部150は、Tout=T2とする。そして、決定木マージ部150は、処理をステップS86に進める。
(S76)決定木マージ部150は、T2がPassの葉ノードであるか否かを判定する。T2がPassの葉ノードである場合、処理をステップS77に進める。T2がPassの葉ノードでない場合、処理をステップS78に進める。
(S75) The decision tree merging unit 150 sets Tout=T 2 . Then, the decision tree merging unit 150 advances the processing to step S86.
(S76) The decision tree merging unit 150 determines whether T 2 is a leaf node of Pass. If T 2 is a Pass leaf node, the process proceeds to step S77. If T 2 is not a leaf node of Pass, the process proceeds to step S78.

(S77)決定木マージ部150は、Tout=T1とする。そして、決定木マージ部150は、処理をステップS86に進める。
(S78)決定木マージ部150は、T1,T2ともにNnが存在しないか否かを判定する。ここで、Nnは、MMIDがnのノードを示す(ノードNnと表記することもある)。T1,T2ともにNnが存在しない場合、処理をステップS79に進める。T1,T2の両方または何れか一方にNnが存在する場合、処理をステップS80に進める。
(S77) The decision tree merging unit 150 sets Tout=T 1 . Then, the decision tree merging unit 150 advances the processing to step S86.
(S78) The decision tree merge unit 150 determines whether or not Nn does not exist in T 1 and T 2 . Here, Nn indicates a node whose MMID is n (may be referred to as a node Nn). If Nn does not exist for both T 1 and T 2 , the process proceeds to step S79. If Nn exists in both or either of T 1 and T 2 , the process proceeds to step S80.

(S79)決定木マージ部150は、Tout=決定木マージ処理(T1,T2,n+1)とする。すなわち、決定木マージ部150は、nに1を加算して、決定木マージ処理を実行し、その結果をToutとする。そして、決定木マージ部150は、処理をステップS86に進める。 (S79) The decision tree merge unit 150 sets Tout=decision tree merge process (T 1 , T 2 , n+1). That is, the decision tree merge unit 150 adds 1 to n, executes the decision tree merge process, and sets the result as Tout. Then, the decision tree merging unit 150 advances the processing to step S86.

(S80)決定木マージ部150は、ToutにノードNnを追加する。
(S81)決定木マージ部150は、MMIDがnのときのミューテーションオペレータ(nopを含む)をmとし、各mについてステップS85までの処理を繰り返し実行する。
(S80) The decision tree merging unit 150 adds the node Nn to Tout.
(S81) The decision tree merging unit 150 sets m as a mutation operator (including nop) when the MMID is n, and repeatedly executes the processing up to step S85 for each m.

(S82)決定木マージ部150は、T1[n,m]を取得する。T1[n,m]は、T1内のNn(を根とした部分木)をT1内のen,mの先の部分木に置き換えた木である。ここで、en,mは、ノードNnから出ているミューテーションオペレータmのエッジを示す。なお、T1内にNnがない場合、T1[n,m]=T1とする。 (S82) The decision tree merging unit 150 acquires T 1 | [n,m] . T 1 | [n, m] is a tree replaced Nn in T 1 (the subtree was rooted) e n in T 1, ahead of the subtree of m. Here, e n,m indicates the edge of the mutation operator m which is output from the node Nn. If there is no Nn in T 1, T 1 | and [n, m] = T 1 .

(S83)決定木マージ部150は、T2[n,m]を取得する。T2[n,m]は、T2内のNn(を根とした部分木)をT2内のen,mの先の部分木に置き換えた木である。なお、T2内にNnがない場合、T2[n,m]=T2とする。 (S83) The decision tree merging unit 150 acquires T 2 | [n,m] . T 2 | [n, m] is a tree by replacing the Nn in T 2 (the subtree that is rooted) e n in T 2, ahead of the subtree of m. If there is no Nn in T 2, T 2 | [n , m] and = T 2 to.

(S84)決定木マージ部150は、Tout内のen,mの先に対し決定木マージ処理(T1[n,m],T2[n,m],n+1)の出力を加える。
(S85)決定木マージ部150は、MMID=nに対する全てのmについてステップS81以降の処理を終えると、処理をステップS86に進める。
(S84) The decision tree merge unit 150 adds the output of the decision tree merge process (T 1 | [n,m] , T 2 | [n,m] , n+1) to the destination of e n,m in Tout. ..
(S85) When the decision tree merging unit 150 finishes the processing from step S81 onward for all m for MMID=n, the processing proceeds to step S86.

(S86)決定木マージ部150は、Toutを出力する。
このように、決定木マージ部150は、決定木マージ処理を再帰的に実行することで、2つの決定木をマージする。3つの決定木T10,T20,T30をマージする場合、決定木マージ部150は、まず、決定木マージ処理の手順により、2つの決定木(例えば、決定木T20,T30)をマージする。次に、決定木マージ部150は、当該マージ結果として得られた決定木と、残りの1つの決定木(例えば、決定木T10)とを、上記の決定木マージ処理の手順によりマージする。こうして、決定木マージ部150は、3つの決定木T10,T20,T30のマージ結果である決定木T40を得る。4以上の決定木をマージする場合も同様である。例えば、4つの決定木をマージする場合、3つの決定木のマージ結果である決定木T40および残りの1つの決定木に対して決定木マージ処理を行えばよい。
(S86) The decision tree merging unit 150 outputs Tout.
In this way, the decision tree merging unit 150 merges two decision trees by recursively executing the decision tree merging process. When merging the three decision trees T10, T20, T30, the decision tree merging unit 150 first merges the two decision trees (for example, the decision trees T20, T30) by the procedure of the decision tree merge process. Next, the decision tree merging unit 150 merges the decision tree obtained as the result of the merging and the remaining one decision tree (for example, decision tree T10) by the procedure of the above decision tree merging process. In this way, the decision tree merging unit 150 obtains a decision tree T40 which is the merged result of the three decision trees T10, T20, T30. The same applies when merging four or more decision trees. For example, when four decision trees are merged, the decision tree merge process may be performed on the decision tree T40 that is the result of merging the three decision trees and the remaining one decision tree.

図26は、結果レポート出力処理例を示すフローチャートである。以下、図26に示す処理をステップ番号に沿って説明する。以下に示す処理は、図19のステップS5に相当する。 FIG. 26 is a flowchart showing an example of the result report output processing. In the following, the process illustrated in FIG. 26 will be described in order of step number. The process described below corresponds to step S5 of FIG.

(S91)結果出力部160は、テスト結果テーブル119において、何れかのテストケースによる実行結果がFailを含むミュータントのミュータント生存結果をKilledとする。 (S91) In the test result table 119, the result output unit 160 sets the mutant survival result of the mutant whose execution result by any test case includes Fail as Killed.

(S92)結果出力部160は、ミュータント生存結果が未確定のミュータントのミューテーション記述子をMとして、ステップS97までの処理を繰り返し実行する。
(S93)結果出力部160は、決定木T40に対する決定木の現在位置特定処理(M)により葉ノードを特定する。具体的には、結果出力部160は、決定木T40に対する決定木の現在位置特定処理(M)を、決定木作成部140により実行させ、その結果を得る(当該処理により葉ノードが特定されることになる)。決定木の現在位置特定処理の手順は、図24で例示した手順と同様である。なお、結果出力部160が、決定木の現在位置特定処理を行ってもよい。
(S92) The result output unit 160 repeatedly executes the processes up to step S97, where M is the mutation descriptor of the mutant whose survival result is undetermined.
(S93) The result output unit 160 identifies the leaf node by the current position identifying process (M) for the decision tree T40. Specifically, the result output unit 160 causes the decision tree creating unit 140 to execute the decision tree current position specifying process (M) for the decision tree T40, and obtains the result (the leaf node is specified by the process). Will be). The procedure for determining the current position of the decision tree is similar to the procedure illustrated in FIG. The result output unit 160 may perform the current position specifying process of the decision tree.

(S94)結果出力部160は、決定木T40の現在位置の先の葉ノードがFailの葉ノードであるか否かを判定する。Failの葉ノードである場合、処理をステップS95に進める。Failの葉ノードでない場合(すなわち、Passの葉ノードである場合)、処理をステップS96に進める。 (S94) The result output unit 160 determines whether or not the previous leaf node at the current position of the decision tree T40 is a Fail leaf node. If it is a Fail leaf node, the process proceeds to step S95. If it is not a Fail leaf node (that is, if it is a Pass leaf node), the process proceeds to step S96.

(S95)結果出力部160は、ミューテーション記述子Mに対応するミュータントのミュータント生存結果をKilledと決定し、テスト結果テーブル119の該当箇所にKilledを記録する。決定木T40でFailに辿り着いたということは、ミューテーション記述子Mに対応するミュータントに対し、3つのテストケースのうちの少なくとも1つでFailになることを示すからである。そして、処理をステップS97に進める。 (S95) The result output unit 160 determines the mutant survival result of the mutant corresponding to the mutation descriptor M to be Killed, and records Killed in the relevant portion of the test result table 119. The reason for reaching Fail in the decision tree T40 is that the mutant corresponding to the mutation descriptor M becomes Fail in at least one of the three test cases. Then, the process proceeds to step S97.

(S96)結果出力部160は、ミューテーション記述子Mに対応するミュータントのミュータント生存結果をUnkilledと決定し、テスト結果テーブル119の該当箇所にUnkilledを記録する。決定木T40でPassに辿り着いたということは、ミューテーション記述子Mに対応するミュータントに対し、3つのテストケースの全てでPassになることを示すからである。 (S96) The result output unit 160 determines that the mutant survival result of the mutant corresponding to the mutation descriptor M is Unkilled, and records Unkilled in the relevant part of the test result table 119. The reason for reaching Pass in the decision tree T40 is that the Mutant corresponding to the mutation descriptor M is Pass in all three test cases.

(S97)結果出力部160は、全てのMについてステップS92以降の処理を終えると、処理をステップS98に進める。
(S98)結果出力部160は、テスト結果テーブル119におけるミュータント生存結果に基づいて、ミューテーションスコア(MS)を算出する。ミューテーションスコアは、全ミュータント数に対するKilledの数の割合である。
(S97) When the result output unit 160 finishes the processes from step S92 onward for all Ms, the process proceeds to step S98.
(S98) The result output unit 160 calculates the mutation score (MS) based on the mutant survival result in the test result table 119. The mutation score is the ratio of the number of Killed to the total number of mutants.

(S99)結果出力部160は、記憶部110に記憶されたメタミューテーション情報115を用いて、ミュータントの位置情報を復元する。
(S100)結果出力部160は、ミューテーションスコア(MS)とUnkilledミュータントとを結果レポートとして出力する。例えば、結果出力部160は、ディスプレイ11により、結果レポートを表示させる。また、ユーザによりUnkilledミュータントが選択されると、当該ミュータントに対応するソースコードの該当箇所をディスプレイ11により表示させる。
(S99) The result output unit 160 restores the mutant position information using the metamutation information 115 stored in the storage unit 110.
(S100) The result output unit 160 outputs the mutation score (MS) and the Unkilled mutant as a result report. For example, the result output unit 160 causes the display 11 to display a result report. Moreover, when the Unkilled mutant is selected by the user, the corresponding portion of the source code corresponding to the mutant is displayed on the display 11.

このように、結果出力部160は、テストの実行により取得された第1のテスト結果および決定木T10,T20,T30に基づいて決定された第2のテスト結果に応じて、結果レポートを出力する。前述のように、結果レポートは、複数のミュータント(ミューテーション箇所の複数の組合せ)のうち、複数のテストケースにより検出可能なミュータントに関する情報(例えば、ミューテーションスコア(MS))を含んでもよい。また、結果レポートは、複数のテストケースにより検出不可能なミュータントに関する情報(例えば、Unkilledミュータントのリストやソースコードの該当箇所の情報)を含んでもよい。 In this way, the result output unit 160 outputs a result report according to the first test result acquired by executing the test and the second test result determined based on the decision trees T10, T20, T30. .. As described above, the result report may include information (for example, a mutation score (MS)) about a mutant detectable by a plurality of test cases among a plurality of mutants (a plurality of combinations of mutation points). In addition, the result report may include information about mutants that cannot be detected by a plurality of test cases (for example, a list of Unkilled mutants or information on a relevant part of the source code).

次に、解析装置100の上記手順による処理の具体例を説明する。まず、図20の手順による決定木T10の作成方法を具体的に説明する。
図27は、決定木の作成例(その1)を示す図である。以下では、テストID“Test1”に対応する第1のテストケース(testcase1)を想定する。テストプログラム113によれば、第1のテストケースでは、func(0)==0を確認する。図27以降の決定木の作成例では、中間コード116による処理内容が分かり易いようにソースコード111も図示する。中間コード116における参照中の命令、および、当該命令に対応するソースコード111の該当箇所を四角形で囲って示す。
Next, a specific example of the processing of the analysis device 100 according to the above procedure will be described. First, a method of creating the decision tree T10 according to the procedure of FIG. 20 will be specifically described.
FIG. 27 is a diagram illustrating an example (part 1) of creating a decision tree. Below, the 1st test case (testcase1) corresponding to test ID "Test1" is assumed. According to the test program 113, func(0)==0 is confirmed in the first test case. In the example of creating the decision tree after FIG. 27, the source code 111 is also illustrated so that the processing content by the intermediate code 116 can be easily understood. The instruction being referred to in the intermediate code 116 and the corresponding portion of the source code 111 corresponding to the instruction are shown surrounded by a rectangle.

まず、決定木作成部140は、初期実行状態(実行状態ID“1”の実行状態)を選択した上で、中間コード116における命令ID“3”の命令に到達する。命令ID“3”の命令は、メタ関数bop_ltを含む。当該メタ関数bop_ltの第1引数で示されるMMID=1は、実行状態ID“1”の実行状態に未記録のMMIDである。そこで、決定木作成部140は、この段階における実行状態ID“1”の実行状態を複製して、実行状態ID“2”の実行状態(この段階では命令ID=3)を実行状態集合117に追加する。図中では、実行状態ID“X”の実行状態を“StateX”のように表す。なお、実行状態ID“1”の実行状態におけるミューテーション記述子は“nop”(変更しないことを示す)である。実行状態ID“2”の実行状態におけるミューテーション記述子は(1,>=)である。 First, the decision tree creating unit 140 selects the initial execution state (execution state of execution state ID “1”), and then reaches the instruction of instruction ID “3” in the intermediate code 116. The instruction with the instruction ID “3” includes the meta function bop_lt. MMID=1 indicated by the first argument of the meta function bop_lt is an MMID that has not been recorded in the execution state of the execution state ID “1”. Therefore, the decision tree creating unit 140 duplicates the execution state of the execution state ID “1” at this stage and sets the execution state of the execution state ID “2” (instruction ID=3 at this stage) to the execution state set 117. to add. In the figure, the execution state of the execution state ID “X” is represented as “StateX”. The mutation descriptor in the execution state of the execution state ID “1” is “nop” (indicating that the change is not made). The mutation descriptor in the execution state of the execution state ID “2” is (1, >=).

また、決定木作成部140は、根ノードとしてMMID=1のノードm1を決定木T10に追加する。決定木作成部140は、“nop”に対応するエッジおよび“>=”に対応するエッジをノードm1に追加する。 Further, the decision tree creating unit 140 adds the node m1 with MMID=1 as the root node to the decision tree T10. The decision tree creating unit 140 adds an edge corresponding to “nop” and an edge corresponding to “>=” to the node m1.

決定木作成部140は、ノードm1の“nop”に対応するエッジを選択し、当該エッジの先を現在位置とする。この場合、決定木作成部140は、命令ID“3”の命令を元の演算“<”のまま実行する。 The decision tree creating unit 140 selects the edge corresponding to the "nop" of the node m1 and sets the tip of the edge as the current position. In this case, the decision tree creating unit 140 executes the instruction with the instruction ID “3” in the original operation “<”.

図28は、決定木の作成例(その2)を示す図である。決定木作成部140は、中間コード116の実行を継続し、命令ID“11”の命令に到達する。命令ID“11”の命令は、メタ関数bop_gtを含む。当該メタ関数bop_gtの第1引数で示されるMMID=3は、実行状態ID“1”の実行状態に未記録のMMIDである。そこで、決定木作成部140は、この段階における実行状態ID“1”の実行状態を複製して、実行状態ID“3”の実行状態(この段階では命令ID=11)を実行状態集合117に追加する。実行状態ID“3”の実行状態におけるミューテーション記述子は(3,<=)である。 FIG. 28 is a diagram illustrating an example (No. 2) of creating a decision tree. The decision tree creating unit 140 continues execution of the intermediate code 116 and reaches the instruction with the instruction ID “11”. The instruction with the instruction ID “11” includes the meta function bop_gt. MMID=3 indicated by the first argument of the meta function bop_gt is an MMID that has not been recorded in the execution state of the execution state ID “1”. Therefore, the decision tree creating unit 140 duplicates the execution state of the execution state ID “1” at this stage and sets the execution state of the execution state ID “3” (instruction ID=11 at this stage) to the execution state set 117. to add. The mutation descriptor in the execution state of the execution state ID “3” is (3,<=).

また、決定木作成部140は、ノードm1の“nop”に対応するエッジの先に、MMID=3のノードm3を追加する。決定木作成部140は、“nop”に対応するエッジおよび“<=”に対応するエッジをノードm3に追加する。 Further, the decision tree creating unit 140 adds the node m3 with MMID=3 to the end of the edge corresponding to the "nop" of the node m1. The decision tree creating unit 140 adds an edge corresponding to “nop” and an edge corresponding to “<=” to the node m3.

決定木作成部140は、ノードm3の“nop”に対応するエッジを選択し、当該エッジの先を現在位置とする。この場合、決定木作成部140は、命令ID“11”の命令を元の演算“>”のまま実行する。 The decision tree creating unit 140 selects the edge corresponding to the "nop" of the node m3 and sets the tip of the edge as the current position. In this case, the decision tree creating unit 140 executes the instruction with the instruction ID “11” in the original operation “>”.

図29は、決定木の作成例(その3)を示す図である。決定木作成部140は、中間コード116の実行を継続し、実行状態ID“1”の実行状態において%13=0となり、func(0)==0が成立することを確認する。このため、決定木作成部140は、ノードm3の“nop”に対応するエッジの先にPassの葉ノードを追加する。そして、決定木作成部140は、実行状態集合117から、実行状態ID“1”の実行状態を削除する。 FIG. 29 is a diagram illustrating an example (part 3) of creating a decision tree. The decision tree creating unit 140 continues to execute the intermediate code 116, and confirms that %13=0 in the execution state of the execution state ID “1”, and func(0)==0 holds. Therefore, the decision tree creating unit 140 adds the leaf node of Pass to the end of the edge corresponding to “nop” of the node m3. Then, the decision tree creating unit 140 deletes the execution state with the execution state ID “1” from the execution state set 117.

次に、決定木作成部140は、実行状態集合117に登録された実行状態のうち、実行状態ID“3”の実行状態を選択する。ここで、決定木作成部140は、SSEの手法を用いている。決定木作成部140による実行状態の選択順は、深さ優先探索のアルゴリズムに基づく(実行状態IDを昇順に付与していくので、実行状態IDの大きいものから選択する)。ただし、別のアルゴリズムを用いて、次の実行状態を選択してもよい。 Next, the decision tree creating unit 140 selects the execution state with the execution state ID “3” from the execution states registered in the execution state set 117. Here, the decision tree creating unit 140 uses the SSE method. The order of execution state selection by the decision tree creating unit 140 is based on the depth-first search algorithm (since the execution state IDs are assigned in ascending order, the execution state IDs are selected in descending order). However, another algorithm may be used to select the next execution state.

決定木作成部140は、実行状態ID“3”の情報を参照して、中間コード116における命令ID“11”の命令に戻り、ミューテーション記述子(3,<=)に対応するエッジを選択し、当該エッジの先を現在位置とする。この場合、決定木作成部140は、命令ID“11”の命令を“<=”の演算に変更して実行する。 The decision tree creating unit 140 refers to the information of the execution state ID “3”, returns to the instruction of the instruction ID “11” in the intermediate code 116, and selects the edge corresponding to the mutation descriptor (3,<=). Then, the tip of the edge is set as the current position. In this case, the decision tree creating unit 140 changes the instruction with the instruction ID “11” into the operation of “<=” and executes the operation.

図30は、決定木の作成例(その4)を示す図である。決定木作成部140は、中間コード116の実行を継続し、命令ID“15”の命令に到達する。命令ID“15”の命令は、メタ関数bop_mulを含む。当該メタ関数bop_mulの第1引数で示されるMMID=4は、実行状態ID“3”の実行状態に未記録のMMIDである。 FIG. 30 is a diagram showing an example (part 4) of creating a decision tree. The decision tree creating unit 140 continues execution of the intermediate code 116 and reaches the instruction with the instruction ID “15”. The instruction with the instruction ID “15” includes the meta function bop_mul. MMID=4 indicated by the first argument of the meta function bop_mul is an MMID that has not been recorded in the execution state of the execution state ID “3”.

そこで、決定木作成部140は、この段階における実行状態ID“3”の実行状態を複製して、実行状態ID“4”の実行状態(この段階では命令ID=15)を実行状態集合117に追加する。実行状態ID“4”の実行状態におけるミューテーション記述子は、{(3,<=),(4,/)}である。 Therefore, the decision tree creating unit 140 duplicates the execution state of the execution state ID “3” at this stage and sets the execution state of the execution state ID “4” (instruction ID=15 at this stage) to the execution state set 117. to add. The mutation descriptor in the execution state with the execution state ID “4” is {(3,<=),(4,/)}.

更に、決定木作成部140は、この段階における実行状態ID“3”の実行状態を複製して、実行状態ID“5”の実行状態(この段階では命令ID=15)を実行状態集合117に追加する。実行状態ID“5”の実行状態におけるミューテーション記述子は、{(3,<=),(4,%)}である。 Further, the decision tree creating unit 140 duplicates the execution state of the execution state ID “3” at this stage, and sets the execution state of the execution state ID “5” (instruction ID=15 at this stage) to the execution state set 117. to add. The mutation descriptor in the execution state of the execution state ID “5” is {(3,<=),(4,%)}.

また、決定木作成部140は、ノードm3の“<=”に対応するエッジの先に、MMID=4のノードm4を追加する。決定木作成部140は、“nop”に対応するエッジ、“/”に対応するエッジ、および、“%”に対応するエッジをノードm4に追加する。 Further, the decision tree creating unit 140 adds the node m4 with MMID=4 to the end of the edge corresponding to “<=” of the node m3. The decision tree creating unit 140 adds an edge corresponding to “nop”, an edge corresponding to “/”, and an edge corresponding to “%” to the node m4.

決定木作成部140は、ノードm4の“nop”に対応するエッジを選択し、当該エッジの先を現在位置とする。この場合、決定木作成部140は、命令ID“15”の命令を元の演算“*”のまま実行する。 The decision tree creating unit 140 selects an edge corresponding to “nop” of the node m4 and sets the tip of the edge as the current position. In this case, the decision tree creating unit 140 executes the instruction with the instruction ID “15” in the original operation “*”.

図31は、決定木の作成例(その5)を示す図である。決定木作成部140は、中間コード116の実行を継続し、実行状態ID“3”の実行状態において、%13=0となり、func(0)==0が成立することを確認する。決定木作成部140は、テスト結果テーブル119のミュータントID“M3”およびテストID“Test1”に対して、“Passed”を記録する。決定木作成部140は、ノードm4の“nop”に対応するエッジの先にPassの葉ノードを追加する。そして、決定木作成部140は、実行状態集合117から、実行状態ID“3”の実行状態を削除する。 FIG. 31 is a diagram illustrating an example (No. 5) of creating a decision tree. The decision tree creating unit 140 continues execution of the intermediate code 116, and confirms that %13=0 and func(0)==0 holds in the execution state of the execution state ID “3”. The decision tree creating unit 140 records “Passed” for the mutant ID “M 3 ”and the test ID “Test1” of the test result table 119. The decision tree creating unit 140 adds a leaf node of Pass to the end of the edge corresponding to "nop" of the node m4. Then, the decision tree creating unit 140 deletes the execution state with the execution state ID “3” from the execution state set 117.

次に、決定木作成部140は、実行状態集合117に登録された実行状態のうち、実行状態ID“5”の実行状態を選択する。
決定木作成部140は、実行状態ID“5”の情報を参照して、中間コード116における命令ID“15”の命令に戻り、ミューテーション記述子(4,%)に対応するエッジを選択し、当該エッジの先を現在位置とする。この場合、決定木作成部140は、命令ID“15”の命令を“%”の演算に変更して実行する。
Next, the decision tree creating unit 140 selects the execution state with the execution state ID “5” from the execution states registered in the execution state set 117.
The decision tree creating unit 140 refers to the information of the execution state ID “5”, returns to the instruction of the instruction ID “15” in the intermediate code 116, and selects the edge corresponding to the mutation descriptor (4%). , The tip of the edge is the current position. In this case, the decision tree creating unit 140 changes the instruction with the instruction ID “15” into the operation of “%” and executes the operation.

図32は、決定木の作成例(その6)を示す図である。決定木作成部140は、中間コード116の実行を継続し、実行状態ID“5”の実行状態において、%13=0となり、func(0)==0が成立することを確認する。決定木作成部140は、テスト結果テーブル119のミュータントID“M3,5”およびテストID“Test1”に対して、“Passed”を記録する。決定木作成部140は、ノードm4の“%”に対応するエッジの先にPassの葉ノードを追加する。そして、決定木作成部140は、実行状態集合117から実行状態ID“5”の実行状態を削除する。 FIG. 32 is a diagram illustrating an example (No. 6) of creating a decision tree. The decision tree creating unit 140 continues to execute the intermediate code 116, and confirms that %13=0 and func(0)==0 holds in the execution state of the execution state ID “5”. The decision tree creating unit 140 records “Passed” for the mutant ID “M 3,5 ” and the test ID “Test1” in the test result table 119. The decision tree creating unit 140 adds the leaf node of Pass to the end of the edge corresponding to “%” of the node m4. Then, the decision tree creating unit 140 deletes the execution state with the execution state ID “5” from the execution state set 117.

次に、決定木作成部140は、実行状態集合117に登録された実行状態のうち、実行状態ID“4”の実行状態を選択する。
決定木作成部140は、実行状態ID“4”の情報を参照して、中間コード116における命令ID“15”の命令に戻り、ミューテーション記述子(4,/)に対応するエッジを選択し、当該エッジの先を現在位置とする。この場合、決定木作成部140は、命令ID“15”の命令を“/”の演算に変更して実行する。
Next, the decision tree creating unit 140 selects the execution state with the execution state ID “4” from the execution states registered in the execution state set 117.
The decision tree creating unit 140 refers to the information of the execution state ID “4”, returns to the instruction of the instruction ID “15” in the intermediate code 116, and selects the edge corresponding to the mutation descriptor (4,/). , The tip of the edge is the current position. In this case, the decision tree creating unit 140 changes the instruction of the instruction ID “15” into the operation of “/” and executes it.

図33は、決定木の作成例(その7)を示す図である。決定木作成部140は、中間コード116の実行を継続し、実行状態ID“4”の実行状態において、%13=0となり、func(0)==0が成立することを確認する。決定木作成部140は、テスト結果テーブル119のミュータントID“M3,4”およびテストID“Test1”に対して、“Passed”を記録する。決定木作成部140は、ノードm4の“/”に対応するエッジの先にPassの葉ノードを追加する。そして、決定木作成部140は、実行状態集合117から実行状態ID“4”の実行状態を削除する。 FIG. 33 is a diagram showing an example (No. 7) of creating a decision tree. The decision tree creating unit 140 continues execution of the intermediate code 116, and confirms that %13=0 and func(0)==0 holds in the execution state of the execution state ID “4”. The decision tree creating unit 140 records “Passed” for the mutant ID “M 3,4 ”and the test ID “Test 1” of the test result table 119. The decision tree generator 140 adds a leaf node of Pass to the end of the edge corresponding to “/” of the node m4. Then, the decision tree creating unit 140 deletes the execution state with the execution state ID “4” from the execution state set 117.

次に、決定木作成部140は、実行状態集合117に登録された実行状態ID“2”の実行状態を選択する。
決定木作成部140は、実行状態ID“2”の情報を参照して、中間コード116における命令ID“3”の命令に戻り、ミューテーション記述子(1,>=)に対応するエッジを選択し、当該エッジの先を現在位置とする。この場合、決定木作成部140は、命令ID“3”の命令を“>=”の演算に変更して実行する。
Next, the decision tree creating unit 140 selects the execution state of the execution state ID “2” registered in the execution state set 117.
The decision tree creating unit 140 refers to the information of the execution state ID “2”, returns to the instruction of the instruction ID “3” in the intermediate code 116, and selects the edge corresponding to the mutation descriptor (1, >=). Then, the tip of the edge is set as the current position. In this case, the decision tree creating unit 140 changes the instruction with the instruction ID “3” to the operation “>=” and executes the operation.

図34は、決定木の作成例(その8)を示す図である。決定木作成部140は、中間コード116の実行を継続し、命令ID“7”の命令に到達する。命令ID“7”の命令は、メタ関数bop_addを含む。当該メタ関数bop_addの第1引数で示されるMMID=2は、実行状態ID“2”の実行状態に未記録のMMIDである。そこで、決定木作成部140は、この段階における実行状態ID“2”の実行状態を複製して、実行状態ID“6”の実行状態(この段階では命令ID=7)を実行状態集合117に追加する。実行状態ID“6”の実行状態におけるミューテーション記述子は、{(1,>=),(2,−)}である。 FIG. 34 is a diagram illustrating an example (No. 8) of creating a decision tree. The decision tree creating unit 140 continues execution of the intermediate code 116 and reaches the instruction with the instruction ID “7”. The instruction with the instruction ID “7” includes the meta function bop_add. MMID=2 indicated by the first argument of the meta function bop_add is an MMID that has not been recorded in the execution state of the execution state ID “2”. Therefore, the decision tree creating unit 140 duplicates the execution state of the execution state ID “2” at this stage and sets the execution state of the execution state ID “6” (instruction ID=7 at this stage) to the execution state set 117. to add. The mutation descriptor in the execution state with the execution state ID “6” is {(1, >=), (2, −)}.

また、決定木作成部140は、ノードm1の“>=”に対応するエッジの先に、MMID=2のノードm2を追加する。決定木作成部140は、“nop”に対応するエッジおよび“−”に対応するエッジをノードm2に追加する。 In addition, the decision tree creating unit 140 adds the node m2 with MMID=2 to the end of the edge corresponding to “>=” of the node m1. The decision tree creating unit 140 adds an edge corresponding to “nop” and an edge corresponding to “−” to the node m2.

決定木作成部140は、ノードm2の“nop”に対応するエッジを選択し、当該エッジの先を現在位置とする。この場合、決定木作成部140は、命令ID“7”の命令を元の演算“+”のまま実行する。 The decision tree creating unit 140 selects an edge corresponding to "nop" of the node m2, and sets the tip of the edge as the current position. In this case, the decision tree creating unit 140 executes the instruction with the instruction ID “7” in the original operation “+”.

図35は、決定木の作成例(その9)を示す図である。決定木作成部140は、中間コード116の実行を継続し、実行状態ID“2”の実行状態において、%13=1となり、func(0)==0が成立しないことを確認する。決定木作成部140は、テスト結果テーブル119のミュータントID“M1”およびテストID“Test1”に対して、“Failed”を記録する。決定木作成部140は、ノードm2の“nop”に対応するエッジの先にFailの葉ノードを追加する。そして、決定木作成部140は、実行状態集合117から、実行状態ID“2”の実行状態を削除する。 FIG. 35 is a diagram showing an example (No. 9) of creating a decision tree. The decision tree creating unit 140 continues execution of the intermediate code 116, and confirms that %13=1 and func(0)==0 is not established in the execution state of the execution state ID “2”. The decision tree creating unit 140 records “Failed” for the mutant ID “M 1 ”and the test ID “Test 1 ” in the test result table 119. The decision tree creating unit 140 adds a Fail leaf node to the end of the edge corresponding to the "nop" of the node m2. Then, the decision tree creating unit 140 deletes the execution state with the execution state ID “2” from the execution state set 117.

次に、決定木作成部140は、実行状態集合117に登録された実行状態ID“6”の実行状態を選択する。
決定木作成部140は、実行状態ID“6”の情報を参照して、中間コード116における命令ID“7”の命令に戻り、ミューテーション記述子(2,−)に対応するエッジを選択し、当該エッジの先を現在位置とする。この場合、決定木作成部140は、命令ID“7”の命令を“−”の演算に変更して実行する。
Next, the decision tree creating unit 140 selects the execution state of the execution state ID “6” registered in the execution state set 117.
The decision tree creating unit 140 refers to the information of the execution state ID “6”, returns to the instruction of the instruction ID “7” in the intermediate code 116, and selects the edge corresponding to the mutation descriptor (2, −). , The tip of the edge is the current position. In this case, the decision tree creating unit 140 changes the instruction with the instruction ID “7” into the operation with “−” and executes the operation.

図36は、決定木の作成例(その10)を示す図である。決定木作成部140は、中間コード116の実行を継続し、実行状態ID“6”の実行状態において、%13=−1となり、func(0)==0が成立しないことを確認する。決定木作成部140は、テスト結果テーブル119のミュータントID“M1,2”およびテストID“Test1”に対して、“Failed”を記録する。決定木作成部140は、ノードm2の“−”に対応するエッジの先にFailの葉ノードを追加する。そして、決定木作成部140は、実行状態集合117から、実行状態ID“6”の実行状態を削除する。 FIG. 36 is a diagram illustrating an example (No. 10) of creating a decision tree. The decision tree creating unit 140 continues to execute the intermediate code 116, and in the execution state of the execution state ID “6”, %13=−1, and confirms that func(0)==0 is not established. The decision tree creating unit 140 records “Failed” for the mutant ID “M 1,2 ” and the test ID “Test1” in the test result table 119. The decision tree creating unit 140 adds the leaf node of Fail to the end of the edge corresponding to "-" of the node m2. Then, the decision tree creating unit 140 deletes the execution state with the execution state ID “6” from the execution state set 117.

この段階で、実行状態集合117に登録された実行状態がなくなる。このため、決定木作成部140は、テストID“Test1”のテストケースの実行を完了する。また、決定木作成部140は、決定木T10の作成を完了する。決定木作成部140は、次のテストID“Test2”のテストケースを選択する。決定木作成部140は、他のテストケースについても同様にして、決定木T20,T30を作成する。 At this stage, the execution states registered in the execution state set 117 disappear. Therefore, the decision tree creating unit 140 completes the execution of the test case with the test ID “Test1”. The decision tree creating unit 140 also completes the creation of the decision tree T10. The decision tree creating unit 140 selects the test case with the next test ID “Test2”. The decision tree creating unit 140 creates decision trees T20 and T30 in the same manner for other test cases.

次に、2つの決定木のマージ例を説明する。以下では、決定木T20,T30をマージする場合を例示する。
図37は、決定木のマージ例(その1)を示す図である。図37(A)は、決定木作成部140により作成された決定木T20(Test2(m1,m2,m3,m4))を示す。図37(B)は、決定木作成部140により作成された決定木T30(Test3(m1,m2,m3,m4))を示す。決定木作成部140は、決定木Tout(1)を用意する。ここで、決定木マージ処理の再帰的な実行により登場するToutを、Tout(1)、Tout(2)、・・・のように表記して区別する。決定木Tout(1)は、この段階では空である。
Next, an example of merging two decision trees will be described. Below, the case where the decision trees T20 and T30 are merged is illustrated.
FIG. 37 is a diagram showing an example (part 1) of merging decision trees. FIG. 37A shows the decision tree T20 (Test2(m1, m2, m3, m4)) created by the decision tree creating unit 140. FIG. 37B shows the decision tree T30 (Test3(m1, m2, m3, m4)) created by the decision tree creating unit 140. The decision tree creating unit 140 prepares the decision tree Tout(1). Here, Tout that appears due to the recursive execution of the decision tree merging process is represented by Tout(1), Tout(2),... The decision tree Tout(1) is empty at this stage.

まず、決定木マージ処理の入力は、(T1,T2,n)=(Test2(m1,m2,m3,m4),Test3(m1,m2,m3,m4),1)である。T1=Test2(m1,m2,m3,m4)およびT2=Test3(m1,m2,m3,m4)は、何れも、Failの葉ノードのみの木ではない(ステップS72 No)。また、T1=Test2(m1,m2,m3,m4)およびT2=Test3(m1,m2,m3,m4)は、何れも、Passの葉ノードのみの木ではない(ステップS74 NoかつステップS76 No)。更に、T1=Test2(m1,m2,m3,m4)およびT2=Test3(m1,m2,m3,m4)には、N1に相当するノードm1が存在する(ステップS78 No)。 First, the input of the decision tree merge processing is (T 1 , T 2 , n)=(Test2(m1, m2, m3, m4), Test3(m1, m2, m3, m4), 1). Neither T 1 =Test2 (m1, m2, m3, m4) nor T 2 =Test3 (m1, m2, m3, m4) is a tree of Fail leaf nodes only (step S72 No). Moreover, neither T 1 =Test2 (m1, m2, m3, m4) nor T 2 =Test3 (m1, m2, m3, m4) is a tree having only Pass leaf nodes (No in step S74 and step S76). No). Furthermore, at T 1 =Test2 (m1, m2, m3, m4) and T 2 =Test3 (m1, m2, m3, m4), a node m1 corresponding to N1 exists (step S78 No).

よって、決定木マージ部150は、Tout(1)にノードm1を追加する(ステップS80)。
図38は、決定木のマージ例(その2)を示す図である。ノードm1におけるミューテーションオペレータは、“>=”および“nop”である。そこで、決定木マージ部150は、これら2つのミューテーションオペレータに対して、ステップS81〜S85を実行する。まず、“>=”について考える。
Therefore, the decision tree merging unit 150 adds the node m1 to Tout(1) (step S80).
FIG. 38 is a diagram illustrating an example (part 2) of merging decision trees. The mutation operators in the node m1 are “>=” and “nop”. Therefore, the decision tree merging unit 150 executes steps S81 to S85 for these two mutation operators. First, consider “>=”.

この場合、T1[1,>=]=Test2|[1,>=](m2,m3,m4)は、決定木T20のノードm1の“>=”に対応するエッジの先の部分木T21である(ステップS82)。 In this case, T 1 | [1,>=] =Test2| [1,>=] (m2,m3,m4) is the subtree at the end of the edge corresponding to “>=” of the node m1 of the decision tree T20. It is T21 (step S82).

また、T2[1,>=]=Test3|[1,>=](m2,m3,m4)は、決定木T30のノードm1の“>=”に対応するエッジの先の部分木T31である(ステップS83)。
決定木マージ部150は、入力を(T1[1,>=],T2[1,>=],2)として、決定木マージ処理を実行する。決定木マージ部150は、決定木Tout(1)におけるノードm1の“>=”に対応するエッジ(e1,>=)の先に、決定木マージ処理(T1[1,>=],T2[1,>=],2)の出力Tout(2)を追加する(ステップS84)。
Further, T 2 | [1,>=] =Test3| [1,>=] (m2, m3, m4) is a subtree T31 at the end of the edge corresponding to “>=” of the node m1 of the decision tree T30. (Step S83).
The decision tree merging unit 150 executes the decision tree merging process with the input (T 1 | [1,>=] , T 2 | [1,>=] , 2). The decision tree merging unit 150 determines the decision tree merge process (T 1 | [1, >=] ) before the edge (e 1,>= ) corresponding to “>=” of the node m1 in the decision tree Tout(1) . , T 2 | [1, >=] , 2) output Tout(2) is added (step S84).

次に、“nop”について考える。
この場合、T1[1,nop]=Test2|[1,nop](m2,m3,m4)は、決定木T20のノードm1の“nop”に対応するエッジの先の部分木T22である(ステップS82)。
Next, consider “nop”.
In this case, T 1 | [1,nop] =Test2| [1,nop] (m2, m3, m4) is the subtree T22 ahead of the edge corresponding to “nop” of the node m1 of the decision tree T20. (Step S82).

また、T2[1,nop]=Test3|[1,nop](m2,m3,m4)は、決定木T30のノードm1の“nop”に対応するエッジの先の部分木T32である(ステップS83)。 Further, T 2 | [1,nop] =Test3| [1,nop] (m2, m3, m4) is the subtree T32 at the end of the edge corresponding to the “nop” of the node m1 of the decision tree T30 ( Step S83).

決定木マージ部150は、入力を(T1[1,nop],T2[1,nop],2)として、決定木マージ処理を実行し、その出力を、決定木Tout(1)におけるノードm1の“nop”に対応するエッジ(e1,nop)の先に追加する(ステップS84)。 The decision tree merging unit 150 executes the decision tree merging process with the input (T 1 | [1,nop] , T 2 | [1,nop] , 2), and outputs the decision tree Tout( 1) It is added to the end of the edge (e 1,nop ) corresponding to the “nop” of the node m1 in (step S84).

次に、前述の部分木T21,T31のマージ例(決定木マージ処理(T1[1,>=],T2[1,>=],2))を説明する。
決定木作成部140は、決定木Tout(2)を用意する。決定木Tout(2)は、この段階では空である。
Next, an example of merging the above-mentioned subtrees T21 and T31 (decision tree merge processing (T 1 | [1,>=] , T 2 | [1,>=] , 2)) will be described.
The decision tree creating unit 140 prepares the decision tree Tout(2). The decision tree Tout(2) is empty at this stage.

1[1,>=]およびT2[1,>=]は、何れも、Failの葉ノードのみの木ではない(ステップS72 No)。また、T1[1,>=]およびT2[1,>=]は、何れも、Passの葉ノードのみの木ではない(ステップS74 NoかつステップS76 No)。更に、T1[1,>=]には、N2に相当するノードm2が存在する(ステップS78 No)。 Neither T 1 | [1,>=] nor T 2 | [1,>=] is a tree of Fail leaf nodes only (step S 72 No). Further, neither T 1 | [1,>=] or T 2 | [1,>=] is a tree having only leaf nodes of Pass (step S 74 No and step S 76 No). Furthermore, a node m2 corresponding to N2 exists in T 1 | [1, >=] (No in step S78).

よって、決定木マージ部150は、決定木Tout(2)にノードm2を追加する(ステップS80)。
図39は、決定木のマージ例(その3)を示す図である。ノードm2におけるミューテーションオペレータは、“−”および“nop”である。そこで、決定木マージ部150は、これら2つのミューテーションオペレータに対して、ステップS81〜S85を実行する。まず、“−”について考える。
Therefore, the decision tree merging unit 150 adds the node m2 to the decision tree Tout(2) (step S80).
FIG. 39 is a diagram illustrating an example (part 3) of merging decision trees. The mutation operators at node m2 are "-" and "nop". Therefore, the decision tree merging unit 150 executes steps S81 to S85 for these two mutation operators. First, consider "-".

この場合、T1[1,>=],[2,-]=Test2|[1,>=],[2,-](m3,m4)は、部分木T21のノードm2の“−”に対応するエッジの先の部分木T21aである(ステップS82)。部分木T21aは、Failの葉ノードのみを要素にもつ。 In this case, T 1 | [1,>=],[2,-] =Test2| [1,>=],[2,-] (m3,m4) is "-" of the node m2 of the subtree T21. It is the partial tree T21a at the end of the edge corresponding to (step S82). The subtree T21a has only a leaf node of Fail as an element.

また、部分木T31は、ノードm2をもたない。このため、T2[1,>=],[2,-]=Test3|[1,>=],[2,-](m3,m4)は、部分木T31と同じ構造をもつ部分木T31aである(ステップS83)。 Further, the subtree T31 does not have the node m2. Therefore, T 2 | [1,>=],[2,-] =Test3| [1,>=],[2,-] (m3,m4) is a subtree having the same structure as the subtree T31. It is T31a (step S83).

決定木マージ部150は、入力を(T1[1,>=],[2,-],T2[1,>=],[2,-],3)として、決定木マージ処理を実行する。決定木マージ部150は、決定木Tout(2)におけるノードm2の“−”に対応するエッジ(e2,-)の先に、決定木マージ処理(T1[1,>=],[2,-],T2[1,>=],[2,-],3)の出力Tout(3)を追加する(ステップS84)。 The decision tree merging unit 150 takes the input as (T 1 | [1,>=],[2,-] , T 2 | [1,>=],[2,-] , 3) and makes a decision tree merge process. To execute. The decision tree merging unit 150 ends the decision tree merging process (T 1 | [1, >=],[] before the edge (e 2,− ) corresponding to “−” of the node m2 in the decision tree Tout(2) . The output Tout(3) of 2,-] , T 2 | [1,>=], [2,-] , 3) is added (step S84).

この場合、T1[1,>=],[2,-]は、Failの葉ノードのみをもつ部分木T21aを示すので、Tout(3)はFailの葉ノードとなる(ステップS72 Yes,S73,S86)。 In this case, T 1 | [1, >=], [2,-] indicates a subtree T21a having only Fail leaf nodes, and thus Tout(3) is a Fail leaf node (step S72 Yes, S73, S86).

次に、“nop”について考える。
この場合、T1[1,>=],[2,nop]=Test2|[1,>=],[2,nop](m3,m4)は、部分木T21のノードm2の“nop”に対応するエッジの先の部分木T21bである(ステップS82)。部分木T21bは、Passの葉ノードのみを要素にもつ。
Next, consider “nop”.
In this case, T 1 | [1,>=],[2,nop] =Test2| [1,>=],[2,nop] (m3,m4) is the “nop” of the node m2 of the subtree T21. It is the partial tree T21b at the end of the edge corresponding to (step S82). The subtree T21b has only leaf nodes of Pass as elements.

また、部分木T31は、ノードm2をもたない。このため、T2[1,>=],[2,nop]=Test3|[1,>=],[2,nop](m3,m4)は、部分木T31と同じ構造をもつ部分木T31bである(ステップS83)。 Further, the subtree T31 does not have the node m2. Therefore, T 2 | [1,>=],[2,nop] =Test3| [1,>=],[2,nop] (m3,m4) is a subtree having the same structure as the subtree T31. It is T31b (step S83).

決定木マージ部150は、入力を(T1[1,>=],[2,nop],T2[1,>=],[2,nop],3)として、決定木マージ処理を実行する。決定木マージ部150は、決定木Tout(2)におけるノードm2の“nop”に対応するエッジ(e2,nop)の先に、決定木マージ処理(T1[1,>=],[2,nop],T2[1,>=],[2,nop],3)の出力Tout(4)を追加する(ステップS84)。 The decision tree merging unit 150 takes the input as (T 1 | [1,>=],[2,nop] , T 2 | [1,>=],[2,nop] ,3) , and performs the decision tree merge process. To execute. The decision tree merging unit 150 precedes the edge (e 2,nop ) corresponding to the “nop” of the node m2 in the decision tree Tout(2) with the decision tree merge process (T 1 | [1, >=],[ 2,nop] , T 2 | [1,>=],[2,nop] , 3) output Tout(4) is added (step S84).

この場合、T1[1,>=],[2,nop]およびT2[1,>=],[2,nop]は、何れも、Failの葉ノードのみの木ではない(ステップS72 No)。
一方、T1[1,>=],[2,nop]は、Passの葉ノードのみをもつ部分木T21bを示すので、Tout(4)=T2[1,>=],[2,nop]となる(ステップS74 Yes,S75,S86)。
In this case, T 1 | [1,>=],[2,nop] and T 2 | [1,>=],[2,nop] are not trees of Fail leaf nodes only (step S72 No).
On the other hand, T 1 | [1,>=],[2,nop] indicates a subtree T21b having only leaf nodes of Pass, so Tout(4)=T 2 | [1,>=],[2 , nop] (step S74 Yes, S75, S86).

図40は、決定木のマージ例(その4)を示す図である。木T51は、決定木T20,T30のマージ途中の木であり、図39で例示したマージ処理の結果(決定木Tout(2))が決定木Tout(1)に追加された段階を示している。 FIG. 40 is a diagram showing an example (part 4) of merging decision trees. The tree T51 is a tree in the middle of merging the decision trees T20 and T30, and shows the stage in which the result of the merge processing illustrated in FIG. 39 (decision tree Tout(2)) is added to the decision tree Tout(1). ..

決定木マージ部150は、木T51におけるノードm1の“nop”に対応するエッジの先も同様にしてマージ処理を実行し、決定木T20,T30をマージした決定木T52を得る。決定木T52は、Tout(1)の出力結果である。 The decision tree merging unit 150 similarly performs the merge process on the edge of the edge corresponding to the "nop" of the node m1 in the tree T51, and obtains the decision tree T52 in which the decision trees T20 and T30 are merged. The decision tree T52 is the output result of Tout(1).

決定木マージ部150は、決定木T52と決定木T10とに対して決定木マージ処理を実行することで、決定木T40を得る。
図41は、決定木を辿る例(その1)を示す図である。結果出力部160は、テスト結果テーブル119に記録された各ミュータントに対するテストケースの実行結果(PassedまたはFailed)に基づいて、各ミュータントのミュータント生存結果を得る。ただし、結果出力部160は、テスト結果テーブル119において、実行結果“Failed”が記録されていないミュータントについては、ミュータント生存結果を得ることができない。そこで、結果出力部160は、決定木T40を辿ることで、ミュータント生存結果を得られていないミュータントに対するミュータント生存結果を決定する。
The decision tree merging unit 150 obtains the decision tree T40 by executing the decision tree merge process on the decision tree T52 and the decision tree T10.
FIG. 41 is a diagram illustrating an example (part 1) of tracing a decision tree. The result output unit 160 obtains the mutant survival result of each mutant based on the execution result (Passed or Failed) of the test case for each mutant recorded in the test result table 119. However, the result output unit 160 cannot obtain the mutant survival result for the mutant for which the execution result “Failed” is not recorded in the test result table 119. Therefore, the result output unit 160 determines the mutant survival result for the mutant for which the mutant survival result has not been obtained by tracing the decision tree T40.

例えば、図13で例示したテスト結果テーブル119では、2次のミュータントM3,4について、テストID“Test1”のテストケースに“Passed”が記録されているのみであり、ミュータント生存結果が得られていない。 For example, in the test result table 119 illustrated in FIG. 13, only “Passed” is recorded in the test case of the test ID “Test1” for the secondary mutant M 3,4 , and the mutant survival result is obtained. Not not.

そこで、結果出力部160は、ミュータントM3,4について、決定木T40によりミュータント生存結果を決定する。コード111aは、ミュータントM3,4に対応するコード例である。コード111aでは、ソースコード111のMMID“3”に対応する箇所(4行目)の演算子“>”が演算子“<=”に変更されている。コード111aでは、ソースコード111のMMID“4”に対応する箇所(5行目)の演算子“*”が演算子“/”に変更されている。 Therefore, the result output unit 160, the mutant M 3, 4, to determine the mutant survival results by the decision tree T40. The code 111a is a code example corresponding to the mutant M 3,4 . In the code 111a, the operator ">" at the location (fourth line) corresponding to the MMID "3" of the source code 111 is changed to the operator "<=". In the code 111a, the operator “*” at the location (fifth line) corresponding to the MMID “4” of the source code 111 is changed to the operator “/”.

まず、結果出力部160は、決定木T40の根ノードであるノードm1を選択する。ミュータントM3,4は、MMID“1”のミューテーションオペレータを含まない(すなわち、MMID“1”に対するミューテーションオペレータは“nop”である)。このため、結果出力部160は、ノードm1の“nop”のエッジを辿り、ノードm2を選択する。 First, the result output unit 160 selects the node m1 that is the root node of the decision tree T40. Mutant M 3,4 does not include the mutation operator of MMID “1” (that is, the mutation operator for MMID “1” is “nop”). Therefore, the result output unit 160 traces the “nop” edge of the node m1 and selects the node m2.

ミュータントM3,4は、MMID“2”のミューテーションオペレータを含まない(すなわち、MMID“2”に対するミューテーションオペレータは“nop”である)。このため、結果出力部160は、ノードm2の“nop”のエッジを辿り、ノードm3を選択する。 Mutant M 3,4 does not include the mutation operator of MMID “2” (that is, the mutation operator for MMID “2” is “nop”). Therefore, the result output unit 160 follows the “nop” edge of the node m2 and selects the node m3.

ミュータントM3,4のMMID“3”のミューテーションオペレータは、“<=”である。このため、結果出力部160は、ノードm3の“<=”のエッジを辿り、Failの葉ノードに辿り着く。Failの葉ノードに辿り着いたので、結果出力部160は、ミュータントM3,4がkillされると判断する。したがって、結果出力部160は、テスト結果テーブル119のミュータントM3,4に対して、ミュータント生存結果“Killed”を登録する。 The mutation operator of the MMID “3” of the mutant M 3,4 is “<=”. Therefore, the result output unit 160 traces the edge of “<=” of the node m3 to reach the leaf node of Fail. Having reached the leaf node of Fail, the result output unit 160 determines that the mutant M 3,4 is killed. Therefore, the result output unit 160 registers the mutant survival result “Killed” for the mutants M 3,4 in the test result table 119.

なお、テストID“Test2”のテストケース(func(1)==2)に対し、コード111aを実際に実行すると、func(1)=0なので、ミュータントM3,4に対する実行結果は“Fail”である。また、テストID“Test3”のテストケース(func(−1)==0)に対し、コード111aを実際に実行すると、func(−1)=0なので、ミュータントM3,4に対する実行結果は“Pass”である。テストID“Test2”のテストケースで“Fail”なので、決定木T40を辿ることで得られたミュータント生存結果“Killed”は正しいテスト結果である。解析装置100は、実際にテストID“Test2”、“Test3”のテストケースを実行せずに、ミュータントM3,4に対するテスト結果を得られたことになる。 Incidentally, with respect to test case of the test ID "Test2" (func (1 ) == 2), when actually executing the code 111a, func (1) = 0 so the execution result for mutant M 3, 4 is "Fail" Is. Further, when the code 111a is actually executed for the test case (func(−1)==0) of the test ID “Test3”, func(−1)=0, so the execution result for the mutant M 3,4 is “ Pass”. Since the test case of the test ID "Test2" is "Fail", the mutant survival result "Killed" obtained by tracing the decision tree T40 is a correct test result. It means that the analysis apparatus 100 has obtained the test result for the mutant M 3,4 without actually executing the test cases of the test IDs “Test2” and “Test3”.

図42は、決定木を辿る例(その2)を示す図である。次に、3次のミュータントM1,3,4を考える。図13で例示したテスト結果テーブル119では、3次のミュータントM1,3,4について、テストID“Test3”のテストケースに“Passed”が記録されているのみであり、ミュータント生存結果が得られていない。 FIG. 42 is a diagram illustrating an example (part 2) of tracing a decision tree. Next, consider the third-order mutants M 1,3,4 . In the test result table 119 illustrated in FIG. 13, for the third-order mutants M 1,3,4 , only “Passed” is recorded in the test case of the test ID “Test3”, and the mutant survival result is obtained. Not not.

そこで、結果出力部160は、ミュータントM1,3,4について、決定木T40によりミュータント生存結果を決定する。コード111bは、ミュータントM1,3,4に対応するコード例である。コード111bでは、ソースコード111のMMID“1”に対応する箇所(2行目)の演算子“<”が演算子“>=”に変更されている。また、コード111bでは、ソースコード111のMMID“3”に対応する箇所(4行目)の演算子“>”が演算子“<=”に変更されている。更に、コード111bでは、ソースコード111のMMID“4”に対応する箇所(5行目)の演算子“*”が演算子“/”に変更されている。 Therefore, the result output unit 160 determines the mutant survival result for the mutants M 1,3,4 using the decision tree T40. Code 111b is a code example corresponding to mutants M 1,3,4 . In the code 111b, the operator "<" at the location (second line) corresponding to the MMID "1" of the source code 111 is changed to the operator ">=". Further, in the code 111b, the operator ">" at the location (4th line) corresponding to the MMID "3" of the source code 111 is changed to the operator "<=". Further, in the code 111b, the operator "*" at the portion (fifth line) corresponding to the MMID "4" of the source code 111 is changed to the operator "/".

まず、結果出力部160は、決定木T40の根ノードであるノードm1を選択する。ミュータントM1,3,4のMMID“1”のミューテーションオペレータは、“>=”である。このため、結果出力部160は、ノードm2の“>=”のエッジを辿り、ノードm2を選択する。 First, the result output unit 160 selects the node m1 that is the root node of the decision tree T40. The mutation operator of the MMID “1” of the mutant M 1,3,4 is “>=”. Therefore, the result output unit 160 follows the “>=” edge of the node m2 and selects the node m2.

ミュータントM1,3,4は、MMID“2”のミューテーションオペレータを含まない(すなわち、MMID“2”に対してミューテーションオペレータは“nop”である)。このため、結果出力部160は、ノードm2の“nop”のエッジを辿り、Failの葉ノードに辿り着く。Failの葉ノードに辿り着いたので、結果出力部160は、テスト結果テーブル119のミュータントM1,3,4に対して、ミュータント生存結果“Killed”を登録する。 Mutants M 1,3,4 do not include the mutation operator of MMID “2” (that is, the mutation operator is “nop” for MMID “2”). Therefore, the result output unit 160 follows the “nop” edge of the node m2 to reach the Fail leaf node. Having arrived at the Fail leaf node, the result output unit 160 registers the mutant survival result “Killed” for the mutants M 1,3,4 of the test result table 119.

なお、テストID“Test1”のテストケース(func(0)==0)に対し、コード111bを実際に実行すると、func(0)=1なので、ミュータントM1,3,4に対する実行結果は“Fail”である。また、テストID“Test2”のテストケース(func(1)==2)に対し、コード111bを実際に実行すると、func(1)=2なので、ミュータントM1,3,4に対する実行結果は“Pass”である。テストID“Test1”のテストケースで“Fail”なので、決定木T40を辿ることで得られたミュータント生存結果“Killed”は正しいテスト結果である。解析装置100は、実際にテストID“Test1”、“Test2”のテストケースを実行せずに、ミュータントM1,3,4に対するテスト結果を得られたことになる。 When the code 111b is actually executed for the test case of test ID “Test1” (func(0)==0), func(0)=1, so the execution result for the mutants M 1,3,4 is “ Fail”. When the code 111b is actually executed for the test case of test ID “Test2” (func(1)==2), func(1)=2, so the execution result for the mutants M 1,3,4 is “ Pass”. Since the test case of the test ID "Test1" is "Fail", the mutant survival result "Killed" obtained by tracing the decision tree T40 is a correct test result. It means that the analyzer 100 has obtained the test results for the mutants M 1,3,4 without actually executing the test cases of the test IDs “Test1” and “Test2”.

図43は、テスト結果の取得例を示す図である。結果出力部160は、こうして、決定木T40を辿ることで、ミュータント生存結果を得られていないミュータントに対するミュータント生存結果を補完し、テスト結果テーブル119aを得る。 FIG. 43 is a diagram illustrating an example of acquisition of test results. In this way, the result output unit 160 traces the decision tree T40 to complement the mutant survival result for the mutant for which the mutant survival result has not been obtained, and obtains the test result table 119a.

具体的には、SSEによるテスト実行では、図13のテスト結果テーブル119で示したように、21個のミュータントのうち、ミュータントM1,M2,M3,M4,M5,M1,2,M1,3,M1,3,5のミュータント生存結果を得られる。一方、残りの13個のミュータントについては、ミュータント生存結果を得られない。 Specifically, in the test execution by SSE, as shown in the test result table 119 of FIG. 13, among the 21 mutants, the mutants M 1 , M 2 , M 3 , M 4 , M 5 , M 1, Mutant survival results of 2 , M 1,3 , M 1,3,5 are obtained. On the other hand, no mutant survival results can be obtained for the remaining 13 mutants.

そこで、結果出力部160は、各ミュータントについて決定木T40を辿ることで、各ミュータントのミュータント生存結果を得る。これにより、結果出力部160は、前述のミュータントM3,4,M1,3,4を含むミュータント生存結果を得られていないミュータントに対し、ミュータント生存結果を得られる。このとき、結果出力部160は、全てのテストケースで試行されなかったミュータント(例えば、ミュータントM1,4,M1,2,3など)に対するミュータント生存結果も得ることができる。 Therefore, the result output unit 160 obtains the mutant survival result of each mutant by tracing the decision tree T40 for each mutant. As a result, the result output unit 160 can obtain the mutant survival result for the mutants that have not obtained the mutant survival result including the above-mentioned mutants M 3,4 and M 1,3,4 . At this time, the result output unit 160 can also obtain mutant survival results for mutants that have not been tried in all test cases (for example, mutants M 1,4 , M 1,2,3, etc.).

すなわち、解析装置100は、一部のテストケースにより試行されるミュータント箇所(変更箇所)の組合せのうち、当該一部のテストケースの実行結果からはミュータント生存結果(テスト結果)を取得できない組合せに対して、効率的にテスト結果を得られる。また、解析装置100は、現在用意されている複数のテストケースでは試行されないミュータント箇所の組合せに対しても、効率的にテスト結果を得られる。 That is, the analysis device 100 selects a combination in which the mutant survival result (test result) cannot be acquired from the execution results of the partial test case among the combinations of mutant parts (changed parts) that are tried by some test cases. On the other hand, test results can be obtained efficiently. In addition, the analysis apparatus 100 can efficiently obtain the test result even for the combination of mutant points that are not tried in the plurality of test cases currently prepared.

テスト結果テーブル119aの例では、ユーザにより指定された3次以下のミュータントのミュータント生存結果が全て“Killed”である。このため、結果出力部160は、ミューテーションスコアMS=21/21=100%を出力する。したがって、現在のテストプログラム113により、3次以下のミュータントを全て検出できることが分かる。ミューテーションスコアMSが100%未満であれば、ユーザは、例えば、ミュータントの検出率(ミューテーションスコア)を向上するように、テストプログラムの改善を図れる。 In the example of the test result table 119a, all the mutant survival results of the third or lower mutants designated by the user are “Killed”. Therefore, the result output unit 160 outputs the mutation score MS=21/21=100%. Therefore, it can be seen that the current test program 113 can detect all mutants of the third order and below. If the mutation score MS is less than 100%, the user can improve the test program so as to improve the mutation detection rate (mutation score), for example.

図44は、SSEでは実行されないミュータントの例を示す図である。SSEでは、前述のように、ソースコード111をコンパイルして得られた中間コード116に対して、命令の実行順に、実行状態を分岐させながらミューテーションを行う。このため、ユーザにより指定された次数のミュータントのうち、比較的高次のミュータントの実行が省略されることがある。 FIG. 44 is a diagram illustrating an example of a mutant that is not executed in SSE. In SSE, as described above, the intermediate code 116 obtained by compiling the source code 111 is mutated while branching the execution state in the order of instruction execution. For this reason, among the mutants of the order designated by the user, the execution of a relatively high-order mutant may be omitted.

ここで、図44では、一例として、ミュータントM1に対応するコード111x、ミュータントM3に対応するコード111y、ミュータントM3,4に対応するコード111a、および、ミュータントM1,3,4に対応するコード111bを示す。コード111xは、ソースコード111のMMID“1”に対応する箇所(2行目)の演算子“<”を演算子“>=”に変更したものである。コード111yは、ソースコード111のMMID“3”に対応する箇所(4行目)の演算子“>”を演算子“<=”に変更したものである。 In FIG. 44, as an example, the code corresponding to the mutant M 1 111x, code corresponding to the mutant M 3 111y, code 111a corresponding to the mutant M 3, 4, and corresponds to the mutant M 1, 3,4 The code 111b is shown. The code 111x is obtained by changing the operator "<" in the portion (second line) corresponding to the MMID "1" of the source code 111 to the operator ">=". The code 111y is obtained by changing the operator ">" in the portion (4th line) corresponding to the MMID "3" of the source code 111 to the operator "<=".

この場合、テストID“Test1”のテストケース(func(0)==0)に対し、ミュータントM1,M3,M3,4は実行されるが、ミュータントM1,3,4は実行されない。なぜなら、テストID“Test1”のテストケースでは、MMID=1,3,4に対応する3つのミューテーション箇所に同時に到達しないからである。すなわち、ミュータントM1が実行される場合、ミュータントM3,M4に対応するミューテーション箇所が実行経路から外れるので、ミュータントM1に対して、ミュータントM3,M4に相当する変更内容が更に適用されることはない。また、ミュータントM3が実行される場合、ミュータントM1に対応するミューテーション箇所が実行経路から外れるので、ミュータントM3に対して、ミュータントM1に相当する変更内容が更に適用されることはない。このように、SSEでは実行されないミュータントが存在し得る。また、一部のテストケースで実行されるものの実行結果がPassとなってミュータント生存結果を判断できないミュータントが存在し得る。 In this case, the mutants M 1 , M 3 , M 3,4 are executed but the mutants M 1,3,4 are not executed for the test case (func(0)=0) of the test ID “Test1”. .. This is because, in the test case with the test ID “Test1”, the three mutation locations corresponding to MMID=1, 3, 4 are not reached at the same time. That is, when the mutant M 1 is executed, the mutation points corresponding to the mutants M 3 and M 4 are deviated from the execution path, so that the change content corresponding to the mutants M 3 and M 4 is further added to the mutant M 1 . It does not apply. In addition, when the mutant M 3 is executed, the mutation portion corresponding to the mutant M 1 is deviated from the execution path, so that the modification corresponding to the mutant M 1 is not applied to the mutant M 3 . .. Thus, there may be mutants that are not implemented in SSE. In addition, there may be a mutant which is executed in some test cases but whose execution result is Pass and whose mutant survival result cannot be determined.

ミュータントM3,4も、一部のテストケース(ここではテストID“Test1”のテストケースのみ)では実行されるものの実行結果がPassである。このため、解析装置100は、現在のテストケースをSSEで実行しただけではミュータントM3,4に対するミュータント生存結果を判断できない。 The mutant M 3,4 is also executed in some test cases (here, only the test case of the test ID “Test1”), but the execution result is Pass. Therefore, the analysis device 100, than the current test case only run in SSE can not determine the mutant survival results for mutant M 3, 4.

図45は、テスト結果取得の比較例を示す図である。テスト結果テーブル119の例では、計13個のミュータントに対して、ミュータント生存結果を得られていない。これらのミュータントに対してミュータント生存結果を得るために、該当のミュータントに対して個別に、計13回のコンパイルを行い、実行結果を得られていない各テストケースについて該当のミュータントのテスト実行を計36回行うことも考えられる。しかし、このように、ミュータント毎にコンパイルおよびテスト実行を個別に行っていると、テストに時間がかかるという問題がある。 FIG. 45 is a diagram illustrating a comparative example of test result acquisition. In the example of the test result table 119, the mutant survival result is not obtained for a total of 13 mutants. In order to obtain the mutant survival results for these mutants, the relevant mutants are individually compiled 13 times in total, and the test execution of the relevant mutants is calculated for each test case for which an execution result is not obtained. It is also possible to do it 36 times. However, if the compilation and the test execution are individually performed for each mutant in this way, there is a problem that the test takes a long time.

そこで、解析装置100は、テスト結果テーブル119を作成する過程で、決定木T10,T20,T30を作成し、決定木T10,T20,T30をマージした決定木T40を作成する。解析装置100は、決定木T40を辿ることで、テスト結果テーブル119ではミュータント生存結果を得られていない13個のミュータントに対するミュータント生存結果を決定する。これにより、解析装置100は、マージ後の決定木T40を計13回辿ることで、ミュータント生存結果を得られることになる。 Therefore, the analysis apparatus 100 creates the decision trees T10, T20, T30 in the process of creating the test result table 119, and creates the decision tree T40 by merging the decision trees T10, T20, T30. The analysis apparatus 100 traces the decision tree T40 to determine the mutant survival result for 13 mutants for which the mutant survival result is not obtained in the test result table 119. Accordingly, the analysis apparatus 100 can obtain the mutant survival result by tracing the merged decision tree T40 13 times in total.

解析装置100の処理では決定木T10,T20,T30の生成、および、マージといった処理コストが生じる。しかし、各ミュータントを個別にコンパイルして実行する処理コストと比べると、決定木T10,T20,T30の生成、および、マージの処理コストは十分に小さいと考えられる。 In the processing of the analysis device 100, processing costs such as generation of the decision trees T10, T20, T30 and merging occur. However, compared with the processing cost of individually compiling and executing each mutant, the processing costs of generating and merging the decision trees T10, T20, T30 are considered to be sufficiently low.

こうして、解析装置100は、決定木T10,T20,T30に基づいて作成した決定木T40を辿るだけでテスト結果を判断できる。このため、各ミュータントを個別にコンパイルして実行せずに済み、その分の実行時間を削減できる。その結果、ミューテーション解析を高速化できる。更に、ミューテーション解析によるテストの評価結果の精度を向上でき、ユーザによるテスト自体の信頼性向上の作業を支援できる。テストの信頼性向上に寄与することで、ソフトウェアの品質向上に貢献できる。 In this way, the analysis apparatus 100 can determine the test result only by tracing the decision tree T40 created based on the decision trees T10, T20, T30. Therefore, it is not necessary to compile and execute each mutant individually, and the execution time can be reduced accordingly. As a result, the mutation analysis can be speeded up. Further, the accuracy of the test evaluation result by the mutation analysis can be improved, and the user's work of improving the reliability of the test itself can be supported. By contributing to the improvement of test reliability, it is possible to contribute to the improvement of software quality.

なお、第1の実施の形態の情報処理は、演算部1bにプログラムを実行させることで実現できる。また、第2の実施の形態の情報処理は、プロセッサ101にプログラムを実行させることで実現できる。プログラムは、コンピュータ読み取り可能な記録媒体13に記録できる。 The information processing according to the first embodiment can be realized by causing the calculation unit 1b to execute a program. The information processing of the second embodiment can be realized by causing the processor 101 to execute a program. The program can be recorded in a computer-readable recording medium 13.

例えば、プログラムを記録した記録媒体13を配布することで、プログラムを流通させることができる。また、プログラムを他のコンピュータに格納しておき、ネットワーク経由でプログラムを配布してもよい。コンピュータは、例えば、記録媒体13に記録されたプログラムまたは他のコンピュータから受信したプログラムを、RAM102やHDD103などの記憶装置に格納し(インストールし)、当該記憶装置からプログラムを読み込んで実行してもよい。 For example, the program can be distributed by distributing the recording medium 13 recording the program. Alternatively, the program may be stored in another computer and distributed via the network. For example, the computer stores (installs) the program recorded in the recording medium 13 or the program received from another computer in a storage device such as the RAM 102 or the HDD 103, reads the program from the storage device, and executes the program. Good.

1 解析装置
1a 記憶部
1b 演算部
P1,P2 ソースコード
T1,T2,T3,T4 決定木
1 Analysis Device 1a Storage Unit 1b Arithmetic Unit P1, P2 Source Code T1, T2, T3, T4 Decision Tree

Claims (7)

プログラムの入力に対する出力を確認する複数のテストケースを含むテストを行う際の前記プログラムの複数の変更箇所および前記複数の変更箇所それぞれの変更内容の情報を記憶する記憶部と、
変更箇所の第1の組合せに対して前記変更内容を適用して前記テストを実行し、実行された前記変更箇所を終端ノード以外のノード、前記変更箇所の前記変更内容をエッジ、実行結果を前記終端ノードとした決定木の情報をテストケース毎に生成し、生成された複数の決定木に基づいて、テスト結果を未取得である前記変更箇所の第2の組合せに対して前記変更内容を適用した場合の前記テスト結果を決定する、演算部と、
を有する解析装置。
A storage unit that stores a plurality of changed portions of the program when performing a test including a plurality of test cases for confirming an output with respect to an input of the program and information of change contents of the plurality of changed portions,
The test is executed by applying the change contents to the first combination of change parts, the executed change part is a node other than the terminal node, the change contents of the change part is an edge, and the execution result is the Information on a decision tree as a terminal node is generated for each test case, and the change contents are applied to a second combination of the changed portions for which a test result has not been acquired, based on the plurality of generated decision trees. An operation unit that determines the test result in the case of
An analyzer having a.
前記演算部は、前記複数の決定木を統合することで統合後の決定木を生成し、前記第2の組合せに対して前記統合後の決定木を辿ることで前記第2の組合せに対する前記テスト結果を決定する、請求項1記載の解析装置。 The calculation unit generates a combined decision tree by combining the plurality of decision trees, and traces the combined decision tree for the second combination to perform the test for the second combination. The analysis device according to claim 1, which determines a result. 前記第2の組合せは、前記複数のテストケースのうちの一部のテストケースにより試行される前記変更箇所の組合せのうち、前記一部のテストケースの前記実行結果からは前記テスト結果を取得できない組合せを含む、請求項1または2記載の解析装置。 The second combination cannot acquire the test result from the execution result of the some test cases among the combinations of the changed portions tried by some test cases of the plurality of test cases. The analysis device according to claim 1 or 2, comprising a combination. 前記第2の組合せは、前記複数のテストケースでは試行されない前記変更箇所の組合せを含む、請求項1乃至3の何れか1項に記載の解析装置。 The analysis device according to any one of claims 1 to 3, wherein the second combination includes a combination of the changed portions that is not tried in the plurality of test cases. 前記演算部は、前記テストの実行により取得された第1のテスト結果および前記複数の決定木に基づいて決定された第2のテスト結果に応じて、前記変更箇所の組合せのうち、前記複数のテストケースにより検出可能な組合せに関する情報、および、前記複数のテストケースにより検出不可能な組合せに関する情報の少なくとも一方を出力する、請求項1乃至4の何れか1項に記載の解析装置。 The calculation unit is configured to select a plurality of combinations of the changed parts according to a first test result acquired by executing the test and a second test result determined based on the plurality of decision trees. The analysis device according to any one of claims 1 to 4, which outputs at least one of information about a combination that can be detected by a test case and information about a combination that cannot be detected by the plurality of test cases. プログラムの入力に対する出力を確認する複数のテストケースを含むテストを行う際の前記プログラムの複数の変更箇所および前記複数の変更箇所それぞれの変更内容の情報を参照して、変更箇所の第1の組合せに対して前記変更内容を適用して前記テストを実行し、実行された前記変更箇所を終端ノード以外のノード、前記変更箇所の前記変更内容をエッジ、実行結果を前記終端ノードとした決定木の情報をテストケース毎に生成し、
生成された複数の決定木に基づいて、テスト結果を未取得である前記変更箇所の第2の組合せに対して前記変更内容を適用した場合の前記テスト結果を決定する、
処理をコンピュータに実行させる解析プログラム。
A first combination of changed portions by referring to information of a plurality of changed portions of the program and change contents of each of the plurality of changed portions when performing a test including a plurality of test cases for confirming output with respect to input of the program The test is executed by applying the change content to a node other than the end node, the change content of the change location being an edge, and the execution result being the end node. Generate information for each test case,
Determining the test result when the change content is applied to the second combination of the change points for which the test result has not been acquired, based on the plurality of generated decision trees,
An analysis program that causes a computer to perform processing.
コンピュータが、
プログラムの入力に対する出力を確認する複数のテストケースを含むテストを行う際の前記プログラムの複数の変更箇所および前記複数の変更箇所それぞれの変更内容の情報を参照して、変更箇所の第1の組合せに対して前記変更内容を適用して前記テストを実行し、実行された前記変更箇所を終端ノード以外のノード、前記変更箇所の前記変更内容をエッジ、実行結果を前記終端ノードとした決定木の情報をテストケース毎に生成し、
生成された複数の決定木に基づいて、テスト結果を未取得である前記変更箇所の第2の組合せに対して前記変更内容を適用した場合の前記テスト結果を決定する、
解析方法。
Computer
A first combination of changed portions by referring to information of a plurality of changed portions of the program and change contents of each of the plurality of changed portions when performing a test including a plurality of test cases for confirming output with respect to input of the program The test is executed by applying the change content to a node other than the end node, the change content of the change location being an edge, and the execution result being the end node. Generate information for each test case,
Determining the test result when the change content is applied to the second combination of the change points for which the test result has not been acquired, based on the plurality of generated decision trees,
analysis method.
JP2016185100A 2016-09-23 2016-09-23 Analysis device, analysis program, and analysis method Active JP6748357B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016185100A JP6748357B2 (en) 2016-09-23 2016-09-23 Analysis device, analysis program, and analysis method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016185100A JP6748357B2 (en) 2016-09-23 2016-09-23 Analysis device, analysis program, and analysis method

Publications (2)

Publication Number Publication Date
JP2018049492A JP2018049492A (en) 2018-03-29
JP6748357B2 true JP6748357B2 (en) 2020-09-02

Family

ID=61766418

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016185100A Active JP6748357B2 (en) 2016-09-23 2016-09-23 Analysis device, analysis program, and analysis method

Country Status (1)

Country Link
JP (1) JP6748357B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114297012B (en) * 2021-12-31 2023-03-10 上海赛美特软件科技有限公司 Method and device for detecting equipment precision, electronic equipment and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07210424A (en) * 1994-01-14 1995-08-11 Toshiba Corp Software test supporting system
FR2873832B1 (en) * 2004-07-30 2006-09-15 Certess Sarl METHOD AND SYSTEM FOR EVALUATING TESTS OF A COMPUTER PROGRAM BY ANALYSIS OF MUTATIONS
JP6364263B2 (en) * 2014-07-08 2018-07-25 株式会社エヌ・ティ・ティ・データ Verification support method, verification support apparatus, and program
JP6365276B2 (en) * 2014-12-08 2018-08-01 富士通株式会社 Program, information processing apparatus and information processing method
JP2016115175A (en) * 2014-12-16 2016-06-23 株式会社東芝 Software test apparatus and software test program

Also Published As

Publication number Publication date
JP2018049492A (en) 2018-03-29

Similar Documents

Publication Publication Date Title
Pradel et al. A framework for the evaluation of specification miners based on finite state machines
US8516434B2 (en) Methods for marking, merging, and managing the results of software program analysis
US11775414B2 (en) Automated bug fixing using deep learning
Kirbas et al. The relationship between evolutionary coupling and defects in large industrial software
JP5845888B2 (en) Software correction apparatus, software correction system, software correction method, and software correction program
Kessentini et al. Automated metamodel/model co-evolution using a multi-objective optimization approach
JP2012150535A (en) Program verification method and program verification program
JP6070847B2 (en) Verification method, verification apparatus, and verification program
Lee et al. Automatic detection and update suggestion for outdated API names in documentation
Carr et al. Automatic contract insertion with ccbot
JP6440895B2 (en) Software analysis apparatus and software analysis method
JP6748357B2 (en) Analysis device, analysis program, and analysis method
JP6651974B2 (en) Information processing apparatus, compiling method and compiler program
Corso et al. Generating Java Methods: An Empirical Assessment of Four AI-Based Code Assistants
Frick Understanding software changes: Extracting, classifying, and presenting fine-grained source code changes
Chekhaba et al. Coach: classification-based architectural patterns detection in Android apps
JP5758311B2 (en) Test code generation device, test code generation method, test code generation program
JP5578625B2 (en) Program analysis apparatus, program analysis method, and program
CN114356783A (en) Method and device for automatically generating unit test code, storage medium and equipment
JP6217440B2 (en) Symbolic execution program, symbolic execution method, and symbolic execution device
Huang et al. ConfFix: Repairing Configuration Compatibility Issues in Android Apps
Ribeiro et al. A mechanized textbook proof of a type unification algorithm
JP7469999B2 (en) Search device, search method, and search program
JP5900212B2 (en) Test data generation apparatus, program, and method
WO2020230241A1 (en) Testing device, testing method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190611

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20190613

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20190613

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20200521

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20200720

R150 Certificate of patent or registration of utility model

Ref document number: 6748357

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150