JP5523525B2 - Test data generation apparatus, method and program having update access during test path - Google Patents

Test data generation apparatus, method and program having update access during test path Download PDF

Info

Publication number
JP5523525B2
JP5523525B2 JP2012199322A JP2012199322A JP5523525B2 JP 5523525 B2 JP5523525 B2 JP 5523525B2 JP 2012199322 A JP2012199322 A JP 2012199322A JP 2012199322 A JP2012199322 A JP 2012199322A JP 5523525 B2 JP5523525 B2 JP 5523525B2
Authority
JP
Japan
Prior art keywords
test case
query
test
update
group
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2012199322A
Other languages
Japanese (ja)
Other versions
JP2014056305A (en
Inventor
治門 丹野
暁晶 張
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2012199322A priority Critical patent/JP5523525B2/en
Publication of JP2014056305A publication Critical patent/JP2014056305A/en
Application granted granted Critical
Publication of JP5523525B2 publication Critical patent/JP5523525B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、テストパス中に更新アクセスを持つテスト用のデータ生成装置及び方法及びプログラムに係り、特に、DB(データベース)に格納されているデータの読み出し及び更新操作を伴うような機能性テストのためのテストデータを生成する際に、DBの更新を必ず発生される入力値とDB初期状態の組み合わせを生成するための、テストパス中に更新アクセスを持つテスト用のデータ生成装置及び方法及びプログラムに関する。   The present invention relates to a test data generation apparatus, method, and program having an update access during a test path, and more particularly to a functionality test that involves reading and updating operations of data stored in a DB (database). DATA GENERATION DEVICE, METHOD, AND PROGRAM FOR TESTING WITH UPDATE ACCESS DURING TEST PATH, FOR GENERATING A COMBINATION OF INPUT VALUES AND DB INITIAL STATE WHICH IS REQUIRED FOR DB UPDATE About.

データベースに格納されているデータの読み出しの操作を伴うような機能性テストのためのテストデータ生成技術として以下のようなものがある。なお、ここで、テストデータとは、データベースの初期状態(以下、「DB初期状態」と記す)と入力値のペアであり、データベースアプリケーションのテストのため、テスト実施時の各画面の入力フィールドへの入力、データベースに予め入れておくデータセットとして利用する。   There are the following test data generation techniques for functional tests that involve an operation of reading data stored in a database. Here, the test data is a pair of the initial state of the database (hereinafter referred to as “DB initial state”) and the input value. To test the database application, to the input field of each screen at the time of test execution Is used as a data set to be entered in advance in the database.

従来は、テストケースごとに記述された事前条件を入力として、テストケース(DB初期状態を含む)生成する方法(例えば、非特許文献1参照)や、ソフトウェアの設計情報を入力として、テストケース及び、そのテストケースの事前条件を抽出し、テストケース毎にテストケースの事前条件を満たすDB初期状態を生成する方法(例えば、非特許文献2参照)がある。   Conventionally, a method for generating a test case (including an initial DB state) (for example, refer to Non-Patent Document 1) using a precondition described for each test case as an input, and a software design information as an input, There is a method of extracting a precondition of the test case and generating a DB initial state that satisfies the precondition of the test case for each test case (for example, see Non-Patent Document 2).

藤原翔一朗、宗像一樹、片山朝子、前田芳晴、大木憲二、上原忠弘、山本里枝子、smt solverを利用したwebアプリケーション用テストデータの生成、情報処理学会創立50周年記念(第72回)全国大会講演論文集,2010.Shoichiro Fujiwara, Kazuki Munakata, Asako Katayama, Yoshiharu Maeda, Kenji Oki, Tadahiro Uehara, Rieko Yamamoto, generation of web application test using smt solver, 50th anniversary commemoration of IPSJ (72nd) National Conference Proceedings, 2010. 丹野治門、張暁晶、星野隆:"設計モデルを利用したテスト用データベースの自動生成手法",情報処理学会論文誌:ソフトウェア工学特集号、Vol. 53, No.2, pp. 566-577, 2012.Omon Tanno, Akira Zhang, Takashi Hoshino: "Automatic generation of test database using design model", Transactions of Information Processing Society of Japan: Special Issue on Software Engineering, Vol. 53, No.2, pp. 566-577, 2012 .

しかしながら、上記従来の技術は、更新クエリ(UPDATE)クエリは等価である2つのSELECTクエリに変換できるが、2つ以上のSELECTクエリがあると、予定したレコード件数と異なるレコード件数が返却される。また、更新アクセスのあるテストケースは、必ず1テストケースにつき、1グループとする、すなわち、DB初期状態を使いまわさない。これにより、更新アクセスが発生すると、DB初期状態が書き換わってしまい、使いまわすことができなくなる。   However, the above conventional technique can convert an update query (UPDATE) query into two equivalent SELECT queries, but if there are two or more SELECT queries, the number of records different from the planned number of records is returned. In addition, test cases with update access are always in one group per test case, that is, do not use the DB initial state. As a result, when update access occurs, the DB initial state is rewritten and cannot be reused.

また、INSERT、DELETEクエリはそれぞれ等価である1つのSELECTクエリに変換できるが、テストパス上でSELECTクエリの後にINSERTクエリ、UPDATEクエリがあった場合、2つのSELECTクエリが存在することとなり、予定したレコード件数と異なるレコード件数が返却されるという問題がある。   In addition, INSERT and DELETE queries can be converted into one equivalent SELECT query, but if there are INSERT and UPDATE queries after SELECT query on the test path, there will be two SELECT queries, There is a problem that the number of records different from the number of records is returned.

また、同じカラムに対する検索条件の空間に重なりがある場合、上記従来方法を用いると、テストパス上のガード条件(整数算術式、整数比較演算子等の整数制約)で予定したレコード件数と異なるレコード件数が返ってきてしまうという問題がある。また、これらの技術は、1テストケースにつき、1つのDB初期状態を生成するため、高々1回のDB定義(Persons)のSELECTアクセスしか扱えない。従ってテスト実施毎に、DB初期状態の入れ替えの回数が多いという問題がある。例えば、図1に示す入力値定義、DB定義(Persons)があり、処理フロー図から抽出されたテストケースにおいて、SELECT文として「SELECT * FROM Persons WHERE Age<= maxAge AND Age>= minAge」が与えられた場合には、1つのSELECT文が使われている場合は、同図右に示すような検索結果レコード件数が2件となるテストデータを得ることができる。しかし、同一テーブル(Persons)に対して複数回の参照アクセス、条件分岐がある場合には、対応できないという問題がある。   Also, if the search condition space for the same column overlaps, using the above conventional method, records that differ from the number of records planned under the guard condition (integer arithmetic expression, integer comparison operator, etc.) on the test path There is a problem that the number of cases is returned. Moreover, since these technologies generate one DB initial state per test case, they can handle only SELECT access of DB definition (Persons) at most once. Therefore, there is a problem that the number of times of initial DB replacement is large every time the test is performed. For example, there are the input value definition and DB definition (Persons) shown in Fig. 1, and "SELECT * FROM Persons WHERE Age <= maxAge AND Age> = minAge" is given as the SELECT statement in the test case extracted from the processing flow diagram. If one SELECT statement is used, test data with two search result records can be obtained as shown on the right side of the figure. However, if there are multiple reference accesses and conditional branches for the same table (Persons), there is a problem that it cannot be handled.

本発明は、上記の点に鑑みなされたもので、従来技術で扱っているSELECTクエリに加えて、UPDATEクエリ、DELETEクエリも扱うテストのためのテストデータを生成することが可能なテストパス中に更新アクセスを持つテスト用のデータ生成装置及び方法及びプログラムを提供することを目的とする。   The present invention has been made in view of the above points, and in a test path capable of generating test data for a test that handles an UPDATE query and a DELETE query in addition to the SELECT query handled in the prior art. An object of the present invention is to provide a test data generation apparatus, method and program having update access.

上記の課題を解決するため、本発明(請求項1)は、データベース(DB)に対して、テストパス中に参照アクセスに加え、更新アクセスを持つテストデータを生成するテストパス中に更新アクセスを持つテスト用のデータ生成装置であって、
入力された設計情報からテストケースを抽出し、テストケース記憶手段に格納するテストケース抽出手段と、
前記テストケース記憶手段からテストケースを読み込み、テストパスで最後に出現するクエリの種類が更新クエリである場合は、該クエリの種類に応じた条件に基づいて該更新クエリを参照クエリに変換し、該テストケース記憶手段に格納する更新系クエリ変換手段と、
前記テストケース記憶手段から前記テストケースを読み出し、同じDB初期状態を共有可能なテストケースを、同じグループに属するテストケースの各SELECT文が抽出するレコードに重複がないようにテストケースグループとしてグルーピングし、テストケースグループ集合記憶手段に格納するテストケースグルーピング手段と、
前記テストケースグループ集合記憶手段から前記テストケースグループを読み出し、該テストケースグループの各テストケースの情報を前記テストケース記憶手段から取得して、該テストケースの入力変数の制約式を生成し、該テストケースが含まれるテストケースグループ集合記憶手段の制約集合に格納する入力変数制約式生成手段と、
前記テストケースグループ集合記憶手段から前記テストケースグループを取得し、該テストケースグループに含まれるテストケースのDBテーブル変数を抽出し、該DBテーブル変数のレコード件数を決定し、該DBテーブル変数の参照クエリ群へSELECTクエリを追加する処理を、各クエリの検索結果レコード件数の合計数分繰り返し、該テストケースグループ集合記憶手段のDBテーブル変数の参照クエリ群に追加するレコード配置決定手段と、
前記テストケースグループ集合記憶手段の前記テストケースグループに含まれるテストケースのDBフィールド変数に関する制約式を生成し、テストケースグループ集合記憶手段の制約集合に追加するDB変制約式生成手段と、
前記テストケースグループ集合記憶手段に格納された前記制約式を任意の解法を用いて解き、テストケース毎の入力値と、該テストケースを共有するDB初期状態をテストデータとして出力する制約式解法手段と、を有する。
In order to solve the above problems, the present invention (Claim 1) provides a database (DB) with update access during a test path for generating test data having update access in addition to reference access during the test path. A test data generation device having
A test case extraction means for extracting a test case from the inputted design information and storing it in the test case storage means;
When the test case is read from the test case storage unit and the last query type in the test path is an update query, the update query is converted into a reference query based on a condition according to the query type, Update query conversion means for storing in the test case storage means;
The test cases are read from the test case storage means, and test cases that can share the same initial DB state are grouped as test case groups so that there is no duplication in the records extracted by each SELECT statement of test cases belonging to the same group. , Test case grouping means for storing in the test case group set storage means,
Reading the test case group from the test case group set storage means, obtaining information of each test case of the test case group from the test case storage means, generating a constraint equation of the input variables of the test case, An input variable constraint expression generating means for storing in a constraint set of a test case group set storage means including a test case;
Obtain the test case group from the test case group set storage means, extract the DB table variable of the test case included in the test case group, determine the number of records of the DB table variable, and refer to the DB table variable A process for adding a SELECT query to a query group is repeated for the total number of search result records of each query, and a record arrangement determining unit that is added to a reference query group of DB table variables of the test case group set storage unit;
Said generating the constraint equation relating DB field variable test cases included in the test case groups, DB variable constraint expression generating means for adding the constraint set of the test case groups set storage unit of the test case group set storage unit,
Constraint equation solving means that solves the constraint expression stored in the test case group set storage means using an arbitrary solution and outputs the input value for each test case and the DB initial state sharing the test case as test data And having.

また、本発明(請求項2)は、前記更新系クエリ変換手段において、
前記更新クエリが、INSERTクエリである場合は、レコード挿入後の一意性を保証するSELECTクエリを生成する手段と、
前記更新クエリが、UPDATEクエリである場合は、更新対象レコードの存在を保証し、更新後にユニークキーの重複が発生しないSELECTクエリを生成する手段と、
前記更新クエリが、DELETEクエリである場合は、削除対象の存在を保証するSELECTクエリを生成する手段と、を含む。
The present invention (Claim 2) provides the update query conversion means,
When the update query is an INSERT query, means for generating a SELECT query that guarantees uniqueness after inserting a record;
When the update query is an UPDATE query, means for generating a SELECT query that guarantees the presence of the update target record and does not cause duplicate unique keys after the update;
When the update query is a DELETE query, it includes means for generating a SELECT query that guarantees the existence of the deletion target.

また、本発明(請求項3)は、前記テストケースグルーピング手段において、
グルーピング対象のテストケースに更新クエリを含む場合には、該テストケースを更新クエリテストケース集合へ追加し、含まない場合は参照クエリテストケース集合に追加する手段と、
前記参照クエリテストケース集合については、入力されたグルーピングパラメータに基づいてグルーピングし、該更新クエリテストケース集合については、1つのテストケースについて1テストケースグループとする手段と、
前記テストケースグループから任意に1つのテストケースを選択し、選択されたテストケースのDBテーブル変数を、前記テストケースグループのDBテーブル変数に代入する手段を含む。
Further, the present invention (Claim 3) is the test case grouping means,
When the test case to be grouped includes an update query, a method for adding the test case to the update query test case set, and when not including the update query to the reference query test case set,
The reference query test case set is grouped based on an input grouping parameter, and the updated query test case set is a test case group for one test case;
Means for arbitrarily selecting one test case from the test case group and substituting the DB table variable of the selected test case into the DB table variable of the test case group;

また、本発明(請求項4)は、前記DB変制約式生成手段において、
レコード配置表記憶手段のレコード配置表を参照して、前記DBレコード変数のSELECT文が参照するWHERE句の条件に合うレコードを生成し、参照しないレコードはWHERE句の条件に一致しないようにレコードを生成する手段を含む。
Further, the present invention (Claim 4), in the DB variable constraint expression generation means,
With reference to records arrangement table records arrangement table storage means, wherein the generating a record that meets the conditions of the WHERE clause SELECT statement references the DB record variable, refers to not record the record so as not to coincide with the condition in the WHERE clause Means for generating

上記のように本発明によれば、必ず1件の更新対象のレコードが存在し、かつ、更新後にユニークキーの重複(エラーとなる)が発生しないことを保証する等の条件に基づいて、SELECTクエリに加えて、UPDATEクエリ、DELETEクエリ、UPDATEクエリ、INSERTクエリ等の更新系クエリを参照系クエリ(SELECTクエリ)に変換することにより、確実にDB更新アクセスを行うテストが可能となり、更新系クエリを扱うテストのためのテストデータを生成することができる。   As described above, according to the present invention, it is necessary to select one record based on a condition such as ensuring that there is one record to be updated and that unique key duplication (resulting in an error) does not occur after the update. In addition to queries, by converting update queries, such as UPDATE, DELETE, UPDATE, and INSERT queries, to reference queries (SELECT queries), it is possible to test DB update access reliably, and update queries Test data can be generated for tests that handle.

SELECT文毎に、当該SELECT文が参照するレコードはWHERE句の条件に合うレコードを生成し、参照しないレコードはWHERE句の条件に一致しないようにレコードを生成するため、テストパス上の各参照アクセスで、予定した件数のレコードが過不足なく返却されることを保証し、結果として、直前のSELECT文の検索結果レコード件数に応じて後続するSELECT文の実行を行うテストケース(テストパス)を試験するためのテストデータを構成するDB初期状態を生成することができる。   For each SELECT statement, records referenced by the SELECT statement generate records that meet the conditions of the WHERE clause, and records that are not referenced generate records so that they do not match the conditions of the WHERE clause. As a result, the test case (test path) that executes the subsequent SELECT statement according to the number of search result records of the immediately preceding SELECT statement is guaranteed. DB initial state that constitutes test data to be generated can be generated.

また、本発明では、同じDB初期状態を使いまわすテストケースをグルーピングすることにより、テスト実施時のDB初期状態の入れ替え回数を削減することができる。なお、更新クエリに対しては1テストケースに対し1つのDB初期状態となるが、参照クエリがグルーピングされるため、総量的に入れ替え回数を削減できる。   Further, in the present invention, by grouping test cases that reuse the same DB initial state, it is possible to reduce the number of times the DB initial state is replaced during the test execution. Note that, for an update query, one DB initial state is set for one test case, but since the reference query is grouped, the number of replacements can be reduced in total.

従来技術におけるテストケース生成例である。It is an example of test case generation in the prior art. 本発明の一実施の形態におけるテストデータ生成の概要を示す図である。It is a figure which shows the outline | summary of the test data generation in one embodiment of this invention. 本発明の一実施の形態におけるテストデータ生成装置の構成図である。It is a block diagram of the test data generation device in one embodiment of the present invention. 本発明の一実施の形態における入力されるDB定義の例である。It is an example of the DB definition input in one embodiment of this invention. 本発明の一実施の形態における入力されるテストケース(経路)の例である。It is an example of the test case (path | route) input in one embodiment of this invention. 本発明の一実施の形態における入力される入力値定義の例である。It is an example of the input value definition input in one embodiment of this invention. 本発明の一実施の形態におけるテストデータ生成装置の概要動作のフローチャートである。It is a flowchart of outline | summary operation | movement of the test data generation apparatus in one embodiment of this invention. 本発明の一実施の形態におけるテストデータグループ集合記憶部に格納されるデータ構成である。It is a data structure stored in the test data group set memory | storage part in one embodiment of this invention. 本発明の一実施の形態におけるテストケース抽出の詳細処理のフローチャートである。It is a flowchart of the detailed process of test case extraction in one embodiment of this invention. 本発明の一実施の形態におけるテストケース記憶部の格納例である。It is a storage example of the test case memory | storage part in one embodiment of this invention. 本発明の一実施の形態における更新系クエリ更新部の詳細処理のフローチャートである。It is a flowchart of the detailed process of the update type | system | group query update part in one embodiment of this invention. 本発明の一実施の形態における更新系クエリから参照系クエリへの変換例である。It is the example of conversion from the update type | system | group query in one embodiment of this invention to a reference type | system | group query. 本発明の一実施の形態におけるテストケースグルーピング部の詳細処理のフローチャートである。It is a flowchart of the detailed process of the test case grouping part in one embodiment of this invention. 本発明の一実施の形態におけるテストケースグルーピング部の動作例である。It is an example of operation | movement of the test case grouping part in one embodiment of this invention. 本発明の一実施の形態における入力変数制約式生成部の詳細処理のフローチャートである。It is a flowchart of the detailed process of the input variable constraint expression production | generation part in one embodiment of this invention. 本発明の一実施の形態におけるレコード配置決定部の詳細処理のフローチャートである。It is a flowchart of the detailed process of the record arrangement | positioning determination part in one embodiment of this invention. 本発明の一実施の形態におけるレコード配置決定部の動作例である。It is an example of operation | movement of the record arrangement | positioning determination part in one embodiment of this invention. 本発明の一実施の形態におけるDBテーブル変制約式生成部の詳細処理のフローチャートである。It is a flowchart of detailed processing of the DB table variable constraint generator according to an embodiment of the present invention. 本発明の一実施の形態におけるDBテーブル変制約式生成部の動作を示す図である。It is a diagram illustrating the operation of the DB table variable constraint generator according to an embodiment of the present invention. 本発明の一実施の形態におけるテストデータ出力部からの出力例である。It is an output example from the test data output part in one embodiment of this invention.

以下、図面と共に本発明の実施の形態を説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

本発明は、図2に示すように、設計情報(XML)として入力値定義、テストケース(経路)、DB定義(本実施の形態ではPersonsテーブル)を入力する。テストケースは、同一テーブル(Persons)に対してn回(同図の例では1回)の参照アクセス及びC1の条件分岐、及び、更新アクセス(INSERT)を行うものである。これらの設計情報から同図右側に示すように、分岐(C1)かつ、INSERTを成功させるテストデータを生成する。例えば、更新アクセスINSERTを成功させるには、newIDと同じ値がDB初期状態のID列に存在しないことが必要である。更新対象のレコードに主キーが重複することによりエラーが発生するので、本発明では、これを回避するために更新対象レコードに同じ主キー値を持たないことを保証することを条件として、更新アクセスのクエリを参照アクセスのクエリに変換する。   In the present invention, as shown in FIG. 2, an input value definition, a test case (path), and a DB definition (in the present embodiment, a Persons table) are input as design information (XML). The test case performs reference access, conditional branch of C1, and update access (INSERT) n times (once in the example in the figure) for the same table (Persons). From the design information, as shown on the right side of the figure, test data for branch (C1) and successful INSERT is generated. For example, in order for the update access INSERT to succeed, it is necessary that the same value as newID does not exist in the ID column in the DB initial state. Since an error occurs due to the duplication of the primary key in the record to be updated, in the present invention, in order to avoid this, update access is performed on the condition that it is guaranteed that the record to be updated does not have the same primary key value. The query to a reference access query.

図3は、本発明の一実施の形態におけるテストデータ生成装置の構成を示す。   FIG. 3 shows a configuration of the test data generation apparatus according to the embodiment of the present invention.

同図に示すテストデータ生成装置1は、テストケース抽出部10、更新系クエリ変換部20、テストケースグルーピング部30、入力変数制約式生成部40、レコード配置決定部50、DBテーブル変制約式生成部60、制約式解法部70、テストデータ出力部80、テストケース記憶部15、テストケースグループ集合記憶部35、レコード配置表メモリ55から構成される。テストケース記憶部15、テストケースグループ集合記憶部35、レコード配置表メモリ55は、ハードディスクやメモリ等の記憶媒体である。また、レコード配置表メモリ55は、レコード配置決定部50の外部に設けているが、この例に限定されることなく、レコード配置決定部50内に具備してもよい。 Test data generating apparatus 1 shown in FIG. 1, test case extraction unit 10, the update system query conversion unit 20, the test case grouping unit 30, the input variable constraint expression generation unit 40, the record allocation determination unit 50, DB table variable constraint The generating unit 60, the constraint equation solving unit 70, the test data output unit 80, the test case storage unit 15, the test case group set storage unit 35, and the record arrangement table memory 55 are configured. The test case storage unit 15, the test case group set storage unit 35, and the record arrangement table memory 55 are storage media such as a hard disk and a memory. In addition, the record arrangement table memory 55 is provided outside the record arrangement determining unit 50, but is not limited to this example, and may be provided in the record arrangement determining unit 50.

まず、端末2からテストデータ生成装置1に入力されるデータについて説明する。   First, data input from the terminal 2 to the test data generation device 1 will be described.

図4〜図6は、本発明の設計情報の例を示す。   4 to 6 show examples of design information of the present invention.

図4は、本発明の一実施の形態における入力されるDB定義の例である。   FIG. 4 is an example of a DB definition input according to the embodiment of the present invention.

DB定義(Personsテーブル)は、DBテーブルID、DBレコードのカラム、カラムID(String型と定義域、カラムの種類(Normal/Primary Key))、型と定義域、整数定義域、カラムの種類等が定義されている。   DB definition (Persons table) is DB table ID, DB record column, column ID (String type and domain, column type (Normal / Primary Key)), type and domain, integer domain, column type, etc. Is defined.

図5は、本発明の一実施の形態における入力されるテストケース(経路)の例である。同図(A)に示す処理フロー図は、処理内容を示すノードと、ある処理から次の処理への遷移を示すエッジからなり、ノードID、ノード内容、クエリId、クエリ(SELECT,UPDATE,INSERT,DELETE)、カラムと設定値、WHERE句条件群、次ノード接続エッジ群、エッジID、ガード条件、整数制約、整数算術式、整数項、整数比較演算子、整数因子、カラム参照、変数参照等が規定されている。なお、SELECTクエリはResultRecordCountを含む。   FIG. 5 is an example of a test case (path) that is input in one embodiment of the present invention. The processing flow diagram shown in Fig. 6A consists of a node indicating the processing content and an edge indicating the transition from one processing to the next, and includes a node ID, node content, query Id, query (SELECT, UPDATE, INSERT , DELETE), column and setting value, WHERE clause condition group, next node connection edge group, edge ID, guard condition, integer constraint, integer arithmetic expression, integer term, integer comparison operator, integer factor, column reference, variable reference, etc. Is stipulated. Note that the SELECT query includes ResultRecordCount.

SELECTクエリは、From TableId、Where句条件群、Result Countを有する。   The SELECT query has From TableId, Where clause condition group, and Result Count.

UPDATEクエリは、TableId、カラムと設定値+Where句条件群を有する。   The UPDATE query has TableId, a column and a set value + Where clause condition group.

INSERTクエリは、Into TableId、カラムと設定値を有する。   The INSERT query has Into TableId, column, and setting value.

DELETEクエリは、From TableId、Where句条件群を有する。   The DELETE query has a From TableId and a Where clause condition group.

図6は、本発明の一実施の形態における入力される入力値定義の例である。   FIG. 6 is an example of an input value definition to be input in an embodiment of the present invention.

入力値定義は、入力値と、その入力値のString型と定義域を含む。   An input value definition includes an input value, a String type and a domain of the input value.

上記の構成における処理を説明する。   Processing in the above configuration will be described.

図7は、本発明の一実施の形態におけるテストデータ生成装置の概要動作のフローチャートである。   FIG. 7 is a flowchart of an outline operation of the test data generation apparatus according to the embodiment of the present invention.

ステップ110) テストケース抽出部10は、端末2から入力された設計情報(XML形式)から、テストケースを抽出し、テストケース記憶部15に格納する。詳細な動作は図9で詳述する。   Step 110) The test case extraction unit 10 extracts a test case from the design information (XML format) input from the terminal 2, and stores it in the test case storage unit 15. Detailed operation will be described in detail with reference to FIG.

