JP2015153323A - Symbolic execution program, symbolic execution method, and symbolic execution device - Google Patents

Symbolic execution program, symbolic execution method, and symbolic execution device Download PDF

Info

Publication number
JP2015153323A
JP2015153323A JP2014028832A JP2014028832A JP2015153323A JP 2015153323 A JP2015153323 A JP 2015153323A JP 2014028832 A JP2014028832 A JP 2014028832A JP 2014028832 A JP2014028832 A JP 2014028832A JP 2015153323 A JP2015153323 A JP 2015153323A
Authority
JP
Japan
Prior art keywords
record
symbolic execution
value
search
records
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2014028832A
Other languages
Japanese (ja)
Other versions
JP6217440B2 (en
Inventor
前田 芳晴
Yoshiharu Maeda
芳晴 前田
忠弘 上原
Tadahiro Uehara
忠弘 上原
一樹 宗像
Kazuki Munakata
一樹 宗像
晋 徳本
Susumu Tokumoto
晋 徳本
翔一朗 藤原
Shoichiro Fujiwara
翔一朗 藤原
朝子 片山
Asako Katayama
朝子 片山
スッパシット モンプラターンチャイ
Monpratarnchai Supasit
スッパシット モンプラターンチャイ
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 JP2014028832A priority Critical patent/JP6217440B2/en
Publication of JP2015153323A publication Critical patent/JP2015153323A/en
Application granted granted Critical
Publication of JP6217440B2 publication Critical patent/JP6217440B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide a symbolic execution device capable of extracting a test case having no duplication.SOLUTION: In a symbolic execution device 50, symbol value setting means 51 sets a symbol value at the value of the item of each record of a DB stub 100; record identification setting means 54 sets the same identification value at a plurality of records satisfying the same search condition for an item among a record group including the symbol value as the value of an item; record retrieval control means 55 extracts one of the plurality of records that satisfy the same search condition among the record group and at which the same identification value is set as an object of symbolic execution processing; and symbolic execution means 52 executes symbolic processing for the symbol value of the item of the extracted record according to the search condition.

Description

本発明は、シンボリック実行プログラム、シンボリック実行方法及びシンボリック実行装置に関する。   The present invention relates to a symbolic execution program, a symbolic execution method, and a symbolic execution apparatus.

プログラムの開発では、作成したプログラムが想定通りに正しく動作するかを確認するため、プログラムのテスト作業(以下、「テスト」という。)が実施される。テスト対象プログラムを網羅的にテストすることが可能なテストケース及びテストデータを作成する作業は手間がかかる。そこで、テスト対象プログラムをシンボリック実行処理してテストケース及びテストデータを生成する技術が提案されている(例えば、非特許文献1参照。)。   In program development, a program test operation (hereinafter referred to as “test”) is performed in order to confirm whether the created program operates correctly as expected. It takes time and effort to create test cases and test data capable of comprehensively testing the test target program. Therefore, a technique for generating a test case and test data by performing symbolic execution processing on a test target program has been proposed (see, for example, Non-Patent Document 1).

シンボリック実行処理は、プログラムに外部から入力する値(引数値)に、「1」や「A」のような確定値(具体値)の替わりにシンボル値(記号値)を設定してプログラムの実行をエミュレート(模擬実行)し、プログラム実行時の種々の情報を収集する技術である。プログラムをシンボリック実行処理により分析した結果、当該プログラムにおいて実行可能な命令文の系列(以下、「パス」または「実行パス」という。)、及び、パスが実行されるためにシンボル値が満たすべき条件(以下、「パス条件」という。)が抽出される。   In symbolic execution processing, a symbol value (symbol value) is set instead of a definite value (specific value) such as “1” or “A” as an externally input value (argument value) to the program. Is a technology that collects various information during program execution. As a result of analyzing the program by symbolic execution processing, a sequence of command statements that can be executed in the program (hereinafter referred to as “path” or “execution path”), and a condition that a symbol value must satisfy in order to execute the path (Hereinafter referred to as “pass condition”) is extracted.

図1は、シンボリック実行処理の結果の一例を示す。図1には、左側に示されるプログラムの一例をシンボリック実行処理により分析した結果として、右表のパス及びパス条件が抽出された例が示されている。「プログラムの例」で示される矩形ボックスは、該プログラムに対するシンボリック実行処理で条件文を通過したときに満たすべき論理的な制約(パス条件)を表している。シンボリック実行処理では、このようなパス条件を代入文や条件文等を通過する毎に積み上げる処理が行われる。図1のプログラムの例では、「性別が男性か?」の条件文T1で、「男性である」というパス条件と「男性でない」というパス条件とが積まれ、「性別が女性か?」の条件文T2で、「女性である」というパス条件と「女性でない」というパス条件とが積み上げられる。   FIG. 1 shows an example of the result of symbolic execution processing. FIG. 1 shows an example in which the paths and path conditions in the right table are extracted as a result of analyzing an example of the program shown on the left side by symbolic execution processing. A rectangular box indicated by “example of program” represents a logical constraint (path condition) to be satisfied when a conditional statement is passed in the symbolic execution process for the program. In the symbolic execution process, a process of accumulating such path conditions every time an assignment statement or a conditional statement is passed is performed. In the example of the program in FIG. 1, the condition statement T1 “gender is male?” Is loaded with the path condition “male” and the path condition “non-male”. In the conditional statement T2, a pass condition of “being a woman” and a pass condition of “not a woman” are accumulated.

その結果、性別が男性でありかつ性別が女性でないパス条件を持つパス1と、性別が男性でなくかつ性別が女性であるパス条件を持つパス2と、性別が男性でなくかつ性別が女性でないパス条件を持つパス3とが抽出される。性別が男性でありかつ性別が女性であるパス条件は矛盾しており成立しないため、パスは抽出されない。抽出されたパス1〜3はテストケースに相当し、パス毎のパス条件を満たす値がテストケース毎のテストデータとなる。このようにして生成された各テストケースのテストデータをテスト対象のプログラムの引数値に入力し、そのプログラムの動作確認を実行することでテスト対象のプログラムを網羅的にテストすることができる。   As a result, pass 1 with a pass condition where the gender is male and the gender is not female, pass 2 with a pass condition where the gender is not male and the gender is female, and the gender is not male and the gender is not female A path 3 having a path condition is extracted. Since the path conditions in which the sex is male and the sex is female are contradictory and are not satisfied, no path is extracted. The extracted paths 1 to 3 correspond to test cases, and values satisfying the path condition for each path become test data for each test case. By inputting the test data of each test case generated in this way into the argument value of the test target program and executing the operation check of the program, the test target program can be comprehensively tested.

例えば受発注管理などの業務システムを構成するプログラムでは、マスタデータや処理結果や履歴等を記録するためにデータベース(Database、以下、「DB」ともいう。)を利用する場合がある。テスト対象のプログラムがDBを利用する場合、そのプログラムへ入力する値には、引数として設定される入力値と、DBにアクセスした結果としてDB内のレコードから取得されるフィールド値との2種類がある。テスト対象のプログラムの実行パスは、これらの2種類の入力値に依存して変化する。ここで、プログラムの実行パスが変化するとは、入力値に依存して条件分岐命令で選択される分岐が変化することによって、実行される一連の命令文の系列、つまりパスが変化することをいう。このため、DBを利用するプログラムのテストは、プログラムに引数値とDBのフィールド値とを設定して実施する必要がある。   For example, in a program that constitutes a business system such as order management, a database (Database, hereinafter also referred to as “DB”) may be used to record master data, processing results, history, and the like. When a test target program uses a DB, there are two types of values to be input to the program: an input value set as an argument and a field value acquired from a record in the DB as a result of accessing the DB. is there. The execution path of the test target program changes depending on these two types of input values. Here, changing the execution path of a program means that a series of executed statements, that is, a path is changed by changing a branch selected by a conditional branch instruction depending on an input value. . For this reason, it is necessary to test a program that uses a DB by setting an argument value and a DB field value in the program.

そこで、以上のようにDBを利用するプログラムのテストにおいて、引数値及びDBのフィールド値に対するテストデータの生成にシンボリック実行処理を使用する方法が考えられる。しかしながら、DBのフィールド値に設定できるデータの型は、数値や文字列等の具体値であり、シンボル値を設定することはできない。つまり、DBをそのまま使用したシンボリック実行処理は困難である。   Thus, as described above, in a test of a program that uses a DB, a method of using a symbolic execution process for generating test data for an argument value and a DB field value can be considered. However, the data type that can be set in the DB field value is a specific value such as a numerical value or a character string, and a symbol value cannot be set. That is, symbolic execution processing using the DB as it is is difficult.

これに対して、DBを利用するプログラムに対するシンボリック実行処理が可能なように、DBをスタブ化する技術が提案されている(例えば、特許文献1参照)。ここで、スタブ化とは、ある処理を代替することを意味する。よって、DBをスタブ化するとは、DBを代替することを意味する。   On the other hand, a technique for stubbing a DB has been proposed so that symbolic execution processing can be performed on a program that uses the DB (see, for example, Patent Document 1). Here, stubbing means substituting a certain process. Thus, stubbing a DB means replacing the DB.

図2には、DBをスタブ化したDBスタブ100にシンボル値を設定し、SQLにて記述された検索条件に従いシンボル値に対するシンボリック実行処理を行った結果の一例が示されている。図2のDBスタブ100は、3つのレコードを有し、各レコードの3つのフィールドF1,F2、F3にシンボル値s1〜s9が設定されている。   FIG. 2 shows an example of a result obtained by setting a symbol value in the DB stub 100 obtained by stubbing the DB and performing symbolic execution processing on the symbol value according to the search condition described in SQL. The DB stub 100 in FIG. 2 has three records, and symbol values s1 to s9 are set in the three fields F1, F2, and F3 of each record.

下記SQL(Structured Query Language)検索式により記述したフィールドF1に対する検索条件「F1=c」に基づき、上記シンボル値が設定されたDBスタブ100を検索するプログラムをシンボリック実行処理する例を挙げて説明する。
SQL検索式:SELECT * FROM Table WHERE (F1 = "c")
このときのシンボリック実行処理では、まず、「レコード1のF1がcか?」の条件文で、「s1=c」というパス条件と「s1≠c」というパス条件とが積まれる。次に、「レコード2のF1がcか?」の条件文で、「s4=c」というパス条件と「s4≠c」というパス条件とが積み上げられる。次に、「レコード3のF1がcか?」の条件文で、「s7=c」というパス条件と「s7≠c」というパス条件とが更に積み上げられる。フィールドF1の複数のシンボル値がcになるパス条件は、DBのフィールド値の一意性制約を満たさず成立しない。ここで、パス毎のパス条件を満たす値がテストケース毎のテストデータとなる。この結果、生成されるテストケースは4個であり、図2の右表に示した4つのテストケースのテストデータが生成される。なお、テストデータに示される「""」、「"!"」、「" "」はすべて「値がcでない」ことを示す。
An example in which a program for searching the DB stub 100 in which the symbol value is set is symbolically executed based on the search condition “F1 = c” for the field F1 described by the following SQL (Structured Query Language) search expression will be described. .
SQL search expression: SELECT * FROM Table WHERE (F1 = "c")
In the symbolic execution process at this time, a path condition of “s1 = c” and a path condition of “s1 ≠ c” are first accumulated in a conditional statement “Is F1 of record 1 c?”. Next, a path condition “s4 = c” and a path condition “s4 ≠ c” are stacked in a conditional statement “Is F1 of record 2 c?”. Next, the path condition “s7 = c” and the path condition “s7 ≠ c” are further accumulated in the conditional statement “Is F1 of record 3 c?”. The path condition in which the plurality of symbol values in the field F1 are c does not satisfy the uniqueness constraint on the DB field value and is not satisfied. Here, the value that satisfies the path condition for each path is the test data for each test case. As a result, four test cases are generated, and test data for the four test cases shown in the right table of FIG. 2 is generated. Note that """" and ""! "" And """" all indicate that the value is not c.

具体的に生成されたテストデータは以下である。
テストケース1:検索条件を満たすレコードが1件もヒットしなかった場合
テストケース2:レコード3が1件ヒットした場合であり、テストデータは、s7=c
テストケース3:レコード2が1件ヒットした場合であり、テストデータは、s4=c
テストケース4:レコード1が1件ヒットした場合であり、テストデータは、s1=c
The test data specifically generated is as follows.
Test case 1: When no record satisfying the search condition is hit Test case 2: When record 3 is hit, test data is s7 = c
Test case 3: When record 2 is hit, test data is s4 = c
Test case 4: When record 1 is hit, test data is s1 = c

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

シンボリック実行:玉井哲雄、福永光一、「記号実行システム」、情報処理、pp18−28、1982/01/15Symbolic execution: Tetsuo Tamai, Koichi Fukunaga, "Symbol execution system", Information processing, pp18-28, 1982/01/15

しかしながら、DBスタブの複数のレコードにシンボル値を設定した場合、各レコードのシンボル値は区別されない。例えば、図2のレコード1、2、3のフィールドF1に設定されたs1、s4、s7のシンボル値は区別されない。よって、テストケース2、3、4は、すべてレコードが1件ヒットし、かつフィールドF1にcの値が設定された場合に該当するので同一のテストケースである。従って、図2では2個のテストケースが重複して抽出されている。このように、上記DBスタブのシンボリック実行処理では、重複したテストケースが抽出されるという課題を有する。   However, when symbol values are set in a plurality of records of the DB stub, the symbol values of each record are not distinguished. For example, the symbol values of s1, s4, and s7 set in the field F1 of the records 1, 2, and 3 in FIG. 2 are not distinguished. Therefore, test cases 2, 3, and 4 are the same test case because they correspond to the case where one record is hit and the value of c is set in the field F1. Accordingly, two test cases are extracted in duplicate in FIG. As described above, the DB stub symbolic execution process has a problem that duplicate test cases are extracted.

そこで、一側面では、重複のないテストケースを抽出することが可能な、シンボリック実行プログラム、シンボリック実行方法及びシンボリック実行装置を提供することを目的とする。   Accordingly, an object of one aspect is to provide a symbolic execution program, a symbolic execution method, and a symbolic execution device that can extract test cases without duplication.

一つの案では、
シンボル値を項目の値として含むレコード群のうち、前記項目に対する同一の検索条件を満たす複数のレコードに同一の識別値を設定し、
前記レコード群のうち同一の検索条件を満たし、かつ同一の識別値が設定された複数のレコードのうちの一つをシンボリック実行処理の対象として抽出し、
前記抽出されたレコードの前記項目の前記シンボル値に対し、前記検索条件に従ってシンボリック処理を実行する、
処理をコンピュータに実行させるためのシンボリック実行プログラムが提供される。
One idea is that
Among the record group that includes the symbol value as the item value, the same identification value is set for a plurality of records that satisfy the same search condition for the item,
One of a plurality of records that satisfy the same search condition and set the same identification value in the record group is extracted as a symbolic execution process target,
Performing symbolic processing on the symbol value of the item of the extracted record according to the search condition;
A symbolic execution program for causing a computer to execute processing is provided.

一態様によれば、重複のないテストケースを抽出することができる。   According to one aspect, test cases without duplication can be extracted.

プログラムをシンボリック実行処理した結果の一例を示す図。The figure which shows an example of the result of having performed the symbolic execution process of the program. DBスタブをシンボリック実行処理した結果の一例を示す図。The figure which shows an example of the result of having performed symbolic execution processing of DB stub. DBを利用するプログラムの一例を示した図。The figure which showed an example of the program using DB. DBを利用するプログラムをテストする方法の一例を示した図。The figure which showed an example of the method of testing the program using DB. DBをスタブ化する方法(1)〜(3)を説明するための図。The figure for demonstrating the method (1)-(3) which stubs DB. 方式(3)によるDBの処理部分のスタブ化を説明するための図。The figure for demonstrating stubbing of the process part of DB by a system (3). 一実施形態にかかるシンボリック実行装置の機能構成の一例を示した図。The figure which showed an example of the function structure of the symbolic execution apparatus concerning one Embodiment. 一実施形態にかかるシンボリック実行処理の一例を示したフローチャート。The flowchart which showed an example of the symbolic execution process concerning one Embodiment. 図8のシンボリック実行処理(テストデータ生成処理)を説明するための図。The figure for demonstrating the symbolic execution process (test data generation process) of FIG. 一実施形態にかかるテストデータの利用の一例を説明するための図。The figure for demonstrating an example of utilization of the test data concerning one Embodiment. 一実施形態にかかるDBを利用するプログラムとテストドライバの一例を示した図。The figure which showed an example of the program and test driver which utilize DB concerning one Embodiment. 一実施形態にかかるJDBCスタブのAPI(ライブラリ)の一例を示した図。The figure which showed an example of API (library) of the JDBC stub concerning one Embodiment. 一実施形態にかかるDBスタブに設定した値の一例を示した図。The figure which showed an example of the value set to DB stub concerning one Embodiment. 一実施形態にかかるレコード識別値の一例を示した図。The figure which showed an example of the record identification value concerning one Embodiment. 一実施形態にかかるシンボリック実行処理を行うレコードの検索処理の一例を示したフローチャート。The flowchart which showed an example of the search process of the record which performs the symbolic execution process concerning one Embodiment. 図14(a)のレコード識別値の場合のシンボリック実行結果の一例を示した図。The figure which showed an example of the symbolic execution result in the case of the record identification value of Fig.14 (a). 図14(b)のレコード識別値の場合のシンボリック実行結果の一例を示した図。The figure which showed an example of the symbolic execution result in the case of the record identification value of FIG.14 (b). 一実施形態にかかるレコード更新処理の一例を示したフローチャート。The flowchart which showed an example of the record update process concerning one Embodiment. 一実施形態にかかるレコード更新処理結果の一例を示す図。The figure which shows an example of the record update process result concerning one Embodiment. 一実施形態にかかるレコード削除処理の一例を示したフローチャート。The flowchart which showed an example of the record deletion process concerning one Embodiment. 一実施形態にかかるレコード削除処理結果の一例を示す図。The figure which shows an example of the record deletion process result concerning one Embodiment. 一実施形態にかかるレコード追加処理の一例を示したフローチャート。The flowchart which showed an example of the record addition process concerning one Embodiment. 一実施形態にかかるレコード追加処理結果の一例を示す図。The figure which shows an example of the record addition process result concerning one Embodiment. 一実施形態にかかるシンボリック実行装置のハードウェア構成の一例を示す図。The figure which shows an example of the hardware constitutions of the symbolic execution apparatus concerning one Embodiment.

以下、本発明の実施形態について添付の図面を参照しながら説明する。なお、本明細書及び図面において、実質的に同一の機能構成を有する構成要素については、同一の符号を付することにより重複した説明を省く。   Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In addition, in this specification and drawing, about the component which has the substantially same function structure, the duplicate description is abbreviate | omitted by attaching | subjecting the same code | symbol.

(はじめに)
[シンボリック実行処理]
テスト対象プログラムをシンボリック実行処理により分析し、テストケース及びテストデータを効率的に生成する手法がある。シンボリック実行(記号実行)処理は、プログラムに外部から入力する値(引数値)にシンボル値(記号値)を設定してプログラムの実行をエミュレート(模擬実行)し、プログラム実行時の種々の情報を収集する技術である。テスト対象プログラムをシンボリック実行処理により分析した結果、そのプログラムにおいて実行可能なパスと、各パスが実行されるためにシンボル値が満たすべきパス条件とが抽出される。
(Introduction)
[Symbolic execution processing]
There is a technique for efficiently generating test cases and test data by analyzing a test target program by symbolic execution processing. Symbolic execution (symbol execution) processing emulates program execution by setting a symbol value (symbol value) to an externally input value (argument value) to the program, and various information during program execution Technology to collect. As a result of analyzing the test target program by the symbolic execution process, a path that can be executed in the program and a path condition that the symbol value must satisfy in order to execute each path are extracted.

受発注管理などの業務システムを構成するプログラムでは、マスタデータや処理結果や履歴等を記録するためにDBを利用する場合がある。例えば、図3は、DBを利用するJava(登録商標)プログラムの一例を示す。業務システムを構成するプログラム10がDB30を利用する場合、プログラム10は、JDBC20を介してDB30と接続する。JDBC20は、JavaプログラムとRDB(リレーショナルデータベース)との接続のためのAPI(Application Programming Interface)である。DB30は、SQL等のDB操作言語を受け付けて、DB操作言語に記述された操作内容に従ってDB30内に格納された情報を返す。   In a program constituting a business system such as order management, a DB may be used to record master data, processing results, history, and the like. For example, FIG. 3 shows an example of a Java (registered trademark) program that uses a DB. When the program 10 constituting the business system uses the DB 30, the program 10 is connected to the DB 30 via the JDBC 20. The JDBC 20 is an API (Application Programming Interface) for connecting a Java program and an RDB (relational database). The DB 30 receives a DB operation language such as SQL, and returns information stored in the DB 30 according to the operation content described in the DB operation language.

なお、業務システムを構成するプログラム10は、テスト対象プログラム11とDBアクセサ12とに分かれた構成であってもよい。DBアクセサ12は、DB30へアクセスする処理を行う専用のプログラムである。テスト対象プログラム11は、DB30を利用するプログラムであり、DBアクセサ12によりJDBC20を介してDB30にアクセスする。特に大規模なシステムのプログラムでは、DBへアクセスする処理を共通化するためにDBアクセサ12が作成され、利用されることがある。   Note that the program 10 constituting the business system may be divided into the test target program 11 and the DB accessor 12. The DB accessor 12 is a dedicated program that performs processing for accessing the DB 30. The test target program 11 is a program that uses the DB 30, and the DB accessor 12 accesses the DB 30 via the JDBC 20. In particular, in a large-scale system program, the DB accessor 12 may be created and used in order to share processing for accessing the DB.

図4は、DB30を利用するプログラムをテストする方法の一例を示す。まず、DB30の各レコードのフィールド値にテストデータ1が設定され(D1)、テスト対象プログラム11の引数値にテストデータ2が設定される(D2)。   FIG. 4 shows an example of a method for testing a program that uses the DB 30. First, test data 1 is set to the field value of each record in the DB 30 (D1), and test data 2 is set to the argument value of the test target program 11 (D2).

次に、テストドライバ40は、テスト対象プログラム11を起動する。テスト作業者は、テスト対象プログラムの実行結果を計測し、実行結果の値と期待値とを比較してテストの成否を判定する(D3)。   Next, the test driver 40 activates the test target program 11. The test operator measures the execution result of the test target program and compares the value of the execution result with the expected value to determine the success or failure of the test (D3).

DB30を利用するプログラム10のテストにおいても、シンボリック実行処理の手法を用いてテストデータを生成することが考えられる。しかしながら、DB30のフィールド値には、数値や文字列などの具体値(確定値)のみを設定することが可能であり、シンボル値を設定することはできない。このため、DBを利用するプログラムをシンボリック実行処理により分析することは困難である。   Even in the test of the program 10 using the DB 30, it is conceivable to generate test data using a symbolic execution processing technique. However, only specific values (determined values) such as numerical values and character strings can be set as the field values in the DB 30, and symbol values cannot be set. For this reason, it is difficult to analyze a program using DB by symbolic execution processing.

[DB処理のスタブ化]
そこで、DBの処理部分をシンボリック実行処理に対応可能なようにスタブ化する必要がある。つまり、シンボリック実行処理に対応していないDB30及びJDBC20(DBアクセスライブラリ)をスタブ化する必要がある。
[Stubbing of DB processing]
Therefore, it is necessary to stub the DB processing portion so as to be compatible with symbolic execution processing. That is, it is necessary to stub the DB 30 and the JDBC 20 (DB access library) that do not support symbolic execution processing.

図5は、DBの処理部分をスタブ化するための方法(1)〜(3)を示す。スタブ化する方法(1)〜(3)は、DBの処理部分をどの範囲でスタブ化するかで分類される。図5には、方式(1)〜(3)においてそれぞれスタブ化される範囲が示されている。   FIG. 5 shows methods (1) to (3) for stubbing the processing portion of the DB. Stubbing methods (1) to (3) are classified according to which range the DB processing portion is stubbed. FIG. 5 shows ranges to be stubbed in the methods (1) to (3).

方式(1)は、DBアクセサ12の呼び出し時点でDBの処理部分をスタブ化する方法である。方式(1)では、DBアクセサ12のクラスまたはメソッドをスタブに置き換え、DBアクセサ12の呼び出し処理を代替する。   Method (1) is a method of stubbing the DB processing part at the time of calling the DB accessor 12. In method (1), the class or method of the DB accessor 12 is replaced with a stub, and the calling process of the DB accessor 12 is substituted.

方式(2)は、DB操作言語の呼び出し時点でDBの処理部分をスタブ化する方法である。DB操作言語の一例としてはSQLが挙げられる。ただし、DB操作言語は、SQLに限られない。DB操作言語は、テスト対象プログラム11又はDBアクセサ12内に記述される。方式(2)は、テスト対象プログラム11又はDBアクセサ12内に記述されたDB操作言語の呼び出し部分の処理を代替する。   Method (2) is a method of stubbing a DB processing part at the time of calling a DB operation language. SQL is an example of the DB operation language. However, the DB operation language is not limited to SQL. The DB operation language is described in the test target program 11 or the DB accessor 12. The method (2) replaces the processing of the calling portion of the DB operation language described in the test target program 11 or the DB accessor 12.

方式(3)は、DB30の替わりに、シンボリック実行処理に対応可能なようにDB30をスタブ化したDB(以下、「DBスタブ」ともいう。)及びDBアクセスライブラリ(以下、「JDBCスタブ」ともいう。)が使用される。テスト対象プログラム11又はDBアクセサ12は、JDBCスタブを介してDBスタブにアクセスする。   In the method (3), instead of the DB 30, a DB (hereinafter also referred to as “DB stub”) and a DB access library (hereinafter also referred to as “JDBC stub”) that stubs the DB 30 so as to be compatible with symbolic execution processing. .) Is used. The test target program 11 or the DB accessor 12 accesses the DB stub via the JDBC stub.

