JP5962350B2 - Program, information processing apparatus and test method - Google Patents
Program, information processing apparatus and test method Download PDFInfo
- Publication number
- JP5962350B2 JP5962350B2 JP2012193870A JP2012193870A JP5962350B2 JP 5962350 B2 JP5962350 B2 JP 5962350B2 JP 2012193870 A JP2012193870 A JP 2012193870A JP 2012193870 A JP2012193870 A JP 2012193870A JP 5962350 B2 JP5962350 B2 JP 5962350B2
- Authority
- JP
- Japan
- Prior art keywords
- test
- code
- priority
- execution
- test data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Description
本発明はプログラム、情報処理装置およびテスト方法に関する。 The present invention relates to a program, an information processing apparatus, and a test method.
ソフトウェアの品質を検証するために、テスト用のデータ(テストデータということがある)を当該ソフトウェアに入力して、その動作をテストすることがある。例えば、入力されたテストデータに対してソフトウェアから正しい出力が得られるかを確認する。そのために、入力され得るコマンドの組合せやパラメータの組合せのパターンを網羅したテストデータを複数作成し、テスト対象のソフトウェアに入力することが考えられる。入力されたテストデータに対するソフトウェアの出力を分析してバグを発見する。しかし、網羅的にテストを行うとするとテストにかかる時間や工数などが増大し得る。 In order to verify the quality of software, test data (sometimes referred to as test data) may be input to the software to test its operation. For example, whether or not a correct output can be obtained from the software with respect to the input test data is confirmed. For this purpose, it is conceivable to create a plurality of test data covering patterns of combinations of commands and parameters that can be input and input them to the software to be tested. Analyze the software output for the input test data to find bugs. However, if an exhaustive test is performed, the time and man-hours required for the test may increase.
そこで、テストする項目に対してテスト優先度を予め付与し、テスト優先度により優先的・重点的にテストする項目を決定することで、テスト計画の作成を支援する提案がある。また、テスト対象のパラメータの組合せ(テストパターン)がテスト済のパラメータの組合せに類似する場合は、当該テストパターンをテスト対象から除く処理の提案もある。 Therefore, there is a proposal for supporting the creation of a test plan by preliminarily giving a test priority to an item to be tested and determining an item to be preferentially / intensively tested based on the test priority. In addition, when a combination of parameters to be tested (test pattern) is similar to a combination of parameters that have been tested, there is a proposal of a process for removing the test pattern from the test target.
上述のようにソフトウェアのテストでは、コマンドやパラメータなどの文字列の組合せを含む複数のテストデータをテスト対象のソフトウェアに入力することがある。当該テストにおいて、テストデータを、生成された順番や予め計画された順番でソフトウェアに入力してテストすることが考えられる。 As described above, in software testing, a plurality of test data including combinations of character strings such as commands and parameters may be input to the software to be tested. In this test, it is conceivable to test the test data by inputting it into software in the order of generation or the order planned in advance.
しかし、テストを行っていく上で優先的にテストしたい内容は変わり得る。例えば、不正な結果となり得るテストデータを用いたテストを先に実行してエラーの状況を早期に確認し、対策の作業を開始したいということがある。また、例えば、正しい結果となり得るテストデータを用いたテストは後回しでもよいということがある。ところが、どのテストデータを入力したときに不正な結果となるか否かは実際にテストを実行してみない限り判断することが難しいという問題がある。 However, what you want to test with priority as you test can change. For example, there is a case where a test using test data that may give an incorrect result is executed first to confirm an error situation at an early stage and to start a countermeasure work. In addition, for example, a test using test data that can give a correct result may be postponed. However, there is a problem that it is difficult to determine which test data is input when an incorrect result is obtained unless the test is actually executed.
一側面によれば、本発明は、テストを効率的に実行できるプログラム、情報処理装置およびテスト方法を提供することを目的とする。 According to one aspect, an object of the present invention is to provide a program, an information processing apparatus, and a test method that can efficiently execute a test.
一実施態様によれば、コンピュータによって実行されるプログラムが提供される。このプログラムは、コンピュータに、複数の文字列を含むテストデータに応じた処理の実行テストを複数のテストデータそれぞれに対して順次実行しながら、実行テストの結果に基づいてテストデータに含まれる文字列ごとの優先度を調整し、複数のテストデータのうち実行テストを未実行であるテストデータに対する実行テストの実行順序をテストデータに含まれる文字列ごとの優先度に基づいて変更する、処理を実行させる。 According to one embodiment, a program executed by a computer is provided. This program allows a computer to sequentially execute an execution test of processing according to test data including a plurality of character strings on each of the plurality of test data, and character strings included in the test data based on the results of the execution test. Execute the process to adjust the priority of each test, and change the execution test execution order for test data that has not been executed from multiple test data based on the priority of each character string included in the test data Let
また、一実施態様によれば、情報処理装置が提供される。情報処理装置は、記憶部と演算部とを有する。記憶部は、複数の文字列を記憶する。演算部は、記憶部に記憶された文字列を含むテストデータに応じた処理の実行テストを複数のテストデータそれぞれに対して順次実行しながら、実行テストの結果に基づいてテストデータに含まれる文字列ごとの優先度を調整し、複数のテストデータのうち実行テストを未実行であるテストデータに対する実行テストの実行順序をテストデータに含まれる文字列ごとの優先度に基づいて変更する。 According to one embodiment, an information processing apparatus is provided. The information processing apparatus includes a storage unit and a calculation unit. The storage unit stores a plurality of character strings. The arithmetic unit sequentially executes the execution test of the process according to the test data including the character string stored in the storage unit for each of the plurality of test data, and the characters included in the test data based on the result of the execution test. The priority for each column is adjusted, and the execution order of the execution tests for the test data for which the execution test has not been executed among the plurality of test data is changed based on the priority for each character string included in the test data.
また、一実施態様によれば、コンピュータによって実行されるテスト方法が提供される。このテスト方法では、コンピュータが、複数の文字列を含むテストデータに応じた処理の実行テストを複数のテストデータそれぞれに対して順次実行しながら、実行テストの結果に基づいてテストデータに含まれる文字列ごとの優先度を調整し、複数のテストデータのうち実行テストを未実行であるテストデータに対する実行テストの実行順序をテストデータに含まれる文字列ごとの優先度に基づいて変更する。 According to one embodiment, a test method executed by a computer is provided. In this test method, the computer sequentially executes the execution test of the process according to the test data including a plurality of character strings on each of the plurality of test data, and the characters included in the test data based on the result of the execution test. The priority for each column is adjusted, and the execution order of the execution tests for the test data for which the execution test has not been executed among the plurality of test data is changed based on the priority for each character string included in the test data.
一実施態様によれば、テストを効率的に実行できる。 According to one embodiment, the test can be performed efficiently.
以下、本実施の形態を図面を参照して説明する。
[第1の実施の形態]
図1は、第1の実施の形態の情報処理装置を示す図である。情報処理装置1は、テスト対象のソフトウェアに、テストデータを入力して、当該ソフトウェアの処理をテストする。情報処理装置1は、記憶部1aおよび演算部1bを有する。記憶部1aはRAM(Random Access Memory)などのメモリである。演算部1bはCPU(Central Processing Unit)などのプロセッサである。例えば、記憶部1aに記憶されたプログラムを演算部1bが実行することで、第1の実施の形態の情報処理を実現できる。
Hereinafter, the present embodiment will be described with reference to the drawings.
[First Embodiment]
FIG. 1 is a diagram illustrating the information processing apparatus according to the first embodiment. The
記憶部1aは、複数の文字列を記憶する。例えば、文字列はコマンドやコマンドの引数となるパラメータなどを示すものである。例えば、記憶部1aは、文字列CS1,CS2,CS3,CS4,CS5,CS6を記憶する。
The
演算部1bは、記憶部1aに記憶された文字列を含むテストデータに応じた処理の実行テストを複数のテストデータそれぞれに対して順次実行しながら、実行テストの結果に基づいてテストデータに含まれる文字列ごとの優先度を調整する。例えば、演算部1bは、あるテストデータに対する実行テストの結果が不正であった場合に、当該テストデータに含まれる文字列の優先度を、当該テストデータの実行テストを行う前より高くしてもよい。
The
例えば、テスト対象のソフトウェアはコンパイラでもよい。コンパイラは、ソースコードを処理して目的コードを作成する。この場合、テストデータはソースコードを記述したデータである。ソースコードは、変数を定義するための文字列やループや分岐などを記述した文字列などを含む。また、テスト対象のソフトウェアは、入力されたコマンドを実行するような他のアプリケーションでもよい。この場合、テストデータは、コマンドとコマンドに与える引数などの文字列を含む。ここで、文字列とは1または複数の文字である。文字は記号などの特殊文字を含んでもよい。 For example, the software to be tested may be a compiler. The compiler processes the source code and creates a target code. In this case, the test data is data describing the source code. The source code includes a character string for defining a variable, a character string describing a loop, a branch, and the like. The software to be tested may be another application that executes an input command. In this case, the test data includes a character string such as a command and an argument given to the command. Here, the character string is one or more characters. The characters may include special characters such as symbols.
演算部1bは、その後に行う実行テストの実行順序をテストデータに含まれる文字列ごとの優先度に基づいて変更する。演算部1bは、当該テストデータに含まれる文字列の優先度に基づいてテストデータの優先度を算出してもよい。演算部1bは、テストデータごとの優先度に基づいて実行テストの実行順序を変更してもよい。例えば、優先度の高いテストデータの実行テストを優先して行うようにしてもよい。そうすれば、過去の実行テストの実績から、結果が不正になる可能性が高いテストデータを優先してテストするように制御することができる。
The
より具体的には次の通りである。例えば、テストデータA,B,C,D,Eをこの順序でテスト対象のソフトウェアに入力して処理の結果を取得し、結果を得るごとにその正否を確認する場合を考える。図1ではテストデータA,B,C,D,Eの集合をテストデータ群と称している。テストデータAは文字列CS1,CS2,CS3を含む。テストデータBは文字列CS3,CS4,CS5を含む。テストデータCは文字列CS1,CS2,CS6を含む。テストデータDは文字列CS2,CS3,CS6を含む。テストデータEは文字列CS3,CS4,CS6を含む。 More specifically, it is as follows. For example, consider a case where test data A, B, C, D, and E are input to the software to be tested in this order to obtain a processing result, and the correctness is confirmed each time the result is obtained. In FIG. 1, a set of test data A, B, C, D, and E is referred to as a test data group. Test data A includes character strings CS1, CS2, and CS3. Test data B includes character strings CS3, CS4 and CS5. Test data C includes character strings CS1, CS2 and CS6. Test data D includes character strings CS2, CS3, CS6. Test data E includes character strings CS3, CS4 and CS6.
まず、演算部1bはテスト対象のソフトウェアにテストデータAを入力する。テストデータAに応じた処理の結果は正しかったとする。次に、演算部1bはテスト対象のソフトウェアにテストデータBを入力する。テストデータBに応じた処理の結果は不正であったとする。そこで、演算部1bはテストデータBに含まれる文字列CS3,CS4,CS5の優先度を、テストデータBによる実行テストを行う前よりも高くする。すると、文字列CS3,CS4,CS5を含む他のテストデータの優先度が高くなる。図1の例では、テストデータD,Eは文字列CS3,CS4を含む。よって、テストデータD,Eの優先度が高くなることになる。
First, the
その結果、例えば、テストデータEの優先度がテストデータDの優先度よりも高くなる。また、テストデータDの優先度がテストデータCの優先度よりも高くなる。よって、演算部1bはテストデータC,D,Eという順番を、テストデータE,D,Cという順番に変更する。すなわち、テストデータEに対するテストをテストデータD,Cよりも繰り上げて実行する。また、テストデータDに対するテストをテストデータCよりも繰り上げて実行する。
As a result, for example, the priority of the test data E becomes higher than the priority of the test data D. In addition, the priority of the test data D is higher than the priority of the test data C. Therefore, the
なお、演算部1bは正しい結果が得られたテストデータに含まれる文字列の優先度を下げるようにしてもよい。そうすれば、当該文字列を含むテストデータが他のテストデータよりも後回しになるように制御できる。
Note that the
また、演算部1bは1つのテストデータについて実行テストを行ったタイミングで実行順序を変更してもよいし、2以上の所定数のテストデータについて実行テストを行ったタイミングで実行順序を変更してもよい。
Further, the
情報処理装置1によれば、演算部1bにより、テストデータに応じた処理の実行テストを複数のテストデータそれぞれに対して順次実行しながら、実行テストの結果に基づいてテストデータに含まれる文字列ごとの優先度が調整される。演算部1bにより、その後に行う実行テストの実行順序がテストデータに含まれる文字列ごとの優先度に基づいて変更される。
According to the
これにより、テストを効率的に実行できる。具体的には、ソフトウェアの処理のテストを実行しながら、動的にテストの実行順序を変更する。このため、各テストデータのテスト結果に応じた実行順序の制御が可能である。例えば、結果が不正になり得るテストデータをテスト開始前に事前に判断するのが難しい場合でも、各テストデータのテスト結果に応じて、不正な結果となる可能性の高いテストデータを優先してテストできる。 Thereby, a test can be performed efficiently. Specifically, the execution order of the tests is dynamically changed while executing the software processing test. Therefore, it is possible to control the execution order according to the test result of each test data. For example, even when it is difficult to determine in advance test data that may have incorrect results before starting the test, give priority to test data that is likely to give incorrect results according to the test results of each test data. Can be tested.
ここで、エラーを引き起こすテストデータや文字列の発見が遅れると、対策の作業が遅滞し得る。特に、テストデータに含まれる文字列の組合せの数によっては、全ての組合せのテストの開始から終了までに数時間から数日かかることもある。品質向上のためにはテストを網羅的に行うことが好ましい。しかし、テストを網羅的に行おうとするほど、テストに時間がかかることになり、作業の遅れが深刻になり得る。 Here, if the test data or character string causing the error is delayed, the countermeasure work may be delayed. In particular, depending on the number of combinations of character strings included in the test data, it may take several hours to several days from the start to the end of the test of all combinations. In order to improve quality, it is preferable to conduct a comprehensive test. However, the more comprehensive the test is, the longer the test takes and the delay in work can become serious.
これに対して、情報処理装置1によれば、上述の制御によりエラーを引き起こすテストデータや文字列を早期に発見できる可能性が高まる。よって、当該テストデータに含まれるコマンドやパラメータなどを参照して、バグなどの原因究明や対策の作業を迅速に行えるようになる。このように、ソフトウェアのデバッグ作業を効率的に支援することができる。
On the other hand, according to the
第1の実施の形態の情報処理は、種々のソフトウェアのテストに適用できる。以下の説明では、まず、第2の実施の形態として、コンパイラの実行テストに適用する場合を例示する。次に、第3の実施の形態として、DBMS(DataBase Management System)におけるSQLの実行テストに適用する場合を例示する。以下の説明では、当該テストを実行する装置をテスト装置と称する。テスト装置は、例えばコンピュータによって実現できる。 The information processing of the first embodiment can be applied to various software tests. In the following description, first, as a second embodiment, a case where the present invention is applied to an execution test of a compiler is illustrated. Next, as a third embodiment, a case of applying to an SQL execution test in a DBMS (DataBase Management System) will be exemplified. In the following description, a device that executes the test is referred to as a test device. The test apparatus can be realized by a computer, for example.
[第2の実施の形態]
図2は、第2の実施の形態のハードウェア例を示す図である。テスト装置100は、コンパイラのコンパイル処理(翻訳処理)の実行テストを行う。第2の実施の形態では、特に、コンパイル時の最適化の処理をテストする。具体的には、コンパイル時に最適化を行っても目的コードを正しく作成できるか否かを確認する。コンパイル時の最適化の処理とは、例えば、ループの融合や分割、ループのネスト(入れ子)構造の変更などである。
[Second Embodiment]
FIG. 2 is a diagram illustrating a hardware example of the second embodiment. The
テスト装置100は、プロセッサ101、RAM102、HDD(Hard Disk Drive)103、通信部104、画像信号処理部105、入力信号処理部106、ディスクドライブ107および機器接続部108を有する。各ユニットがテスト装置100のバスに接続されている。
The
プロセッサ101は、テスト装置100の情報処理を制御する。プロセッサ101は、マルチプロセッサであってもよい。プロセッサ101は、例えばCPU、MPU(Micro Processing Unit)、DSP(Digital Signal Processor)、ASIC(Application Specific Integrated Circuit)、FPGA(Field Programmable Gate Array)またはPLD(Programmable Logic Device)などである。プロセッサ101は、CPU、MPU、DSP、ASIC、FPGA、PLDのうちの2以上の要素の組合せであってもよい。
The
RAM102は、テスト装置100の主記憶装置である。RAM102は、プロセッサ101に実行させるOS(Operating System)のプログラムやアプリケーションのプログラムの少なくとも一部を一時的に記憶する。また、RAM102は、プロセッサ101による処理に用いる各種データを記憶する。
The
HDD103は、テスト装置100の補助記憶装置である。HDD103は、内蔵した磁気ディスクに対して、磁気的にデータの書き込みおよび読み出しを行う。HDD103には、OSのプログラム、アプリケーションプログラム、および各種データが格納される。テスト装置100は、フラッシュメモリやSSD(Solid State Drive)などの他の種類の補助記憶装置を備えてもよく、複数の補助記憶装置を備えてもよい。
The
通信部104は、ネットワーク10を介して他のコンピュータと通信を行えるインタフェースである。通信部104は、有線インタフェースでもよいし、無線インタフェースでもよい。
The
画像信号処理部105は、プロセッサ101からの命令に従って、テスト装置100に接続されたディスプレイ11に画像を出力する。ディスプレイ11としては、CRT(Cathode Ray Tube)ディスプレイや液晶ディスプレイなどを用いることができる。
The image
入力信号処理部106は、テスト装置100に接続された入力デバイス12から入力信号を取得し、プロセッサ101に出力する。入力デバイス12としては、例えば、マウスやタッチパネルなどのポインティングデバイス、キーボードなどを用いることができる。
The input
ディスクドライブ107は、レーザ光などを利用して、光ディスク13に記録されたプログラムやデータを読み取る駆動装置である。光ディスク13として、例えば、DVD(Digital Versatile Disc)、DVD−RAM、CD−ROM(Compact Disc Read Only Memory)、CD−R(Recordable)/RW(ReWritable)などを使用できる。ディスクドライブ107は、例えば、プロセッサ101からの命令に従って、光ディスク13から読み取ったプログラムやデータをRAM102またはHDD103に格納する。
The
機器接続部108は、テスト装置100に周辺機器を接続するための通信インタフェースである。例えば、機器接続部108にはメモリ装置14やリーダライタ装置15を接続できる。メモリ装置14は、機器接続部108との通信機能を搭載した記録媒体である。リーダライタ装置15は、メモリカード16へのデータの書き込み、またはメモリカード16からのデータの読み出しを行う装置である。メモリカード16は、カード型の記録媒体である。機器接続部108は、例えば、プロセッサ101からの命令に従って、メモリ装置14またはメモリカード16から読み取ったプログラムやデータをRAM102またはHDD103に格納する。
The
第2の実施の形態では、テスト対象のコンパイラを被検コンパイラと称する。被検コンパイラの最適化の機能をテストするために、テスト用の複数のソースコード(テストデータ)に対して次の(1)〜(3)の手順を順次実行する。 In the second embodiment, a test target compiler is referred to as a test compiler. In order to test the optimization function of the test compiler, the following steps (1) to (3) are sequentially executed on a plurality of test source codes (test data).
(1)被検コンパイラでソースコードをコンパイルする。被検コンパイラは、最適化オン(最適化する)/最適化オフ(最適化しない)の2通りの方法でコンパイルする。
(2)被検コンパイラのコンパイル結果に基づいて、コンパイルの成否を確認する。コンパイル成功と判断できた場合には、被検コンパイラによる最適化オン/オフのコンパイル処理で生成された2通りの目的コードを実行する。
(1) Compile the source code with the compiler under test. The compiler under test is compiled in two ways: optimization on (optimization) / optimization off (no optimization).
(2) The success or failure of the compilation is confirmed based on the compilation result of the tested compiler. If it is determined that the compilation is successful, two kinds of target codes generated by the optimization on / off compilation process by the tested compiler are executed.
(3)両方の目的コードの実行結果に基づいて、最適化を行っても目的コードが正しく作成できるかを確認する。具体的には、両方の目的コードの実行結果が一致すれば、目的コードが正しく作成できたことになる。一方、両方の目的コードの実行結果が不一致であれば、目的コードが正しく作成できていないことになる。 (3) Based on the execution results of both target codes, it is confirmed whether the target codes can be created correctly even if optimization is performed. Specifically, if the execution results of both target codes match, the target code has been created correctly. On the other hand, if the execution results of both target codes do not match, the target code has not been created correctly.
図3は、第2の実施の形態のソフトウェア例を示す図である。図3に示す各ユニットは、例えば、プロセッサ101がRAM102に記憶されたプログラムを実行することで実現できる。図3の各ユニットはASICやFPGAなどによって実現されてもよい。
FIG. 3 is a diagram illustrating an example of software according to the second embodiment. Each unit illustrated in FIG. 3 can be realized, for example, by the
テスト装置100は、記憶部110、組合せ生成部120、順序管理部130、コード生成部140、テスト用ソフトウェア150および検証部160を有する。
記憶部110は、各部の処理に用いられるデータを記憶する。記憶部110は、例えばRAM102やHDD103の記憶領域を用いて実装できる。記憶部110に格納されるデータには、定義ファイル、組合せ管理テーブル、順序管理テーブルおよびテスト結果テーブルなどが含まれる。
The
The
定義ファイルは、ソースコードを生成するためのコマンドやパラメータなどを示す文字列を定義したデータである。組合せ管理テーブルは、文字列の組合せを管理するためのデータである。順序管理テーブルは、組合せごとのテストの実行順序を管理するためのデータである。 The definition file is data defining a character string indicating a command or parameter for generating a source code. The combination management table is data for managing combinations of character strings. The order management table is data for managing the execution order of tests for each combination.
組合せ生成部120は、記憶部110に記憶された定義ファイルに基づいて、文字列の組合せを生成し、組合せ管理テーブルに登録する。組合せ生成部120は、類似する組合せや余分の組合せを削減して、テストに用いる組合せを絞り込む処理も行う。
The
順序管理部130は、記憶部110に記憶された組合せ管理テーブルに登録された複数の組合せについて、テストの実行順序を決定し、順序管理テーブルに登録する。具体的には、組合せに含まれる文字列ごとに優先度が設定される。順序管理部130は、文字列ごとの優先度に基づいて組合せ単位の優先度を算出する。順序管理部130は、組合せ単位の優先度に基づいて、テストの実行順序を決定する。
The
コード生成部140は、記憶部110に記憶された定義ファイルに基づいて、テスト用のソースコードを生成する。このとき、コード生成部140は順序管理部130が決定した順番に従って、テスト用のソースコードを生成する。
The
テスト用ソフトウェア150は、テスト対象のソフトウェアを含むソフトウェア群である。第2の実施の形態では、当該ソフトウェアはコンパイラである。コンパイラはソースコードから目的コードを生成する。テスト用ソフトウェア150には、被検コンパイラ151および比較用コンパイラ152が含まれる。被検コンパイラ151は、テスト対象のコンパイラである。被検コンパイラ151は、最適化オン/オフでのコンパイルを行える。比較用コンパイラ152は、被検コンパイラ151によるコンパイルの成否確認に利用できるコンパイラである。
The
ここで、第2の実施の形態では、プログラミング言語の一例としてFortranを想定する。被検コンパイラ151および比較用コンパイラ152は、Fortranで記述されたソースコードをコンパイルする。ただし、C、C++およびJava(登録商標)など他のプログラミング言語で記述されたソースコードのコンパイルのテストに、第2の実施の形態の情報処理を適用してもよい。
Here, in the second embodiment, Fortran is assumed as an example of a programming language. The
検証部160は、テスト用のソースコードのうち、コンパイルに成功したものについて、目的コードを実行し、実行結果の正否を確認する。具体的には、コンパイルに成功した場合、被検コンパイラ151により生成された2種類の目的コードが得られる。1つ目は最適化オンで生成された目的コードである。2つ目は最適化オフで生成された目的コードである。検証部160は、両方の目的コードを実行して、両方の実行結果が一致するか否かにより、最適化オンでも正しい結果が得られるかを確認する。検証部160は、最適化オンで生成された目的コードの実行結果と、比較用コンパイラで生成された目的コードの実行結果とを照合して、当該正否の判断を行ってもよい。検証部160は、記憶部110に記憶されたテスト結果テーブルに確認結果を登録する。
The
検証部160は、確認結果に応じて、対応するソースコードの生成に用いられたコード要素の組合せに含まれる各コード要素の優先度を調整する。
図4は、第2の実施の形態のデータ例を示す図である。記憶部110は、定義ファイル111、コード要素管理テーブル112、組合せ絞込条件リスト113、組合せ管理テーブル114、順序管理テーブル115、コンパイル成否基準テーブル116、ソースコード117およびテスト結果テーブル118を記憶する。
The
FIG. 4 is a diagram illustrating an example of data according to the second embodiment. The
定義ファイル111は、前述のように、ソースコードを生成するためのコマンドやパラメータなどを示す文字列を定義したデータである。以下の説明では、コマンドやパラメータなどを示す文字列をコード要素と称することがある。定義ファイル111は、例えばテストに応じてユーザにより予め作成される。
As described above, the
定義ファイル111では、1つのコード要素について複数のバリエーションを定義できる。例えば、ソースコードの一部分に対して、第1のコマンドおよび第2のコマンドの何れかを挿入するような定義が可能である。また、あるコマンドの引数について、第1のパラメータおよび第2のパラメータの何れかを挿入するような定義が可能である。
In the
更に、定義ファイル111ではコード要素ごとに優先度が設定される。例えば、2つのコード要素である第1,第2のコマンドを、ソースコード内に選択的に挿入する場合に、第1のコマンドの優先度を第2のコマンドの優先度よりも高くする。すると、第1のコマンドが第2のコマンドよりも優先的に選択されてソースコードが作成される。すなわち、第1のコマンドを含むソースコードのテストを、第2のコマンドを含むソースコードのテストよりも早い段階で行えることになる。
In the
コード要素管理テーブル112は、定義ファイル111に定義されたコード要素およびコード要素ごとの優先度を管理するためのデータである。各コード要素は識別記号に対応付けられる(後述する)。
The code element management table 112 is data for managing the code elements defined in the
組合せ絞込条件リスト113は、コード要素の組合せを絞り込むための条件を定義したデータである。例えば、組合せ生成部120は類似の組合せを削減する処理を行う。この場合、類似の組合せを判定するための基準が組合せ絞込条件リスト113に予め設定される。
The combination narrowing
組合せ管理テーブル114は、前述のように、文字列(コード要素)の組合せを管理するためのデータである。コード要素の組合せは、コード要素に対応する記号の組合せによって管理される。 The combination management table 114 is data for managing combinations of character strings (code elements) as described above. A combination of code elements is managed by a combination of symbols corresponding to the code elements.
順序管理テーブル115は、前述のように、コード要素の組合せごとのテストの実行順序を管理するためのデータである。順序管理テーブル115は、順序管理部130によって更新される。
As described above, the order management table 115 is data for managing the execution order of tests for each combination of code elements. The order management table 115 is updated by the
コンパイル成否基準テーブル116は、ソースコードのコンパイルの成否を判定するための基準を定義したデータである。あるテスト用のソースコードのコンパイルの成否は、被検コンパイラ151や比較用コンパイラ152によるコンパイル処理の結果に基づいて判定される。当該判定のための基準がコンパイル成否基準テーブル116に予め設定される。
The compilation success / failure criteria table 116 is data defining criteria for determining success / failure of compilation of source code. The success or failure of compiling a certain test source code is determined based on the result of the compiling process by the tested
ソースコード117は、コード生成部140により定義ファイル111に基づいて生成されたテスト用のソースコード(テストデータの一例)である。ソースコード117は、1つの定義ファイル111に対して複数のバリエーションが生成され得る。
The
テスト結果テーブル118は、目的コードの実行結果の正否を登録したデータである。テスト結果テーブル118は、順序管理部130によって参照され、コード要素の優先度を変更する処理に用いられる。
The test result table 118 is data in which the correctness of the execution result of the target code is registered. The test result table 118 is referred to by the
また、記憶部110はソースコード117に対応する目的コードを記憶してもよい。具体的には、被検コンパイラ151により最適化オン/オフの2種類の方法を用いて生成された2種類の目的コードを記憶してもよい。更に、比較用コンパイラ152により生成された目的コードを記憶してもよい。
The
図5は、第2の実施の形態の定義ファイルの例を示す図である。定義ファイル111は、Fortranのソースコードを作成するためのデータである。以下、定義ファイル111に便宜的に付した行番号を用いて説明する。定義ファイル111は次のルール1〜3に基づいて記述されている。
FIG. 5 is a diagram illustrating an example of a definition file according to the second embodiment. The
(ルール1)行頭(行の左端)のコロン“:”によって、ソースコード内のコード要素の1つの集合(要素集合と称することがある)を表す。例えば、ある行に行頭の第1のコロン“:”が存在する場合、定義ファイル111をその行から順番に下に参照していき、行頭の第2のコロン“:”が現れる行の1つ前の行を特定する。第1のコロン“:”の行から当該特定された行までが、第1のコロン“:”で表される1つの要素集合である。行頭の“:”に続けて、同じ行に記述された文字列は当該要素集合の名称を示す。1つの要素集合は1以上のコード要素を含み得る(ただし、行頭に“*”が付された記述はコード要素には該当しない)。
(Rule 1) A colon “:” at the beginning of the line (the left end of the line) represents one set of code elements in the source code (sometimes referred to as an element set). For example, when the first colon “:” at the beginning of a line exists in a certain line, the
例えば、1行目の“:program start”は、1つの要素集合の開始を表している。“program start”は要素集合の名称である。当該要素集合は、4行目以降に記述された“integer i1,i2,i3”や“integer [*4,10|*8,20] v1”などの文字列を含んでいる。これらの文字列がコード要素である。 For example, “: program start” on the first line represents the start of one element set. “Program start” is the name of an element set. The element set includes character strings such as “integer i1, i2, i3” and “integer [* 4, 10 | * 8, 20] v1” described in the fourth and subsequent lines. These character strings are code elements.
(ルール2)行頭の“*”によって、要素集合内のコード要素に対する属性を定義できる。定義可能な属性としては、要素ID(IDentifier)および優先度である。要素IDはコード要素の識別名である。優先度はコード要素ごとの優先度である。優先度は、値が大きいほど、優先される度合いが高いものとする。行頭の“*”に続けて、要素IDおよび優先度をカンマ区切りで記述する。 (Rule 2) The attribute for the code element in the element set can be defined by “*” at the beginning of the line. Attributes that can be defined include an element ID (IDentifier) and a priority. The element ID is an identification name of the code element. The priority is a priority for each code element. It is assumed that the priority is higher as the value is higher. Following the “*” at the beginning of the line, the element ID and priority are described in a comma-separated list.
例えば、16行目の記述“* loop (, 120”は、17行目のコード要素“do i1=0,10,1”の属性を定義している。具体的には、要素ID“loop (”、優先度“120”が当該コード要素に付与されていることを示す。ここで、要素IDに“loop”の文字列が含まれる場合、当該要素集合がソースコード内のブロック構造(より詳細にはループ)に関するコード要素であることを示す。 For example, the description “* loop (, 120” on the 16th line defines the attribute of the code element “do i1 = 0, 10, 1” on the 17th line. Specifically, the element ID “loop ( ", Indicating that the priority" 120 "is assigned to the code element. Here, when the element ID includes the character string" loop ", the element set is a block structure in the source code (more details). Indicates a code element related to a loop.
同様に、18行目の記述“* loop_end )”は、19行目のコード要素“end do”の属性を定義している。具体的には、要素ID“loop_end )”が当該コード要素に付与されていることを示す。要素ID“loop_end )”は要素ID“loop (”で示されるコード要素に付随するブロック構造に関するコード要素(より詳細にはループの終了)であることを示す。ここで、優先度は付与されていない。19行目のコード要素は、17行目のコード要素に付随するものであり、17行目のコード要素に優先度を定義すれば十分だからである。これは、24行目、29行目のコード要素(何れも“end do”)についても同様である。 Similarly, the description “* loop_end” on the 18th line defines the attribute of the code element “end do” on the 19th line. Specifically, it indicates that the element ID “loop_end)” is assigned to the code element. The element ID “loop_end)” indicates that the code element is related to the block structure associated with the code element indicated by the element ID “loop (”) (more specifically, the end of the loop), where priority is given. The code element on the 19th line is attached to the code element on the 17th line, and it is sufficient to define the priority on the code element on the 17th line. The same applies to the code elements of the eyes (both “end do”).
また、必須のコード要素には優先度を定義しなくてもよい。必須のコード要素とはソースコードに必ず含まれるようにするコード要素である。例えば、2行目の記述“* main”は“main”という要素IDのみを定義している(優先度を定義していない)。なお、要素ID“main”は、データ構造の定義に関するコード要素であることを示す。 In addition, the priority may not be defined for the essential code element. Essential code elements are code elements that must be included in the source code. For example, the description “* main” on the second line defines only the element ID “main” (no priority is defined). The element ID “main” indicates that the code element is related to the definition of the data structure.
(ルール3)1つのブロックはコマンドを示す文字列を1または複数個含み得る。各コマンドを示す文字列を選択可能な形式で記述できる。具体的には、角括弧記号“[”、“]”で囲った内側に、バーティカルバー記号“|”で区切って選択対象の文字列を記述する。各文字列には、当該文字列を選択する際の優先度をカンマ区切りで設定できる。 (Rule 3) One block may include one or a plurality of character strings indicating commands. A character string indicating each command can be described in a selectable format. Specifically, the character string to be selected is described inside the brackets “[”, “]”, separated by the vertical bar symbol “|”. For each character string, the priority at the time of selecting the character string can be set in a comma separated manner.
例えば、5行目のコード要素“integer [*4,10|*8,20] v1”は、テスト用のソースコード内に“integer*4 v1”または“integer*8 v1”の何れか一方を選択して記述することを示す。このとき、当該コード要素の定義によれば、“integer*4 v1”の優先度が“10”、“integer*8 v1”の優先度が“20”である。よって、当該定義ファイル111の設定では“integer*8 v1”の方が優先的に選択されてソースコードが生成されることになる。ただし、この優先度はソースコードごとのテスト結果に応じて補正され得る。
For example, the code element “integer [* 4, 10 | * 8, 20] v1” on the fifth line includes either “integer * 4 v1” or “integer * 8 v1” in the test source code. Indicates selection and description. At this time, according to the definition of the code element, the priority of “integer * 4 v1” is “10”, and the priority of “integer * 8 v1” is “20”. Therefore, in the setting of the
また、5行目のコード要素では要素IDを定義していない。当該コード要素の要素IDは、コード要素を直接記述した文字列となる。この場合は、“integer*4 v1”および“integer*8 v1”を要素IDとする。 In addition, the element ID is not defined in the code element on the fifth line. The element ID of the code element is a character string that directly describes the code element. In this case, “integer * 4 v1” and “integer * 8 v1” are element IDs.
図6は、第2の実施の形態の定義ファイルの例(続き)を示す図である。例えば、要素集合“exper”(32行目の記述)が定義されている。当該要素集合は、例えば、34行目のコード要素“[v1|v2]=[v2|v3]”を含む。これは“v1=v2”、“v1=v3”、“v2=v2”、“v2=v3”の何れかをソースコード内に記述するための定義である。33行目の記述“* expr1,50”によれば、34行目のコード要素には要素ID“expr1”、優先度“50”が付与されている。要素IDに“expr”の文字列が含まれる場合、当該要素集合が数式やAPI(Application Programming Interface)の利用に関するコード要素であることを示す。 FIG. 6 is a diagram illustrating an example (continued) of the definition file according to the second embodiment. For example, an element set “exper” (description on the 32nd line) is defined. The element set includes, for example, the code element “[v1 | v2] = [v2 | v3]” on the 34th line. This is a definition for describing any one of “v1 = v2”, “v1 = v3”, “v2 = v2”, and “v2 = v3” in the source code. According to the description “* expr1, 50” on the 33rd line, the element ID “expr1” and the priority “50” are assigned to the code element on the 34th line. When the element ID includes the character string “expr”, it indicates that the element set is a code element related to the use of a mathematical expression or API (Application Programming Interface).
なお、定義ファイル111には要素集合“end”(44行目)において、要素ID“print”(45行目)、“end”(47行目)も例示されている。要素ID“print”は、出力に関するコード要素であることを示す。要素ID“end”は、プログラムの終了を示すコード要素であることを示す。
In the
組合せ生成部120は、定義ファイル111に記述されたコード要素を組合せる。組合せを行うためには次の(1)(2)のような条件も用いる。(1)ループの選択数。例えば5個以内というように予め指定される。(2)ループ内に挿入する数式・APIの数。例えば5個以内というように予め指定される。これらの条件は、組合せ生成部120に対して予め指定できる。あるいは、定義ファイル111内に定義されてもよい。
The
図7は、第2の実施の形態のコード要素管理テーブルの例を示す図である。コード要素管理テーブル112には、定義ファイル111のうち、選択の対象となり得るコード要素が組合せ生成部120により登録される。コード要素管理テーブル112は、コード要素、要素区分、識別記号および優先度補正値の項目を含む。
FIG. 7 illustrates an example of a code element management table according to the second embodiment. In the code element management table 112, code elements that can be selected from the
コード要素の項目には、要素IDが登録される。要素区分の項目には、要素区分が登録される。要素区分とは、要素IDから導かれるコード要素の区分である。例えば、要素IDに“integer”が含まれる場合、要素区分は“データ構造”である。また、要素IDに“loop”が含まれる場合、要素区分は“ブロック構造”である。また、要素IDに“expr”が含まれる場合、要素区分は“式、API”である。 An element ID is registered in the code element item. The element classification is registered in the element classification item. The element classification is a code element classification derived from the element ID. For example, when “integer” is included in the element ID, the element classification is “data structure”. When the element ID includes “loop”, the element classification is “block structure”. Further, when “expr” is included in the element ID, the element classification is “expression, API”.
識別記号の項目には、識別記号が登録される。識別記号とは、コード要素の組合せの管理に用いられる記号である。識別記号は、定義ファイル111で指定されることもあるし、組合せ生成部120によって付与されることもある。例えば、要素IDの文字列の末尾にスペースに続く記号を含む場合(例えば、“loop (”)、当該コード要素の識別記号はその記号(例えば、丸括弧開始記号“(”)である。要素IDがそのような記号を含まなければ、組合せ生成部120が当該コード要素に一意の識別記号を付与する。
An identification symbol is registered in the item of the identification symbol. An identification symbol is a symbol used for managing combinations of code elements. The identification symbol may be specified in the
優先度補正値の項目には、定義ファイル111で指定された優先度に対する補正値が登録される。優先度補正値の項目に設定される初期値は“0”である。
例えば、コード要素管理テーブル112には、コード要素が“integer*4 v1”、要素区分が“データ構造”、識別記号が“a”、優先度補正値が“15”という情報が登録されている。これは、コード要素“integer*4 v1”の要素区分が“データ構造”を示すものであることを示す。また、識別記号が“a”であり、定義ファイル111で設定された優先度に補正値“15”を加算することを示す。
In the priority correction value item, a correction value for the priority specified in the
For example, in the code element management table 112, information that the code element is “integer * 4 v1”, the element classification is “data structure”, the identification symbol is “a”, and the priority correction value is “15” is registered. . This indicates that the element classification of the code element “integer * 4 v1” indicates “data structure”. The identification symbol is “a”, which indicates that the correction value “15” is added to the priority set in the
ここで、定義ファイル111では、コード要素“integer*4 v1”や“integer*8 v1”に対する識別記号は指定されていない。このようなコード要素には組合せ生成部120が識別記号を付与する。識別記号“a”は組合せ生成部120によって付与されたものである。また、コード要素“integer*4 v1”および“integer*8 v1”は、同一の変数“v1”を定義するものである。よって、ソースコードには何れか一方の定義を記述すればよいことになる。
Here, in the
また、例えば、コード要素管理テーブル112には、コード要素が“loop(”、要素区分が“ブロック構造”、識別記号が“(”、優先度補正値が“0”という情報が登録されている。これは、コード要素“loop (”の要素区分が“ブロック構造”を示すものであることを示す。また、識別記号が“(”であり、定義ファイル111で設定された優先度に補正値“0”を加算する(初期値のままとする)ことを示す。
Further, for example, in the code element management table 112, information that the code element is “loop (”, the element classification is “block structure”, the identification symbol is “(”, and the priority correction value is “0” is registered. This indicates that the element classification of the code element “loop (” indicates “block structure”. Also, the identification symbol is “(”, and the priority set in the
また、例えば、コード要素管理テーブル112には、コード要素が“expr1”、要素区分が“式、API”、識別記号が“1”、優先度補正値が“−1”という情報が登録されている。これは、コード要素“expr1”の要素区分が“式、API”を示すものであることを示す。また、識別記号が“1”であり、定義ファイル111で設定された優先度に補正値“−1”を加算する(“1”を減算する)ことを示す。このように、優先度補正値は、プラス/マイナスの値をとり得る。 Further, for example, in the code element management table 112, information that the code element is “expr1”, the element classification is “expression, API”, the identification symbol is “1”, and the priority correction value is “−1” is registered. Yes. This indicates that the element classification of the code element “expr1” indicates “expression, API”. Further, the identification symbol is “1”, which indicates that the correction value “−1” is added to the priority set in the definition file 111 (“1” is subtracted). Thus, the priority correction value can take a plus / minus value.
なお、以下の説明において、コード要素をコード要素管理テーブル112に設定された識別記号で指し示すことがある。例えば、コード要素“a”という場合、識別記号が“a”であるコード要素“integer*4 v1”を意味する。 In the following description, a code element may be indicated by an identification symbol set in the code element management table 112. For example, the code element “a” means a code element “integer * 4 v1” whose identification symbol is “a”.
図8は、第2の実施の形態の組合せ絞込条件リストの例を示す図である。組合せ絞込条件リスト113には、コード要素の組合せの絞込みを行うための条件を設定可能である。この条件はテスト対象の入力データを絞り込むための条件ということもできる。
FIG. 8 is a diagram illustrating an example of a combination narrowing down condition list according to the second embodiment. Conditions for narrowing down combinations of code elements can be set in the combination narrowing
例えば、組合せ絞込条件リスト113には、““loop <”は“loop (”と類似”という情報が登録されている。これは、要素ID“loop <”で示されるコード要素“do i3=0,10,2”を、要素ID“loop (”で示されるコード要素“do i1=0,10,1”と類似するものとし、前者のコード要素を含む組合せを省略し得ることを示している。
For example, the information ““ loop <”is similar to“ loop (”” is registered in the combination narrowing-
また、例えば、組合せ絞込条件リスト113には、““loop_end”記号の直後に“式、API”のコード要素あり”という情報が登録されている。これは、“loop_end”記号、すなわち、定義ファイル111の例でいえば“)”、“]”、“>”などの後に、要素区分“式、API”のコード要素が結合されるような組合せを省略し得ることを示している。
For example, in the combination narrowing-
このような組合せを省略し得るのは、コンパイルの最適化のテストには不向きである可能性が高いからである。例えば、ループに対する最適化の処理についてテストしたい場合に、ループの外側に数式が存在するソースコードをテストしても、バグの調査にとって有益な情報を得られない場合がある。そこで、このような組合せをテスト対象から除外可能とする。テストを効率的に行えるようにするためである。 Such a combination can be omitted because it is likely not suitable for the compilation optimization test. For example, when it is desired to test the optimization processing for a loop, there is a case where useful information for investigating a bug cannot be obtained by testing a source code having a mathematical expression outside the loop. Therefore, such a combination can be excluded from the test target. This is to enable efficient testing.
このように、組合せ絞込条件リスト113には、テスト対象から除外し得る組合せを判別するための条件を、テスト内容に応じて登録できる。
図9は、第2の実施の形態の組合せ管理テーブルの例を示す図である。組合せ管理テーブル114では、コード要素の組合せが識別記号を用いて管理される。組合せ管理テーブル114は、組合せID、組合せ内容および優先度の項目を含む。
As described above, the conditions for determining the combinations that can be excluded from the test target can be registered in the combination narrowing
FIG. 9 is a diagram illustrating an example of a combination management table according to the second embodiment. In the combination management table 114, combinations of code elements are managed using identification symbols. The combination management table 114 includes items of combination ID, combination contents, and priority.
組合せIDの項目には、組合せを識別するための識別情報が登録される。組合せ内容の項目には、コード要素の識別記号を用いて表された組合せの内容が登録される。ループの開始を示すコード要素に対しては、それに付随するループの終了を示すコード要素も組合せ内容に含める。ループの範囲を識別し易くするためである。優先度の項目には、組合せ単位の優先度が登録される。 In the combination ID item, identification information for identifying the combination is registered. In the item of combination content, the content of the combination expressed using the identification symbol of the code element is registered. For a code element indicating the start of a loop, a code element indicating the end of the loop accompanying the code element is also included in the combination content. This is to facilitate identification of the loop range. The priority of the combination unit is registered in the priority item.
例えば、組合せ管理テーブル114には、組合せIDが“C1”、組合せ内容が“bce(<13><23><1>)”、優先度が“704”という情報が登録されている。これは、組合せID“C1”で示される組合せの内容がコード要素の識別記号の組合せ“bce(<13><23><1>)”であり、組合せ単位の優先度が“704”であることを示す。 For example, information indicating that the combination ID is “C1”, the combination content is “bce (<13> <23> <1>)”, and the priority is “704” is registered in the combination management table 114. In this case, the content of the combination indicated by the combination ID “C1” is the combination “bce (<13> <23> <1>)” of the identification symbol of the code element, and the priority of the combination unit is “704”. It shows that.
なお、以下の説明において、組合せIDを用いて組合せを指し示すことがある。例えば、組合せ“C1”という場合、組合せIDが“C1”である組合せを意味する。
1つの組合せでは、同じコード要素が複数回現れてもよい。ただし、要素区分が“データ構造”であるコード要素(例えば、“integer*8 v1”)は、1つの変数(例えば、“v1”)に対し、1つの組合せの中で1回登場すれば十分である。よって、組合せ生成部120は、このようなコード要素は1つの変数(例えば、“v1”)に対して1回だけ現れるようにする。
In the following description, a combination may be indicated using a combination ID. For example, the combination “C1” means a combination whose combination ID is “C1”.
In one combination, the same code element may appear multiple times. However, code elements whose element classification is “data structure” (for example, “integer * 8 v1”) need only appear once in one combination for one variable (for example, “v1”). It is. Therefore, the
また、優先度(組合せ単位の優先度)は、定義ファイル111で定義されたコード要素単位の優先度を、コード要素管理テーブル112に設定された優先度補正値で補正し、組合せに含まれる各コード要素の補正後の優先度を加算したものである。
In addition, the priority (priority in combination unit) is obtained by correcting the priority in code element unit defined in the
組合せ“C1”の例でいえば、コード要素“b”は“integer*8 v1”に対応する。当該コード要素には定義ファイル111で優先度“20”が付与されている。また、コード要素管理テーブル112によれば、当該コード要素の優先度補正値は“5”である。したがって、コード要素単位の補正後の優先度は“20+5=25”となる。
In the example of the combination “C1”, the code element “b” corresponds to “integer * 8 v1”. The code element is given a priority “20” in the
同様にして、コード要素“c”の補正後の優先度は“10+15=25”である。コード要素“e”の補正後の優先度は“10+15=25”である。コード要素“<”の補正後の優先度は“80+20=100”である。コード要素“(”の補正後の優先度は“120+0=120”である。コード要素“1”の補正後の優先度は“50+(−1)=49”である。コード要素“2”の補正後の優先度は“40+5=45”である。コード要素“3”の補正後の優先度は“30+3=33”である。 Similarly, the corrected priority of the code element “c” is “10 + 15 = 25”. The priority after correction of the code element “e” is “10 + 15 = 25”. The priority after correction of the code element “<” is “80 + 20 = 100”. The corrected priority of the code element “(” is “120 + 0 = 120”. The corrected priority of the code element “1” is “50 + (− 1) = 49”. The priority after correction is “40 + 5 = 45.” The priority after correction of the code element “3” is “30 + 3 = 33”.
組合せ“C1”の組合せ単位の優先度は、コード要素“b”、“c”、“e”、“(”、“<”、“1”、“2”、“3”の補正後の優先度(複数回現れるコード要素はその回数を補正後の優先度に乗じた値)を合計した値となる。すなわち、組合せ“C1”の優先度は“25+25+25+120+100+49+33+100+45+33+100+49=704”と算出される。 The priority of the combination unit of the combination “C1” is the priority after correction of the code elements “b”, “c”, “e”, “(”, “<”, “1”, “2”, “3”. In other words, the priority of the combination “C1” is calculated as “25 + 25 + 25 + 120 + 100 + 49 + 33 + 100 + 45 + 33 + 100 + 49 = 704”.
図10は、第2の実施の形態の順序管理テーブルの例を示す図である。順序管理テーブル115では、組合せIDを用いて組合せごとのテスト順序が管理される。順序管理テーブル115は、順序および組合せIDの項目を含む。順序の項目には、テストを実行する順番が登録される。順序“1”が最初(1番目)である。順序“2”が2番目である。3番目以降も同様である。組合せIDの項目には、組合せIDが登録される。 FIG. 10 is a diagram illustrating an example of an order management table according to the second embodiment. In the order management table 115, the test order for each combination is managed using the combination ID. The order management table 115 includes items of order and combination ID. The order of execution of tests is registered in the order item. The order “1” is the first (first). The order “2” is the second. The same applies to the third and subsequent times. The combination ID is registered in the combination ID item.
例えば、順序管理テーブル115には、順序が“1”、組合せIDが“C1”という情報が登録される。これは、順序管理テーブル115に登録された組合せの中で組合せ“C1”を最も優先して、テストすることを示す。 For example, information indicating that the order is “1” and the combination ID is “C1” is registered in the order management table 115. This indicates that the combination “C1” is most preferentially tested among the combinations registered in the order management table 115.
図11は、第2の実施の形態のコンパイル成否基準テーブルの例を示す図である。コンパイル成否基準テーブル116には、テスト用のソースコードのコンパイル成否を判断するための基準が登録される。 FIG. 11 is a diagram illustrating an example of a compilation success / failure criterion table according to the second embodiment. In the compilation success / failure criterion table 116, a criterion for determining whether or not the test source code is successfully compiled is registered.
コンパイル成功と判断される場合は、次のフェーズ(目的コードの実行)に移ることになる。これをテストの“続行”と称している。一方、コンパイル失敗と判断される場合は目的コードがないため、当該ソースコードについては、次のフェーズ(目的コードの実行)を行わない(次のソースコードのテストに移る)。これをテストの“スキップ”と称している。 If it is determined that the compilation is successful, the process proceeds to the next phase (execution of the target code). This is called “continuation” of the test. On the other hand, if it is determined that the compilation is unsuccessful, there is no target code, so the next phase (execution of the target code) is not performed on the source code (the process proceeds to the next source code test). This is called “skip” of the test.
コンパイル成否基準テーブル116は、被検コンパイラ、比較用コンパイラおよびテスト実行方針の項目を含む。被検コンパイラでは最適化オン/オフでコンパイルを行うため、被検コンパイラの項目は、更に最適化オン/オフの項目に細分化される。 The compilation success / failure criteria table 116 includes items of a tested compiler, a comparison compiler, and a test execution policy. Since the test compiler compiles with optimization on / off, the items of the test compiler are further subdivided into optimization on / off items.
被検コンパイラ(最適化オン/オフ)の項目には、被検コンパイラ151によるコンパイルの成功/失敗の何れかが登録される。比較用コンパイラの項目には、比較用コンパイラ152によるコンパイルの成功/失敗の何れかが登録される。テスト実行方針の項目には、被検コンパイラ151および比較用コンパイラ152のコンパイルの成功/失敗のパターンに応じた、当該ソースコードに対するテストの実行方針が登録される。
In the item of the test compiler (optimization on / off), either success / failure of compilation by the
例えば、コンパイル成否基準テーブル116では、被検コンパイラ151で最適化オン/オフの両方の方法でコンパイルが成功すれば、当該ソースコードに対するテストを“続行”し、最適化オン/オフの少なくとも何れかの方法でコンパイルが失敗すれば、当該ソースコードに対するテストを“スキップ”するように設定されている。
For example, in the compilation success / failure criteria table 116, if compilation is successful by both the optimization on / off methods in the tested
ただし、被検コンパイラ151の最適化オンでコンパイル成功し、比較用コンパイラ152でコンパイル成功していれば、被検コンパイラ151の最適化オフでコンパイル失敗していても、当該ソースコードに対するテストを“続行”するように設定してもよい。被検コンパイラ151により最適化オンで生成された目的コードと、比較用コンパイラ152で生成された目的コードを用いて、最適化オンで生成された目的コードを実行したときの結果を検証できるからである。
However, if compilation is successful when the
図12は、第2の実施の形態のテスト用のソースコードの例を示す図である。ソースコード117は、順序管理部130により指定された組合せの内容および定義ファイル111に基づいて、コード生成部140により生成されるテストデータである。ソースコード117は、組合せ“C1”に対して生成されるソースコードの一例である。組合せ“C1”の組合せ内容は“bce(<13><23><1>)”である。以下、ソースコード117に便宜的に付した行番号を用いて説明する。
FIG. 12 is a diagram illustrating an example of test source code according to the second embodiment. The
1行目に記述された“loop0001.f”はソースコード117のファイル名である。4行目はコード要素“b”である。5行目はコード要素“c”である。6行目はコード要素“e”である。13行目はコード要素“(”である。
“Loop0001.f” described in the first line is the file name of the
14行目はコード要素“<”である。15行目はコード要素“1”である。16行目はコード要素“3”である。17行目は14行目のコード要素“<”に付随するコード要素“>”である。 The 14th line is a code element “<”. The fifteenth line is a code element “1”. The 16th line is a code element “3”. The 17th line is a code element “>” accompanying the code element “<” on the 14th line.
18行目はコード要素“<”である。19行目はコード要素“2”である。20行目はコード要素“3”である。21行目は18行目のコード要素“<”に付随するコード要素“>”である。 The 18th line is a code element “<”. The 19th line is a code element “2”. The 20th line is a code element “3”. The 21st line is a code element “>” accompanying the code element “<” on the 18th line.
22行目はコード要素“<”である。23行目はコード要素“1”である。24行目は22行目のコード要素“<”に付随するコード要素“>”である。
25行目は13行目のコード要素“(”に付随するコード要素“)”である。
The 22nd line is a code element “<”. The 23rd line is a code element “1”. The 24th line is a code element “>” accompanying the code element “<” on the 22nd line.
The 25th line is the code element “(” accompanying the code element “)” of the 13th line.
それ以外の行に記述されたコード要素は定義ファイル111に必須のコード要素として記述されたコード要素である。また、ソースコード中には、コード要素の優先度は記述されない。
Code elements described in other lines are code elements described as essential code elements in the
図13は、第2の実施の形態のテスト結果テーブルの例を示す図である。テスト結果テーブル118では、ソースコードのファイル名に対応付けてテスト結果が登録される。テスト結果テーブル118は、組合せID、ソースコードファイル名および結果の項目を含む。 FIG. 13 is a diagram illustrating an example of a test result table according to the second embodiment. In the test result table 118, the test result is registered in association with the file name of the source code. The test result table 118 includes items of a combination ID, a source code file name, and a result.
組合せIDの項目には、組合せIDが登録される。ソースコードファイル名の項目には、ソースコードのファイル名が登録される。結果の項目には、テスト結果の内容が登録される。テスト結果としては、例えば、次のような内容が登録され得る。 The combination ID is registered in the combination ID item. In the source code file name item, the file name of the source code is registered. The content of the test result is registered in the result item. As the test result, for example, the following contents can be registered.
(1)正常に実行できたこと。(2)コンパイルの時点で失敗したこと。(3)目的コードの実行中に異常が発生したこと。(4)コンパイルに成功して目的コードを実行したが最適化オン/オフ(または、最適化オンで生成された目的コードと比較用コンパイラ152が生成した目的コードと)で実行結果が不一致だった(すなわち、実行結果が不正であった)こと。失敗や異常が発生した場合には、目的コードのエラー箇所などを示すデバッグ情報を登録してもよい。 (1) Successful execution. (2) Failure at the time of compilation. (3) An error occurred during execution of the target code. (4) The target code was executed after successful compilation, but the execution result did not match between optimization on / off (or the target code generated by optimization on and the target code generated by the comparison compiler 152). (In other words, the execution result was invalid). When failure or abnormality occurs, debug information indicating the error location of the target code may be registered.
例えば、テスト結果テーブル118には、組合せIDが“C1”、ソースコードファイル名が“loop0001.f”、結果が“実行結果不一致”という情報が登録される。これは、組合せ“C1”に対して生成されたソースコードのファイル名が“loop0001.f”であり、コンパイルに成功して目的コードを実行したが実行結果が不正であったことを示す。 For example, information indicating that the combination ID is “C1”, the source code file name is “loop0001.f”, and the result is “execution result mismatch” is registered in the test result table 118. This indicates that the file name of the source code generated for the combination “C1” is “loop0001.f”, the compilation was successful, and the target code was executed, but the execution result was incorrect.
例えば、ソフトウェアの開発者は、テスト結果テーブル118の内容を参照可能である。ソフトウェアの開発者は、テスト結果テーブル118の内容に基づいて、被検コンパイラ151のバグ箇所を特定し、修正し得る。なお、ソースコードのファイルは、所定のディレクトリに格納される。ソフトウェアの開発者は、ソースコードの内容を閲覧してバグ解析に活用できる。
For example, the software developer can refer to the contents of the test result table 118. The software developer can identify and correct the bug location of the tested
図14は、第2の実施の形態のテスト処理を示すフローチャートである。以下、図14に示す処理をステップ番号に沿って説明する。
(ステップS11)組合せ生成部120は、被検コンパイラ151の最適化処理に関するテストを開始する旨の入力を受け付ける。例えば、ソフトウェアの開発者は、入力デバイス12を操作して、当該入力を行える。ソフトウェアの開発者は、定義ファイル111、組合せ絞込条件リスト113およびコンパイル成否基準テーブル116を記憶部110に予め格納しておく。組合せ生成部120は、定義ファイル111に含まれるコード要素の組合せ処理を実行し、コード要素管理テーブル112および組合せ管理テーブル114を生成する(詳細は後述する)。ただし、本ステップでは組合せ管理テーブル114において、組合せ単位の優先度は未登録であるとする。
FIG. 14 is a flowchart illustrating a test process according to the second embodiment. In the following, the process illustrated in FIG. 14 will be described in order of step number.
(Step S <b> 11) The
(ステップS12)順序管理部130は、定義ファイル111、コード要素管理テーブル112および組合せ管理テーブル114に基づいて、組合せ単位の優先度を計算し、組合せ管理テーブル114に登録する。組合せ単位の具体的な計算方法は、図9で説明した通りである。順序管理部130は、組合せ管理テーブル114に基づいて順序管理テーブル115を作成する。
(Step S12) The
(ステップS13)順序管理部130は、順序管理テーブル115に基づいて、次に実行するコード要素の組合せを1つ抽出し、その組合せIDをコード生成部140に出力する。
(Step S <b> 13) The
(ステップS14)コード生成部140は、順序管理部130から取得した組合せIDに対応する組合せ内容を組合せ管理テーブル114から取得する。コード生成部140は当該組合せ内容に基づいてテスト用のソースコードを生成し、被検コンパイラ151および比較用コンパイラ152に入力する。具体的には、コード生成部140は組合せ内容に含まれる識別記号に対応するコード要素を、定義ファイル111から選択してソースコードを生成する。例えば、組合せ“C1”であれば、図12で説明したようにソースコード117を生成する。ここで、定義ファイル111では、1つのコード要素に複数の文字列が対応することがある。例えば、コード要素“1”(要素ID“expr1”)に対して“v1=v2”、“v1=v3”、“v2=v2”、“v2=v3”の4つの文字列の何れかを選択可能である。この場合、コード生成部140は、何れか1つをランダムに選択してもよい。あるいは、コード要素ごとに選択された履歴を記憶部110に保持しておき、前回とは異なるコード要素を選択してソースコードを生成するようにしてもよい。
(Step S <b> 14) The
(ステップS15)被検コンパイラ151は、最適化オン/オフの2つの方法でソースコードをコンパイルし、検証部160にコンパイル結果を出力する。被検コンパイラ151は、コンパイルが成功していれば記憶部110の所定のディレクトリに、生成された目的コードを格納する。比較用コンパイラ152は、ソースコードをコンパイルし、検証部160にコンパイル結果を出力する。比較用コンパイラ152も、コンパイルが成功していれば、記憶部110の所定のディレクトリに、生成された目的コードを格納するようにしてもよい。
(Step S15) The tested
(ステップS16)検証部160は、被検コンパイラ151および比較用コンパイラ152のコンパイル結果と、コンパイル成否基準テーブル116とに基づいて、当該ソースコードにつき以降のフェーズのテストを続行するか否かを判定する。続行する場合、処理をステップS17に進める。続行しない場合(すなわち、スキップする場合)、処理をステップS19に進める。コンパイル成否基準テーブル116の例では、被検コンパイラ151が最適化オン/オフの両方でコンパイル成功であれば、“続行”であり、何れか一方でコンパイル失敗であれば“スキップ”である。
(Step S16) Based on the compilation results of the tested
(ステップS17)検証部160は、最適化オン/オフの2種類の方法で被検コンパイラ151により生成された目的コードを実際に実行して、目的コードが正しく生成されたかをテストする。更に、検証部160は、目的コードが正しく生成されたか否かの判断結果に基づいて定義ファイル111に含まれる各コード要素の優先度補正値を増減させる。詳細は後述する。
(Step S <b> 17) The
(ステップS18)検証部160は、目的コードを実行して行ったテストの結果をテスト結果テーブル118に登録する。登録され得る内容は図13で例示した通りである。そして、処理をステップS20に進める。
(Step S18) The
(ステップS19)検証部160は、ステップS14で生成されたソースコードについて、コンパイルが失敗した旨をテスト結果テーブル118に登録する。
(ステップS20)検証部160は、テストの実行回数に1を加算する。ここで、テストの実行回数はステップS11の直前では“0”である。検証部160はテスト済の組合せを組合せ管理テーブル114から削除する。
(Step S19) The
(Step S20) The
(ステップS21)検証部160は、組合せ管理テーブル114に登録された全ての組合せについてテスト済であるか否かを判定する。全てテスト済である場合、処理を終了する。未テストの組合せがある場合、処理をステップS22に進める。
(Step S <b> 21) The
(ステップS22)検証部160は、各組合せのテスト順序を変更する。具体的には、ステップS17の処理によって定義ファイル111に含まれるコード要素ごとの優先度補正値が変動するので、当該優先度補正値に基づいて、組合せ単位の優先度を再計算し、テスト順序を変更する。詳細は後述する。そして、処理をステップS13に進める。
(Step S22) The
このようにして、テスト装置100は、各ソースコードのテストを実行しながら、実行結果に基づいて、以降にテストするソースコードの順番を変更する。次に、ステップS11に処理を説明する。
In this way, the
図15は、第2の実施の形態のコード要素組合せ処理を示すフローチャートである。以下、図15に示す処理をステップ番号に沿って説明する。
(ステップS31)組合せ生成部120は、記憶部110に記憶された定義ファイル111からコード要素を抽出し、コード要素管理テーブル112に登録する。ここで、優先度補正値の初期値は“0”である。本ステップでは、各コード要素の識別記号は未登録の状態である。
FIG. 15 is a flowchart illustrating a code element combination process according to the second embodiment. In the following, the process illustrated in FIG. 15 will be described in order of step number.
(Step S31) The
(ステップS32)組合せ生成部120は、抽出した各コード要素に識別記号を付与し、コード要素管理テーブル112に登録する。前述のように、定義ファイル111内に各コード要素の識別記号が指定されていれば、当該識別記号を付与する。一方、定義ファイル111内で識別記号が付与されていないコード要素には、当該コード要素を一意に識別するための識別記号を付与する。識別記号は例えば半角一文字が好ましい。コード要素の組合せ管理の容易化のためである。
(Step S <b> 32) The
(ステップS33)組合せ生成部120は、要素区分が“ブロック構造”のコード要素を抽出して、ブロック構造パターンのリストを作成する。“ブロック構造”のコード要素を幾つ抽出するかは、組合せ生成部120に予め与えられる。あるいは、定義ファイル111で明示して組合せ生成部120に指定してもよい。例えば、5個以下であれば、ループなどのブロック構造に係るコード要素を5個以内で選択して、複数のループを(入れ子にせずに)順番に実行するようなパターン、複数のループを入れ子で実行するようなパターンおよびこれら2種類のパターンが混在したパターンなど、ブロック構造の複数のパターンを作成する。当該ブロック構造のパターン(数式などを含まないパターン)をブロック構造パターンと称する。
(Step S33) The
(ステップS34)組合せ生成部120は、ブロック構造パターンに要素区分“ブロック構造”以外の要素区分のコード要素を追加して、複合パターンを作成する。複合パターンは、全ての要素区分のコード要素を考慮して作成されたコード要素の組合せである。ブロック構造パターン(要素区分“ブロック構造”のコード要素のみを考慮して作成された組合せ)と区別するために複合パターンの用語を用いる。例えば、要素区分“データ構造”のコード要素を1つの変数につき1つ選択して、ブロック構造パターンに追加する。例えば、要素区分“データ構造”のコード要素は、最初のループに入る前に追加される。また、例えば、要素区分“式、API”のコード要素は、ループ内に挿入される。1つのループ内に幾つ挿入するかは、組合せ生成部120に予め与えられる。あるいは、定義ファイル111で明示して組合せ生成部120に指定してもよい。例えば、5個以下であれば、ループ内に挿入する“式、API”のコード要素を5個以内で選択して、各ブロック構造パターンに含まれる各ループ内に挿入する。これにより、複数の複合パターンが作成される。
(Step S <b> 34) The
(ステップS35)組合せ生成部120は、複合パターンにおいて、ブロック構造以外のコード要素をマスクしてマスク後パターンを作成する。“マスクする”とは、他の文字(例えば、“x”の文字)に置換することである。要素区分ごとにマスク文字を変えてもよい(例えば、要素区分“式・API”であれば“x”、要素区分“データ構造”であれば“y”の文字でマスクするなど)。
(Step S35) The
(ステップS36)組合せ生成部120は、同一のマスク後パターンは1つを残してテスト対象の組合せから除外する。
(ステップS37)組合せ生成部120は、組合せ絞込条件リスト113に基づいて、マスク後パターンの絞込を更に行う。組合せ絞込条件リスト113では、例えば“loop <”と“loop (”とを類似のコード要素としている。この場合、パターンの構造が同一で、ループに用いられているコード要素の識別記号が“<”か“(”、および、“>”か“)”の違いのみであれば、識別記号“<”および“>”を用いている方のマスク後パターンをテスト対象から除外する(具体例は後述する)。また、組合せ絞込条件リスト113では、例えば、“loop_end”の識別記号の直後に要素区分“式、API”のコード要素がある場合に、当該マスク後パターンをテスト対象から除外するものとしている。この場合、例えば、識別記号“)”に続いて文字“x”が存在するマスク後パターンはテスト対象から除外される(具体例は後述する)。
(Step S36) The
(Step S37) The
(ステップS38)組合せ生成部120は、残ったマスク後パターンに対応する複合パターンを組合せ管理テーブル114に登録する。要素区分“データ構造”のコード要素については、1つのマスク文字に対して、2種類の識別記号が存在し得る(例えば、1つの変数“v1”につき識別記号“a”、“b”が存在する)。このため、残ったマスク後パターンに対応する複合パターンは少なくとも2つ登録されることになる。
(Step S38) The
このようにして、組合せ生成部120は、テスト対象とするコード要素の組合せを生成し、組合せ管理テーブル114に登録する。次に、ステップS33〜S37の具体例を説明する。
In this way, the
図16は、第2の実施の形態のコード要素の組合せ例を示す図である。図16では、図15で説明したステップS33〜S37で処理される各パターンリストを例示している。各パターンリストは複数の行を含み、1つの行が1つのパターンに相当する。1つのパターンを各行に便宜的に付した記号(a1など)によって指し示すことがある。例えば、ブロック構造パターンa1というとき、ブロック構造パターンリスト210の行“a1”のパターン“(<[]>)”を示す。
FIG. 16 is a diagram illustrating a combination example of code elements according to the second embodiment. FIG. 16 illustrates each pattern list processed in steps S33 to S37 described in FIG. Each pattern list includes a plurality of lines, and one line corresponds to one pattern. One pattern may be indicated by a symbol (such as a1) attached to each line for convenience. For example, the block structure pattern a1 indicates the pattern “(<[]>)” in the row “a1” of the block
まず、組合せ生成部120は、ブロック構造パターンリスト210を作成する(ステップS33)。組合せ生成部120は、ブロック構造パターンリスト210の各ブロック構造パターンに、他の要素区分のコード要素を追加して複合パターンリスト220を作成する(ステップS34)。
First, the
組合せ生成部120は、複合パターンリスト220にマスク処理を施してマスク後パターンリスト230を作成する(ステップS35)。そして、同一のマスク後パターンは1つを残して除外して、マスク後パターンリスト240を作成する(ステップS36)。例えば、マスク後パターンリスト230においてマスク後パターンc2,c3は同一である。よって、例えば、マスク後パターンc2を残して、マスク後パターンc3を削除する。
The
組合せ生成部120は、組合せ絞込条件リスト113に基づいて、マスク後パターンリスト240を更に絞り込み、マスク後パターンリスト250を作成する(ステップS37)。例えば、マスク後パターンリスト240によれば、マスク後パターンd4は“xxx[xx(xx)]”である。マスク後パターンd5は“xxx[xx<xx>]”である。マスク後パターンd4,d5はパターンの構造が同一である(xの文字の並びとブロック構造を示す記号の並びが一致している)。マスク後パターンd4では“(xx)”と記述されている箇所が、マスク後パターンd5では“<xx>”と記述されている点のみが相違している。組合せ絞込条件リスト113によれば、これらは類似するものとして取り扱う。この場合、マスク後パターンd4を残して、マスク後パターンd5を削除する。
The
また、例えば、マスク後パターンリスト240によれば、マスク後パターンd1は“xxx(x<x[x]x>x)”である。マスク後パターンd3は“xxx(x<xx[x]x>)”である。組合せ絞込条件リスト113によれば、“loop_end”記号の直後に“式、API”のコード要素があれば、テスト対象から除外する。“loop_end”記号とは“)”、“]”、“>”などである。また、ステップS34の処理によればループ内の文字“x”は“式、API”である。したがって、マスク後パターンd1,d3は絞込条件に該当する。“]x”(角括弧記号の直後の文字“x”)や“>x”(山形括弧記号の直後の文字“x”)を含むからである。よって、組合せ生成部120はマスク後パターンd1,d3を削除する。
For example, according to the
このように、組合せ生成部120は、重複したテストを排除し、また、最適化のテストにとって有益でない組合せを排除する。これにより、無駄にテストが実行されるのを抑制し、テストの効率化を図れる。なお、ステップS37では類似のパターンを削除することを例示したが、それ以外の方法も考えられる。例えば、第1のパターンと第2のパターンとが類似する場合、何れか一方のパターンのテストを後回し(例えば、最後)にするように制御してもよい。
In this manner, the
次に、図14のステップS17の処理を説明する。
図17は、第2の実施の形態の目的コードの実行を示すフローチャートである。以下、図17に示す処理をステップ番号に沿って説明する。
Next, the process of step S17 in FIG. 14 will be described.
FIG. 17 is a flowchart illustrating the execution of the object code according to the second embodiment. In the following, the process illustrated in FIG. 17 will be described in order of step number.
(ステップS41)検証部160は、目的コードを実行する。検証部160は、1つのソースコードに対して2種類の目的コードを実行する。1つは、被検コンパイラ151が最適化オンで生成した目的コードである。もう1つは、例えば被検コンパイラ151が最適化オフで生成した目的コードである。
(Step S41) The
(ステップS42)検証部160は、2種類の目的コードの実行結果に基づいて、最適化オンで生成された目的コードの実行結果が正しいか否かを判定する。正しい場合、処理をステップS43に進める。正しくない場合、処理をステップS45に進める。前述のように、目的コードの実行結果の正否は、例えば2種類の目的コードの実行結果が一致するか否かに基づいて判定できる。一致すれば正しい。不一致であれば不正である。また、最適化オンで生成された目的コードの実行中にエラーが発生することもある。この場合も目的コードの実行結果が不正であると判断する。
(Step S42) Based on the execution results of the two types of target codes, the
(ステップS43)検証部160は、目的コードが連続して正常実行された回数が閾値以上であるか否かを判定する。目的コードが連続して正常実行されるとは、例えば、テスト結果テーブル118に連続して“正常実行”が登録されることを意味する。すなわち、“実行結果不一致”や“コンパイル失敗”など“正常実行”以外の内容が記録されると“連続”が途切れることになる。閾値は、例えば、50回、100回などと予め検証部160に与えられる。例えば、閾値が50回であるとする。テスト結果テーブル118に直前まで連続して49回“正常実行”が記録されているとき、今回の目的コードの実行結果が正常実行であれば、閾値50回に達することになる。連続して正常実行された回数が閾値以上である場合、処理をステップS44に進める。閾値よりも小さければ、処理を終了する。
(Step S43) The
(ステップS44)検証部160は、連続して正常実行した組合せに含まれるコード要素の優先度を下げる。例えば、ステップS43の閾値が50であり、連続して正常実行した回数が50回であれば、直近の過去50回分でテストした組合せに含まれる各コード要素の優先度を下げる。閾値が50であり、連続して正常実行した回数が51回であれば、直近の過去51回分でテストした組合せに含まれる各コード要素の優先度を下げる。例えば、各コード要素につき優先度補正値から1だけ減算する。連続して正常実行した回数に応じて減算する値を変えてもよい。例えば、50〜59回連続して正常実行できた場合は1減算し、60〜69回連続して正常実行できた場合は2減算するなどのようにしてもよい。検証部160は、コード要素管理テーブル112の優先度補正値の項目に、各コード要素の当該減算後の優先度補正値を登録する。そして、処理を終了する。
(Step S44) The
(ステップS45)検証部160は、コード要素を変更したソースコードの作り直しをコード生成部140に指示する。コード生成部140は、検証部160の指示に応じてソースコードを作り直す。例えば、元のソースコードに対して、変数の定義を変更したソースコードを作成する。また、例えば加算の演算を減算の演算に変更したソースコードを作成する。具体的な方法は後述する。
(Step S45) The
(ステップS46)コード生成部140は、作り直したソースコードを被検コンパイラ151に入力する。被検コンパイラ151は、最適化オン/オフの両方の方法を用いて、当該ソースコードをコンパイルし、2つの目的コードを生成する。検証部160は、2つの目的コードを実行して、結果の正否を検証する。コード要素を変更することで不正な結果となった原因(エラー原因)のコード要素を特定できる可能性がある。例えば、あるコード要素が原因でエラーが生じている場合、そのコード要素を類似の処理を行う別のコード要素に置き換えると、正しい結果が得られることがある。その場合、変更前のコード要素がエラーの原因である可能性が高いと推測できる。したがって、その場合は変更前の当該コード要素をエラー原因と特定する。
(Step S46) The
(ステップS47)検証部160は、ステップS46の処理により、エラー原因のコード要素を特定できたか否かを判定する。特定できた場合、処理をステップS48に進める。特定できなかった場合、処理をステップS49に進める。
(Step S47) The
(ステップS48)検証部160は、エラー原因のコード要素を含む組合せをテスト対象から除外する。具体的には、検証部160は、組合せ管理テーブル114から当該組合せを削除する。例えば、コード要素“4”がエラー原因であると特定された場合、コード要素“4”を含む全ての組合せが削除されることになる。そして、処理を終了する。
(Step S48) The
(ステップS49)検証部160は、エラーとなった組合せに含まれる各コード要素の優先度を上げる。例えば、各コード要素につき優先度補正値に1だけ加算する。ただし、1以外の他の値を加算してもよい。検証部160は、コード要素管理テーブル112の優先度補正値の項目に、各コード要素の当該加算後の優先度補正値を登録する。そして、処理を終了する。
(Step S49) The
このようにして、検証部160は目的コードを実行しながら、その実行結果に応じて各コード要素の優先度補正値を更新する。すなわち、検証部160は各コード要素の優先度を調整する。各コード要素の優先度補正値は、ユーザ(例えば、ソフトウェアの開発者)により、任意のタイミングで変更可能としてもよい。
In this way, the
ステップS48において、エラー原因のコード要素を含む組合せをテスト対象から除外する理由は次の通りである。1つのコード要素がエラー原因として特定されれば、当該1つのコード要素を含む組合せでは、対応する目的コードの実行結果が不正となる可能性が高い。この場合、ソフトウェアの開発者は当該コード要素に係る最適化の処理の見直しに注力すればよい。よって、この場合には当該コード要素を含む組合せをテスト対象から除外して無駄なテストを行わないようにする。これにより、テストの一層の効率化を図れる。 In step S48, the reason for excluding the combination including the code element causing the error from the test target is as follows. If one code element is identified as the cause of the error, there is a high possibility that the execution result of the corresponding target code is incorrect in the combination including the one code element. In this case, the software developer may concentrate on reviewing the optimization process related to the code element. Therefore, in this case, a combination including the code element is excluded from the test target so that a useless test is not performed. As a result, the test can be made more efficient.
なお、ステップS48では、同一のコード要素がエラー原因となった回数が所定回数(例えば、2回)に達したときに、当該コード要素を含む組合せをテスト対象から除外するようにしてもよい。例えば、あるコード要素がエラー原因であると最初に特定された場合、ステップS48では当該コード要素を含む組合せの除外を行わない。その代わり、検証部160は、当該コード要素がエラー原因となった回数“1”を記憶しておく。そして、その後、他の目的コードをテストする上で当該コード要素が次にエラー原因として特定されたときに、当該コード要素を含む組合せをテスト対象から除外するようにする。同じコード要素が複数回エラー原因と特定されるときは、当該コード要素を含む組合せに対応する目的コードの実行結果が不正となる可能性は非常に高いと考えられるからである。
In step S48, when the number of times that the same code element causes an error reaches a predetermined number (for example, twice), the combination including the code element may be excluded from the test target. For example, when it is first identified that a certain code element is the cause of the error, the combination including the code element is not excluded in step S48. Instead, the
また、ステップS48では、当該コード要素を含む組合せをテスト対象から除外する代わりに、エラー原因と特定されたコード要素の優先度を大幅に下げたり、または、当該組合せのテストを後回し(例えば、最後)にしたりしてもよい。例えば、後回しになった(最後に回された)組合せが複数ある場合は、後回しになった組合せ同士の優先度を比べて、更に順番を決定する。また、当該コード要素の優先度を下げることも、当該コード要素の組合せのテストを後回しにするための制御といえる。 In step S48, instead of excluding the combination including the code element from the test target, the priority of the code element identified as the cause of the error is significantly reduced, or the test of the combination is postponed (for example, the last combination) ). For example, when there are a plurality of combinations that have been postponed (turned last), the priorities of the combinations that have been postponed are compared, and the order is further determined. Also, lowering the priority of the code element can be said to be control for postponing the test of the combination of the code elements.
図18は、第2の実施の形態のコード要素の変更例を示す図である。図17のステップS45において、コード生成部140は例えば次のようにソースコード117のコード要素を変更する。図18(A)は変数の定義を変更する場合を例示している。図18(B)は減算を加算に変更する場合を例示している。
FIG. 18 is a diagram illustrating a modification example of the code element according to the second embodiment. In step S45 of FIG. 17, the
例えば、コード生成部140は、4行目の“integer*8 v1”を“integer*4 v1”に変更する。または、16行目の“v1=v1−v3”を“v1=v1+v3”に変更する。ソースコード117の各コード要素について1つずつ順番にコード要素を検索して、1つずつ変更していき、1つのコード要素を変更したら、コンパイルの実行、目的コードの実行の手順を繰り返す。例えば、倍精度の変数を単精度の変更にする(またはその逆)、加算を減算に変更する(またはその逆)、乗算を除算に変更する(またはその逆)などの変更が考えられる。
For example, the
次に、図14のステップS22の処理を説明する。
図19は、第2の実施の形態のテスト順序変更を示すフローチャートである。以下、図19に示す処理をステップ番号に沿って説明する。
Next, the process of step S22 of FIG. 14 will be described.
FIG. 19 is a flowchart illustrating a test order change according to the second embodiment. In the following, the process illustrated in FIG. 19 will be described in order of step number.
(ステップS51)順序管理部130は、テストの実行回数が所定値に達したか否かを判定する。テストの実行回数が所定値に達した場合、処理をステップS52に進める。テストの実行回数が所定値よりも小さい場合、処理を終了する。所定値は、例えば10回、50回、100回など、1以上の回数を示す値が順序管理部130に予め与えられる。
(Step S51) The
(ステップS52)順序管理部130は、定義ファイル111、コード要素管理テーブル112および組合せ管理テーブル114に基づいて、組合せ単位の優先度を再計算する。順序管理部130は、再計算した優先度を組合せ管理テーブル114に登録する。更に、順序管理部130は組合せ管理テーブル114に基づいて、順序管理テーブル115を再作成する。
(Step S52) The
(ステップS53)順序管理部130は、テストの実行回数を“0”にリセットする。
このようにして、順序管理部130はテストの実行回数が所定値に達すると、組合せごとの優先度を再計算する。そして、当該優先度に基づいて、順序管理テーブル115を再作成する。これによって、コード要素の組合せをテストする順序が更新される。ステップS51でいう“所定値”は、テストに応じた値を設定可能である。例えば、コード要素の種類が多い場合には、テスト順序を毎回変更すると、テスト順序を変更するための処理コストが増大し得る。そこで、テストを複数回行うたびにテスト順序を変更するよう設定すれば、処理コストの増大を抑えられる。
(Step S53) The
In this manner, when the number of test executions reaches a predetermined value, the
ここで、ステップS52において、あるコード要素の組合せについて、組合せ単位の優先度が所定の最低値よりも低くなることがある。その場合には当該コード要素の組合せをテスト対象から除外するように制御してもよい。 Here, in step S52, for a certain combination of code elements, the combination unit priority may be lower than a predetermined minimum value. In that case, it may be controlled to exclude the combination of the code elements from the test target.
図20は、第2の実施の形態のテスト順序変更例を示す図である。図20では、ソースコード117k,117l,117p,117q,117rが例示されている。ソースコード117k,117l,117p,117q,117rは、定義ファイル111に基づいてコード生成部140により生成されるソースコード117のバリエーションである。
FIG. 20 is a diagram illustrating a test order change example according to the second embodiment. FIG. 20 illustrates
テストの開始当初のテスト順序は次の通りであるとする。ソースコード117kはK番目にテストされる予定である。ソースコード117lはL番目(L>K)にテストされる予定である。ソースコード117pはP番目(P>L)にテストされる予定である。ソースコード117qはQ番目(Q>P)にテストされる予定である。ソースコード117rはR番目(R>Q)にテストされる予定である。
Assume that the test sequence at the beginning of the test is as follows.
例えば、第1サイクルは図19のステップS51でいう所定値分の回数のテストを含んでいる。K,L番目のテストは第1サイクルに含まれる。第2サイクルは第1サイクルよりも後に実行されるテスト群を含んでいる。P,Q,R番目のテストは第2サイクルに含まれる。 For example, the first cycle includes the test for the predetermined number of times in step S51 of FIG. The Kth and Lth tests are included in the first cycle. The second cycle includes a test group that is executed after the first cycle. The Pth, Qth, and Rth tests are included in the second cycle.
第1サイクルにおいて、K番目のテストで目的コードの実行結果が不正であったとする。また、コード要素を変更してテストをやり直してもエラー原因が特定できなかったとする。すると、当該目的コードに対応する組合せに含まれるコード要素について、優先度補正値に1が加算される。同様にL番目のテストで目的コードの実行結果が不正であったとする。また、コード要素を変更してテストをやり直してもエラー原因が特定できなかったとする。すると、当該目的コードに対応する組合せに含まれるコード要素について、優先度補正値に1が加算される。 It is assumed that the execution result of the target code is incorrect in the Kth test in the first cycle. In addition, even if the code element is changed and the test is performed again, the cause of the error cannot be identified. Then, 1 is added to the priority correction value for the code element included in the combination corresponding to the target code. Similarly, it is assumed that the execution result of the target code is incorrect in the Lth test. In addition, even if the code element is changed and the test is performed again, the cause of the error cannot be identified. Then, 1 is added to the priority correction value for the code element included in the combination corresponding to the target code.
このように、目的コードの実行結果が不正であるたびに、その目的コードに対応する組合せに含まれるコード要素の優先度が増加し、そのコード要素を含む組合せのテストの優先度が高まる。 Thus, whenever the execution result of the target code is invalid, the priority of the code element included in the combination corresponding to the target code increases, and the priority of the test of the combination including the code element increases.
第1サイクルが終了すると、順序管理部130はテスト順序を更新する。例えば、ソースコード117q,117rは、第1サイクルでエラーが発生したソースコード117k,117lなどに含まれるコード要素を比較的多く含んでいるとする。そして、ソースコード117q,117rに対応する組合せの優先度が、ソースコード117pに対応する組合せの優先度よりも大きくなったとする。すると、ソースコード117q,117rをソースコード117pよりも前に順番を繰り上げて実行する。このようにして、テスト装置100はテストの実行順序を制御する。
When the first cycle ends, the
結果が不正となる可能性の高いソースコードを早い段階でテストすることで、エラーとなる入力のサンプルや各エラーの内容などを早い段階で取得できることになる。このため、ソフトウェアの開発者は、被検コンパイラ151のバグに対して早期に対処することができる。このようにして、テスト装置100はテストを効率的に実行することができる。また、ソフトウェアのデバッグ作業を効率的に支援することができる。
By testing the source code that is likely to be invalid at an early stage, it is possible to obtain an input sample that causes an error and the contents of each error at an early stage. Therefore, the software developer can deal with bugs in the tested
[第3の実施の形態]
以下、第3の実施の形態を説明する。前述の第2の実施の形態との相違点を主に説明し、同様の事項の説明を省略する。
[Third Embodiment]
Hereinafter, a third embodiment will be described. Differences from the second embodiment will be mainly described, and description of similar matters will be omitted.
第2の実施の形態では、テスト対象のソフトウェアとしてコンパイラを例示した。第3の実施の形態では、他のソフトウェアとしてDBMSを例示する。具体的には、DBMSにおけるSQLの実行テストを行う場合を想定する。ここで、第3の実施の形態のテスト装置のハードウェア例は、図2で説明したテスト装置100と同様である。第3の実施の形態のテスト装置を、特に断らない限りテスト装置100と同一の名称・符号を用いて指し示す。
In the second embodiment, the compiler is exemplified as the test target software. In the third embodiment, a DBMS is exemplified as other software. Specifically, it is assumed that a SQL execution test is performed in the DBMS. Here, the hardware example of the test apparatus according to the third embodiment is the same as that of the
図21は、第3の実施の形態のソフトウェア例を示す図である。図21に示す各ユニットは、例えば、テスト装置100aが備えるプロセッサがRAMに記憶されたプログラムを実行することで実現できる。図21の各ユニットはASICやFPGAなどによって実現されてもよい。 FIG. 21 is a diagram illustrating an example of software according to the third embodiment. Each unit illustrated in FIG. 21 can be realized, for example, by a processor included in the test apparatus 100a executing a program stored in the RAM. Each unit in FIG. 21 may be realized by an ASIC, FPGA, or the like.
テスト装置100は、記憶部110、組合せ生成部120、順序管理部130、コード生成部140、テスト用ソフトウェア150および検証部160を有する。記憶部110、組合せ生成部120、順序管理部130、コード生成部140、テスト用ソフトウェア150および検証部160の説明は、第2の実施の形態と同様である。
The
ただし、組合せ生成部120および順序管理部130は、テスト用のソースコードに代えて、テスト用のSQLを生成するためのコマンドおよびパラメータの組合せを処理する点が第2の実施の形態と異なる。また、コード生成部140は、テスト用のソースコードに代えて、テスト用のSQLを生成する点が第2の実施の形態と異なる。
However, the
また、テスト用ソフトウェア150は、テスト対象のソフトウェアとして被検DBMS151aを含む点が第2の実施の形態と異なる。テスト用ソフトウェア150は、被検DBMS151aによるSQL実行の正否を確認するためのソフトウェアとして比較用DBMS152aを含む点が第2の実施の形態と異なる。
The
更に、検証部160は、被検DBMS151aによるSQLの実行結果および比較用DBMS152aによるSQLの実行結果に基づいて、被検DBMS151aによるSQL実行の正否を検証する点が第2の実施の形態と異なる。例えば、被検DBMS151aによるSQLの実行結果が、比較用DBMS152aによるSQLの実行結果に一致すれば、被検DBMS151aが正しくSQLを実行できたことになる。一方、被検DBMS151aによるSQLの実行結果が、比較用DBMS152aによるSQLの実行結果に一致しなければ、被検DBMS151aが正しくSQLを実行できていないことになる。
Furthermore, the
図22は、第3の実施の形態のデータ例を示す図である。記憶部110は、定義ファイル111a、コード要素管理テーブル112a、組合せ絞込条件リスト113、組合せ管理テーブル114、順序管理テーブル115、テスト結果テーブル118およびテスト用SQL119を記憶する。
FIG. 22 is a diagram illustrating an example of data according to the third embodiment. The
ここで、組合せ絞込条件リスト113、組合せ管理テーブル114、順序管理テーブル115およびテスト結果テーブル118の説明は、第2の実施の形態の絞込条件リスト113、組合せ管理テーブル114、順序管理テーブルおよびテスト結果テーブル118と同様である。ただし、組合せ絞込条件リスト113には、SQLの実行テストを考慮した絞込条件が予め登録される。また、テスト結果テーブル118には、SQLの実行正否などのテスト結果が検証部160により登録される。
Here, the description of the combination narrowing-
定義ファイル111aは、SQLを生成するためのコマンドやパラメータなどを示す文字列を定義したデータである。以下の説明では、SQLを生成するためのコマンドやパラメータなどを示す文字列をコード要素と称することがある。SQLもDBMSに実行させたい命令を記述したコードと呼べるからである。各コード要素について定義可能な内容は第2の実施の形態の定義ファイル111と同様である。例えば、定義ファイル111aでもコード要素ごとに優先度を定義できる。
The
コード要素管理テーブル112aは、定義ファイル111aに定義されたコード要素およびコード要素ごとの優先度を管理するためのデータである。各コード要素は、第2の実施の形態と同様に、識別記号に対応付けられる。
The code element management table 112a is data for managing the code elements defined in the
テスト用SQL119は、コード生成部140により生成されたテスト用のSQL(テストデータの一例)である。テスト用SQL119は、1つの定義ファイル111aに対して複数のバリエーションが生成され得る。
The
図23は、第3の実施の形態の定義ファイルの例を示す図である。以下、定義ファイル111aに便宜的に付した行番号を用いて説明する。定義ファイル111aの記述ルールは、図5で説明した定義ファイル111aの記述ルールと同様である。ただし、定義ファイル111aでは要素集合の概念がない。このため、行頭に“:”が記述された行は存在しない。定義ファイル111aで指定されるのは、コマンドとコマンドの実行に用いる引数である。
FIG. 23 is a diagram illustrating an example of a definition file according to the third embodiment. Hereinafter, description will be made using line numbers assigned to the
例えば、1行目の記述“* command1,100”は2行目のコード要素“select [row1] from [table1] [where1|where2|・・・]”の属性を定義している。具体的には、要素ID“command1”、優先度“100”が付与されていることを示す。当該コード要素のうち“select・・・from・・・”は、SQLにおけるselectコマンドの1つの構文を示すものである。 For example, the description “* command1, 100” on the first line defines the attribute of the code element “select [row1] from [table1] [where1 | where2 |...]” On the second line. Specifically, the element ID “command1” and the priority “100” are assigned. Among the code elements, “select... From...” Indicates one syntax of the select command in SQL.
それ以外の“[”および“]”で囲われた箇所(“[row1]”など)は、selectコマンドで用いる列名、テーブル名、条件文、副問合せ文などを複数の選択肢から選択して挿入し得ることを示す。例えば、“[row1]”であれば、16行目に要素ID“row1”に対応するコード要素“[ID|NAME|・・・]”が記述されている(“row1”の要素IDは15行目で付与されている)。これは、“[row1]”として、“ID”、“NAME”、・・・の何れかの列名を選択して挿入し得ることを示している。 For other parts surrounded by “[” and “]” (such as “[row1]”), select a column name, table name, conditional statement, subquery statement, etc. used in the select command from multiple options. Indicates that it can be inserted. For example, in the case of “[row1]”, the code element “[ID | NAME |...]” Corresponding to the element ID “row1” is described in the 16th line (the element ID of “row1” is 15). Is given in line). This indicates that any one of “ID”, “NAME”,... Can be selected and inserted as “[row1]”.
2行目の“[table1]”、“[where1|where2|・・・]”などの記述も同様の意味である。ただし、“[where1|where2|・・・]”の記述は、“[where1]”、“[where2]”、・・・の何れかを選択することを意味する。“[where1]”について、要素ID“where1”のコード要素が20行目に定義されている。“where1”について複数の選択肢が存在することもある。その場合、コード要素“command1”において、“[where1]”が選択されたとき、“where1”の複数の選択肢の中の何れかが更に選択されることになる。 Descriptions such as “[table1]” and “[where1 | where2 |...]” On the second line have the same meaning. However, the description “[where1 | where2 |...]” Means that “[where1]”, “[where2]”,... Is selected. For “[where1]”, a code element having an element ID “where1” is defined on the 20th line. There may be a plurality of options for “where1”. In this case, when “[where1]” is selected in the code element “command1”, any one of a plurality of options of “where1” is further selected.
insertコマンドやupdateコマンドなどの他のSQLコマンドについても、selectコマンドと同様にして引数として与えるコード要素のバリエーションを定義できる。また、コード要素ごとに優先度を定義できる。 For other SQL commands such as the insert command and the update command, variations of code elements given as arguments can be defined in the same manner as the select command. A priority can be defined for each code element.
図24は、第3の実施の形態のコード要素管理テーブルの例を示す図である。コード要素管理テーブル112aは、コード要素、要素区分、識別記号および優先度補正値の項目を含む。ここで、コード要素、要素区分、識別記号および優先度補正値の項目の説明は、第2の実施の形態のコード要素管理テーブル112の各項目の説明と同様である。 FIG. 24 is a diagram illustrating an example of a code element management table according to the third embodiment. The code element management table 112a includes items of code element, element classification, identification symbol, and priority correction value. Here, the description of the items of the code element, the element classification, the identification symbol, and the priority correction value is the same as the description of each item of the code element management table 112 of the second embodiment.
例えば、コード要素管理テーブル112aには、コード要素が“command1”、要素区分が“コマンド種別”、識別記号が“!”、優先度補正値が“5”という情報が登録される。これは、要素ID“command1”の要素区分が“コマンド種別”であり、組合せ管理に用いる識別記号が“!”、定義ファイル111aに設定された優先度の補正値が“5”であることを示す。
For example, information indicating that the code element is “command1”, the element classification is “command type”, the identification symbol is “!”, And the priority correction value is “5” is registered in the code element management table 112a. This is because the element classification of the element ID “command1” is “command type”, the identification symbol used for combination management is “!”, And the priority correction value set in the
このように、SQLを生成するためのコード要素についても、定義ファイル111の場合と同様に管理することができる。そして、以上のような構成により、図14〜19で説明した第2の実施の形態と同様の手順を実行し得る。ただし、ソースコードの生成に代えて、SQLを生成する。また、コンパイル成否の確認に相当するステップ(例えば、図14のステップS15,S16,S19や図17のステップS46のコンパイル処理の部分)を行わなくてよい。更に、目的コードを実行する代わりに、被検DBMS151aおよび比較用DBMS152aにSQLを実行させる。当該実行結果に応じて、テストしたSQLに対応する組合せに含まれるコード要素の優先度補正値を加減する。
As described above, the code elements for generating the SQL can be managed in the same manner as in the
図25は、第3の実施の形態のテスト順序変更例を示す図である。図25ではテスト用SQL119k,119l,119m,119n,119p,119q,119rが例示されている。テスト用SQL119k,119l,119m,119n,119p,119q,119rは、定義ファイル111aに基づいてコード生成部140により生成されるテスト用SQL119のバリエーションである。
FIG. 25 is a diagram illustrating a test order change example according to the third embodiment. In FIG. 25,
テストの開始当初のテスト順序は次の通りであるとする。テスト用SQL119kはK番目にテストされる予定である。テスト用SQL119lはL番目(L>K)にテストされる予定である。テスト用SQL119mはM番目(M>L)にテストされる予定である。テスト用SQL119nはN番目(N>M)にテストされる予定である。テスト用SQL119pはP番目(P>N)にテストされる予定である。テスト用SQL119qはQ番目(Q>P)にテストされる予定である。テスト用SQL119rはR番目(R>Q)にテストされる予定である。
Assume that the test sequence at the beginning of the test is as follows. The
例えば、第1サイクルは所定値分の回数のテストを含んでいる。K,L,M,N番目のテストは第1サイクルに含まれる。第2サイクルは第1サイクルよりも後に実行されるテスト群を含んでいる。P,Q,R番目のテストは第2サイクルに含まれる。 For example, the first cycle includes a predetermined number of tests. The Kth, Lth, Mth and Nth tests are included in the first cycle. The second cycle includes a test group that is executed after the first cycle. The Pth, Qth, and Rth tests are included in the second cycle.
第1サイクルにおいて、K,L,M,N番目のテストでSQLの実行結果が不正であったとする。また、何れのテストにおいても、コード要素を変更してテストをやり直してもエラー原因が特定できなかったとする。すると、各テストのSQLに対応する組合せに含まれる各コード要素について、優先度補正値に1が加算される。 Assume that the SQL execution result is incorrect in the K, L, M, and Nth tests in the first cycle. Further, in any test, it is assumed that the cause of the error cannot be identified even if the code element is changed and the test is performed again. Then, 1 is added to the priority correction value for each code element included in the combination corresponding to the SQL of each test.
このように、SQLの実行結果が不正であるたびに、そのSQLに対応する組合せに含まれるコード要素の優先度が増加し、そのコード要素を含む組合せのテストの優先度が高まる。 Thus, whenever the SQL execution result is invalid, the priority of the code element included in the combination corresponding to the SQL increases, and the priority of the test of the combination including the code element increases.
第1サイクルが終了すると、順序管理部130はテスト順序を更新する。例えば、テスト用SQL119q,119rは、第1サイクルでエラーが発生したテスト用SQL119k,119l,119m,119nなどに含まれるコード要素を比較的多く含んでいるとする。そして、テスト用SQL119q,119rに対応する組合せの優先度が、テスト用SQL119pに対応する組合せの優先度よりも大きくなったとする。すると、テスト用SQL119q,119rをテスト用SQL119pよりも前に順番を繰り上げて実行する。このようにして、テスト装置100はテストの実行順序を制御する。
When the first cycle ends, the
結果が不正となる可能性の高いSQLを早い段階でテストすることで、エラーとなる入力のサンプルや各エラーの内容などを早い段階で多数取得できることになる。そして、ソフトウェアの開発者は、被検DBMS151aのバグに対して早期に対処することができる。このようにして、テスト装置100はテストを効率的に実行することができる。また、ソフトウェアのデバッグ作業を効率的に支援することができる。
By testing the SQL that is likely to have an incorrect result at an early stage, it is possible to acquire a large number of input samples and the contents of each error in the early stage. The software developer can deal with bugs in the
なお、前述のように、第1の実施の形態の情報処理は、演算部1bにプログラムを実行させることで実現できる。また、第2の実施の形態の情報処理は、プロセッサ101にプログラムを実行させることで実現できる。プログラムは、コンピュータ読み取り可能な記録媒体(例えば、光ディスク13、メモリ装置14およびメモリカード16など)に記録できる。
As described above, the information processing of the first embodiment can be realized by causing the
プログラムを流通させる場合、例えば、当該プログラムを記録した可搬記録媒体が提供される。また、プログラムを他のコンピュータの記憶装置に格納しておき、ネットワーク経由でプログラムを配布することもできる。コンピュータは、例えば、可搬記録媒体に記録されたプログラムまたは他のコンピュータから受信したプログラムを、記憶装置に格納し、当該記憶装置からプログラムを読み込んで実行する。ただし、可搬記録媒体から読み込んだプログラムを直接実行してもよく、他のコンピュータからネットワークを介して受信したプログラムを直接実行してもよい。 When distributing the program, for example, a portable recording medium in which the program is recorded is provided. It is also possible to store the program in a storage device of another computer and distribute the program via a network. The computer stores, for example, a program recorded on a portable recording medium or a program received from another computer in a storage device, and reads and executes the program from the storage device. However, a program read from a portable recording medium may be directly executed, or a program received from another computer via a network may be directly executed.
また、上記の情報処理の少なくとも一部を、DSP、ASIC、PLDなどの電子回路で実現することもできる。 In addition, at least a part of the information processing described above can be realized by an electronic circuit such as a DSP, ASIC, or PLD.
1 情報処理装置
1a 記憶部
1b 演算部
A,B,C,D,E テストデータ
CS1,CS2,CS3,CS4,CS5,CS6 文字列
DESCRIPTION OF
Claims (7)
複数の文字列を含むテストデータに応じた処理の実行テストを複数のテストデータそれぞれに対して順次実行しながら、実行テストの結果に基づいてテストデータに含まれる文字列ごとの優先度を調整し、
前記複数のテストデータのうち実行テストを未実行であるテストデータに対する実行テストの実行順序をテストデータに含まれる文字列ごとの優先度に基づいて変更する、処理を実行させるプログラム。 On the computer,
While executing the execution test of the process according to the test data including multiple character strings sequentially for each of the multiple test data, the priority for each character string included in the test data is adjusted based on the result of the execution test. ,
A program for executing a process for changing an execution order of execution tests for test data for which execution tests have not been executed among the plurality of test data based on a priority for each character string included in the test data.
テストデータに含まれる文字列ごとの優先度に基づいてテストデータ単位の優先度を求め、テストデータごとの優先度に基づいて前記実行順序を変更する、請求項1記載のプログラム。 If the result of the execution test of the process according to the test data is invalid, adjust the priority for each character string so that the priority for each character string included in the test data increases,
The program according to claim 1, wherein the priority of each test data unit is obtained based on the priority for each character string included in the test data, and the execution order is changed based on the priority for each test data.
テストデータに含まれる文字列ごとの優先度に基づいてテストデータ単位の優先度を求め、テストデータごとの優先度に基づいて前記実行順序を変更する、請求項1または2記載のプログラム。 If the result of the execution test of the process according to the test data is correct, adjust the priority for each character string so that the priority for each character string included in the test data decreases,
The program according to claim 1 or 2, wherein a priority of a test data unit is obtained based on a priority for each character string included in test data, and the execution order is changed based on a priority for each test data.
前記記憶部に記憶された文字列を含むテストデータに応じた処理の実行テストを複数のテストデータそれぞれに対して順次実行しながら、実行テストの結果に基づいてテストデータに含まれる文字列ごとの優先度を調整し、前記複数のテストデータのうち実行テストを未実行であるテストデータに対する実行テストの実行順序をテストデータに含まれる文字列ごとの優先度に基づいて変更する演算部と、を有する情報処理装置。 A storage unit for storing a plurality of character strings;
While sequentially executing the execution test of the process according to the test data including the character string stored in the storage unit for each of the plurality of test data, for each character string included in the test data based on the result of the execution test An arithmetic unit that adjusts the priority and changes the execution order of the execution test with respect to the test data in which the execution test is not executed among the plurality of test data based on the priority for each character string included in the test data; Information processing apparatus.
複数の文字列を含むテストデータに応じた処理の実行テストを複数のテストデータそれぞれに対して順次実行しながら、実行テストの結果に基づいてテストデータに含まれる文字列ごとの優先度を調整し、
前記複数のテストデータのうち実行テストを未実行であるテストデータに対する実行テストの実行順序をテストデータに含まれる文字列ごとの優先度に基づいて変更する、テスト方法。
Computer
While executing the execution test of the process according to the test data including multiple character strings sequentially for each of the multiple test data, the priority for each character string included in the test data is adjusted based on the result of the execution test. ,
A test method for changing an execution order of execution tests with respect to test data for which execution tests have not been executed among the plurality of test data based on a priority for each character string included in the test data.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2012193870A JP5962350B2 (en) | 2012-09-04 | 2012-09-04 | Program, information processing apparatus and test method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2012193870A JP5962350B2 (en) | 2012-09-04 | 2012-09-04 | Program, information processing apparatus and test method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2014049066A JP2014049066A (en) | 2014-03-17 |
| JP5962350B2 true JP5962350B2 (en) | 2016-08-03 |
Family
ID=50608625
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2012193870A Expired - Fee Related JP5962350B2 (en) | 2012-09-04 | 2012-09-04 | Program, information processing apparatus and test method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP5962350B2 (en) |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP6890795B1 (en) * | 2020-12-10 | 2021-06-18 | 株式会社Shift | Programs, methods, information processing equipment, and systems |
| KR102567407B1 (en) * | 2021-07-26 | 2023-08-14 | 한동대학교 산학협력단 | Method and system for extracting fine-grained traceability links between API document comments and test code lines |
| JP7661447B1 (en) | 2023-11-08 | 2025-04-14 | 楽天グループ株式会社 | Test execution device, test execution method and program |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH1139363A (en) * | 1997-07-18 | 1999-02-12 | Fujitsu Ltd | Data verification method |
| JP2004005399A (en) * | 2002-04-05 | 2004-01-08 | Sharp Corp | Software testing method and apparatus |
| JP2005250937A (en) * | 2004-03-05 | 2005-09-15 | Matsushita Electric Ind Co Ltd | Microcomputer software program verification device |
| JP4134218B2 (en) * | 2006-11-16 | 2008-08-20 | インターナショナル・ビジネス・マシーンズ・コーポレーション | Information processing apparatus, method, and program for determining priority of test cases to be executed in regression test |
| JP2009277110A (en) * | 2008-05-16 | 2009-11-26 | Mitsubishi Electric Corp | Software test/development support device, and program for device |
-
2012
- 2012-09-04 JP JP2012193870A patent/JP5962350B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2014049066A (en) | 2014-03-17 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11579856B2 (en) | Multi-chip compatible compiling method and device | |
| US7103883B2 (en) | System and method for translating include files | |
| EP3265916B1 (en) | A method for identifying a cause for a failure of a test | |
| US8898635B2 (en) | System and method for automatic impact variable analysis and field expansion in mainframe systems | |
| US8250554B2 (en) | Systems and methods for generating and distributing executable procedures for technical desk-side support | |
| US9311077B2 (en) | Identification of code changes using language syntax and changeset data | |
| US6829759B1 (en) | System and method for generating a translation display | |
| JP5962350B2 (en) | Program, information processing apparatus and test method | |
| US20240111521A1 (en) | Code processing method and system, and computer cluster, medium, and program product | |
| US9395977B2 (en) | Locating program code units after software refactoring | |
| US20250383870A1 (en) | Systems and methods for llm-based code refactoring | |
| CN109766125B (en) | Identification method and device for leveling conflict among batches | |
| KR20050028465A (en) | Mcu application program verification system providing source code level debugging using debugging information files in different versions and method thereof | |
| US12367033B2 (en) | Identifying significant code changes via syntactic representation | |
| CN109019217B (en) | Elevator control software field debugging system | |
| JP2014126900A (en) | Program analysis device, program analysis method, and program analysis program | |
| US9405514B1 (en) | Process fragment management | |
| JP6217440B2 (en) | Symbolic execution program, symbolic execution method, and symbolic execution device | |
| JP5550578B2 (en) | Entry rewriting device and entry rewriting program | |
| JP6748357B2 (en) | Analysis device, analysis program, and analysis method | |
| CN113568834A (en) | SDK code compatibility detection method, device, computer equipment and medium | |
| JP6840656B2 (en) | Test script modifiers and programs | |
| JP2016126700A (en) | Program verification device, program verification method, and program verification program | |
| JP7469999B2 (en) | Search device, search method, and search program | |
| Sonkin et al. | From Developer Assistance to Complete Development Automation: A Workflow-Centric Framework for AI Code Generation |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20150512 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20160129 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20160209 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20160406 |
|
| 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: 20160531 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20160613 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 5962350 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| LAPS | Cancellation because of no payment of annual fees |