ステップ120) 更新系クエリ変換部20は、テストケース記憶部15からテストケースを取得し、テストパスにおける更新系クエリを当該更新系クエリの条件を満たすように参照クエリへと変換する。詳細な動作は図11で詳述する。   Step 120) The update query conversion unit 20 acquires a test case from the test case storage unit 15, and converts the update query in the test path into a reference query so as to satisfy the conditions of the update query. Detailed operation will be described in detail with reference to FIG.

ステップ130) テストケースグルーピング部30は、ステップ110で抽出されたテストケースをテストケース記憶部15から読み込み、同じDB初期状態を使い回すテストケースをテストケースグループとしてグルーピングし、テストケースグループ集合記憶部35に格納する。テストケースグループ集合記憶部35には、図8に示すように、テストケースグループID(テストケース+制約集合、DBテーブル変数)毎に、テストケース記憶部15から取得したテストケースが格納される。テストケースは、テストケースId,FlowId、(テストパス、変換済み更新クエリ)、制約集合、DBテーブル変数、DBフィールド変数、参照群クエリ(SELECTクエリ)、入力変数、整数型変数を含む。   Step 130) The test case grouping unit 30 reads the test cases extracted in step 110 from the test case storage unit 15, groups the test cases that reuse the same DB initial state as test case groups, and sets the test case group storage unit. 35. As shown in FIG. 8, the test case group set storage unit 35 stores test cases acquired from the test case storage unit 15 for each test case group ID (test case + constraint set, DB table variable). The test case includes test case Id, FlowId, (test path, converted update query), constraint set, DB table variable, DB field variable, reference group query (SELECT query), input variable, and integer type variable.