以上に説明したDB処理をスタブ化する方式のうち、方式(1)及び方式(2)には、次の第1〜第3の課題がある。第1には、スタブ化のためにプログラム10自体を一部修正する必要がある。第2には、DBアクセサ12毎又はSQL等のDB操作言語の記述毎にスタブを用意する必要があるため、大規模なプログラムでは用意すべきスタブの個数が多数となる。このため、スタブの箇所の発見とスタブの作成に多大の手間を要し、最終的にテストの工数が増大する。   Among the methods for stubbing the DB processing described above, the methods (1) and (2) have the following first to third problems. First, it is necessary to partially modify the program 10 itself for stubbing. Second, since it is necessary to prepare stubs for each DB accessor 12 or for each description of a DB operation language such as SQL, the number of stubs to be prepared becomes large in a large-scale program. For this reason, a great deal of labor is required to find a stub and to create a stub, which ultimately increases the number of test steps.

第3には、シンボリック実行処理による分析によって生成されたテストデータは、DBアクセサ12等に記述されたSQLの実行の時点の変数に対して生成され、DBのフィールド値に対して生成されるわけではない。このため、DBを使ったテストに、生成したテストデータをそのまま利用することは困難である。   Third, the test data generated by the analysis by the symbolic execution process is generated for the variables at the time of executing the SQL described in the DB accessor 12 and the like, and is generated for the DB field value. is not. For this reason, it is difficult to use the generated test data as it is for the test using the DB.

上記3つの課題のため、本実施形態は、方式(1)及び方式(2)を採用せず、方式(3)によりDBをスタブ化する方式を採用する。しかしながら、方式(3)においても、以下に説明するようにテストケース及びテストデータが重複して生成されるという課題がある。   Due to the above three problems, the present embodiment does not employ the method (1) and the method (2), but adopts a method of stubbing the DB by the method (3). However, the method (3) also has a problem that test cases and test data are generated in duplicate as described below.

[テストケース及びテストデータの重複]
以下、方式(3)の課題について、図6及び図2を参照しながら説明する。図6は、方式(3)によるDBの処理部分のスタブ化を説明するための図である。図2は、図6に示したDBスタブのシンボリック実行処理の結果の一例を示す。
[Duplicate test cases and test data]
Hereinafter, the problem of the method (3) will be described with reference to FIGS. 6 and 2. FIG. 6 is a diagram for explaining stubbing of the DB processing part by the method (3). FIG. 2 shows an example of the result of the DB stub symbolic execution process shown in FIG.

図6に示されるように、方式(3)によるDBの処理部分のスタブ化では、DBスタブ100及びJDBCスタブ200の2つのスタブが生成される。   As shown in FIG. 6, in the stubification of the DB processing part by the method (3), two stubs of the DB stub 100 and the JDBC stub 200 are generated.

DBスタブ100は、DB30のスタブである。DBスタブ100は、下記の機能を備える。
・DBスタブ100のフィールドFにシンボル値を設定することができる。よって、DBスタブ100は、シンボリック実行処理に対応できる。
・SQL等のDB操作言語を受け付け、DB操作言語に記述された操作内容に従って、DBスタブ100内に格納された情報を返す。
The DB stub 100 is a stub of the DB 30. The DB stub 100 has the following functions.
A symbol value can be set in the field F of the DB stub 100. Therefore, the DB stub 100 can cope with symbolic execution processing.
-Accepts a DB operation language such as SQL, and returns information stored in the DB stub 100 in accordance with the operation content described in the DB operation language.