なお、本実施の形態では、ユーザ入力された、参照クエリについてグルーピングするためのパラメータに基づいて、参照クエリ(SELECT)をグルーピングを行うものとする。また、変換済み更新クエリについては、1テストケースにつき、1テストケースグループとする。詳細な動作は図13で詳述する。   In the present embodiment, it is assumed that the reference query (SELECT) is grouped based on a parameter input by the user for grouping the reference query. In addition, with respect to the converted update query, one test case group is assigned to one test case. Detailed operation will be described in detail with reference to FIG.

ステップ140) 入力変数制約式生成部40は、テストケースグループ集合記憶部35からテストケースグループを取得し、当該テストケースグループに含まれるテストケースを抽出し、テストケースにおける入力変数の制約式を生成し、テストケースグループ集合記憶部35のテストケースグループ毎の制約集合へ追加する。当該処理を取得した全テストケースについて繰り返す。詳細な処理は図15で詳述する。   Step 140) The input variable constraint expression generation unit 40 acquires a test case group from the test case group set storage unit 35, extracts test cases included in the test case group, and generates a constraint expression for input variables in the test case. And added to the constraint set for each test case group in the test case group set storage unit 35. This process is repeated for all the test cases that have been acquired. Detailed processing will be described in detail with reference to FIG.

ステップ150) レコード配置決定部50は、テストケースグループ集合記憶部35からテストケースグループを読み込み、当該テストケースグループに含まれるテストケースのDBテーブル変数を抽出する。DBテーブル変数に基づいて、最終的に生成するDBテーブルにおけるレコードの件数、そして、各参照クエリにヒットするレコードをそれぞれどの位置に配置するかを決定する。レコード件数は、DBテーブルのクエリ(SELECT)の検索結果レコード件数(ResultRecordCount)の合計値とし、DBテーブル変数の参照クエリ群へSELECTクエリを追加する処理を、当該レコード件数分繰り返し、テストケースグループ集合記憶部35のDBレコード変数の参照クエリ群に追加する。詳細な処理は図16で詳述する。 Step 150) The record arrangement determining unit 50 reads the test case group from the test case group set storage unit 35, and extracts the DB table variable of the test case included in the test case group. Based on the DB table variable, the number of records in the DB table to be finally generated and the position where the record that hits each reference query is arranged are determined. The number of records is the total number of search result records (ResultRecordCount) for each DB table query (SELECT), and the process of adding a SELECT query to the DB table variable reference query group is repeated for the number of records, and the test case group This is added to the reference query group of DB record variables in the set storage unit 35. Detailed processing will be described in detail with reference to FIG.

ステップ160) DBテーブル変数制約式生成部60は、テストケースグループ集合記憶部35からテストケースグループを読み込み、レコード配置表を参照して、当該テストケースグループに含まれるテストケースの各DBフィールド変数に関する制約式を生成し、テストケースグループ集合記憶部34のテストケースグループの制約集合へ追加する。加えて、各テストケースの入力変数に関する制約式も生成し、同様に制約集合へ追加する。詳細な処理は図18で詳述する。   Step 160) The DB table variable constraint expression generation unit 60 reads the test case group from the test case group set storage unit 35, refers to the record arrangement table, and relates to each DB field variable of the test case included in the test case group. A constraint equation is generated and added to the constraint set of the test case group in the test case group set storage unit 34. In addition, a constraint expression related to the input variable of each test case is also generated and added to the constraint set in the same manner. Detailed processing will be described in detail with reference to FIG.

ステップ170) 制約式解法部70は、テストケースグループ集合記憶部35のテストケースグループの制約集合を読み出して、制約式を取り出し、連立不等式を解き、ランダムに解を一つ得て、テストケースグループ集合記憶部35に格納する。なお、連立不等式の解をとるために、既存の制約ソルバ(Trends in constraint Programming (Frederic Benhamou et. al., Wiley-ISTE, 1905209975, 2007)を用いる。   Step 170) The constraint equation solving unit 70 reads the constraint set of the test case group in the test case group set storage unit 35, extracts the constraint equation, solves the simultaneous inequality, obtains one solution at random, and obtains the test case group. Store in the collective storage unit 35. To solve the simultaneous inequality, an existing constraint solver (Trends in constraint Programming (Frederic Benhamou et. Al., Wiley-ISTE, 1905209975, 2007)) is used.

ステップ180) テストデータ出力部80は、テストケースグループ集合記憶部35から取得したテストケース毎の入力値と、テストケースで使いまわすDB初期状態値1つを、このテストケースグループの使用するテストデータとしてまとめ、出力する。当該処理には、例えば、特許文献1:特開2010-267022号公報に記載の技術を適用することが可能である。   Step 180) The test data output unit 80 uses the input value for each test case acquired from the test case group set storage unit 35 and one DB initial state value to be used in the test case as test data used by this test case group. And output as For this processing, for example, the technique described in Patent Document 1: Japanese Patent Application Laid-Open No. 2010-267022 can be applied.

以下に、上記の図7の各ステップの動作を詳細に説明する。   The operation of each step in FIG. 7 will be described in detail below.

<テストケース抽出部の処理(ステップ110)>
次に、図7のステップ110のテストケース抽出部10の処理について説明する。
<Process of Test Case Extraction Unit (Step 110)>
Next, the process of the test case extraction unit 10 in step 110 of FIG. 7 will be described.

図9は、本発明の一実施の形態におけるS110の詳細処理のフローチャートである。   FIG. 9 is a flowchart of detailed processing in S110 according to the embodiment of the present invention.

ステップ210) テストケース抽出部10は、入力された設計情報の処理フロー図からテストパスを抽出する。例えば、図5の例では、分岐条件C1カバレッジを満たすよう、全てのテストパスを抽出する。   Step 210) The test case extraction unit 10 extracts a test path from the processing flow diagram of the input design information. For example, in the example of FIG. 5, all test paths are extracted so as to satisfy the branch condition C1 coverage.

ステップ220) 次に、抽出されたテストパスから当該テストパスを持つテストケースを作成し、テストケース記憶部15に格納する。テストケースの作成方法としては、処理フロー図から抽出したそれぞれのパスに対応するテストケース(抽出した1本のパスが1テストケースとなる)を抽出するための特許文献1(特許4966386号公報)に記載の方法を用いることが可能である。   Step 220) Next, a test case having the test path is created from the extracted test path and stored in the test case storage unit 15. As a test case creation method, Patent Document 1 (Patent No. 4966386) for extracting a test case corresponding to each path extracted from the processing flow diagram (one extracted path becomes one test case) Can be used.

ステップ230) 設計情報のDB定義を取得し、DBテーブル変数を抽出し、テストケース記憶部15のテストケースに対応づけて追加する。テストケース記憶部15へのDBテーブル変数の追加の例を図10に示す。   Step 230) Obtain the DB definition of the design information, extract the DB table variable, and add it in association with the test case in the test case storage unit 15. An example of adding a DB table variable to the test case storage unit 15 is shown in FIG.

ステップ240) 設計情報の入力値定義を読み込み、入力値(入力変数と制約)を抽出し、テストケース記憶部15のテストケースに対応づけて、図10に示すように追加する。図6の例では、入力値名に対応する型、最小値、最大値を抽出し、これを図10の入力変数としてテストケースに対応付けて追加する。   Step 240) The input value definition of the design information is read, input values (input variables and constraints) are extracted, added to the test cases in the test case storage unit 15 as shown in FIG. In the example of FIG. 6, the type, minimum value, and maximum value corresponding to the input value name are extracted and added as input variables in FIG. 10 in association with the test case.

<更新系クエリ更新部の処理(ステップ120)>
次に、図7のステップ120の更新系クエリ更新部20の処理について説明する。
<Processing of Update Query Update Unit (Step 120)>
Next, the processing of the update query update unit 20 in step 120 of FIG. 7 will be described.

図11は、本発明の一実施の形態における更新系クエリ更新部の詳細処理のフローチャートである。   FIG. 11 is a flowchart of detailed processing of the update query update unit according to the embodiment of the present invention.

ステップ310) テストケース記憶部15からテストケースを読み込む。   Step 310) A test case is read from the test case storage unit 15.

ステップ320) テストケースのテストパスにおいて、終端に存在するクエリを得る。取得したクエリが参照クエリ(SELECT)であれば、以下の処理を行わず、ステップ130の処理に移行する。取得したクエリが更新クエリの場合は以下の処理を行う。   Step 320) In the test pass of the test case, get the query that exists at the end. If the acquired query is a reference query (SELECT), the following processing is not performed and the processing proceeds to step 130. If the acquired query is an update query, the following processing is performed.

ステップ330) クエリの種類がINSERTクエリである場合は、レコード挿入後の一意性保証を条件として参照クエリを生成する。ここで、挿入後の一意性保証とは、更新後にユニークキーの重複が生じないようにすることを指す。具体的には、INSERTクエリからInto TableId、カラムが主キーである「カラムと設定値」からcolumnId,setValueを取り出し複製し、copiedInto Tabled,copied ColumnId,copiedSetValueとする。これらを用いて
「SELECT * FROM copiedInto TableId WHERE copiedColumnId = copiedSetValue, ResultCount = 0」
というSELECTクエリを新しく作成し、これを変換済み更新クエリとし、ステップ370に移行する。
Step 330) If the query type is an INSERT query, a reference query is generated on condition that the uniqueness after the record is inserted is a condition. Here, guaranteeing uniqueness after insertion refers to ensuring that unique keys do not overlap after updating. Specifically, the Into TableId from the INSERT query and the columnId and setValue are extracted from the “column and set value” where the column is the primary key, and copied to be copiedInto Tabled, copied ColumnId, and copiedSetValue. Using these, `` SELECT * FROM copiedInto TableId WHERE copiedColumnId = copiedSetValue, ResultCount = 0 ''
A new SELECT query is created, which is used as a converted update query, and the process proceeds to step 370.

ステップ340) クエリの種類がUPDATEクエリである場合は、更新対象のレコードの存在を保証することを条件として参照クエリを生成する。具体的には、UPDATEクエリから、TableId, WHERE句条件群を取り出し複製し、copiedTableId, copiedWhere句条件群とする。それらを用いて、
「SELECT * FROM copiedTableId WHERE copiedWhere句条件群」
というSELECTクエリを新しく作成し、これを変換済み更新クエリとする。
Step 340) If the query type is an UPDATE query, a reference query is generated on condition that the existence of the record to be updated is guaranteed. Specifically, the TableId and WHERE clause condition groups are extracted from the UPDATE query and copied to obtain the copiedTableId and copiedWhere clause condition groups. Using them,
"SELECT * FROM copiedTableId WHERE copiedWhere clause condition group"
Create a new SELECT query, and use this as the converted update query.

ステップ350) 更に、レコード更新後の一意性保証を条件として参照クエリを生成する。具体的には、UPDATEクエリから、TableId、カラムが主キーである「カラムと設定値」からColumnId,SetValueを取り出し複製し、copiedTableId,copiedColumnId, copiedSetValueとする。それらを用いて、
「SELECT * FROM copiedInto TableId WHERE copiedClumnId = copiedSetValue, ResultCount = 0」
というSELECTクエリを新しく作成し、これを変換済み更新クエリとする。
Step 350) Further, a reference query is generated on the condition that the uniqueness guarantee after the record is updated. Specifically, from the UPDATE query, ColumnId and SetValue are extracted from TableId and the column and set value whose column is the primary key, and copiedTableId, copiedColumnId, and copiedSetValue. Using them,
“SELECT * FROM copiedInto TableId WHERE copiedClumnId = copiedSetValue, ResultCount = 0”
Create a new SELECT query, and use this as the converted update query.

ステップ360) クエリの種類がDELETクエリである場合は、削除対象のレコードの存在を保証することを条件として参照クエリを生成する。具体的には、DELETEクエリから、TableId, Where句条件群を取り出し複製し、copiedTableId, copiedWhere句条件群とする。それらを用いて、
「SELECT * FROM copiedTAbleId WHERE copiedWhere句条件群」
というSELECTクエリを新しく作成し、これを変換済み更新クエリとする。
Step 360) If the query type is a DELET query, a reference query is generated on condition that the existence of the record to be deleted is guaranteed. Specifically, the TableId and Where clause condition group is extracted from the DELETE query and copied to obtain the copiedTableId and copiedWhere clause condition group. Using them,
`` SELECT * FROM copied TAbleId WHERE copiedWhere clause condition group ''
Create a new SELECT query, and use this as the converted update query.

ステップ370) 上記の各ステップ330,340,350,360で新規作成された参照クエリを変換済み更新クエリとしてテストケースグループ集合記憶部35のテストケースの変換済み更新クエリへ追加する。なお、ステップ340から遷移してきた場合には、2つの変換済み更新クエリが入力となる。   Step 370) The reference query newly created in each of the above steps 330, 340, 350, 360 is added as a converted update query to the test case converted update query in the test case group set storage unit 35. Note that when the process proceeds from step 340, two converted update queries are input.