JDBCスタブ200は、JDBC20のスタブである。JDBCスタブ200は、ConnectionクラスのスタブやPrepared Statementクラスのスタブなど、JDBCを構成するクラスのスタブから構成され、下記の機能を備える。
・シンボル値を処理できる。
・DB30に替わってDBスタブ100にアクセスする。
The JDBC stub 200 is a stub of the JDBC 20. The JDBC stub 200 is composed of stubs of classes constituting the JDBC, such as a Connection class stub and a Prepared Statement class stub, and has the following functions.
Can process symbol values.
Access the DB stub 100 instead of the DB 30.

図6の左に示したプログラムは、DBアクセサ12と一体化したテスト対象プログラム11のDBアクセス部分をJavaプログラムにより記述した例である。JDBCは、Javaプログラムの圧縮形式であるJar形式で提供される。Javaプログラムの実行時にクラスパスでJDBCスタブ200を指定することによって、JDBC20に代替してJDBCスタブ200を利用できる。JDBCスタブ200は、DB30に替わってDBスタブ100にアクセスする。これにより、テスト対象プログラム11には手を加えずに、DBの処理部分をスタブ化することができる。   The program shown on the left in FIG. 6 is an example in which the DB access portion of the test target program 11 integrated with the DB accessor 12 is described by a Java program. The JDBC is provided in the Jar format that is a compression format of the Java program. By specifying the JDBC stub 200 by the class path when executing the Java program, the JDBC stub 200 can be used instead of the JDBC 20. The JDBC stub 200 accesses the DB stub 100 instead of the DB 30. Thereby, the processing part of DB can be stubbed without modifying the test target program 11.

なお、図6のJavaプログラムの(a)は、DBの接続、Prepared Statement(図6の例ではSQLの検索式)の取得を記述する。Javaプログラムの(b)は、Prepared Statementへの入力パラメタの設定(図6の例ではフィールド1にcを設定)、SQLに記述された検索条件に従ったシンボリック実行処理を記述する。Javaプログラムの(c)は、シンボリック実行処理の結果の返却を記述する。   Note that (a) of the Java program in FIG. 6 describes DB connection and preparation statement (SQL search formula in the example of FIG. 6). (B) of the Java program describes setting of input parameters to the prepared statement (c is set to field 1 in the example of FIG. 6), and symbolic execution processing according to the search conditions described in SQL. (C) of the Java program describes the return of the result of the symbolic execution process.

図2には、DBをスタブ化したDBスタブ100にシンボル値を設定し、SQLにて記述された検索条件に従いシンボル値に対するシンボリック実行処理を行った結果の一例が示されている。本例でのSQL検索式(SQL:SELECT * FROM Table WHERE (F1 = "c"))の検索条件は、DBスタブ100のフィールドF1に対して検索条件「F1=c」に従い各レコードを検索するものである。   FIG. 2 shows an example of a result obtained by setting a symbol value in the DB stub 100 obtained by stubbing the DB and performing symbolic execution processing on the symbol value according to the search condition described in SQL. As the search condition of the SQL search expression (SQL: SELECT * FROM Table WHERE (F1 = “c”)) in this example, each record is searched for the field F1 of the DB stub 100 according to the search condition “F1 = c”. Is.

このときのシンボリック実行処理では、まず、「レコード1のF1がcか?」の条件文で、「s1=c」というパス条件と「s1≠c」というパス条件とが積まれる。次に、「レコード2のF1がcか?」の条件文で、「s4=c」というパス条件と「s4≠c」というパス条件とが積み上げられる。次に、「レコード3のF1がcか?」の条件文で、「s7=c」というパス条件と「s7≠c」というパス条件とが更に積み上げられる。フィールドF1の複数のシンボル値がcになるパス条件は、検索条件を満たさず成立しない。ここで、パス毎のパス条件を満たす値がテストケース毎のテストデータとなる。この結果、生成されるテストケースは4個であり、図2の右表に示した4つのテストケースのテストデータが生成される。なお、テストデータに示される「""」、「"!"」、「" "」はすべて「値がcでない」ことを示す。   In the symbolic execution process at this time, a path condition of “s1 = c” and a path condition of “s1 ≠ c” are first accumulated in a conditional statement “Is F1 of record 1 c?”. Next, a path condition “s4 = c” and a path condition “s4 ≠ c” are stacked in a conditional statement “Is F1 of record 2 c?”. Next, the path condition “s7 = c” and the path condition “s7 ≠ c” are further accumulated in the conditional statement “Is F1 of record 3 c?”. The path condition in which a plurality of symbol values in the field F1 are c does not satisfy the search condition and is not satisfied. Here, the value that satisfies the path condition for each path is the test data for each test case. As a result, four test cases are generated, and test data for the four test cases shown in the right table of FIG. 2 is generated. Note that "" "" and ""! "" And "" "" all indicate that the value is not c.

具体的に生成されたテストデータは以下である。
テストケース1:検索条件を満たすレコードが1件もヒットしなかった場合
テストケース2:レコード3が1件ヒットした場合であり、テストデータは、s7=c
テストケース3:レコード2が1件ヒットした場合であり、テストデータは、s4=c
テストケース4:レコード1が1件ヒットした場合であり、テストデータは、s1=c
ここでDBスタブの複数のレコードにシンボル値を設定した場合、各レコードのシンボル値は区別されない。例えば、図2のレコード1、2、3のフィールドF1に設定されたs1、s4、s7のシンボル値は区別されない。よって、テストケース2、3、4は、すべてレコードが1件ヒットし、かつフィールドF1にcの値が設定された場合に該当するので同一のテストケースである。従って、図2では2個のテストケースが重複して抽出されている。このように、上記DBスタブのシンボリック実行処理では、重複したテストケースが抽出されるという課題を有する。
The test data specifically generated is as follows.
Test case 1: When no record satisfying the search condition is hit Test case 2: When record 3 is hit, test data is s7 = c
Test case 3: When record 2 is hit, test data is s4 = c
Test case 4: When record 1 is hit, test data is s1 = c
Here, when a symbol value is set for a plurality of records of the DB stub, the symbol value of each record is not distinguished. For example, the symbol values of s1, s4, and s7 set in the field F1 of the records 1, 2, and 3 in FIG. 2 are not distinguished. Therefore, test cases 2, 3, and 4 are the same test case because they correspond to the case where one record is hit and the value of c is set in the field F1. Accordingly, two test cases are extracted in duplicate in FIG. As described above, the DB stub symbolic execution process has a problem that duplicate test cases are extracted.

そこで、以下に示す本実施形態にかかるシンボリック実行装置では、重複のないテストケースを抽出するために、シンボル値が設定されたDBスタブ100の各レコードを区別できるようにする。そして、各レコードの異同を識別してシンボリック実行処理が制御される。これにより、重複のないテストデータを生成することができる。以下、本実施形態にかかるシンボリック実行装置の機能及び動作について詳細に説明する。   Therefore, in the symbolic execution device according to the present embodiment described below, each record of the DB stub 100 in which a symbol value is set can be distinguished in order to extract a test case having no overlap. Then, the symbolic execution process is controlled by identifying the difference between the records. Thereby, test data without duplication can be generated. Hereinafter, functions and operations of the symbolic execution device according to the present embodiment will be described in detail.

[シンボリック実行装置の機能構成]
まず、一実施形態にかかるシンボリック実行装置の機能構成について、図7を参照しながら説明する。図7は、一実施形態にかかるシンボリック実行装置の機能構成の一例を示す。
[Functional configuration of symbolic execution unit]
First, a functional configuration of a symbolic execution device according to an embodiment will be described with reference to FIG. FIG. 7 shows an example of a functional configuration of the symbolic execution device according to the embodiment.

本実施形態にかかるシンボリック実行装置50は、DBスタブ100の各レコードのフィールド値にシンボル値を設定し、検索条件に従いシンボル値に対するシンボリック実行処理を行う。シンボリック実行装置50は、シンボル値設定手段51、シンボリック実行手段52、DB接続スタブ手段53、レコード識別設定手段54、レコード検索制御手段55、レコード更新制御手段56、レコード削除制御手段57及びレコード追加制御手段58を有する。   The symbolic execution device 50 according to the present embodiment sets a symbol value to the field value of each record of the DB stub 100, and performs symbolic execution processing on the symbol value according to the search condition. The symbolic execution device 50 includes a symbol value setting unit 51, a symbolic execution unit 52, a DB connection stub unit 53, a record identification setting unit 54, a record search control unit 55, a record update control unit 56, a record deletion control unit 57, and a record addition control. Means 58 are included.

DBスタブ100は、DB30をスタブ化してシンボル値を設定可能にしたDB30の代替である。DBスタブ100は、シンボリック実行装置50の内部の記憶領域を使用して生成されてもよく、シンボリック実行装置50の外部の記憶領域を使用して生成されてもよい。   The DB stub 100 is an alternative to the DB 30 in which the DB 30 can be set as a stub. The DB stub 100 may be generated using a storage area inside the symbolic execution device 50 or may be generated using a storage area outside the symbolic execution device 50.

シンボル値設定手段51は、DBスタブ100の各レコードのフィールド値にシンボル値を設定する。   The symbol value setting means 51 sets a symbol value to the field value of each record of the DB stub 100.

シンボリック実行手段52は、検索条件に従い、設定されたシンボル値に対するシンボリック実行処理を行う。シンボリック実行処理された結果、DBスタブ100のシンボル値のパス毎のパス条件が得られる。   The symbolic execution means 52 performs symbolic execution processing for the set symbol value according to the search condition. As a result of the symbolic execution process, a path condition for each symbol value path of the DB stub 100 is obtained.

DB接続スタブ手段53は、シンボル値を処理可能なJDBCスタブ200を用いてDB30に替わってDBスタブ100にアクセスする。   The DB connection stub means 53 accesses the DB stub 100 instead of the DB 30 using the JDBC DB stub 200 capable of processing symbol values.

レコード識別設定手段54は、DBスタブ100のレコードを区別するためにレコード毎にレコード識別値を設定する。レコード識別設定手段54は、シンボル値をフィールド値として含むレコード群のうち、フィールド値に対する同一の検索条件を満たす複数のレコードに同一の識別値を設定してもよい。   The record identification setting unit 54 sets a record identification value for each record in order to distinguish the records of the DB stub 100. The record identification setting means 54 may set the same identification value for a plurality of records satisfying the same search condition for the field value in the record group including the symbol value as the field value.

レコード検索制御手段55は、検索条件に従いシンボリック実行処理の対象となるレコードを検索する。その際、レコード検索制御手段55は、レコード群のうち同一の検索条件を満たし、かつ同一の識別値が設定された複数のレコードのうちの一つをシンボリック実行処理の対象として抽出する。   The record search control means 55 searches for a record to be subjected to symbolic execution processing according to the search condition. At that time, the record search control means 55 extracts one of a plurality of records that satisfy the same search condition and set the same identification value as a target of the symbolic execution process.

レコード更新制御手段56は、設定されたレコード識別値に基づきDBスタブ100のレコードの更新処理を制御する。レコード更新制御手段56は、検索条件を満たすレコードが特定された場合、その特定されたレコードを更新する。   The record update control means 56 controls a record update process of the DB stub 100 based on the set record identification value. When a record satisfying the search condition is specified, the record update control means 56 updates the specified record.

レコード削除制御手段57は、設定されたレコード識別値に基づきDBスタブ100のレコードの削除処理を制御する。レコード削除制御手段57は、検索条件を満たすレコードが特定された場合、その特定されたレコードを更新する。   The record deletion control means 57 controls the record deletion process of the DB stub 100 based on the set record identification value. When a record that satisfies the search condition is specified, the record deletion control unit 57 updates the specified record.

レコード追加制御手段58は、設定されたレコード識別値に基づきDBスタブ100のレコードの追加処理を制御する。レコード追加制御手段58は、検索条件を満たすレコードが特定された場合、その特定されたレコードに対して一意性制約に反しないレコードを追加する。一意性制約とはデータを追加や更新する際の制約の一つで、プライマリキーが設定されたフィールドFの値が一意であること、つまり、プライマリキーが設定されたフィールドに同じデータがないことを要求する。   The record addition control means 58 controls the record addition process of the DB stub 100 based on the set record identification value. When a record satisfying the search condition is identified, the record addition control means 58 adds a record that does not violate the uniqueness constraint to the identified record. A unique constraint is one of the constraints when adding or updating data, and the value of the field F with the primary key set is unique, that is, the field with the primary key does not have the same data Request.

かかる機能構成を有するシンボリック実行装置50は、同じレコード識別値が付与された複数のレコードのうちの一つのレコードに対してシンボリック実行処理を行う。この結果、本実施形態にかかるシンボリック実行装置50によれば、重複のないDBのテストケースを生成することができる。   The symbolic execution device 50 having such a functional configuration performs symbolic execution processing on one record among a plurality of records to which the same record identification value is assigned. As a result, according to the symbolic execution device 50 according to the present embodiment, it is possible to generate DB test cases without duplication.

つまり、後述されるように、シンボリック実行処理により抽出されたパス毎のパス条件は、テストケース生成装置60のテストデータ生成手段61に入力される。テストデータ生成手段61は、入力されたパス毎のパス条件に基づきDB30のフィールド値のテストデータを生成する。これによれば、抽出されたパス及びパス条件は重複していないため、重複のないテストケース及びテストデータを生成することができる。   That is, as will be described later, the path condition for each path extracted by the symbolic execution process is input to the test data generation unit 61 of the test case generation apparatus 60. The test data generation unit 61 generates test data of field values in the DB 30 based on the input path condition for each path. According to this, since the extracted paths and path conditions do not overlap, it is possible to generate test cases and test data having no overlap.

[シンボリック実行処理(テストデータ生成処理)]
次に、本実施形態にかかるシンボリック実行処理について、図8及び図9を参照しながら説明する。図8は、本実施形態にかかるシンボリック実行処理(テストデータ生成処理)の一例を示したフローチャートである。図9は、図8に示したシンボリック実行処理を説明するための図である。
[Symbolic execution processing (test data generation processing)]
Next, symbolic execution processing according to the present embodiment will be described with reference to FIGS. FIG. 8 is a flowchart showing an example of symbolic execution processing (test data generation processing) according to the present embodiment. FIG. 9 is a diagram for explaining the symbolic execution process shown in FIG.

図8では、まず、テスト対象プログラム11(又はDBアクセサ12)が、クラスパスでJDBCスタブ200を指定し、JDBCスタブ200に接続するように変更される(ステップS10)。これにより、図9の(1)に示されるように、DBアクセサ12が、JDBCスタブ200と接続可能になる。   In FIG. 8, first, the test target program 11 (or the DB accessor 12) is changed so as to designate the JDBC stub 200 by the class path and connect to the JDBC stub 200 (step S10). As a result, the DB accessor 12 can be connected to the JDBC stub 200 as shown in FIG.

次に、テストドライバ40の制御により、シンボル値設定手段51は、DBスタブ100のレコードの各フィールドにシンボル値を設定する(ステップS11)。これにより、図9の(2)に示されるように、DBスタブ100の各フィールドにシンボル値が設定される。なお、DBスタブ100のフィールド値には、シンボル値又は具体値を設定することができる。   Next, under the control of the test driver 40, the symbol value setting means 51 sets a symbol value in each field of the record of the DB stub 100 (step S11). As a result, symbol values are set in the fields of the DB stub 100 as shown in (2) of FIG. A symbol value or a specific value can be set as the field value of the DB stub 100.

次に、シンボリック実行手段52によりテストドライバ40が起動され、テスト対象プログラム11、DBアクセサ12、JDBCスタブ200及びDBスタブ100が順にアクセスされる。シンボリック実行手段52は、テスト対象プログラム11又はDBアクセサ12内のSQLに記述された検索条件に従いシンボル値に対してシンボリック実行処理を行う(ステップS12)。本実施形態では、DBスタブ100の各フィールドには、テストドライバ40の制御により指定されたシンボル値が設定されている。よって、検索条件に従い、その設定されたシンボル値に対するシンボリック実行処理が行われる。この結果、図9の(3)に示されたシンボル値に対するシンボリック実行処理が行われ、実行可能なパス及びパス条件が抽出される。   Next, the test driver 40 is activated by the symbolic execution unit 52, and the test target program 11, the DB accessor 12, the JDBC stub 200, and the DB stub 100 are accessed in order. The symbolic execution means 52 performs symbolic execution processing on the symbol value according to the search conditions described in the SQL within the test target program 11 or the DB accessor 12 (step S12). In the present embodiment, a symbol value designated by the control of the test driver 40 is set in each field of the DB stub 100. Therefore, symbolic execution processing is performed on the set symbol value according to the search condition. As a result, symbolic execution processing is performed on the symbol values shown in (3) of FIG. 9, and executable paths and path conditions are extracted.

抽出されたパス毎のパス条件は、テストデータ生成手段61に入力される。テストデータ生成手段61は、入力されたパス毎のパス条件を解析し、テストケース毎にテストデータを生成し(ステップS13)、本シンボリック実行処理(テストデータ生成処理)を終了する。   The extracted path condition for each path is input to the test data generation means 61. The test data generation means 61 analyzes the input path condition for each path, generates test data for each test case (step S13), and ends the symbolic execution process (test data generation process).

[テストデータの利用例]
以上のようにして生成されたテストデータの利用の一例について、図10を参照しながら説明する。図10は、一実施形態にかかるテストデータの利用の一例を説明するための図である。
[Example of using test data]
An example of use of the test data generated as described above will be described with reference to FIG. FIG. 10 is a diagram for explaining an example of use of test data according to an embodiment.

図10の上段に示される利用手順1では、図8のフローチャートを参照して説明した通り、シンボリック実行処理を用いてテストケース毎のテストデータが生成され、出力される。   In the usage procedure 1 shown in the upper part of FIG. 10, as described with reference to the flowchart of FIG. 8, test data for each test case is generated and output using symbolic execution processing.

図10の下段に示される利用手順2では、DB30の各フィールド値に生成したテストデータが設定される。この状態で、テストドライバ40によりテスト対象プログラム11が起動され、テスト対象プログラム11の動作を確認するテストが実施される。   In the usage procedure 2 shown in the lower part of FIG. 10, the generated test data is set in each field value of the DB 30. In this state, the test target program 11 is started by the test driver 40, and a test for confirming the operation of the test target program 11 is performed.

後述されるように、本実施形態に係るシンボリック実行装置50では、重複のないテストケース及びテストデータを生成することができる。この結果、上記テスト対象プログラム11の動作確認のテストを効率的に行うことができる。   As will be described later, the symbolic execution device 50 according to the present embodiment can generate test cases and test data without duplication. As a result, the operation check test of the test target program 11 can be efficiently performed.

[DBを利用するプログラムとテストドライバの例]
次に、一実施形態にかかるDBを利用するプログラム(テスト対象プログラム11の一部)及びテストドライバの一例を、図11を参照しながら説明する。図11は、一実施形態にかかるDBを利用するプログラム及びテストドライバの一例を示した図である。
[Examples of programs and test drivers that use DB]
Next, an example of a program (a part of the test target program 11) and a test driver that use the DB according to the embodiment will be described with reference to FIG. FIG. 11 is a diagram illustrating an example of a program and a test driver that use a DB according to an embodiment.

図11に示されるDBを利用するプログラムのプログラミング言語はJavaである。このプログラムの例では、プログラムはテストドライバと一体となって、テストドライバから直接にDBスタブ100にアクセス可能である。また、本実施形態においてプログラムが利用する、シンボリック実行処理の対象となるDBスタブを呼び出すメソッドは、「testJDBCStub」である。   The programming language of the program that uses the DB shown in FIG. 11 is Java. In the example of this program, the program is integrated with the test driver and can directly access the DB stub 100 from the test driver. In addition, a method for calling a DB stub that is a target of symbolic execution processing and that is used by the program in the present embodiment is “testJDBCStub”.

図11のプログラム(テストドライバ)の一例では、下記の(1)〜(4)の処理が記述される。
(1)では、s1〜s9をフィールドFに設定するシンボル値として扱うことの宣言が記述される。
(2)では、testJDBCStubのメソッド(ドライバ)から呼び出されるDBスタブ100の各レコードのフィールドFにシンボル値s1〜s9を設定することが記述される。
(3)では、DBを検索する処理が記述される。SQLの検索式の設定や入力パラメタの設定等の準備後、SQLの検索条件に従いシンボル値を用いたシンボリック実行処理が行われる。
(4)では、DB処理結果を利用するための処理が記述される。これにより、シンボル値を用いたシンボリック実行処理による検索結果が返却される。
In the example of the program (test driver) in FIG. 11, the following processes (1) to (4) are described.
In (1), a declaration of handling s1 to s9 as symbol values to be set in the field F is described.
(2) describes that the symbol values s1 to s9 are set in the field F of each record of the DB stub 100 called from the method (driver) of the testJDBCStub.
In (3), a process for searching the DB is described. After preparing the SQL search expression and input parameter settings, symbolic execution processing using symbol values is performed according to the SQL search conditions.
In (4), a process for using the DB processing result is described. Thereby, the search result by the symbolic execution process using the symbol value is returned.

[JDBCスタブ及びDBスタブ]
JDBCスタブ200は、JDBC20を代替し、DB30の代わりにDBスタブ100にアクセスする手段を提供する。図12は、JDBCスタブ200の主要なAPI(ライブラリ)の例を示す。JDBCスタブ200は、JDBC20と同一のAPIを提供してもよい。テスト対象プログラム11(又はDBアクセサ12)は、JDBCスタブ200のAPIを利用してDBスタブ100にアクセスすることができる。
[JDBC stub and DB stub]
The JDBC stub 200 replaces the JDBC 20 and provides a means for accessing the DB stub 100 instead of the DB 30. FIG. 12 shows an example of main API (library) of the JDBC stub 200. The JDBC stub 200 may provide the same API as the JDBC 20. The test target program 11 (or the DB accessor 12) can access the DB stub 100 using the API of the JDBC stub 200.

DBスタブ100は、DB30の機能を代替する。図13に示されるように、DBスタブ100のフィールドには、例えばABCや11のような具体値だけでなく、s1〜s11のようなシンボル値(記号値)を設定できる。DBスタブ100は、JDBCスタブ200から接続され、SQLの検索条件に従いシンボル値を用いたシンボリック実行処理が可能である。   The DB stub 100 replaces the function of the DB 30. As shown in FIG. 13, not only specific values such as ABC and 11 but also symbol values (symbol values) such as s1 to s11 can be set in the field of the DB stub 100. The DB stub 100 is connected to the JDBC stub 200 and can perform symbolic execution processing using symbol values in accordance with SQL search conditions.

具体的には、SQLなどのDB操作言語と、JDBCスタブ200のAPIの呼出しにより指示された内容に従ってシンボリック実行処理が行われ、DBスタブ100内のレコードに設定されたシンボル値に対する検索(Select)、更新(Update)、削除(Delete)及び追加(Insert)などの処理が実行される。   More specifically, symbolic execution processing is performed according to the content instructed by the DB operation language such as SQL and the API call of the JDBC stub 200, and the search for the symbol value set in the record in the DB stub 100 (Select) Processing such as update (Update), deletion (Delete), and addition (Insert) is executed.

[レコード識別]
次に、DBスタブ100内の各レコードに付与されたレコード識別値について説明する。レコード識別設定手段54は、DBスタブ100内のレコードを区別するためにレコード識別値を設定する。レコード識別設定手段54は、シンボル値をフィールド値として含むレコード群のうち、フィールド値に対する同一の検索条件を満たす複数のレコードに同一の識別値を設定してもよい。
Record identification
Next, a record identification value assigned to each record in the DB stub 100 will be described. The record identification setting unit 54 sets a record identification value in order to distinguish the records in the DB stub 100. The record identification setting means 54 may set the same identification value for a plurality of records satisfying the same search condition for the field value in the record group including the symbol value as the field value.

レコード識別設定手段54は、ユーザによる指定に応じてレコード識別値を設定してもよい。例えば、DBスタブ100内の複数のレコードに対して検索条件を満たすレコードのヒット件数を1件にしたい場合、レコード識別設定手段54は、複数のレコードに1種類のレコード識別値を設定する。DBスタブ100内の複数のレコードに対して検索条件を満たすレコードのヒット件数をN件にしたい場合、レコード識別設定手段54は、複数のレコードにN種類のレコード識別値を設定する。   The record identification setting unit 54 may set a record identification value in accordance with designation by the user. For example, when the number of hits of records satisfying the search condition is desired to be one for a plurality of records in the DB stub 100, the record identification setting unit 54 sets one type of record identification value for the plurality of records. When it is desired to set the number of hits of records satisfying the search condition to N for a plurality of records in the DB stub 100, the record identification setting unit 54 sets N types of record identification values for the plurality of records.

図14は、一実施形態にかかるレコード識別値の一例を示す。DBスタブ100の複数のレコード101のフィールドF1、F2、F3にはシンボル値s1〜s9が設定されている。本例では、DBスタブ100の3つのレコード101のそれぞれのフィールド値はすべてシンボル値であり、各レコードを区別することができない。そこで、レコード識別設定手段54は、これらのレコードを区別できるようにレコード毎にレコード識別値102を設定する。   FIG. 14 shows an example of a record identification value according to an embodiment. Symbol values s1 to s9 are set in the fields F1, F2, and F3 of the plurality of records 101 of the DB stub 100. In this example, the field values of the three records 101 of the DB stub 100 are all symbol values, and the records cannot be distinguished. Therefore, the record identification setting means 54 sets the record identification value 102 for each record so that these records can be distinguished.

レコード識別設定手段54は、SQLの検索条件を満たす複数のレコードが検出された場合にそれらの複数のレコードのうちの一つのレコードに対してシンボリック実行処理が行われるように、同一の検索条件を満たす複数のレコードに同じレコード識別値を付与する。同じレコード識別値が付与された複数のレコードのうちの一つのレコードに対してシンボリック実行処理が行われた場合、それ以外のレコードは検索対象から除外され、シンボリック実行処理の対象外となる。   The record identification setting unit 54 sets the same search condition so that when a plurality of records satisfying the SQL search condition are detected, symbolic execution processing is performed on one of the plurality of records. Assign the same record identification value to multiple records that satisfy it. When symbolic execution processing is performed on one of a plurality of records to which the same record identification value is assigned, the other records are excluded from the search target and excluded from the symbolic execution processing.

例えば、図14(a)は、レコード1〜3のレコード識別値102に同じ値「A」が付与されている例である。この場合、レコード1〜3は、同じレコードであると識別される。よって、図14(a)は、レコード1〜3を区別せず、レコード1〜3から検索条件を満たすテストケースが1件だけ抽出されるようにしたい場合のレコード識別値の設定例である。この場合、レコード識別設定手段54は、レコード1〜3のレコード識別値102に同一の値を設定すればよい。   For example, FIG. 14A is an example in which the same value “A” is assigned to the record identification values 102 of records 1 to 3. In this case, records 1 to 3 are identified as the same record. Therefore, FIG. 14A is an example of setting the record identification value when it is desired to extract only one test case satisfying the search condition from the records 1 to 3 without distinguishing the records 1 to 3. In this case, the record identification setting unit 54 may set the same value as the record identification value 102 of records 1 to 3.

図14(b)は、レコード1,2のレコード識別値102に同じ値「A」が付与され、レコード3のレコード識別値102にレコード1,2と異なる値「B」が付与されている例である。この場合、レコード1,2は、同じレコードであると識別され、レコード3は、レコード1,2と異なるレコードであると識別される。よって、図14(b)は、レコード1〜3を2種類に区別して、3件のレコードからテストケースが2件抽出されるようにしたい場合のレコード識別値の設定例である。この場合、レコード識別設定手段54は、レコード識別値102に2種類の値を設定すればよい。   FIG. 14B shows an example in which the same value “A” is assigned to the record identification values 102 of records 1 and 2, and the value “B” different from records 1 and 2 is assigned to the record identification value 102 of record 3. It is. In this case, records 1 and 2 are identified as the same record, and record 3 is identified as a record different from records 1 and 2. Therefore, FIG. 14B is an example of setting a record identification value when it is desired to distinguish two records 1 to 2 and extract two test cases from three records. In this case, the record identification setting unit 54 may set two types of values for the record identification value 102.

このようにして、SQL等で記述された検索条件を満たすDBスタブの複数のレコードに対して同じレコード識別値を付与することで、検索条件を満たすDBスタブの複数のレコードから1件のテストケースを生成することができる。   In this way, by assigning the same record identification value to a plurality of records in the DB stub satisfying the search condition described in SQL or the like, one test case from a plurality of records in the DB stub satisfying the search condition Can be generated.

[レコード検索処理]
レコード検索制御手段55は、DBスタブ100のレコード群のうち同一の検索条件を満たし、かつ同一のレコード識別値が設定された複数のレコードのうちの一つをシンボリック実行処理の対象として抽出する。その際、レコード検索制御手段55は、同一のレコード識別値が設定されたレコードが既にシンボリック実行処理の対象として抽出されたかを示すフラグを用いる。
[Record search processing]
The record search control means 55 extracts one of a plurality of records that satisfy the same search condition and set the same record identification value from the record group of the DB stub 100 as a symbolic execution process target. At that time, the record search control means 55 uses a flag indicating whether or not a record having the same record identification value has already been extracted as a symbolic execution process target.