図12に上記の更新系クエリから参照系クエリへの変換の例を示す。   FIG. 12 shows an example of conversion from the above update query to a reference query.

INSERTクエリは、同図(A)に示すようにSELECTクエリに変換する。変換する場合には、主キーが重複するとエラーになってしまうため、挿入するレコードと同じ主キー値を持つレコードが、DB初期状態に存在しないことを保証することを条件とする。   The INSERT query is converted into a SELECT query as shown in (A) of the figure. In the case of conversion, an error occurs if the primary key is duplicated, so it is a condition that it is guaranteed that a record having the same primary key value as the record to be inserted does not exist in the DB initial state.

UPDATEクエリは、同図(B)に示すようにSELECTクエリに変換する。変換する場合には、更新対象のレコードが1件存在することを条件とする。当該条件を設定することで、必ずDB更新が行われる。また、主キーが重複するとエラーとなるため、更新したレコードと同じキー値を持つレコードが、DB初期状態に存在しないことを条件とする。これにより必ずDB更新が行われる。   The UPDATE query is converted into a SELECT query as shown in FIG. In the case of conversion, the condition is that there is one record to be updated. DB update is always performed by setting this condition. In addition, if the primary key is duplicated, an error occurs. Therefore, it is a condition that a record having the same key value as the updated record does not exist in the DB initial state. This ensures that the DB is updated.

DELETEクエリは、同図(C)に示すように、SLELECTクエリに変換する。変換する場合には、削除対象のレコードが1件存在することを条件とすることで、必ずDB更新が行われる。   The DELETE query is converted into a SLELECT query as shown in FIG. In the case of conversion, DB update is always performed on condition that there is one record to be deleted.

<テストケースグルーピング部の処理(ステップ130)>
次に、図7のステップ130のテストケースグルーピング部30の処理について説明する。当該処理は、DB初期状態を使いまわすテストケース毎にグループ化し、テストケースグループ集合記憶部35に格納するものである。
<Processing of test case grouping unit (step 130)>
Next, the process of the test case grouping unit 30 in step 130 in FIG. 7 will be described. In this process, the test cases that use the DB initial state are grouped and stored in the test case group set storage unit 35.

図13は、本発明の一実施の形態におけるテストケースグルーピング部の詳細処理のフローチャートである。また、図14は、本発明の一実施の形態におけるテストケースグルーピング部の動作例を示す。なお、図14の例では、ユーザから入力されたグルーピングパラメータに基づいてテストケースをグルーピングするものとする。   FIG. 13 is a flowchart of detailed processing of the test case grouping unit according to the embodiment of the present invention. FIG. 14 shows an operation example of the test case grouping unit in the embodiment of the present invention. In the example of FIG. 14, test cases are grouped based on grouping parameters input from the user.

ステップ610) テストケースグルーピング部30は、テストケース記憶部15からテストケース集合を読み込む。   Step 610) The test case grouping unit 30 reads a test case set from the test case storage unit 15.

ステップ620) 空のテストケースグループ集合をテストケースグループ集合記憶部35上に生成する。   Step 620) An empty test case group set is generated on the test case group set storage unit 35.

ステップ630) テストケースグループ集合記憶部35に空の参照クエリテストケース集合を生成する。   Step 630) An empty reference query test case set is generated in the test case group set storage unit 35.

ステップ640) テストケースグループ集合記憶部35に、空の更新クエリテストケース集合を作成する。   Step 640) An empty update query test case set is created in the test case group set storage unit 35.

ステップ650) ステップ610で、テストケース記憶部15から読み込んだ、参照系テストケースを、テストケースグループ集合記憶部35の参照クエリテストケース集合に追加する。   Step 650) In step 610, the reference system test case read from the test case storage unit 15 is added to the reference query test case set in the test case group set storage unit 35.

ステップ655) 更新クエリのテストケースをテストケースグループ集合記憶部35の更新クエリテストケース集合へ追加する。   Step 655) The test case of the update query is added to the update query test case set in the test case group set storage unit 35.

ステップ657) ステップ650と655の処理をテストケース集合の全テストケースについて繰り返した後、ユーザから、参照クエリテストケースをまとめるためのグルーピングパラメータを取得する。   Step 657) After the processes of Steps 650 and 655 are repeated for all test cases in the test case set, grouping parameters for collecting reference query test cases are acquired from the user.

ステップ660) グルーピングパラメータを元に、参照クエリテストケース集合のテストケースをグルーピングする。図14の例では、グルーピングパラメータとして{[01,02,03],[04,05]}が入力された場合の例である。参照クエリテストケース集合の、TestCase Id=01、TestCase Id=02、TestCase Id=03が、同図(a)に示すようにTestCaseGroup01にグルーピングされ、TestCase Id=04、TestCase Id=05が同図(b)に示すように、TestCaseGroup02にグルーピングされる。   Step 660) Group the test cases of the reference query test case set based on the grouping parameters. In the example of FIG. 14, {[01,02,03], [04,05]} is input as the grouping parameter. TestCase Id = 01, TestCase Id = 02, TestCase Id = 03 in the reference query test case set are grouped into TestCaseGroup01 as shown in the figure (a), and TestCase Id = 04 and TestCase Id = 05 are shown in the figure ( As shown in b), it is grouped into TestCaseGroup02.

ステップ670) ステップ655で得られた更新クエリテストケース集合を取得し、1テストケースにつき、1テストケースグループとしてまとめ、テストケースグループ集合記憶部35のテストケースグループ集合へ追加する。図14の例では、(c)、(d)に示すように、テストケースグループ03には、「TestCase Id=06」のみが追加され、テストケースグループ04には、「TestCase Id=07」のみが追加される。   Step 670) The update query test case set obtained in Step 655 is acquired, and one test case is collected as one test case group and added to the test case group set in the test case group set storage unit 35. In the example of FIG. 14, as shown in (c) and (d), only “TestCase Id = 06” is added to the test case group 03, and only “TestCase Id = 07” is added to the test case group 04. Is added.

ステップ680) テストグループに属するテストケースを任意に1つ選ぶ。なお、どのテストケースを選んでもDBテーブル変数群は同じである。   Step 680) An arbitrary test case belonging to the test group is selected. The DB table variable group is the same regardless of which test case is selected.

ステップ690) 選んだテストケースのDBテーブル変数を複製して、テストケースグループのDBテーブル変数へ代入し、テストケースグループ集合記憶部35のテストケースに追加する。   Step 690) The DB table variable of the selected test case is duplicated, substituted into the DB table variable of the test case group, and added to the test case in the test case group set storage unit 35.

本発明では、上記のように、複数のテストケースをグルーピングすることにより、グループ化したテストケースが使いまわせるDB初期状態を生成するため、1つのテストケースに対して1つのDB初期状態を生成する従来技術よりもDB初期状態の入れ替え回数が少なくなる。   In the present invention, as described above, by creating a DB initial state that can be used by grouped test cases by grouping a plurality of test cases, one DB initial state is generated for one test case. The number of replacements of the DB initial state is less than that of the prior art.

<入力変数制約式生成部の処理(ステップ140)>
次に、図7のステップ140の入力変数制約式生成部40の処理について説明する。
<Processing of Input Variable Constraint Expression Generation Unit (Step 140)>
Next, the processing of the input variable constraint expression generation unit 40 in step 140 of FIG. 7 will be described.

図15は、本発明の一実施の形態における入力変数制約式生成部の詳細処理のフローチャートである。   FIG. 15 is a flowchart of detailed processing of the input variable constraint expression generation unit in one embodiment of the present invention.

ステップ810) 入力変数制約式生成部40は、テストケースグループ集合記憶部35からテストケースグループを読み込む。   Step 810) The input variable constraint expression generation unit 40 reads the test case group from the test case group set storage unit 35.

ステップ820) テストケースグループからテストケースを抽出する。   Step 820) Extract test cases from the test case group.

ステップ830) 抽出されたテストケースの各入力変数全てに対し、当該入力変数の定義域から制約式を生成する。詳しくは、入力された入力変数をXとする。当該入力変数Xに対応する入力値定義の「整数定義域」の最小値(Min Value)、最大値(Max Value)を取得し、X≧Min Value、X≦Max Valueという制約式を新たに生成し、テストグループに対応付けてテストケースグループ集合記憶部35の制約集合に追加する処理を各入力変数に対して繰り返す。   Step 830) For all the input variables of the extracted test cases, a constraint expression is generated from the domain of the input variables. Specifically, let X be the input variable that was input. Get the minimum value (Min Value) and maximum value (Max Value) of the “integer domain” of the input value definition corresponding to the input variable X, and generate a new constraint expression of X ≧ Min Value, X ≦ Max Value The process of adding to the constraint set in the test case group set storage unit 35 in association with the test group is repeated for each input variable.

ステップ840) 処理フロー図(図5参照)に含まれるガード条件と、テストグループ集合記憶部35から取得したテストケースグループを入力とし、ガード条件の整数制約を、テストケースグループ集合記憶部35のテストケースグループの制約集合に追加する。   Step 840) The guard condition included in the processing flow diagram (see FIG. 5) and the test case group acquired from the test group set storage unit 35 are input, and the integer constraint of the guard condition is set as the test of the test case group set storage unit 35. Add to the case group constraint set.

<レコード配置決定部の処理(ステップ150)>
次に、図7のステップ150のレコード配置決定部50の処理について説明する。
<Processing of Record Placement Determination Unit (Step 150)>
Next, the process of the record arrangement determining unit 50 in step 150 of FIG. 7 will be described.

当該処理は、DBテーブルをクエリと対応付けてレコード配置表を作成するものである。   This process creates a record arrangement table by associating a DB table with a query.

図16は、本発明の一実施の形態におけるレコード配置決定部の詳細処理のフローチャートである。   FIG. 16 is a flowchart of the detailed processing of the record arrangement determining unit in one embodiment of the present invention.

ステップ910) レコード配置決定部50は、テストグループ集合記憶部35からテストケースグループを読み込む。   Step 910) The record arrangement determining unit 50 reads the test case group from the test group set storage unit 35.