例えば、本実施形態では、フラグの初期値は「0」であり、既にシンボリック実行処理の対象として抽出されたレコードのレコード識別値に対するフラグの値は、「0」から「1」に変更される。ただし、既にシンボリック実行処理の対象として抽出されたレコードに設定されたレコード識別値か否かを判定できれば、フラグ以外のいかなる手段を用いることもできる。そして、レコード検索制御手段55は、フラグの値に基づき、既にシンボリック実行処理の対象として抽出されたレコードのレコード識別値と同一のレコード識別値が設定されたレコードについてはシンボリック実行処理を行うレコードの検索対象から除外する。以下、レコード検索制御手段55が行うレコード検索処理例1、2について詳しく説明する。   For example, in the present embodiment, the initial value of the flag is “0”, and the flag value for the record identification value of the record that has already been extracted as the target of the symbolic execution process is changed from “0” to “1”. . However, any means other than the flag can be used as long as it can be determined whether or not the record identification value is set in the record already extracted as the target of the symbolic execution process. Based on the flag value, the record search control unit 55 sets the record for which the symbolic execution process is performed for the record having the same record identification value as the record identification value of the record already extracted as the target of the symbolic execution process. Exclude from search. Hereinafter, the record search processing examples 1 and 2 performed by the record search control unit 55 will be described in detail.

[レコード検索処理例1]
まず、本実施形態に係るレコード検索処理例1について、図15及び図16を参照しながら説明する。図15は、本実施形態にかかるシンボリック実行処理を行うレコードの検索処理の一例を示したフローチャートである。図16は、左表に示されるDBスタブ100のレコード1〜3のレコード識別値に「A」が設定された場合の図15のレコード検索処理の結果の一例を示す。
[Record search processing example 1]
First, a record search processing example 1 according to the present embodiment will be described with reference to FIGS. 15 and 16. FIG. 15 is a flowchart illustrating an example of a record search process for performing a symbolic execution process according to the present embodiment. FIG. 16 shows an example of the result of the record search process of FIG. 15 when “A” is set in the record identification values of records 1 to 3 of the DB stub 100 shown in the left table.

図15のレコード検索処理が開始されると、レコード検索制御手段55は、テスト対象プログラムに記述されたSQLの検索式を解析し、検索条件を取得する(ステップS20)。以下の処理では、図16に示されるようにSQLの検索式に基づき、検索条件がフィールドF1=cである場合を例に挙げて説明する。   When the record search process of FIG. 15 is started, the record search control means 55 analyzes the SQL search formula described in the test target program and acquires the search condition (step S20). In the following processing, a case where the search condition is field F1 = c will be described as an example based on the SQL search formula as shown in FIG.

次に、レコード検索制御手段55は、検索対象のDBスタブ100からレコードi(i=1,2・・・N)を取得する(ステップS21)。例えば、図16に示されるDBスタブ100では、レコード1,2,3(レコード数N=3)が取得される。   Next, the record search control means 55 acquires the record i (i = 1, 2,... N) from the search target DB stub 100 (step S21). For example, in the DB stub 100 shown in FIG. 16, records 1, 2, and 3 (number of records N = 3) are acquired.

次に、レコード検索制御手段55は、レコードiに1を設定し(ステップS22)、レコードiのレコード識別値が既出かを判定する(ステップS23)。ここで、「レコードiのレコード識別値が既出か」とは、レコードiのレコード識別値が、既にシンボリック実行処理の対象として抽出されたレコードに設定されたレコード識別値と同じレコード識別値であるかを意味する。   Next, the record search control means 55 sets 1 to the record i (step S22), and determines whether the record identification value of the record i has already appeared (step S23). Here, “whether or not the record identification value of record i has already been issued” means that the record identification value of record i is the same as the record identification value set for the record that has already been extracted as the target of symbolic execution processing. Means.

この時点では、レコード識別値「A」のフラグは「0」に設定されている。よって、レコード検索制御手段55は、レコード1のレコード識別値「A」は既出でないと判定し、レコード1が検索条件を満たすかを判定する(ステップS24)。   At this time, the flag of the record identification value “A” is set to “0”. Therefore, the record search control means 55 determines that the record identification value “A” of the record 1 has not been found, and determines whether the record 1 satisfies the search condition (step S24).

ここでは、レコード検索制御手段55は、レコード1のフィールドF1に設定された値がcであるかを判定する。レコード1のフィールドF1に設定された値がcでないと判定された場合(ここでは、シンボル値s1がcでない場合)、ステップS26に進む。一方、レコード1のフィールドF1に設定された値がcであると判定された場合(ここでは、シンボル値s1がcである場合)、レコード検索制御手段55は、検索結果を格納するテーブルに検索条件を満たすレコード1を記憶し、レコード1のレコード識別値「A」のフラグに1を設定し、レコード1のレコード識別値を既出とする(ステップS25)。   Here, the record search control means 55 determines whether the value set in the field F1 of the record 1 is c. When it is determined that the value set in the field F1 of the record 1 is not c (here, the symbol value s1 is not c), the process proceeds to step S26. On the other hand, when it is determined that the value set in the field F1 of the record 1 is c (here, the symbol value s1 is c), the record search control means 55 searches the table storing the search results. Record 1 satisfying the condition is stored, 1 is set in the flag of record identification value “A” of record 1, and the record identification value of record 1 is already issued (step S25).

次に、レコード検索制御手段55は、レコードiに1を加え(ステップS26)、レコードiがレコード数N(=3)よりも大きいかを判定する(ステップS27)。この時点では、レコード2は、レコード数3よりも小さいため、ステップS23に戻り、レコード検索制御手段55は、レコード2のレコード識別値「A」が既出かを判定する。   Next, the record search control means 55 adds 1 to the record i (step S26), and determines whether the record i is larger than the record number N (= 3) (step S27). At this time, since the record 2 is smaller than the number of records 3, the process returns to step S23, and the record search control means 55 determines whether the record identification value “A” of the record 2 has already appeared.

この時点で、レコード識別値「A」のフラグは「1」に設定されているため、レコード検索制御手段55は、レコード識別値「A」が既出であると判定し、シンボリック実行手段52にバックトラックの指示を出す(ステップS28)。この指示に応じて、シンボリック実行手段52は、レコード2に対するシンボリック実行処理におけるパスのパス条件の追跡を中断し、追跡可能な別のパスが存在するレコードの位置(命令文)まで戻る(バックトラック)。これにより、本実施形態では、既にシンボリック実行処理の対象として抽出されたレコード1と同一のレコード識別値が設定されたレコード2は、検索対象から除外される。   At this point, since the flag of the record identification value “A” is set to “1”, the record search control unit 55 determines that the record identification value “A” has already been issued, and returns the symbolic execution unit 52 to the symbolic execution unit 52. A track instruction is issued (step S28). In response to this instruction, the symbolic execution means 52 interrupts the tracking of the path condition of the path in the symbolic execution process for the record 2 and returns to the position (command statement) of the record where another path that can be tracked exists (backtrack). ). Thereby, in this embodiment, the record 2 in which the same record identification value as the record 1 already extracted as the target of the symbolic execution process is set is excluded from the search target.

次に、レコード検索制御手段55は、レコードiに1を加え(ステップS26)、レコードiがレコード数Nよりも大きいかを判定する(ステップS27)。   Next, the record search control means 55 adds 1 to the record i (step S26), and determines whether the record i is larger than the record number N (step S27).

この時点では、レコード3は、レコード数3に等しいため、ステップS23に戻り、レコード検索制御手段55は、レコード3のレコード識別値「A」が既出かを判定する。レコード識別値「A」のフラグは1に設定されているため、レコード検索制御手段55は、レコード識別値「A」が既出であると判定し、シンボリック実行手段52にバックトラックの指示を出す(ステップS28)。この指示に応じて、シンボリック実行手段52は、レコード3に対するシンボリック実行処理におけるパスのパス条件の追跡を中断し、バックトラックする。これにより、本実施形態では、既にシンボリック実行処理の対象として抽出されたレコード1と同一のレコード識別値が設定されたレコード3は、検索対象から除外される。   At this time, since the record 3 is equal to the number of records 3, the process returns to step S23, and the record search control means 55 determines whether the record identification value “A” of the record 3 has already appeared. Since the flag of the record identification value “A” is set to 1, the record search control means 55 determines that the record identification value “A” has already been issued, and issues a backtrack instruction to the symbolic execution means 52 ( Step S28). In response to this instruction, the symbolic execution unit 52 interrupts the backtracking of the path condition of the path in the symbolic execution process for the record 3 and backtracks. Thereby, in this embodiment, the record 3 in which the same record identification value as the record 1 already extracted as the target of the symbolic execution process is set is excluded from the search target.

次に、レコード検索制御手段55は、レコードiに1を加え(ステップS26)、レコードiがレコード数Nよりも大きいかを判定する(ステップS27)。   Next, the record search control means 55 adds 1 to the record i (step S26), and determines whether the record i is larger than the record number N (step S27).

この時点では、レコード4は、レコード数3よりも大きいため、ステップS29に進む。シンボリック実行手段52は、検索結果のテーブルに格納されたレコード1からSQLに記述された検索条件に従ってシンボリック実行処理を行い、パス毎のパス条件を抽出して、出力する(ステップS29)。   At this point, since the record 4 is larger than the number of records 3, the process proceeds to step S29. The symbolic execution means 52 performs symbolic execution processing from the record 1 stored in the search result table according to the search conditions described in SQL, extracts the path conditions for each path, and outputs them (step S29).

シンボリック実行手段52は、検索条件「F1=c」に従い、検索結果のテーブルに記憶されたレコード1のフィールドF1に設定されたシンボル値s1に対するシンボリック実行処理を行う。この結果、シンボル値s1がcである場合とcでない場合の2つのパス条件が抽出される。なお、シンボル値s4及びシンボル値s7はcである場合は成立せず、cでない場合のパス条件が抽出される。   The symbolic execution means 52 performs symbolic execution processing on the symbol value s1 set in the field F1 of the record 1 stored in the search result table in accordance with the search condition “F1 = c”. As a result, two path conditions are extracted when the symbol value s1 is c and when it is not c. Note that the symbol value s4 and the symbol value s7 do not hold when c, and the path condition is extracted when it is not c.

この結果、パス1では、シンボル値s1、s4、s7がすべてcでないパス条件が抽出され、パス2では、シンボル値s1がcであり、シンボル値s4、s7がcでないパス条件が抽出される。このようにして抽出されたパス及びパス条件が出力された後、本レコード検索処理は終了する。   As a result, a path condition in which the symbol values s1, s4, and s7 are not all c is extracted in the path 1, and a path condition in which the symbol value s1 is c and the symbol values s4 and s7 are not c is extracted in the path 2. . After the path and path condition extracted in this way are output, this record search process ends.

以上、レコード1〜3に同一のレコード識別値が設定された場合のレコード検索処理にについて説明した。これによれば、同一のレコード識別値に基づき、レコード1〜3はすべて同じレコードであると識別される。そして、本実施形態に係るレコード検索処理では、同じレコード識別値が設定された複数のレコードのうち、検索条件を満たした一つのレコードに対してシンボリック実行処理が行われるようにレコードが検索される。例えば、レコード1が検索条件を満たし、シンボリック実行処理の対象として抽出された場合、同じレコード識別値が設定されたレコード2,3は検索対象から除外される。これにより、同一の検索条件を満たし、かつ同一のレコード識別値が設定された複数のレコードのうちの一つをシンボリック実行処理の対象として抽出できる。以上により、同じレコード識別値が設定された複数のレコードに関して重複したテストケース及びテストデータの生成を防止できる。   The record search process when the same record identification value is set for records 1 to 3 has been described above. According to this, based on the same record identification value, records 1 to 3 are all identified as the same record. In the record search process according to the present embodiment, a record is searched so that a symbolic execution process is performed on one record that satisfies the search condition among a plurality of records having the same record identification value. . For example, when the record 1 satisfies the search condition and is extracted as the target of the symbolic execution process, the records 2 and 3 in which the same record identification value is set are excluded from the search target. Thereby, one of a plurality of records satisfying the same search condition and having the same record identification value set can be extracted as a symbolic execution process target. As described above, it is possible to prevent generation of duplicate test cases and test data for a plurality of records having the same record identification value.

なお、本実施形態に係るレコード検索処理例1では、レコード1をシンボリック実行処理させ、レコード1と同じレコード識別値が設定されたレコード2,3は検索対象から除外した。しかしながら、本実施形態に係るシンボリック実行装置50は、これに限られず、レコード識別値が同じ複数のレコードのうちの任意の一つのレコードに対してシンボリック実行処理が行われるようにしてもよい。例えば、レコード識別値が同じレコード2に対してシンボリック実行処理を行い、レコード1,3は検索対象から除外してもよい。また、レコード識別値が同じレコード3に対してシンボリック実行処理を行い、レコード1,2は検索対象から除外してもよい。   In the record search processing example 1 according to this embodiment, the record 1 is subjected to symbolic execution processing, and the records 2 and 3 in which the same record identification value as that of the record 1 is set are excluded from the search targets. However, the symbolic execution device 50 according to the present embodiment is not limited to this, and the symbolic execution process may be performed on any one of a plurality of records having the same record identification value. For example, the symbolic execution process may be performed on the record 2 having the same record identification value, and the records 1 and 3 may be excluded from the search targets. Further, symbolic execution processing may be performed on the record 3 having the same record identification value, and the records 1 and 2 may be excluded from the search target.

[レコード検索処理例2]
次に、本実施形態に係るレコード検索処理例1について、図15及び図17を参照しながら説明する。図17は、左表に示されるDBスタブ100のレコード1、2のレコード識別値に「A」が設定され、レコード3のレコード識別値に「B」が設定された場合の図15のレコード検索処理の結果の一例を示す。
[Record search processing example 2]
Next, a record search processing example 1 according to this embodiment will be described with reference to FIGS. 15 and 17. FIG. 17 shows the record search in FIG. 15 when “A” is set for the record identification values of records 1 and 2 of the DB stub 100 shown in the left table and “B” is set for the record identification value of record 3. An example of the result of a process is shown.

図15のシンボリック実行処理が開始されると、レコード検索制御手段55は、SQLの検索式を解析し、検索条件を取得する(ステップS20)。以下の処理では、図17に示されるようにSQLの検索式に基づき、検索条件がフィールドF2=bである場合を例に挙げて説明する。   When the symbolic execution process of FIG. 15 is started, the record search control means 55 analyzes the SQL search expression and acquires the search condition (step S20). In the following processing, a case where the search condition is the field F2 = b based on the SQL search formula as shown in FIG. 17 will be described as an example.

次に、レコード検索制御手段55は、検索対象のDBスタブ100からレコードi(i=1,2・・・N)を取得する(ステップS21)。例えば、図17に示されるDBスタブ100では、レコード1,2,3(レコード数N=3)が取得される。   Next, the record search control means 55 acquires the record i (i = 1, 2,... N) from the search target DB stub 100 (step S21). For example, in the DB stub 100 shown in FIG. 17, records 1, 2, and 3 (number of records N = 3) are acquired.

次に、レコード検索制御手段55は、レコードiに1を設定し(ステップS22)、レコードiのレコード識別値が既出かを判定する(ステップS23)。この時点では、レコード識別値「A」のフラグは0に設定されている。よって、レコード検索制御手段55は、レコード1のレコード識別値Aは既出でないと判定し、レコード1が検索条件を満たすかを判定する(ステップS24)。   Next, the record search control means 55 sets 1 to the record i (step S22), and determines whether the record identification value of the record i has already appeared (step S23). At this time, the flag of the record identification value “A” is set to 0. Therefore, the record search control means 55 determines that the record identification value A of the record 1 has not been issued, and determines whether the record 1 satisfies the search condition (step S24).

ここでは、レコード検索制御手段55は、レコード1のフィールドF2に設定された値がbであるかを判定する。レコード1のフィールドF2に設定された値がbでないと判定された場合(ここでは、シンボル値s2がbでない場合)、ステップS26に進む。一方、レコード1のフィールドF2に設定された値がbであると判定された場合(ここでは、シンボル値s2がbである場合)、レコード検索制御手段55は、検索結果を格納するテーブルにレコード1を記憶し、レコード1のレコード識別値「A」のフラグに1を設定、レコード1のレコード識別値を既出とする(ステップS25)。   Here, the record search control means 55 determines whether or not the value set in the field F2 of the record 1 is b. If it is determined that the value set in the field F2 of the record 1 is not b (here, the symbol value s2 is not b), the process proceeds to step S26. On the other hand, when it is determined that the value set in the field F2 of the record 1 is b (here, the symbol value s2 is b), the record search control unit 55 records the record in the table storing the search results. 1 is stored, 1 is set to the flag of record identification value “A” of record 1, and the record identification value of record 1 is already issued (step S25).

次に、レコード検索制御手段55は、レコードiに1を加え(ステップS26)、レコードiがレコード数Nよりも大きいかを判定する(ステップS27)。この時点では、レコード2は、レコード数3よりも小さいため、ステップS23に戻り、レコード検索制御手段55は、レコード2のレコード識別値「A」が既出かを判定する。   Next, the record search control means 55 adds 1 to the record i (step S26), and determines whether the record i is larger than the record number N (step S27). At this time, since the record 2 is smaller than the number of records 3, the process returns to step S23, and the record search control means 55 determines whether the record identification value “A” of the record 2 has already appeared.

この時点で、レコード識別値「A」のフラグは「1」に設定されているため、レコード検索制御手段55は、レコード識別値「A」が既出であると判定し、シンボリック実行手段52にバックトラックの指示を出す(ステップS28)。この指示に応じて、シンボリック実行手段52は、レコード2に対するシンボリック実行処理によるパスのパス条件の追跡を中断し、バックトラックする。これにより、レコード2は、検索対象から除外される。   At this point, since the flag of the record identification value “A” is set to “1”, the record search control unit 55 determines that the record identification value “A” has already been issued, and returns the symbolic execution unit 52 to the symbolic execution unit 52. A track instruction is issued (step S28). In response to this instruction, the symbolic execution unit 52 suspends the tracking of the path condition of the path by the symbolic execution process for the record 2 and backtracks. Thereby, the record 2 is excluded from search targets.

次に、レコード検索制御手段55は、レコードiに1を加え(ステップS26)、レコードiがレコード数Nよりも大きいかを判定する(ステップS27)。   Next, the record search control means 55 adds 1 to the record i (step S26), and determines whether the record i is larger than the record number N (step S27).

この時点では、レコード3は、レコード数3に等しいため、ステップS23に戻り、レコード検索制御手段55は、レコード3のレコード識別値「B」が既出かを判定する。レコード識別値「B」のフラグは0に設定されているため、レコード検索制御手段55は、レコード識別値「B」は既出でないと判定し、レコード3が検索条件を満たすかを判定する(ステップS24)。   At this time, since the record 3 is equal to the number of records 3, the process returns to step S23, and the record search control means 55 determines whether the record identification value “B” of the record 3 has already appeared. Since the flag of the record identification value “B” is set to 0, the record search control means 55 determines that the record identification value “B” has not been issued, and determines whether the record 3 satisfies the search condition (step S24).

ここでは、レコード検索制御手段55は、レコード3のフィールドF2に設定された値がbであるかを判定する。シンボル値s8がbでないと判定された場合、ステップS26に進む。一方、ステップS24にてシンボル値s8がbであると判定された場合、レコード検索制御手段55は、検索結果を格納するテーブルにレコード3を追加し、レコード3のレコード識別値「B」のフラグに1を設定する(ステップS25)。   Here, the record search control means 55 determines whether or not the value set in the field F2 of the record 3 is b. If it is determined that the symbol value s8 is not b, the process proceeds to step S26. On the other hand, if it is determined in step S24 that the symbol value s8 is b, the record search control means 55 adds record 3 to the table for storing the search results, and records the record identification value “B” of record 3 Is set to 1 (step S25).

次に、レコード検索制御手段55は、レコードiに1を加え(ステップS26)、レコードiがレコード数Nよりも大きいかを判定する(ステップS27)。   Next, the record search control means 55 adds 1 to the record i (step S26), and determines whether the record i is larger than the record number N (step S27).

この時点では、レコード4は、レコード数3よりも大きいため、ステップS29に進む。シンボリック実行手段52は、検索結果のテーブルに格納されたレコード1,3からSQLに記述された検索条件に従ってシンボリック実行処理を行い、パス毎のパス条件を抽出して、出力する(ステップS29)。   At this point, since the record 4 is larger than the number of records 3, the process proceeds to step S29. The symbolic execution means 52 performs symbolic execution processing according to the search conditions described in SQL from the records 1 and 3 stored in the search result table, and extracts and outputs the path conditions for each path (step S29).

シンボリック実行手段52は、検索結果のテーブルに記憶されたレコード1に対して検索条件「s2=b」に応じたシンボリック実行処理を行い、レコード3に対して検索条件「s8=b」に応じたシンボリック実行処理を行う。この結果、シンボル値s2がbである場合とbでない場合、及びシンボル値s8がbである場合とbでない場合の4つの組み合わせのパスが抽出される。なお、シンボル値s5はbでない場合のみ抽出される。   The symbolic execution means 52 performs a symbolic execution process corresponding to the search condition “s2 = b” for the record 1 stored in the search result table, and corresponds to the search condition “s8 = b” for the record 3. Perform symbolic execution processing. As a result, four combinations of paths are extracted when the symbol value s2 is b and not b, and when the symbol value s8 is b and not b. The symbol value s5 is extracted only when it is not b.

この結果、パス1では、シンボル値s2、s5、s8のすべてがbでないパス条件が抽出される。パス2では、シンボル値s2がbであり、シンボル値s5、s8がbでないパス条件が抽出される。パス3では、シンボル値s2、s5がbでなく、シンボル値s8がbであるパス条件が抽出される。パス4では、シンボル値s2、s8がbであり、シンボル値s5がbでないパス条件が抽出される。このようにして抽出されたパス及びパス条件を出力後、本レコード検索処理は終了する。   As a result, in pass 1, a path condition in which all of the symbol values s2, s5, and s8 are not b is extracted. In pass 2, a path condition is extracted in which the symbol value s2 is b and the symbol values s5 and s8 are not b. In pass 3, a path condition in which the symbol values s2 and s5 are not b and the symbol value s8 is b is extracted. In pass 4, a path condition in which the symbol values s2 and s8 are b and the symbol value s5 is not b is extracted. After outputting the path and path condition extracted in this way, the record search process ends.

以上、二つのレコードに同一のレコード識別値が設定され、残りの一つのレコードには異なるレコード識別値が設定された場合のレコード検索処理について説明した。これによれば、同一のレコード識別値に基づき、レコード1,2は同じレコードであると識別される。これにより、レコード1が検索条件を満たしたら、同じレコード識別値が設定されたレコード2は検索対象から除外される。一方、レコード1と異なるレコード識別値が設定されたレコード3は検索対象から除外されない。このようにして、複数のレコードから最大で2個のレコードが抽出されてシンボリック実行処理によるテストケースが生成される場合、複数のレコードには2種類のレコード識別値が設定されればよい。これにより、複数のレコードからテストケースが2件だけ抽出されるように制御できる。以上により、同じレコード識別値が設定された複数のレコードに関して重複したテストケース及びテストデータの生成を防止できる。   As described above, the record search processing in the case where the same record identification value is set in two records and different record identification values are set in the remaining one record has been described. According to this, based on the same record identification value, the records 1 and 2 are identified as the same record. Thereby, when the record 1 satisfies the search condition, the record 2 having the same record identification value is excluded from the search target. On the other hand, the record 3 in which the record identification value different from the record 1 is set is not excluded from the search target. In this manner, when a maximum of two records are extracted from a plurality of records and a test case is generated by the symbolic execution process, two types of record identification values may be set for the plurality of records. Thereby, control can be performed so that only two test cases are extracted from a plurality of records. As described above, it is possible to prevent generation of duplicate test cases and test data for a plurality of records having the same record identification value.

なお、本実施形態に係るレコード検索処理例1では、レコード1をシンボリック実行処理させ、レコード1と同じレコード識別値が設定されたレコード2は検索対象から除外した。しかしながら、本実施形態に係るシンボリック実行装置50は、これに限られず、レコード2をシンボリック実行処理させ、レコード1は検索対象から除外してもよい。   In the record search processing example 1 according to the present embodiment, the record 1 is subjected to symbolic execution processing, and the record 2 in which the same record identification value as the record 1 is set is excluded from the search target. However, the symbolic execution device 50 according to the present embodiment is not limited to this, and the record 2 may be subjected to symbolic execution processing, and the record 1 may be excluded from search targets.

[レコード更新処理]
次に、DBスタブ100のレコードの更新処理について、図18及び図19を参照しながら説明する。図18は、一実施形態にかかるレコード更新処理の一例を示したフローチャートである。図19は、一実施形態にかかるレコード更新処理の結果の一例を示す。なお、DBスタブ100の各レコードには、図19の左表に示されるシンボル値及びレコード識別値が設定されている。
[Record update processing]
Next, the record update processing of the DB stub 100 will be described with reference to FIGS. FIG. 18 is a flowchart illustrating an example of a record update process according to an embodiment. FIG. 19 shows an example of the result of the record update process according to the embodiment. Note that the symbol values and record identification values shown in the left table of FIG. 19 are set in each record of the DB stub 100.

レコード更新制御手段56は、SQLで記述された検索条件に従いレコード更新処理を制御する。その際、レコード更新制御手段56は、レコード識別値に基づきレコードの更新処理を制御する。図18のレコード更新処理のステップS21〜S29は、図15にて説明したレコード検索処理のステップS21〜S29と同一処理であり、レコード検索制御手段55により実行される。   The record update control means 56 controls record update processing according to the search conditions described in SQL. At that time, the record update control means 56 controls a record update process based on the record identification value. Steps S21 to S29 of the record update process in FIG. 18 are the same processes as steps S21 to S29 of the record search process described with reference to FIG. 15 and are executed by the record search control means 55.

図18のレコード更新処理が開始されると、レコード更新制御手段56は、SQLの検索式を解析し、検索条件を取得する(ステップS30)。以下の処理では、図19に示されるようにSQLの検索式に基づき、フィールドF2=bの検索条件を満たすレコードが特定され、特定されたレコードのフィールドF1を「B」に更新する処理が実行される。この更新処理は、検索条件を満たすレコードが特定された場合、特定されたレコードを変更する処理の一例である。   When the record update process in FIG. 18 is started, the record update control unit 56 analyzes the SQL search expression and acquires the search condition (step S30). In the following processing, as shown in FIG. 19, a record satisfying the search condition of the field F2 = b is specified based on the SQL search formula, and a process of updating the field F1 of the specified record to “B” is executed. Is done. This update process is an example of a process for changing the specified record when a record satisfying the search condition is specified.

次に、レコード更新制御手段56は、レコード検索制御手段55にステップS21〜S29の処理を実行させる。レコード検索制御手段55は、ステップS21〜S29の順に各レコードを検索する。その結果、初めにレコード1が抽出され、その際にレコード識別値「A」のフラグに1が設定される。これにより、レコード2,3は検索対象から除外される。   Next, the record update control unit 56 causes the record search control unit 55 to execute the processes of steps S21 to S29. The record search control means 55 searches each record in the order of steps S21 to S29. As a result, first, record 1 is extracted, and 1 is set to the flag of record identification value “A”. Thereby, the records 2 and 3 are excluded from search targets.

次に、レコード更新制御手段56は、抽出されたレコード1をシンボリック実行処理させた結果により得られるパスに基づき、検索条件を満たすレコードを特定する(ステップS32)。   Next, the record update control means 56 specifies a record that satisfies the search condition based on the path obtained from the result of the symbolic execution processing of the extracted record 1 (step S32).

図19では、抽出されたレコード1をシンボリック実行処理させた結果により得られるパス1,2のパス条件が示されている。抽出されたレコード1をシンボリック実行処理させた結果、パス1のシンボル値s2、s5、s8がbでない場合と、パス2のシンボル値s2がbであり、シンボル値s5、s8がbでない場合が抽出される。このうち、パス2のパス条件が検索条件F2=bを満たす。よって、パス2に基づき検索条件を満たすレコード1が特定される。   FIG. 19 shows the path conditions for paths 1 and 2 obtained as a result of the symbolic execution processing of the extracted record 1. As a result of performing symbolic execution processing on the extracted record 1, there are cases where the symbol values s2, s5, and s8 of pass 1 are not b, and the symbol values s2 of pass 2 are b, and the symbol values s5 and s8 are not b. Extracted. Among these, the path condition of the path 2 satisfies the search condition F2 = b. Therefore, the record 1 satisfying the search condition based on the path 2 is specified.

次に、レコード更新制御手段56は、特定されたレコード1に対してSQLに記述されたフィールドF1を「B」に更新する処理を実行し(ステップS34)、本更新処理を終了する。   Next, the record update control means 56 executes a process for updating the field F1 described in the SQL to “B” for the identified record 1 (step S34), and ends this update process.