ステップ920) テストケース記憶部15からテストケースグループに含まれるテストケースのDB定義のDBテーブル変数を読み込む。   Step 920) The DB table variable of the DB definition of the test case included in the test case group is read from the test case storage unit 15.

ステップ930) SELECTクエリの「FROM Table ID」がDBテーブル変数のIDと一致している場合は、レコード配置表メモリ55のテーブル(図17の例では、テーブル変数=「Table A」)にDBテーブル変数の参照クエリ群へSELECTクエリを追加する。   Step 930) When the “FROM Table ID” of the SELECT query matches the ID of the DB table variable, the DB table is stored in the table of the record arrangement table memory 55 (table variable = “Table A” in the example of FIG. 17). Add SELECT query to variable reference query group.

当該処理を、テストケースグループに属するテストケースの各SELECTクエリに対して繰り返す。   This process is repeated for each SELECT query of test cases belonging to the test case group.

ステップ940) DB変数の参照クエリ群における各クエリQ1,Q2,…,Qn,Qiの検索結果レコード件数(ResultRecordCount)をRiとおく。DBレコードの件数Rは、R1+R2+…+Rnとし、DBレコード変数をR個生成し、DBテーブル変数へ追加する。なお、検索結果レコード件数は、図5の処理フロー図のSELECTクエリが保持する「ResultRecordCount」に対応する。   Step 940) The search result record count (ResultRecordCount) of each query Q1, Q2,..., Qn, Qi in the DB variable reference query group is set to Ri. The number of DB records R is R1 + R2 + ... + Rn, and R DB record variables are generated and added to the DB table variables. The number of search result records corresponds to “ResultRecordCount” held by the SELECT query in the processing flow diagram of FIG.

ステップ950) レコード配置表メモリ55上にレコード位置カウンタを生成し、0で初期化する。   Step 950) A record position counter is generated on the record arrangement table memory 55 and initialized with zero.

ステップ960) SELECTクエリをレコード配置表メモリ55のレコード配置表のDBテーブル変数のレコード位置カウンタの箇所へ登録し、レコード位置カウンタを1インクリメントする。   Step 960) The SELECT query is registered in the record position counter of the DB table variable of the record arrangement table in the record arrangement table memory 55, and the record position counter is incremented by one.

詳しくは、DBテーブル変数の「レコード位置カウンタ」番目のDBレコード変数の参照クエリ群へSELECTクエリを追加し、その後、レコード位置カウンタを1インクリメントする。   Specifically, a SELECT query is added to the reference query group of the DB record variable “record position counter” of the DB table variable, and then the record position counter is incremented by one.

上記の動作を、図17を用いて説明する。Q1〜Q3のクエリはSELECTクエリ(ステップ120で更新クエリから変換されたSELECTクエリを含む)であり、これらのSELECTクエリはDBテーブル変数「TableA」を参照しており、検索結果レコード件数は、クエリQ1が1件、クエリQ2が2件、クエリQ3が3件であるため、1+2+3=6件のレコードをレコード配置表上に作成する。   The above operation will be described with reference to FIG. The queries of Q1 to Q3 are SELECT queries (including the SELECT query converted from the update query in step 120), these SELECT queries refer to the DB table variable “TableA”, and the number of search result records is the query Since Q1 is 1, query Q2 is 2, and query Q3 is 3, 1 + 2 + 3 = 6 records are created on the record arrangement table.

上記のSELECTクエリの検索結果レコード件数分の処理が終了したら、レコード配置表のDBテーブル変数(SELECTクエリ)をテストケースグループ集合記憶部35に出力する。   When the processing corresponding to the number of search result records of the SELECT query is completed, the DB table variable (SELECT query) of the record arrangement table is output to the test case group set storage unit 35.

なお、上記ではレコード配置表メモリ55のレコード配置表を用いているが、テストケースグループ集合記憶部35のDBテーブル変数の各レコード変数が持つ参照クエリ群に直接設定することが可能である。例えば、DBレコード変数として、Record1、Record2があるとき、クエリQ1,Q2を設定する場合、Record1にはクエリQ1を設定し、Record2にはクエリQ1、Q2を設定することができる。   In the above description, the record arrangement table of the record arrangement table memory 55 is used. However, it is possible to directly set the reference query group included in each record variable of the DB table variable of the test case group set storage unit 35. For example, when there are Record1 and Record2 as DB record variables, when setting queries Q1 and Q2, query Q1 can be set for Record1, and queries Q1 and Q2 can be set for Record2.

<DBテーブル変制約式生成部の処理(ステップ160)>
次に、図7のステップ160のDBテーブル変制約式生成部60の処理について説明する。当該処理は、参照するレコードに対しては、WHERE句の条件に合うレコードを生成し、参照しないレコードに対してはWHERE句の条件に一致しないようにレコードを生成するための処理である。
<Processing DB table variable constraint generator (step 160)>
Next, a description is given of processing of the DB table variable constraint generator 60 in step 160 of FIG. This processing is processing for generating records that meet the conditions of the WHERE clause for records to be referenced, and generating records so that the records that are not referred to do not match the conditions of the WHERE clause.

図18は、本発明の一実施の形態におけるDBテーブル変制約式生成部の詳細処理のフローチャートである。 Figure 18 is a flowchart of detailed processing of the DB table variable constraint generator according to an embodiment of the present invention.

ステップ1010) DBテーブル変制約式生成部60は、テストケースグループ集合記憶部35からテストグループを読み込む。 Step 1010) DB table variable constraint expression generating unit 60 reads a test group from the test case groups set storage unit 35.

ステップ1020) テストグループに含まれるテストケースのDBテーブル変数を抽出する。   Step 1020) Extract DB table variables of test cases included in the test group.

ステップ1030) DBテーブル変数の参照クエリ群の各SELECTクエリのWHERE句条件群を複製する。   Step 1030) Duplicate the WHERE clause condition group of each SELECT query in the DB table variable reference query group.

ステップ1040) ステップ1030で複製されたWHERE句条件群に含まれる各カラム参照について、そのカラム参照に対応するDBレコード変数のDBフィールド変数に置き換える。   Step 1040) Each column reference included in the WHERE clause condition group duplicated in Step 1030 is replaced with the DB field variable of the DB record variable corresponding to the column reference.

ステップ1050) SELECTクエリがDBレコード変数の参照クエリ群に含まれる場合には、複製クエリ条件群の論理否定を作成するため、「複製WHERE句条件群」を「NOT(複製WHERE句条件群)」へと変換し、新たな複製クエリ条件群とする。SELECTクエリが参照クエリ群に含まれない場合は当該処理をスキップする。   Step 1050) If the SELECT query is included in the reference query group of the DB record variable, in order to create a logical negation of the duplicate query condition group, “duplicate WHERE clause condition group” is set to “NOT (duplicate WHERE clause condition group)”. Into a new replication query condition group. If the SELECT query is not included in the reference query group, this process is skipped.

ステップ1060) 複製WHERE句条件群をテストケースグループ集合記憶部35のテストケースグループの制約集合へ追加する。   Step 1060) The duplicate WHERE clause condition group is added to the test case group constraint set in the test case group set storage unit 35.

ステップ1070) テストケースのDBテーブル変数において、対応するカラムの種類がPrimary KeyであるDBフィールド変数をF1,F2,…,Fnとする(nはDBレコード変数の件数となる)。「F1<F2<…Fn」というFi同士の一意性を保証するための制約式を生成し、テストケースグループ集合記憶部35の制約集合へ追加する。   Step 1070) In the DB table variable of the test case, DB field variables whose corresponding column type is Primary Key are F1, F2,..., Fn (n is the number of DB record variables). A constraint expression for guaranteeing the uniqueness of Fi such as “F1 <F2 <... Fn” is generated and added to the constraint set of the test case group set storage unit 35.

以下に、図19を用いてDBテーブル変制約式生成部60の処理を説明する。 The following describes the processing of the DB table variable constraint generator 60 with reference to FIG. 19.

DBテーブル変制約式生成部60は、テーブルごとに参照クエリから制約式を生成する。図19(a)のPersonsテーブルと同図(b)のレコード配置表のイメージで表されたDBレコード変数を取得し、Personsテーブルの参照クエリ(SELECT)に対して、指定された検索結果レコード件数分の制約式を生成し、テストケースグループ集合記憶部35に格納する。同図の例において、「SELECT *FROM Persons WHERE Id < 10」については、“AGE”については、制約式として「not (Age[3].>=10)」を設定している。 DB table variable constraint generator 60 generates a constraint equation from the reference query for each table. The DB record variable represented by the Persons table in FIG. 19A and the image of the record arrangement table in FIG. 19B is acquired, and the number of search result records specified for the reference query (SELECT) in the Persons table Minute constraint expressions are generated and stored in the test case group set storage unit 35. In the example of the figure, for “SELECT * FROM Persons WHERE Id <10”, “not (Age [3].> = 10)” is set as the constraint expression for “AGE”.

上記のレコード配置決定部50と、DBテーブル変制約式生成部60により、SELECT文毎に、自身が参照するレコードについては、WHERE句の条件に合うレコードを生成し、参照しないレコードはWHERE句の条件に一致しないようNOT WHERE句としてレコードを生成する。これにより、直前のSELECT文の参照結果のレコード件数に応じて後続するSELECT文の実行を行うテストケースを試験するためのテストデータを生成することが可能となる。また、テストパス上の各参照アクセスで、予定した件数のレコードが過不足なく返ってくることが保証される。結果として、直前のSELECT文の参照結果のレコード件数に応じて後続するSELECT文の実行を行うテストケース(テストパス)を試験するためのテストデータを構成するDB初期状態を生成できる。 A record arrangement determination unit 50 described above, by DB table variable constraint generator 60, the SELECT each sentence, for the record to which it references, generating a record that meets the conditions of the WHERE clause, refer to not record WHERE clause A record is generated as a NOT WHERE clause so that it does not match the above conditions. This makes it possible to generate test data for testing a test case that executes the subsequent SELECT statement according to the number of records of the reference result of the immediately preceding SELECT statement. In addition, each reference access on the test path is guaranteed to return the expected number of records without excess or deficiency. As a result, it is possible to generate an initial DB state that constitutes test data for testing a test case (test path) that executes the subsequent SELECT statement according to the number of records of the reference result of the immediately preceding SELECT statement.

制約式解法部70は、テストケース集合記憶部35から制約式を読み込み、当該制約式に制約ソルバを適用することにより、テストケースの解を得て、テストケースグループ集合記憶部35の各テーブル変数、各DBレコードのそれぞれのDBフィールド変数に対して追加する。   The constraint equation solving unit 70 reads a constraint equation from the test case set storage unit 35, applies a constraint solver to the constraint equation, obtains a test case solution, and obtains each table variable of the test case group set storage unit 35. Add to each DB field variable of each DB record.

テストデータ出力部80は、テストケースグループ集合記憶部35からテストケースとテストデータを読み込み、テキスト形式でテストケースグループとテストパスを出力する。テストケースグループは、図18に示すように、テストケースグループのデータとして、テストグループId、DBテーブル変数、テストケース(Id、フローId、テストパス)、DBテーブル変数(Id、DBレコード変数)、DBレコード変数(Id、インデックス、DBフィールド変数)、DBフィールド変数(Id、整数型変数入力)、変数(Id、整数型変数)、整数型変数(変数値)を含む。   The test data output unit 80 reads the test case and test data from the test case group set storage unit 35 and outputs the test case group and test path in text format. As shown in FIG. 18, the test case group includes test group group data, test group Id, DB table variable, test case (Id, flow Id, test path), DB table variable (Id, DB record variable), Includes DB record variables (Id, index, DB field variables), DB field variables (Id, integer type variable input), variables (Id, integer type variable), integer type variables (variable value).

なお、上記の図3に示すテストデータ生成装置の構成要素の動作をプログラムとして構築し、テストデータ生成装置として利用されるコンピュータにインストールして実行させる、または、ネットワークを介して流通させることが可能である。   The operation of the constituent elements of the test data generation apparatus shown in FIG. 3 can be constructed as a program, installed on a computer used as the test data generation apparatus, executed, or distributed via a network. It is.

本発明は、上記の実施の形態に限定されることなく、特許請求の範囲内において、種々変更・応用が可能である。   The present invention is not limited to the above-described embodiments, and various modifications and applications are possible within the scope of the claims.

1 テストデータ生成装置
2 ユーザ端末
10 テストケース抽出部
15 テストケース記憶部
20 更新系クエリ更新部
30 テストケースグルーピング部
35 テストケースグループ集合記憶部
40 入力変数制約式生成部
50 レコード配置決定部
55 レコード配置表メモリ
60 DBテーブル変制約式生成部
70 制約式解法部
80 テストデータ出力部
DESCRIPTION OF SYMBOLS 1 Test data generation apparatus 2 User terminal 10 Test case extraction part 15 Test case storage part 20 Update system query update part 30 Test case grouping part 35 Test case group set storage part 40 Input variable constraint expression generation part 50 Record arrangement | positioning determination part 55 Record arrangement table memory 60 DB table variable constraint generator 70 constraint equation solver 80 test data output unit

Claims (9)

データベース(DB)に対して、テストパス中に参照アクセスに加え、更新アクセスを持つテストデータを生成するテストパス中に更新アクセスを持つテスト用のデータ生成装置であって、
入力された設計情報からテストケースを抽出し、テストケース記憶手段に格納するテストケース抽出手段と、
前記テストケース記憶手段からテストケースを読み込み、テストパスで最後に出現するクエリの種類が更新クエリである場合は、該クエリの種類に応じた条件に基づいて該更新クエリを参照クエリに変換し、該テストケース記憶手段に格納する更新系クエリ変換手段と、
前記テストケース記憶手段から前記テストケースを読み出し、同じDB初期状態を共有可能なテストケースを、同じグループに属するテストケースの各SELECT文が抽出するレコードに重複がないようにテストケースグループとしてグルーピングし、テストケースグループ集合記憶手段に格納するテストケースグルーピング手段と、
前記テストケースグループ集合記憶手段から前記テストケースグループを読み出し、該テストケースグループの各テストケースの情報を前記テストケース記憶手段から取得して、該テストケースの入力変数の制約式を生成し、該テストケースが含まれるテストケースグループ集合記憶手段の制約集合に格納する入力変数制約式生成手段と、
前記テストケースグループ集合記憶手段から前記テストケースグループを取得し、該テストケースグループに含まれるテストケースのDBテーブル変数を抽出し、該DBテーブル変数のレコード件数を決定し、該DBテーブル変数の参照クエリ群へSELECTクエリを追加する処理を、各クエリの検索結果レコード件数の合計数分繰り返し、該テストケースグループ集合記憶手段のDBテーブル変数の参照クエリ群に追加するレコード配置決定手段と、
前記テストケースグループ集合記憶手段の前記テストケースグループに含まれるテストケースのDBフィールド変数に関する制約式を生成し、テストケースグループ集合記憶手段の制約集合に追加するDB変制約式生成手段と、
前記テストケースグループ集合記憶手段に格納された前記制約式を任意の解法を用いて解き、テストケース毎の入力値と、該テストケースを共有するDB初期状態をテストデータとして出力する制約式解法手段と、
を有することを特徴とするテストパス中に更新アクセスを持つテスト用のデータ生成装置。
A data generation device for a test having update access in a test path for generating test data having update access in addition to reference access during a test path for a database (DB),
A test case extraction means for extracting a test case from the inputted design information and storing it in the test case storage means;
When the test case is read from the test case storage unit and the last query type in the test path is an update query, the update query is converted into a reference query based on a condition according to the query type, Update query conversion means for storing in the test case storage means;
The test cases are read from the test case storage means, and test cases that can share the same initial DB state are grouped as test case groups so that there is no duplication in the records extracted by each SELECT statement of test cases belonging to the same group. , Test case grouping means for storing in the test case group set storage means,
Reading the test case group from the test case group set storage means, obtaining information of each test case of the test case group from the test case storage means, generating a constraint equation of the input variables of the test case, An input variable constraint expression generating means for storing in a constraint set of a test case group set storage means including a test case;
Obtain the test case group from the test case group set storage means, extract the DB table variable of the test case included in the test case group, determine the number of records of the DB table variable, and refer to the DB table variable A process for adding a SELECT query to a query group is repeated for the total number of search result records of each query, and a record arrangement determining unit that is added to a reference query group of DB table variables of the test case group set storage unit;
Said generating the constraint equation relating DB field variable test cases included in the test case groups, DB variable constraint expression generating means for adding the constraint set of the test case groups set storage unit of the test case group set storage unit,
Constraint equation solving means that solves the constraint expression stored in the test case group set storage means using an arbitrary solution and outputs the input value for each test case and the DB initial state sharing the test case as test data When,
A test data generation device having update access during a test path.
前記更新系クエリ変換手段は、
前記更新クエリが、INSERTクエリである場合は、レコード挿入後の一意性を保証するSELECTクエリを生成する手段と、
前記更新クエリが、UPDATEクエリである場合は、更新対象レコードの存在を保証し、更新後にユニークキーの重複が発生しないSELECTクエリを生成する手段と、
前記更新クエリが、DELETEクエリである場合は、削除対象の存在を保証するSELECTクエリを生成する手段と、
を含む請求項1記載のテストパス中に更新アクセスを持つテスト用のデータ生成装置。
The update query conversion means includes:
When the update query is an INSERT query, means for generating a SELECT query that guarantees uniqueness after inserting a record;
When the update query is an UPDATE query, means for generating a SELECT query that guarantees the presence of the update target record and does not cause duplicate unique keys after the update;
If the update query is a DELETE query, means for generating a SELECT query that guarantees the existence of the deletion target;
A test data generation apparatus having update access during a test path according to claim 1.
前記テストケースグルーピング手段は、
グルーピング対象のテストケースに更新クエリを含む場合には、該テストケースを更新クエリテストケース集合へ追加し、含まない場合は参照クエリテストケース集合に追加する手段と、
前記参照クエリテストケース集合については、入力されたグルーピングパラメータに基づいてグルーピングし、該更新クエリテストケース集合については、1つのテストケースについて1テストケースグループとする手段と、
前記テストケースグループから任意に1つのテストケースを選択し、選択されたテストケースのDBテーブル変数を、前記テストケースグループのDBテーブル変数に代入する手段を含む
請求項1記載のテストパス中に更新アクセスを持つテスト用のデータ生成装置。
The test case grouping means includes:
When the test case to be grouped includes an update query, a method for adding the test case to the update query test case set, and when not including the update query to the reference query test case set,
The reference query test case set is grouped based on an input grouping parameter, and the updated query test case set is a test case group for one test case;
The update during a test path according to claim 1, further comprising means for arbitrarily selecting one test case from the test case group and substituting the DB table variable of the selected test case into the DB table variable of the test case group. Data generator for testing with access.
前記DB変制約式生成手段は、
レコード配置表記憶手段のレコード配置表を参照して、前記DBレコード変数のSELECT文が参照するWHERE句の条件に合うレコードを生成し、参照しないレコードはWHERE句の条件に一致しないようにレコードを生成する手段を含む
請求項1記載のテストパス中に更新アクセスを持つテスト用のデータ生成装置。
The DB variable constraint expression generating means,
With reference to records arrangement table records arrangement table storage means, wherein the generating a record that meets the conditions of the WHERE clause SELECT statement references the DB record variable, refers to not record the record so as not to coincide with the condition in the WHERE clause 2. The test data generation apparatus having update access during a test path according to claim 1, further comprising means for generating
データベース(DB)に対して、テストパス中に参照アクセスに加え、更新アクセスを持つテストデータを生成するテストパス中に更新アクセスを持つテスト用のデータ生成方法であって、
テストケース記憶手段、テストケースグループ集合記憶手段、テストケース抽出手段、更新系クエリ変換手段、テストケースグルーピング手段、入力変数制約式生成手段、レコード配置決定手段、DB変制約式生成手段、制約式解法手段を有する装置において、
前記テストケース抽出手段が、入力された設計情報からテストケースを抽出し、テストケース記憶手段に格納するテストケース抽出ステップと、
前記更新系クエリ変換手段が、前記テストケース記憶手段からテストケースを読み込み、テストパスで最後に出現するクエリの種類が更新クエリである場合は、該クエリの種類に応じた条件に基づいて該更新クエリを参照クエリに変換し、該テストケース記憶手段に格納する更新系クエリ変換ステップと、
前記テストケースグルーピング手段が、前記テストケース記憶手段から前記テストケースを読み出し、同じDB初期状態を共有可能なテストケースを、同じグループに属するテストケースの各SELECT文が抽出するレコードに重複がないようにテストケースグループとしてグルーピングし、テストケースグループ集合記憶手段に格納するテストケースグルーピングステップと、
前記入力変数制約式生成手段が、前記テストケースグループ集合記憶手段から前記テストケースグループを読み出し、該テストケースグループの各テストケースの情報を前記テストケース記憶手段から取得して、該テストケースの入力変数の制約式を生成し、該テストケースが含まれるテストケースグループ集合記憶手段の制約集合に格納する入力変数制約式生成ステップと、
前記レコード配置決定手段が、前記テストケースグループ集合記憶手段から前記テストケースグループを取得し、該テストケースグループに含まれるテストケースのDBテーブル変数を抽出し、該DBテーブル変数のレコード件数を決定し、該DBテーブル変数の参照クエリ群へSELECTクエリを追加する処理を、各クエリの検索結果レコード件数の合計数分繰り返し、該テストケースグループ集合記憶手段のDBテーブル変数の参照クエリ群に追加するレコード配置決定ステップと、
前記DB変制約式生成手段が、前記テストケースグループ集合記憶手段の前記テストケースグループに含まれるテストケースのDBフィールド変数に関する制約式を生成し、テストケースグループ集合記憶手段の制約集合に追加するDB変制約式生成ステップと、
前記制約式解法手段が、前記テストケースグループ集合記憶手段に格納された前記制約式を任意の解法を用いて解き、テストケース毎の入力値と、該テストケースを共有するDB初期状態をテストデータとして出力する制約式解法ステップと、
を行うことを特徴とするテストパス中に更新アクセスを持つテスト用のデータ生成方法。
A data generation method for a test having update access in a test path for generating test data having update access in addition to reference access during a test path for a database (DB),
Test case storage unit, the test case group set storage unit, the test case extraction means, updated based query transformation means, test case grouping means, the input variable constraint expression generation unit, the record arrangement determining means, DB variable constraint generator, constraint equation In an apparatus having a solution means,
The test case extraction means extracts a test case from the inputted design information and stores it in the test case storage means;
When the update query conversion means reads the test case from the test case storage means and the type of the query that appears last in the test path is an update query, the update query conversion means updates the update based on a condition corresponding to the type of the query. An update query conversion step of converting the query into a reference query and storing the query in the test case storage means;
The test case grouping unit reads the test case from the test case storage unit, and the test cases that can share the same DB initial state are not duplicated in the records extracted by the SELECT statements of the test cases belonging to the same group. A test case grouping step for grouping as test case groups and storing them in a test case group set storage means;
The input variable constraint expression generation means reads the test case group from the test case group set storage means, acquires information of each test case of the test case group from the test case storage means, and inputs the test case An input variable constraint expression generation step for generating a constraint expression for a variable and storing the constraint expression in a constraint set of a test case group set storage means including the test case;
The record arrangement determining means acquires the test case group from the test case group set storage means, extracts a DB table variable of the test case included in the test case group, and determines the number of records of the DB table variable. , The process of adding the SELECT query to the reference query group of the DB table variable is repeated for the total number of search result records of each query, and the record to be added to the reference query group of the DB table variable of the test case group set storage means A placement determination step;
The DB variable constraint expression generating means generates constraint equation relating DB field variable test cases included in the test case groups of the test case group set storage unit, added to the constraint set of the test case groups set storage unit and DB variables constraint expression generation step of,
The constraint equation solving means solves the constraint expression stored in the test case group set storage means using an arbitrary solution, and inputs test values for each test case and the DB initial state sharing the test case. A constraint solution step to output as
A test data generation method having update access during a test path.
前記更新系クエリ変換ステップにおいて、
前記更新クエリが、INSERTクエリである場合は、レコード挿入後の一意性を保証するSELECTクエリを生成するステップと、
前記更新クエリが、UPDATEクエリである場合は、更新対象レコードの存在を保証し、更新後にユニークキーの重複が発生しないSELECTクエリを生成するステップと、
前記更新クエリが、DELETEクエリである場合は、削除対象の存在を保証するSELECTクエリを生成するステップと、
を含む請求項5記載のテストパス中に更新アクセスを持つテスト用のデータ生成方法。
In the update query conversion step,
If the update query is an INSERT query, generating a SELECT query that guarantees uniqueness after inserting the record;
When the update query is an UPDATE query, a step of generating a SELECT query that guarantees the existence of an update target record and does not cause duplication of a unique key after update;
If the update query is a DELETE query, generating a SELECT query that guarantees the existence of the deletion target;
A test data generation method having update access during a test path according to claim 5.
前記テストケースグルーピングステップにおいて、
グルーピング対象のテストケースに更新クエリを含む場合には、該テストケースを更新クエリテストケース集合へ追加し、含まない場合は参照クエリテストケース集合に追加し、
前記参照クエリテストケース集合については、入力されたグルーピングパラメータに基づいてグルーピングし、該更新クエリテストケース集合については、1つのテストケースについて1テストケースグループとし、
前記テストケースグループから任意に1つのテストケースを選択し、選択されたテストケースのDBテーブル変数を、前記テストケースグループのDBテーブル変数に代入する請求項5記載のテストパス中に更新アクセスを持つテスト用のデータ生成方法。
In the test case grouping step,
When an update query is included in the test cases to be grouped, the test case is added to the update query test case set. Otherwise, it is added to the reference query test case set.
The reference query test case set is grouped based on the input grouping parameters, and the update query test case set is set as one test case group for one test case,
6. The test path according to claim 5, wherein one test case is arbitrarily selected from the test case group, and the DB table variable of the selected test case is substituted for the DB table variable of the test case group. Data generation method for testing.
前記DB変制約式生成ステップにおいて、
レコード配置表記憶手段のレコード配置表を参照して、前記DBレコード変数のSELECT文が参照するWHERE句の条件に合うレコードを生成し、参照しないレコードはWHERE句の条件に一致しないようにレコードを生成する
請求項5記載のテストパス中に更新アクセスを持つテスト用のデータ生成方法。
In the DB variable constraint expression generation step,
With reference to records arrangement table records arrangement table storage means, wherein the generating a record that meets the conditions of the WHERE clause SELECT statement references the DB record variable, refers to not record the record so as not to coincide with the condition in the WHERE clause A test data generation method having update access during a test path according to claim 5.
コンピュータを、
請求項1乃至4のいずれか1項に記載のデータ生成装置の各手段として機能させるためのテストパス中に更新アクセスを持つテスト用のデータ生成プログラム。
Computer
A test data generation program having update access during a test path for functioning as each unit of the data generation apparatus according to claim 1.
JP2012199322A 2012-09-11 2012-09-11 Test data generation apparatus, method and program having update access during test path Active JP5523525B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012199322A JP5523525B2 (en) 2012-09-11 2012-09-11 Test data generation apparatus, method and program having update access during test path

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012199322A JP5523525B2 (en) 2012-09-11 2012-09-11 Test data generation apparatus, method and program having update access during test path

Publications (2)

Publication Number Publication Date
JP2014056305A JP2014056305A (en) 2014-03-27
JP5523525B2 true JP5523525B2 (en) 2014-06-18

Family

ID=50613590

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012199322A Active JP5523525B2 (en) 2012-09-11 2012-09-11 Test data generation apparatus, method and program having update access during test path

Country Status (1)

Country Link
JP (1) JP5523525B2 (en)

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5609681B2 (en) * 2011-01-27 2014-10-22 富士通株式会社 Test data generation program, method and apparatus

Also Published As

Publication number Publication date
JP2014056305A (en) 2014-03-27

Similar Documents

Publication Publication Date Title
US9519706B2 (en) Multiple rule development support for text analytics
JP6011533B2 (en) Information processing apparatus, information processing method, and program
JP5601066B2 (en) Information integration program, apparatus and method
US8250536B2 (en) Analysis of a legacy source code application
JP6132698B2 (en) Tabular multidimensional data conversion method and apparatus
US10031936B2 (en) Database table data fabrication
CN106933703A (en) A kind of method of database data backup, device and electronic equipment
CN109726066B (en) Method and apparatus for identifying problem components in a storage system
CN109753289B (en) Art resource merging method and device, electronic equipment and storage medium
CN110471994A (en) Method, apparatus, storage medium and the electronic equipment of replicate data
Begicheva et al. Discovering high-level process models from event logs
JP5523526B2 (en) Test data generation apparatus, method and program having multiple reference accesses in test path
Schlie et al. Incremental feature model synthesis for clone-and-own software systems in MATLAB/Simulink
JP5106447B2 (en) Test case generation apparatus, generation method thereof, and computer program
CN108984337A (en) A kind of restorative procedure of data synchronous abnormality, prosthetic device, medium and calculate equipment
JP5523525B2 (en) Test data generation apparatus, method and program having update access during test path
JP2014056306A (en) Db data debug support device, method and program
JP2006277282A (en) Model evaluation analysis system and model evaluation analysis program
Wang et al. A formal verification method for smart contract
JP5487078B2 (en) Software asset management method and apparatus
JP2015022356A (en) Test scenario variation creation device, method, and program
WO2019176011A1 (en) Retrieval sentence utilization device and retrieval sentence utilization method
JP2014056304A (en) Device, method and program for generating minimum test data
Sarmiento et al. Analysis of scenarios with Petri-Net models
CN106502903B (en) A kind of change function of program determines method, apparatus and processing equipment

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140107

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140310

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140408

R150 Certificate of patent or registration of utility model

Ref document number: 5523525

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150