この結果、図19の右下の表に示されるように、レコード1のフィールドF1がBに更新される。以上に説明したレコード更新処理によれば、レコード識別値に基づいてレコードの更新を制御することができる。   As a result, the field F1 of the record 1 is updated to B as shown in the lower right table of FIG. According to the record update process described above, the record update can be controlled based on the record identification value.

[レコード削除処理]
次に、DBスタブ100のレコードの削除処理について、図20及び図21を参照しながら説明する。図20は、一実施形態にかかるレコード削除処理の一例を示したフローチャートである。図21は、一実施形態にかかるレコード削除処理の結果の一例を示す。なお、DBスタブ100各レコードには、図21の左表に示されるシンボル値及びレコード識別値が設定されている。
[Record deletion processing]
Next, the record deletion process of the DB stub 100 will be described with reference to FIGS. 20 and 21. FIG. FIG. 20 is a flowchart illustrating an example of a record deletion process according to an embodiment. FIG. 21 shows an example of the result of the record deletion process according to one embodiment. Note that the symbol value and record identification value shown in the left table of FIG. 21 are set in each record of the DB stub 100.

レコード削除制御手段57は、SQLで記述された検索条件に従いレコード削除処理を制御する。その際、レコード削除制御手段57は、レコード識別値に基づきレコードの削除処理を制御する。図20のレコード更新処理のステップS21〜S29は、図15にて説明したレコード検索処理のステップS21〜S29と同一処理であり、レコード検索制御手段55により実行される。   The record deletion control means 57 controls the record deletion process in accordance with the search conditions described in SQL. At that time, the record deletion control means 57 controls the record deletion processing based on the record identification value. Steps S21 to S29 of the record update process in FIG. 20 are the same processes as steps S21 to S29 of the record search process described with reference to FIG. 15 and are executed by the record search control means 55.

図20のレコード削除処理が開始されると、レコード削除制御手段57は、SQLの検索式を解析し、検索条件を取得する(ステップS40)。以下の処理では、図21に示されるようにSQLの検索式に基づき、フィールドF2=bの検索条件を満たすレコードが特定され、特定されたレコードを削除する処理が実行される。この削除処理は、検索条件を満たすレコードが特定された場合、特定されたレコードを変更する処理の一例である。   When the record deletion process of FIG. 20 is started, the record deletion control means 57 analyzes the SQL search expression and acquires the search condition (step S40). In the following process, as shown in FIG. 21, a record that satisfies the search condition of the field F2 = b is specified based on the SQL search formula, and a process of deleting the specified record is executed. This deletion process is an example of a process for changing the specified record when a record satisfying the search condition is specified.

次に、レコード削除制御手段57は、レコード検索制御手段55にステップS21〜S29の処理を実行させる。レコード検索制御手段55は、ステップS21〜S29の順に各レコードを検索する。その結果、初めにレコード1が抽出され、その際にレコード識別値「A」のフラグに1が設定される。これにより、レコード2,3は検索対象から除外される。   Next, the record deletion control unit 57 causes the record search control unit 55 to execute the processes of steps S21 to S29. The record search control means 55 searches each record in the order of steps S21 to S29. As a result, first, record 1 is extracted, and 1 is set to the flag of record identification value “A”. Thereby, the records 2 and 3 are excluded from search targets.

次に、レコード削除制御手段57は、抽出されたパス及びパス条件に基づきフィールドF2=bの検索条件を満たすレコードを特定する。(ステップS42)。   Next, the record deletion control means 57 specifies a record that satisfies the search condition of the field F2 = b based on the extracted path and path condition. (Step S42).

図21では、抽出されたレコード1をシンボリック実行処理させた結果により得られるパス1,2のパス条件が示されている。抽出されたレコード1をシンボリック実行処理させた結果、パス1のシンボル値s2、s5、s8がbでない場合と、パス2のシンボル値s2がbであり、シンボル値s5、s8がbでない場合が抽出される。このうち、パス2のパス条件が検索条件F2=bを満たす。よって、パス2に基づき検索条件を満たすレコード1が特定される。   FIG. 21 shows the path conditions of paths 1 and 2 obtained as a result of performing the symbolic execution process on the extracted record 1. As a result of performing symbolic execution processing on the extracted record 1, there are cases where the symbol values s2, s5, and s8 of pass 1 are not b, and the symbol values s2 of pass 2 are b, and the symbol values s5 and s8 are not b. Extracted. Among these, the path condition of the path 2 satisfies the search condition F2 = b. Therefore, the record 1 satisfying the search condition based on the path 2 is specified.

次に、レコード削除制御手段57は、特定されたレコード1に対してSQLに記述されたレコードの削除処理を実行し(ステップS44)、本削除処理を終了する。   Next, the record deletion control means 57 executes a record deletion process described in SQL on the specified record 1 (step S44), and ends this deletion process.

この結果、図21の右下の表に示されるように、レコード1が削除される。以上に説明したレコード削除処理によれば、レコード識別値に基づいてレコードの削除を制御することができる。   As a result, record 1 is deleted as shown in the lower right table of FIG. According to the record deletion process described above, deletion of a record can be controlled based on the record identification value.

[レコード追加処理]
次に、DBスタブ100のレコードの追加処理について、図22及び図23を参照しながら説明する。図22は、一実施形態にかかるレコード追加処理の一例を示したフローチャートである。図23は、一実施形態にかかるレコード追加処理の結果の一例を示す。なお、DBスタブ100の各レコードには、図23の左表に示されるシンボル値及びレコード識別値が設定されている。
[Record addition processing]
Next, the record addition process of the DB stub 100 will be described with reference to FIGS. FIG. 22 is a flowchart illustrating an example of a record addition process according to an embodiment. FIG. 23 shows an example of the result of the record addition process according to an embodiment. Note that the symbol value and record identification value shown in the left table of FIG. 23 are set in each record of the DB stub 100.

レコード追加制御手段58は、SQLで記述された更新値に従いレコード追加処理を制御する。その際、レコード追加制御手段58は、レコード識別値に基づきレコードの追加処理を制御する。図22のレコード更新処理のステップS21〜S29は、図15にて説明したレコード検索処理のステップS21〜S29と同様の処理であり、レコード検索制御手段55により実行される。ただし、本実施形態では、等号の条件に従いレコードを検索する。   The record addition control means 58 controls the record addition process according to the update value described in SQL. At that time, the record addition control means 58 controls record addition processing based on the record identification value. Steps S21 to S29 of the record update process in FIG. 22 are the same processes as steps S21 to S29 of the record search process described with reference to FIG. 15 and are executed by the record search control means 55. However, in this embodiment, a record is searched according to the condition of the equal sign.

図22のレコード追加処理が開始されると、レコード追加制御手段58は、SQLの検索式を解析し、追加するレコードの更新値を取得する(ステップS50)。以下の処理では、図23に示されるようにSQLの検索式に基づき、フィールドF1、F2,F3の更新値がa、b、cのレコードを追加する処理が実行される。この追加処理は、検索条件を満たすレコードが特定された場合、新たなレコードを追加する処理の一例である。本実施形態に係る検索条件については、後述される。   When the record addition process of FIG. 22 is started, the record addition control means 58 analyzes the SQL search expression and acquires the update value of the record to be added (step S50). In the following process, as shown in FIG. 23, a process of adding records with update values a, b, and c in the fields F1, F2, and F3 is executed based on the SQL search expression. This addition process is an example of a process for adding a new record when a record satisfying the search condition is specified. Search conditions according to this embodiment will be described later.

レコード追加制御手段58は、プライマリキーが設定されたフィールドF1に対して、更新値との一意性制約に関する等号の条件を生成する(ステップS52)。ここで、一意性制約とはデータを追加や更新する際の制約の一つで、プライマリキーが設定されたフィールドFの値が一意であること、つまり、プライマリキーが設定された各レコードのフィールド値に同一値がないことを要求する。   The record addition control means 58 generates an equal sign condition related to the uniqueness constraint with the update value for the field F1 in which the primary key is set (step S52). Here, the unique constraint is one of constraints when adding or updating data, and the value of the field F in which the primary key is set is unique, that is, the field of each record in which the primary key is set. Require that values do not have the same value.

本実施形態では、一意性制約に関する等号の条件として、プライマリキーが設定された各レコードのフィールドF1の値と、フィールドF1に追加する更新値「a」との間で等号の条件F1=aが生成される。   In the present embodiment, as an equal sign condition regarding the uniqueness constraint, an equal sign condition F1 = between the value of the field F1 of each record in which the primary key is set and the update value “a” to be added to the field F1 = a is generated.

次に、レコード追加制御手段58は、レコード検索制御手段55にステップS21〜S29の処理を実行させる。レコード検索制御手段55は、ステップS21〜S29を実行し、等号の条件F1=aを満たすレコードの検索を行う。これにより、レコード検索制御手段55は、等号の条件F1=aを満たすレコードを抽出する。その結果、初めにレコード1が抽出され、その際にレコード識別値「A」のフラグに1が設定される。これにより、レコード2,3は検索対象から除外される。   Next, the record addition control means 58 causes the record search control means 55 to execute the processes of steps S21 to S29. The record search control means 55 executes steps S21 to S29 to search for a record satisfying the equal sign condition F1 = a. Thereby, the record search control means 55 extracts a record satisfying the equal sign condition F1 = a. As a result, first, record 1 is extracted, and 1 is set to the flag of record identification value “A”. Thereby, the records 2 and 3 are excluded from search targets.

次に、レコード追加制御手段58は、抽出されたパス及びパス条件に基づき、等号の条件を満たさないレコードを特定する(ステップS54)。つまり、等号の条件を満たすと一意性制約に反することになるため、本実施形態では、等号の条件を満たさない、つまりF1≠aとなるレコードが特定される。また、本実施形態に係る検索条件は、抽出されたレコードのうちプライマリキーが設定されたフィールド値が等号の条件を満たさないことであり、本実施形態では抽出されたレコード1のフィールドF1≠aである。   Next, the record addition control means 58 identifies a record that does not satisfy the equal sign condition based on the extracted path and path condition (step S54). That is, if the condition of the equal sign is satisfied, the uniqueness constraint is violated. Therefore, in the present embodiment, a record that does not satisfy the condition of the equal sign, that is, F1 ≠ a is specified. The search condition according to the present embodiment is that the field value in which the primary key is set among the extracted records does not satisfy the condition of the equal sign. In the present embodiment, the field F1 of the extracted record 1 ≠ a.

図23では、抽出されたレコード1をシンボリック実行処理させた結果により得られるパス1,2のパス条件が示されている。抽出されたレコード1をシンボリック実行処理させた結果、パス1のシンボル値s1、s4、s7がaでない場合と、パス2のシンボル値s1がaであり、シンボル値s4、s7がaでない場合が抽出される。   FIG. 23 shows the path conditions of paths 1 and 2 obtained as a result of symbolic execution processing of the extracted record 1. As a result of symbolic execution processing of the extracted record 1, there are cases where the symbol values s1, s4, and s7 of pass 1 are not a, and the symbol values s1 of pass 2 are a, and the symbol values s4 and s7 are not a. Extracted.

このうち、パス1のパス条件は、検索条件F1≠aを満たし、一意性制約に反しない。よって、レコード追加制御手段58は、ステップS56にて、レコード1は一意性制約に反しないレコードであると判定し、更新値a、b、cの新たなレコードを追加し(ステップS58)、本追加処理を終了する。これにより、図23の右下の表に示されるようにレコード4が追加される。   Among these, the path condition of the path 1 satisfies the search condition F1 ≠ a and does not violate the uniqueness constraint. Therefore, the record addition control means 58 determines in step S56 that the record 1 is a record that does not violate the uniqueness constraint, adds a new record with the updated values a, b, and c (step S58). The addition process ends. Thereby, the record 4 is added as shown in the lower right table of FIG.

なお、レコード追加制御手段58は、ステップS56にて、抽出されたレコードが一意性制約に反するレコードであると判定した場合、新たなレコードを追加せずに(ステップS60)、本追加処理を終了する。   If the record addition control unit 58 determines in step S56 that the extracted record is a record that violates the uniqueness constraint, the record addition control unit 58 ends the addition process without adding a new record (step S60). To do.

以上に説明したレコード追加処理によれば、レコード識別値に基づいてレコードの追加を制御することができる。   According to the record addition process described above, the addition of records can be controlled based on the record identification value.

なお、レコード更新制御手段56、レコード削除制御手段57及びレコード追加制御手段58は、抽出されたレコードをシンボリック実行処理させた結果により得られるパスに基づき、検索条件を満たすレコードが特定された場合、特定されたレコードを変更する又は新たなレコードを追加するレコード変更制御手段の一例である。   Note that the record update control unit 56, the record deletion control unit 57, and the record addition control unit 58, when a record that satisfies the search condition is specified based on the path obtained by the result of performing the symbolic execution processing on the extracted record, It is an example of a record change control means for changing a specified record or adding a new record.

以上、本実施形態にかかるシンボリック実行装置50について説明した。これによれば、DBスタブのシンボリック実行処理において、各レコードを識別するレコード識別値に基づき重複のないテストケースを抽出することができる。   Heretofore, the symbolic execution device 50 according to the present embodiment has been described. According to this, in the DB stub symbolic execution process, it is possible to extract test cases without duplication based on the record identification value for identifying each record.

(ハードウェア構成例)
最後に、シンボリック実行装置50のハードウェア構成例について簡単に説明する。図24は、本実施形態にかかるシンボリック実行装置50のハードウェア構成例を示す図である。
(Hardware configuration example)
Finally, a hardware configuration example of the symbolic execution device 50 will be briefly described. FIG. 24 is a diagram illustrating a hardware configuration example of the symbolic execution device 50 according to the present embodiment.

シンボリック実行装置50は、入力装置101、表示装置102、外部I/F103、RAM(Random Access Memory)104、ROM(Read Only Memory)105、CPU(Central Processing Unit)106、通信I/F107及びHDD(Hard Disk Drive)108を備え、それぞれがバスBで相互に接続されている。   The symbolic execution device 50 includes an input device 101, a display device 102, an external I / F 103, a RAM (Random Access Memory) 104, a ROM (Read Only Memory) 105, a CPU (Central Processing Unit) 106, a communication I / F 107, and an HDD ( Hard Disk Drive) 108 are connected to each other via a bus B.

入力装置101は、キーボードやマウスなどを含み、シンボリック実行装置50に各操作を入力するのに用いられる。表示装置102は、ディスプレイなどを含み、シンボリック実行装置50を使用してDBを利用するプログラムをテストするテスト作業者にテストケース及びテストデータ等のデータを表示する。   The input device 101 includes a keyboard and a mouse and is used to input each operation to the symbolic execution device 50. The display device 102 includes a display or the like, and displays data such as test cases and test data to a test worker who tests a program using the DB using the symbolic execution device 50.

外部I/F103は、外部装置とのインタフェースである。外部装置には、記録媒体103aなどがある。シンボリック実行装置50は、外部I/F103を介して、記録媒体103aの読み取り及び/又は書き込みを行うことができる。記録媒体103aには、CD(Compact Disk)、及びDVD(Digital Versatile Disk)、ならびに、SDメモリカード(SD Memory card)やUSBメモリ(Universal Serial Bus memory)等がある。   The external I / F 103 is an interface with an external device. The external device includes a recording medium 103a. The symbolic execution device 50 can read and / or write to the recording medium 103 a via the external I / F 103. The recording medium 103a includes a CD (Compact Disk), a DVD (Digital Versatile Disk), an SD memory card (SD Memory card), a USB memory (Universal Serial Bus memory), and the like.

ROM105は、不揮発性の半導体メモリ(記憶装置)であり、各種のプログラムやデータが格納されている。RAM104は、プログラムやデータを一時保持する揮発性の半導体メモリ(記憶装置)である。   The ROM 105 is a nonvolatile semiconductor memory (storage device) and stores various programs and data. The RAM 104 is a volatile semiconductor memory (storage device) that temporarily stores programs and data.

HDD108は、プログラムやデータを格納している不揮発性の記憶装置である。格納されるプログラムやデータには、各種機能を提供するアプリケーションソフトウェアなどがある。また、HDD108は、上記実施形態のシンボリック実行処理やレコードの検索処理等を行うためにCPU106により実行されるJavaプログラムやAPI(ライブラリ)を格納してもよい。   The HDD 108 is a non-volatile storage device that stores programs and data. The stored programs and data include application software that provides various functions. Further, the HDD 108 may store a Java program or API (library) executed by the CPU 106 in order to perform the symbolic execution process or the record search process of the above embodiment.

CPU106は、上記記憶装置(例えば「HDD」や「ROM」など)から、プログラムやデータをRAM上に読み出し、装置全体の制御や搭載機能を実現する演算装置である。シンボリック実行処理やレコードの検索処理等は、HDD108等にインストールされたプログラムをCPU106に実行させることにより実現される。   The CPU 106 is an arithmetic device that reads programs and data from the storage device (for example, “HDD”, “ROM”, etc.) onto the RAM, and realizes overall control and mounting functions of the device. Symbolic execution processing, record search processing, and the like are realized by causing the CPU 106 to execute a program installed in the HDD 108 or the like.

通信I/F107は、ネットワークを介して他の機器と接続するためのインタフェースである。   The communication I / F 107 is an interface for connecting to other devices via a network.

以上、シンボリック実行プログラム、シンボリック実行方法及びシンボリック実行装置を上記実施形態により説明したが、本発明は上記実施形態に限定されるものではなく、本発明の範囲内で種々の変形及び改良が可能である。   The symbolic execution program, the symbolic execution method, and the symbolic execution device have been described in the above embodiment. However, the present invention is not limited to the above embodiment, and various modifications and improvements can be made within the scope of the present invention. is there.

以上の説明に関し、更に以下の項を開示する。
(付記1)
シンボル値を項目の値として含むレコード群のうち、前記項目に対する同一の検索条件を満たす複数のレコードに同一の識別値を設定し、
前記レコード群のうち同一の検索条件を満たし、かつ同一の識別値が設定された複数のレコードのうちの一つをシンボリック実行処理の対象として抽出し、
前記抽出されたレコードの前記項目の前記シンボル値に対し、前記検索条件に従ってシンボリック処理を実行する、
処理をコンピュータに実行させるためのシンボリック実行プログラム。
(付記2)
シンボリック実行処理させた結果により得られるパスに基づき、前記検索条件を満たすレコードを特定し、特定されたレコードを変更する、又は新たなレコードを追加する処理を更に含む、
付記1に記載のシンボリック実行プログラム。
(付記3)
シンボル値を項目の値として含むレコード群のうち、前記項目に対する同一の検索条件を満たす複数のレコードに同一の識別値を設定し、
前記レコード群のうち同一の検索条件を満たし、かつ同一の識別値が設定された複数のレコードのうちの一つをシンボリック実行処理の対象として抽出し、
前記抽出されたレコードの前記項目の前記シンボル値に対し、前記検索条件に従ってシンボリック処理を実行する、
処理をコンピュータが実行するシンボリック実行方法。
(付記4)
シンボリック実行処理させた結果により得られるパスに基づき、前記検索条件を満たすレコードが特定された場合、特定されたレコードを変更する又は新たなレコードを追加する処理を更に含む、
付記3に記載のシンボリック実行方法。
(付記5)
シンボル値を項目の値として含むレコード群のうち、前記項目に対する同一の検索条件を満たす複数のレコードに同一の識別値を設定するレコード識別設定手段と、
前記レコード群を検索し、同一の検索条件を満たし、かつ同一の識別値が設定された複数のレコードのうちの一つを抽出するレコード検索制御手段と、
前記抽出されたレコードの前記項目の前記シンボル値に対し、前記検索条件に従ってシンボリック処理を実行するシンボリック実行手段と、
を有するシンボリック実行装置。
(付記6)
シンボリック実行処理させた結果により得られるパスに基づき、前記検索条件を満たすレコードが特定された場合、特定されたレコードを変更する又は新たなレコードを追加するレコード変更制御手段を更に有する、
付記5に記載のシンボリック実行装置。
Regarding the above description, the following items are further disclosed.
(Appendix 1)
Among the record group that includes the symbol value as the item value, the same identification value is set for a plurality of records that satisfy the same search condition for the item,
One of a plurality of records that satisfy the same search condition and set the same identification value in the record group is extracted as a symbolic execution process target,
Performing symbolic processing on the symbol value of the item of the extracted record according to the search condition;
A symbolic execution program that causes a computer to execute processing.
(Appendix 2)
Based on the path obtained from the result of the symbolic execution process, the record that satisfies the search condition is specified, the specified record is changed, or a process of adding a new record is further included.
The symbolic execution program according to attachment 1.
(Appendix 3)
Among the record group that includes the symbol value as the item value, the same identification value is set for a plurality of records that satisfy the same search condition for the item,
One of a plurality of records that satisfy the same search condition and set the same identification value in the record group is extracted as a symbolic execution process target,
Performing symbolic processing on the symbol value of the item of the extracted record according to the search condition;
A symbolic execution method in which processing is executed by a computer.
(Appendix 4)
When a record that satisfies the search condition is specified based on a path obtained as a result of the symbolic execution process, the process further includes a process of changing the specified record or adding a new record.
The symbolic execution method according to attachment 3.
(Appendix 5)
Among record groups including symbol values as item values, record identification setting means for setting the same identification value to a plurality of records that satisfy the same search condition for the item;
A record search control means for searching the record group, extracting one of a plurality of records that satisfy the same search condition and set the same identification value;
Symbolic execution means for executing symbolic processing in accordance with the search condition for the symbol value of the item of the extracted record;
A symbolic execution device.
(Appendix 6)
Based on the path obtained from the result of the symbolic execution process, when a record satisfying the search condition is specified, the record change control means for changing the specified record or adding a new record is further included.
The symbolic execution device according to appendix 5.

50:シンボリック実行装置
51:シンボル値設定手段
52:シンボリック実行手段
53:DB接続スタブ手段
54:レコード識別設定手段
55:レコード検索制御手段
56:レコード更新制御手段
57:レコード削除制御手段
58:レコード追加制御手段
60:テストデータ生成装置
61:テストデータ生成手段
100:DBスタブ
101:レコード
102:レコード識別値
200:JDBCスタブ
F1、F2、F3:フィールド
s1〜s9:シンボル値
50: Symbolic execution device 51: Symbol value setting means 52: Symbolic execution means 53: DB connection stub means 54: Record identification setting means 55: Record search control means 56: Record update control means 57: Record deletion control means 58: Record addition Control means 60: Test data generating device 61: Test data generating means 100: DB stub 101: Record 102: Record identification value 200: JDBC stub F1, F2, F3: Field s1 to s9: Symbol value

Claims (4)

シンボル値を項目の値として含むレコード群のうち、前記項目に対する同一の検索条件を満たす複数のレコードに同一の識別値を設定し、
前記レコード群のうち同一の検索条件を満たし、かつ同一の識別値が設定された複数のレコードのうちの一つをシンボリック実行処理の対象として抽出し、
前記抽出されたレコードの前記項目の前記シンボル値に対し、前記検索条件に従ってシンボリック処理を実行する、
処理をコンピュータに実行させるためのシンボリック実行プログラム。
Among the record group that includes the symbol value as the item value, the same identification value is set for a plurality of records that satisfy the same search condition for the item,
One of a plurality of records that satisfy the same search condition and set the same identification value in the record group is extracted as a symbolic execution process target,
Performing symbolic processing on the symbol value of the item of the extracted record according to the search condition;
A symbolic execution program that causes a computer to execute processing.
シンボリック実行処理させた結果により得られるパスに基づき、前記検索条件を満たすレコードが特定された場合、特定されたレコードを変更する又は新たなレコードを追加する処理を更に含む、
請求項1に記載のシンボリック実行プログラム。
When a record that satisfies the search condition is specified based on a path obtained as a result of the symbolic execution process, the process further includes a process of changing the specified record or adding a new record.
The symbolic execution program according to claim 1.
シンボル値を項目の値として含むレコード群のうち、前記項目に対する同一の検索条件を満たす複数のレコードに同一の識別値を設定し、
前記レコード群のうち同一の検索条件を満たし、かつ同一の識別値が設定された複数のレコードのうちの一つをシンボリック実行処理の対象として抽出し、
前記抽出されたレコードの前記項目の前記シンボル値に対し、前記検索条件に従ってシンボリック処理を実行する、
処理をコンピュータが実行するシンボリック実行方法。
Among the record group that includes the symbol value as the item value, the same identification value is set for a plurality of records that satisfy the same search condition for the item,
One of a plurality of records that satisfy the same search condition and set the same identification value in the record group is extracted as a symbolic execution process target,
Performing symbolic processing on the symbol value of the item of the extracted record according to the search condition;
A symbolic execution method in which processing is executed by a computer.
シンボル値を項目の値として含むレコード群のうち、前記項目に対する同一の検索条件を満たす複数のレコードに同一の識別値を設定するレコード識別設定手段と、
前記レコード群を検索し、同一の検索条件を満たし、かつ同一の識別値が設定された複数のレコードのうちの一つを抽出するレコード検索制御手段と、
前記抽出されたレコードの前記項目の前記シンボル値に対し、前記検索条件に従ってシンボリック処理を実行するシンボリック実行手段と、
を有するシンボリック実行装置。
Among record groups including symbol values as item values, record identification setting means for setting the same identification value to a plurality of records that satisfy the same search condition for the item;
A record search control means for searching the record group, extracting one of a plurality of records that satisfy the same search condition and set the same identification value;
Symbolic execution means for executing symbolic processing in accordance with the search condition for the symbol value of the item of the extracted record;
A symbolic execution device.
JP2014028832A 2014-02-18 2014-02-18 Symbolic execution program, symbolic execution method, and symbolic execution device Expired - Fee Related JP6217440B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014028832A JP6217440B2 (en) 2014-02-18 2014-02-18 Symbolic execution program, symbolic execution method, and symbolic execution device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014028832A JP6217440B2 (en) 2014-02-18 2014-02-18 Symbolic execution program, symbolic execution method, and symbolic execution device

Publications (2)

Publication Number Publication Date
JP2015153323A true JP2015153323A (en) 2015-08-24
JP6217440B2 JP6217440B2 (en) 2017-10-25

Family

ID=53895447

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014028832A Expired - Fee Related JP6217440B2 (en) 2014-02-18 2014-02-18 Symbolic execution program, symbolic execution method, and symbolic execution device

Country Status (1)

Country Link
JP (1) JP6217440B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020510925A (en) * 2017-02-28 2020-04-09 スパロー カンパニー リミテッド Method and apparatus for performing a test using a test case
JP2020126501A (en) * 2019-02-06 2020-08-20 キヤノンマーケティングジャパン株式会社 Program, information processor, and method for processing

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012018675A (en) * 2010-07-07 2012-01-26 Fujitsu Ltd System and method for generating database model for application analysis
WO2012104907A1 (en) * 2011-02-02 2012-08-09 株式会社日立製作所 Test data production method for evaluating execution performance of program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012018675A (en) * 2010-07-07 2012-01-26 Fujitsu Ltd System and method for generating database model for application analysis
WO2012104907A1 (en) * 2011-02-02 2012-08-09 株式会社日立製作所 Test data production method for evaluating execution performance of program

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020510925A (en) * 2017-02-28 2020-04-09 スパロー カンパニー リミテッド Method and apparatus for performing a test using a test case
JP2020126501A (en) * 2019-02-06 2020-08-20 キヤノンマーケティングジャパン株式会社 Program, information processor, and method for processing
JP7319516B2 (en) 2019-02-06 2023-08-02 キヤノンマーケティングジャパン株式会社 Program, information processing device, and control method thereof

Also Published As

Publication number Publication date
JP6217440B2 (en) 2017-10-25

Similar Documents

Publication Publication Date Title
US11755466B1 (en) Systems and methods for testing a software application
EP2784665B1 (en) Program and version control method
CN107122368B (en) Data verification method and device and electronic equipment
US8010962B2 (en) Infrastructure for the automation of the assembly of schema maintenance scripts
US20120005528A1 (en) Data set index record preservation
US10649744B1 (en) Systems and methods for handling renaming of programming constructs in programming environments
US20160124795A1 (en) Evaluation method and apparatus
JP2020119348A (en) Analysis program, analysis method, and analysis device
EP2951680B1 (en) Acquiring identification of an application lifecycle management entity associated with similar code
US20160253157A1 (en) Software refactoring
US10678864B2 (en) Analysis model preparing system, programming apparatus, and analysis model preparing method
JP6217440B2 (en) Symbolic execution program, symbolic execution method, and symbolic execution device
KR101798705B1 (en) Flexible metadata composition
CN117193802A (en) Merge space providing access to multiple instances of application content
KR101534493B1 (en) Source code security weakness detection apparatus and method based on structure conversion
JP6336919B2 (en) Source code review method and system
US9354870B2 (en) Maintaining integrity of output of code generators
JP5578625B2 (en) Program analysis apparatus, program analysis method, and program
JP6870454B2 (en) Analytical equipment, analytical programs and analytical methods
WO2016105354A1 (en) Simulation of a synchronization of records
JP2018169998A (en) Analyzing apparatus, analysis method, and analysis program
US11256602B2 (en) Source code file retrieval
JP5970882B2 (en) Configuration information management device, configuration information management program
JP2018116517A (en) Development support device, development support method, and program
CN114385584A (en) Data writing method and data reading method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20161102

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20170823

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170911

R150 Certificate of patent or registration of utility model

Ref document number: 6217440

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees