JP2016081231A - Abnormal system test data generating device, method, and program, permitting ready recognition of multiple input variables - Google Patents
Abnormal system test data generating device, method, and program, permitting ready recognition of multiple input variables Download PDFInfo
- Publication number
- JP2016081231A JP2016081231A JP2014210776A JP2014210776A JP2016081231A JP 2016081231 A JP2016081231 A JP 2016081231A JP 2014210776 A JP2014210776 A JP 2014210776A JP 2014210776 A JP2014210776 A JP 2014210776A JP 2016081231 A JP2016081231 A JP 2016081231A
- Authority
- JP
- Japan
- Prior art keywords
- group
- value
- conditional expression
- candidate
- input
- 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
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
Description
本発明は、複数入力変数に対する視認性が高い異常系テストデータ生成装置、方法、及びプログラムに関する。 The present invention relates to an abnormal test data generation apparatus, method, and program having high visibility for a plurality of input variables.
従来、プログラムのブラックボックステストのためにプログラムの入力変数に対して入力されるテストデータを、ソフトウェア設計に基づいて自動生成する技術が有る(例えば、特許文献1及び特許文献2参照)。
2. Description of the Related Art Conventionally, there is a technique for automatically generating test data input to a program input variable for a program black box test based on software design (see, for example,
このような技術を利用することで、プログラムのテストに効果的、かつ、効率的なテストデータを導出することができる。 By using such a technique, it is possible to derive test data that is effective and efficient for testing the program.
しかしながら、従来において、相互に依存関係を有する2以上の入力変数を含む複数の入力変数に関して、効率的、かつ、効果的なテストデータを生成するのは困難であった。 However, conventionally, it has been difficult to generate efficient and effective test data for a plurality of input variables including two or more input variables having a dependency relationship with each other.
ここで、入力変数の依存関係とは、入力変数が満たすべき制約において、一方の入力変数の値が、他方の入力変数の値に依存する関係をいう。斯かる制約の一例として、入力変数がX及びYである場合に、X+Y≦100であるといったような制約が挙げられる。この場合、当該制約を満たすために、入力変数Xの値と入力変数Yの値とは相互に依存する。 Here, the input variable dependency relationship refers to a relationship in which the value of one input variable depends on the value of the other input variable in a constraint to be satisfied by the input variable. An example of such a constraint is a constraint such that X + Y ≦ 100 when the input variables are X and Y. In this case, in order to satisfy the restriction, the value of the input variable X and the value of the input variable Y are mutually dependent.
そして、テスト対象のプログラムに対し異常なテストデータを入力した際に、入力チェックが正しく動作することを確認するテストにおいて、適切で、かつ、視認性が高く、レビューやテストを実施し易い異常系のテストデータの生成は重要である。ここで、視認性が高いとは、複数の入力変数のうちのいずれの入力変数に着目したテストデータであるのかについて、区別し易いことをいう。 In the test to confirm that the input check works correctly when abnormal test data is input to the program under test, the abnormal system is appropriate and has high visibility and is easy to conduct reviews and tests. The generation of test data is important. Here, high visibility means that it is easy to distinguish which input variable among a plurality of input variables is the test data.
本発明は、上記の点に鑑みてなされたものであって、相互に依存関係を有する入力変数を含む複数の入力変数に対する視認性が高い異常系のテストデータを生成することを目的とする。 The present invention has been made in view of the above points, and an object of the present invention is to generate abnormal test data having high visibility for a plurality of input variables including input variables having a mutual dependency.
そこで上記課題を解決するため、開示のテストデータ生成装置は、テスト対象のプログラムにおける複数の入力変数が満たすべき1以上の条件式に基づいて、前記入力変数間の依存関係の有無を判定し、前記依存関係の有無に基づいて前記複数の入力変数を1以上のグループに分類して、前記各条件式を当該条件式に関連する入力変数が属するグループに関連付ける変数分類部と、前記グループごとに、当該グループに関連付けられた前記条件式に基づいて、当該グループに属する入力変数の値の候補を生成する値候補生成部と、前記各条件式について、当該条件式に関連する入力変数が属する第一のグループに関して生成された候補のうち、前記第一のグループに関連付けられたいずれかの条件式を満たさない前記候補ごとに、前記第一のグループ以外の第二のグループのそれぞれから、当該第二のグループに属する入力変数のデータ型に依存して設定された単純値を、前記条件式に基づいて生成された候補に対して優先的に1つずつ選択して、前記候補の組み合わせを生成する組み合わせ生成部とを有し、前記組み合わせ生成部が一つの前記条件式について前記第二のグループから選択する前記単純値又は前記候補は、当該条件式に関して生成される全ての前記組み合わせに対して共通である。 Therefore, in order to solve the above-described problem, the disclosed test data generation device determines whether or not there is a dependency between the input variables based on one or more conditional expressions to be satisfied by a plurality of input variables in the test target program, A variable classification unit that classifies the plurality of input variables into one or more groups based on the presence or absence of the dependency relationship, associates each conditional expression with a group to which an input variable related to the conditional expression belongs, and for each group A value candidate generating unit that generates a value candidate of an input variable belonging to the group based on the conditional expression associated with the group, and for each conditional expression, the input variable associated with the conditional expression For each candidate generated for one group that does not satisfy any of the conditional expressions associated with the first group, the first From each of the second groups other than the loop, the simple value set depending on the data type of the input variable belonging to the second group is preferentially given to the candidate generated based on the conditional expression. A combination generation unit that selects one by one and generates the combination of candidates, and the combination generation unit selects one simple conditional expression from the second group or the candidate This is common to all the combinations generated for the conditional expression.
相互に依存関係を有する入力変数を含む複数の入力変数に対する視認性が高い異常系のテストデータを生成することができる。 It is possible to generate abnormal test data with high visibility with respect to a plurality of input variables including input variables having dependency relations with each other.
以下、図面に基づいて本発明の実施の形態を説明する。図1は、本発明の実施の形態におけるテストデータ生成システムの構成例を示す図である。図1において、テストデータ生成装置10は、LAN(Local Area Network)又はインターネット等のネットワークを介して1以上のユーザ端末20に通信可能に接続されている。
Hereinafter, embodiments of the present invention will be described with reference to the drawings. FIG. 1 is a diagram illustrating a configuration example of a test data generation system according to an embodiment of the present invention. In FIG. 1, a test
テストデータ生成装置10は、プログラムのブラックボックステストに利用される、プログラムの入力変数に対する入力用のテストデータを生成するコンピュータである。ユーザ端末20は、テストデータ生成装置10に対するユーザインタフェースとして機能する端末である。なお、テストデータ生成装置10が、ディスプレイ等の表示装置や、マウス及びキーボート等の入力装置を備え、ユーザによって直接操作可能とされてもよい。
The test
図2は、本発明の実施の形態におけるテストデータ生成装置のハードウェア構成例を示す図である。図2のテストデータ生成装置10は、それぞれバスBで相互に接続されているドライブ装置100、補助記憶装置102、メモリ装置103、CPU104、及びインタフェース装置105等を有する。
FIG. 2 is a diagram illustrating a hardware configuration example of the test data generation apparatus according to the embodiment of the present invention. The test
テストデータ生成装置10での処理を実現するプログラムは、CD−ROM等の記録媒体101によって提供される。プログラムを記憶した記録媒体101がドライブ装置100にセットされると、プログラムが記録媒体101からドライブ装置100を介して補助記憶装置102にインストールされる。但し、プログラムのインストールは必ずしも記録媒体101より行う必要はなく、ネットワークを介して他のコンピュータよりダウンロードするようにしてもよい。補助記憶装置102は、インストールされたプログラムを格納すると共に、必要なファイルやデータ等を格納する。
A program for realizing processing in the test
メモリ装置103は、プログラムの起動指示があった場合に、補助記憶装置102からプログラムを読み出して格納する。CPU104は、メモリ装置103に格納されたプログラムに従ってテストデータ生成装置10に係る機能を実行する。インタフェース装置105は、ネットワークに接続するためのインタフェースとして用いられる。
The
図3は、本発明の実施の形態におけるテストデータ生成装置の機能構成例を示す図である。図3において、テストデータ生成装置10は、設計モデル抽出部11、設計モデル分析部12、テスト項目抽出部13、条件抽出部14、変数分類部15、値候補生成部16、及び組み合わせ生成部17等を有する。これら各部は、テストデータ生成装置10にインストールされた1以上のプログラムが、CPU104に実行させる処理により実現される。テストデータ生成装置10は、また、値候補記憶部111を利用する。値候補記憶部111は、メモリ装置103若しくは補助記憶装置102、又はテストデータ生成装置10にネットワークを介して接続される記憶装置等を用いて実現可能である。
FIG. 3 is a diagram illustrating a functional configuration example of the test data generation apparatus according to the embodiment of the present invention. In FIG. 3, the test
設計モデル抽出部11は、ユーザ端末20から設計書データを受信し、設計書データから設計モデルを抽出する。設計書データとは、ソフトウェアの設計書を示すデータをいう。また、設計モデルとは、ソフトウェアの仕様に関する情報をいう。例えば、設計モデルには、入力変数に関する制約等が含まれている。設計モデル分析部12は、設計モデルを分析し、設計モデルに含まれる1以上のビジネスロジックのそれぞれを、テスト対象として抽出する。ビジネスロジックとは、例えば、ソフトウェアが有する機能群のうちの一つの機能、又はソフトウェアがコンピュータに実行させる複数の処理手順のうちの一つの処理手順に対応する概念、又は当該処理手順をコンピュータに実行させるプログラムに対応する概念等である。また、設計モデル内には、ビジネスロジックごとに、当該ビジネスロジックに対する入力変数や、各入力変数に対する制約等が定義されている。
The design model extraction unit 11 receives design document data from the
テスト項目抽出部13は、各テスト対象(各ビジネスロジック)からテスト項目の一覧(以下、「テスト項目一覧」という。)を抽出する。テスト項目一覧は、各テスト対象に含まれる入力変数に関する制約等に基づいて抽出される。条件抽出部14は、テスト項目ごとに、当該テスト項目において着目される入力変数に対するテストデータを生成するための条件式(以下、「テストデータ生成条件」という。)を設計モデルから抽出する。
The test
変数分類部15は、テスト項目ごとに、当該テスト項目に関するテストデータ生成条件を解析し、当該テスト項目に関する入力変数を、依存関係の有無に基づいて分類する。分類の結果生成されるグループを、以下、「変数集合」という。変数分類部15は、また、各テストデータ生成条件を、当該テストデータ生成条件に関係する入力変数が属する変数集合に振り分ける(関連付ける)。
For each test item, the
値候補生成部16は、変数集合ごとに、当該変数集合に振り分けられたテストデータ生成条件に基づいて、当該変数集合に属する各入力変数のテストデータの候補(以下、「値候補」という。)を生成する。なお、値候補生成部16は、変数集合の特徴(変数集合に含まれる入力変数間の依存関係の有無)に基づいて、値候補の生成方法を切り替える。値候補記憶部111は、値候補生成部16によって生成された値候補を記憶する。
The
組み合わせ生成部17は、各入力変数の値候補の組み合わせに関して1通り以上の組みをテストデータとして生成する。組み合わせ生成部17は、生成されたテストデータを含むテストモデルを生成し、当該テストモデルの内容をテストケース表としてユーザ端末20に出力する。
The
以下、テストデータ生成装置10が実行する処理手順について説明する。図4は、テストデータ生成装置が実行する処理手順の一例を説明するためのフローチャートである。
Hereinafter, a processing procedure executed by the test
ユーザ端末20に対するユーザによる指示入力に応じ、ユーザ端末20は、ソフトウェアの設計書データを、テストデータ生成装置10に送信する。当該設計書データは、テストデータ生成装置10において設計モデル抽出部11によって受信される。設計モデル抽出部11は、図5に示されるような設計モデルのデータ構造の定義に基づいて設計書データを分析して、図6に示されるような設計モデルを抽出する(S100)。
In response to an instruction input by the user to the
図5は、設計モデルのデータ構造の定義の一例を示す図である。図5では、設計モデルのデータ構造が、BNF(Backus-Naur Form)によって定義されている。 FIG. 5 is a diagram illustrating an example of the definition of the data structure of the design model. In FIG. 5, the data structure of the design model is defined by BNF (Backus-Naur Form).
図5によれば、本実施の形態において、設計モデルは、1以上のビジネスロジックを含む。ビジネスロジックは、ビジネスロジックID、1以上の入力変数、1以上の入力制約、及び1以上のドメイン定義等を含む。入力変数とは、ビジネスロジックに対して入力される変数である。入力制約とは、入力変数に関する制約情報である。ドメイン定義とは、ビジネスロジックの振る舞いごと(出力結果ごと)に、当該振る舞いを引き起こすために入力変数が満たすべき条件の定義である。 According to FIG. 5, in the present embodiment, the design model includes one or more business logics. The business logic includes a business logic ID, one or more input variables, one or more input constraints, one or more domain definitions, and the like. An input variable is a variable input to business logic. An input constraint is constraint information related to an input variable. A domain definition is a definition of a condition that an input variable must satisfy in order to cause the behavior for each business logic behavior (for each output result).
なお、入力変数、入力制約、及びドメイン定義より下層の構造に関する説明については省略する。 Note that descriptions of input variables, input constraints, and structures below the domain definition are omitted.
図6は、設計モデルの一例を示す図である。図6に示されるように、本実施の形態では、設計モデルに二つのビジネスロジックが含まれている。一つは、「夫婦型保険の加入判定処理」であり、もう一つは、「夫婦型保険の料金計算処理」である。「夫婦型保険の加入判定処理」は、夫婦型保険への加入の可否を判定する処理(ビジネスロジック)である。「夫婦型保険の料金計算処理」は、「夫婦型保険の加入判定処理」において加入が可能であると判定された場合に、加入対象の夫婦型保険の料金を計算する処理(ビジネスロジック)である。なお、本実施の形態において、「夫婦型保険の料金計算処理」に関するテストデータの生成の説明については、便宜上、省略される。 FIG. 6 is a diagram illustrating an example of a design model. As shown in FIG. 6, in this embodiment, the design model includes two business logics. One is the “judgment-type insurance enrollment determination process”, and the other is “the couple-type insurance charge calculation process”. The “judgment type insurance enrollment determination process” is a process (business logic) for determining whether or not the couple type insurance can be enrolled. “Couple-type insurance fee calculation processing” is a process (business logic) that calculates the fee for couple-type insurance to be enrolled when it is determined that “joint-type insurance subscription determination processing” is possible. is there. In the present embodiment, the description of the test data generation related to the “couple-type insurance fee calculation process” is omitted for the sake of convenience.
「夫婦型保険の加入判定処理」には、夫年齢、妻年齢、プラン名、又は備考を変数IDとする4つの入力変数が有る。夫年齢は、夫の年齢が入力される整数型の変数である。妻年齢は、妻の年齢が入力される整数型の入力変数である。プラン名は、夫婦型保険に属する複数のプランのうち、加入対象とするプランのプラン名が入力される列挙型の入力変数である。備考は、任意の文字列が入力される文字列型の変数である。なお、夫年齢、妻年齢、及びプラン名については、入力が必須とされている。一方、備考については、入力は必須とされていない。 There are four input variables with the husband ID, wife age, plan name, or remarks as variable IDs in the “coupled insurance enrollment determination process”. Husband age is an integer type variable into which the age of the husband is input. The wife age is an integer type input variable into which the wife's age is input. The plan name is an enumerated input variable into which a plan name of a plan to be subscribed among a plurality of plans belonging to the couple-type insurance is input. The comment is a character string type variable into which an arbitrary character string is input. Note that the husband age, wife age, and plan name must be entered. On the other hand, input is not required for remarks.
入力制約としては、それぞれ制約(1)、制約(2)、制約(3)、制約(4)を入力制約IDとする4つの入力制約が有る。制約(1)は、式(1)を含む。式(1)は、夫年齢が18歳以上であることを示す。制約(2)は、式(2)を含む。式(2)は、妻年齢が16歳以上であることを示す。なお、制約(1)及び制約(2)の少なくともいずれか一方に違反した場合、「年齢不正」のエラーメッセージが表示される。制約(3)は、式(3)を含む。式(3)は、備考の長さが10文字以下であることを示す。制約(4)は、式(4)を含む。式(4)は、備考の各文字が、全角の漢字又は全角のカタカナであることを示す。なお、制約(3)及び制約(4)の少なくともいずれか一方に違反した場合、「備考不正」のエラーメッセージが表示される。 As the input constraints, there are four input constraints having the constraint (1), the constraint (2), the constraint (3), and the constraint (4) as input constraint IDs, respectively. Constraint (1) includes equation (1). Formula (1) indicates that the husband's age is 18 years or older. Constraint (2) includes equation (2). Equation (2) indicates that the wife is 16 years old or older. If at least one of the constraint (1) and the constraint (2) is violated, an error message “age invalid” is displayed. Constraint (3) includes equation (3). Equation (3) indicates that the remark length is 10 characters or less. Constraint (4) includes equation (4). Formula (4) shows that each character of the remarks is a full-width kanji or a full-width katakana. When at least one of constraint (3) and constraint (4) is violated, an error message “remarks illegal” is displayed.
ドメイン定義としては、それぞれドメイン1、ドメイン2をドメインIDとする2つのドメイン定義が有る。ドメイン1は、式(5)を含む。式(5)は、夫年齢と妻年齢との差が20歳以下であることを示す。式(5)が満たされる場合、加入は可能であると判定され、「夫婦型保険の料金計算処理」を起動させるためのボタンが表示される。ドメイン2は、式(6)を含む。式(6)は、夫年齢と妻年齢との差が20歳を超えることを示す。式(6)が満たされる場合、加入はできないと判定され、個人型保険へのリンクが表示される。
As domain definitions, there are two domain definitions in which
上記の式(5)及び式(6)から明らかなように、本実施の形態において、夫年齢と妻年齢とが、相互に依存関係を有する入力変数の一例である。すなわち、式(5)又は式(6)を満たすために、夫年齢の値と妻年齢との値は、他方の値に依存する。 As is clear from the above formulas (5) and (6), in the present embodiment, the husband age and the wife age are examples of input variables having a dependency relationship with each other. That is, in order to satisfy Expression (5) or Expression (6), the value of the husband age and the value of the wife age depend on the other value.
なお、設計モデルは、例えば、特許文献2に示されるように、表形式のデータによって与えられてもよい。
The design model may be given by tabular data as disclosed in
続いて、設計モデル分析部12は、設計モデルを分析し、設計モデルに含まれる各ビジネスロジックを、それぞれテスト対象として抽出する(S110)。すなわち、本実施の形態において、1つのビジネスロジックは、1つのテスト対象となる。続くステップS120〜S180は、テスト対象ごと(ビジネスロジックごと)に実行される。以下、処理対象とされているテスト対象を、「着目テスト対象」という。
Subsequently, the design
ステップS120において、テスト項目抽出部13は、着目テスト対象からテスト項目一覧を抽出する。具体的には、テスト項目抽出部13は、着目テスト対象に含まれる、各入力制約、各ドメイン定義に対するテスト項目をそれぞれ生成する。例えば、着目テスト対象に、入力制約がn個、ドメイン定義がm個含まれる場合、an+bm件のテスト項目が抽出される。係数a及びbは、1つの設計要素(入力制約又はドメイン定義等)に関して複数の観点から複数件のテスト項目が生成されてもよいことを示す。本実施の形態では、a=1、b=1であるとする。
In step S120, the test
図7は、テスト項目一覧の抽出例を示す図である。図7には、テスト項目IDが1〜6の6個のテスト項目を含むテスト項目一覧が抽出された例が示されている。各テスト項目は、テスト項目ID、着目設計要素、及びテスト項目内容等を含む。テスト項目IDは、各テスト項目の識別情報である。着目設計要素は、当該テスト項目の抽出元となった設計要素(入力制約又はドメイン定義)である。テスト項目内容は、テスト項目の内容を示す情報である。
FIG. 7 is a diagram illustrating an example of extracting a test item list. FIG. 7 shows an example in which a test item list including six test items having
図7において、テスト項目IDが1であるテスト項目(以下、「テスト項目1」といい、他のテスト項目も同様の命名規則に従う。)は、図6に示される設計モデルの入力制約の制約(1)に基づいて抽出されたテスト項目である。テスト項目2、テスト項目3、テスト項目4は、それぞれ、制約(2)、制約(3)、制約(4)に基づいて抽出されたテスト項目である。テスト項目5は、ドメイン定義のドメイン1に基づいて抽出されたテスト項目である。テスト項目6は、ドメイン2に基づいて抽出されたテスト項目である。
In FIG. 7, the test item whose test item ID is 1 (hereinafter referred to as “
続くステップS130〜S180は、ステップS120において抽出されたテスト項目ごとに実行される。以下、処理対象とされているテスト項目を「着目テスト項目」という。 Subsequent steps S130 to S180 are executed for each test item extracted in step S120. Hereinafter, the test item to be processed is referred to as “target test item”.
ステップS130において、条件抽出部14は、着目テスト項目に対応するテストデータの生成条件(以下、「テストデータ生成条件」という。)を抽出する(S130)。具体的には、着目テスト項目が、入力制約に基づいて抽出されたテスト項目1〜4のいずれかである場合、着目テスト項目の入力制約に加え、他の全ての入力制約の式も取得され、テストデータ生成条件が生成される。したがって、テスト項目1〜4に関しては、それぞれ制約(1)〜制約(4)のそれぞれの式を含むテストデータ生成条件が生成される。一方、着目テスト項目が、ドメイン定義に基づいて抽出されたテスト項目5又は6である場合、当該テスト項目において着目されているドメイン定義に加え、全ての入力制約の式も取得され、テストデータ生成条件が生成される。したがって、例えば、テスト項目5に関しては、図8に示されるようなテストデータ生成条件が生成される。
In step S130, the condition extraction unit 14 extracts a test data generation condition (hereinafter referred to as “test data generation condition”) corresponding to the test item of interest (S130). Specifically, when the target test item is one of the
図8は、一つのテスト項目に関するテストデータ生成条件の一例を示す図である。図8に示されるようにテスト項目5に関しては、式(1)〜式(5)の5つのテストデータ生成条件が生成される。式(1)〜式(4)は、制約(1)〜制約(4)に関するテストデータ生成条件であり、式(5)は、ドメイン1に関するテストデータ生成条件である。
FIG. 8 is a diagram illustrating an example of test data generation conditions for one test item. As shown in FIG. 8, for the
なお、テスト項目6に関しては、式(5)の代わりにドメイン2に関する式(6)を含むテストデータ生成条件が生成される。ドメイン定義に基づくテスト項目に関して全ての入力制約のそれぞれに関するテストデータ生成条件が生成されるのは、全ての入力制約が満たされていないと、ドメイン定義に関するテストを正しく実行することができないからである。
For the
続いて、変数分類部15は、各テストデータ生成条件を解析し、各テストデータ生成条件に関する入力変数を、依存関係の有無に基づいて変数集合に分類し、各テストデータ生成条件を各変数集合に振り分ける(S140)。
Subsequently, the variable classifying
図9は、テストデータ生成条件が各変数集合に振り分けられた例を示す図である。図9には、図8に示したテストデータ生成条件が、変数集合1〜3の3つの変数集合に振り分けられた例が示されている。
FIG. 9 is a diagram illustrating an example in which the test data generation conditions are distributed to each variable set. FIG. 9 shows an example in which the test data generation conditions shown in FIG. 8 are distributed to three
変数集合1は、夫年齢及び妻年齢を含む変数集合である。すなわち、夫年齢と妻年齢とは相互に依存関係を有するため、同じ変数集合に含まれる。変数集合2は、プラン名を含む変数集合である。変数集合3は、備考を含む変数集合である。プラン名及び備考のそれぞれは、他の入力変数と依存関係を有さないため、それぞれ単独で変数集合を形成する。
The
各変数集合には、当該変数集合に含まれる入力変数に関する式を含むテストデータ生成条件が振り分けられる。したがって、変数集合1には式(1)、式(2)、及び式(5)が振り分けられ、変数集合3には式(3)及び式(4)が振り分けられている。なお、プラン名に関する式は無いため、変数集合2に振り分けられるテストデータ生成条件は無い。
Each variable set is assigned a test data generation condition including an expression relating to an input variable included in the variable set. Therefore, Expression (1), Expression (2), and Expression (5) are assigned to the
続くステップS150〜S170は、変数集合ごとに実行される。以下、処理対象とされている変数集合を、「着目変数集合」という。 Subsequent steps S150 to S170 are executed for each variable set. Hereinafter, the variable set to be processed is referred to as a “target variable set”.
ステップS150において、値候補生成部16は、着目変数集合に2以上の入力変数が含まれているか否かを判定する。例えば、着目変数集合が変数集合1であれば、2以上の入力変数が含まれていると判定される。着目変数集合が変数集合2又は3であれば、2以上の入力変数は含まれていないと判定される。
In step S150, the
着目変数集合に2以上の変数集合が含まれていない場合(S150でNO)、値候補生成部16は、着目変数集合に含まれる1つの入力変数に関する値候補を、例えば、特許文献1又は特許文献2に記載された手法を用いて生成する(S160)。値候補生成部16は、生成された値候補を、当該値候補の特徴を示す情報に関連付けて、値候補記憶部111に記憶する。
When two or more variable sets are not included in the target variable set (NO in S150), the value
一方、着目変数集合に2以上の変数集合が含まれている場合(S150でYES)、値候補生成部16は、着目変数集合に含まれる入力変数に関する値候補を、ドメインテスト技法を用いて生成する(S170)。値候補生成部16は、生成された値候補を、当該値候補の特徴を示す情報に関連付けて、値候補記憶部111に記憶する。なお、ステップS170の詳細については後述される。
On the other hand, if the target variable set includes two or more variable sets (YES in S150), the value
なお、ステップS160及びステップS170において、値候補生成部16は、正常値の値候補として、入力変数のデータ型に依存した単純値を取得する。単純値とは、データ型ごとに予め設定された、視認性の高い単純な値(固定値)である。例えば、整数型であれば、0が単純値の一例として挙げられる。但し、視認性の高さに関する評価は、人によって異なる可能性も有る。したがって、単純値は、所定の値に限定されず、任意に設定されてよい。なお、単純値は、例えば、データ型ごとに、補助記憶装置102、又はテストデータ生成装置10にネットワークを介して接続可能な記憶装置等に記憶されている。1つのデータ型に、複数の単純値が設定されていてもよい。
In step S160 and step S170, the value
変数集合1〜3に関して、ステップS150〜S170が実行されると、値候補記憶部111には、図10に示されるような値候補が記憶される。
When steps S150 to S170 are executed for the variable sets 1 to 3, the value
図10は、変数集合ごとの値候補の生成例を示す図である図10には、変数集合1に含まれる夫年齢及び妻年齢の組に関して、inポイント、outポイント、onポイント、並びに2つの正常値のoffポイント及び2つの異常値のoffポイント、並びに単純値の8通りの値候補が生成され、変数集合2に含まれるプラン名に関して、2つの正常値及び1つの異常値を含む3通りの値候補が生成され、変数集合3に含まれる備考に関して5つの正常値(単純値を含む)及び4つの異常値を含む9通りの値候補が生成された例が示されている。
FIG. 10 is a diagram illustrating an example of generation of value candidates for each variable set. FIG. 10 shows in point, out point, on point, and two points for the husband age and wife age group included in the
本実施の形態において、変数集合2及び変数集合3については、ステップS160において正常値及び異常値が値候補として生成されるため、これらの入力変数の値候補の特徴には、「正常値」又は「異常値」が含まれている。また、変数集合1については、ステップS170において、正常値及び異常値が値候補として生成されるため、これらの入力変数の値候補の特徴には「正常値」又は「異常値」が含まれている。
In the present embodiment, for the
また、変数集合1の値候補については、(inポイント)、(outポイント)、(onポイント)、(offポイント)が特徴に含まれている。「onポイント」は、当該値候補が、onポイントであることを示す。onポイントとは、入力制約又はドメイン定義に基づいて求まる同値クラスの境界上の値である。「outポイント」は、当該値候補が、outポイントであることを示す。outポイントとは、同値クラス外の値である。「inポイント」は、当該値候補が、inポイントであることを示す。inポイントは、同値クラス内の値である。「offポイント」は、当該値候補が、offポイントであることを示す。offポイントとは、onポイントがのる境界を、変数ごとにプラス側およびマイナス側にずらして得られる境界近傍の値である。但し、式(5)のように、onポイントが一つである場合、onポイントからプラス側及びマイナス側のそれぞれに1ずれた値がoffポイントとなる。
Further, regarding the value candidates of the
また、変数集合1のinポイント若しくはoutポイントの値候補及び変数集合3の値候補については、(境界値分析)又は(同値分割)が特徴に含まれている。「境界値分析」は、境界値分析に基づく値候補であることを示す。「同値分割」は、同値分割に基づく値候補であることを示す。
In addition, the value candidate of the in point or the out point of the
また、変数集合1及び変数集合3のそれぞれには、(単純値)を特徴に含む正常値の値候補が含まれている。「単純値」は、単純値であることを示す。なお、厳密には、単純値は、必ずしも正常値になるとは限らない。単純値は、入力制約やドメイン定義等とは無関係に、データ型に依存して予め設定される値だからである。したがって、例えば、変数集合1の単純値の値候補である(0,0)は、夫年齢及び妻年齢に対する入力制約を満たしていないが、便宜的に正常値の値候補として生成される。
Further, each of the
また、プラン名が属する変数集合2には、単純値の値候補が含まれていない。これは、プラン名のデータ型が列挙型であるからである。すなわち、列挙型については、特定の入力変数に依存しない単純値を設定するのは困難である。そこで、本実施の形態では、列挙型については、単純値が設定されておらず、したがって、変数集合2には、単純値の値候補は含まれていない。
The
続いて、組み合わせ生成部17は、着目テスト項目に関して生成された値候補を組み合わせてテストケースを生成する(S180)。具体的には、組み合わせ生成部17は、着目テスト項目に関する変数集合のうち、テスト項目の着目設計要素の式が属している変数集合の異常値の値候補ごとに、その他の各変数集合から1つの単純値の値候補を選択して、テストデータを生成する。但し、単純値が値候補に含まれない変数集合からは、単純値でも境界値でもない1つの正常値が選択される。例えば、着目テスト項目がテスト項目5であれば、その着目設計要素がドメイン1であり、ドメイン1の式(5)は変数集合1の条件であるため、図10における、変数集合1の3通りの異常値の値候補ごとに、変数集合2及び変数集合3のそれぞれから1つの正常値又は単純値の値候補が選択されて、値候補の組み合わせがテストデータとして生成される。したがって、この場合、3通りの組み合わせが生成される。
Subsequently, the
テストケースの生成の結果、全ての入力変数に対して具体値が割り当てられる。組み合わせ生成部17は、生成された組み合わせごとにテストケースを生成する。
As a result of test case generation, specific values are assigned to all input variables. The
ステップS130〜ステップS180が全てのテスト項目について実行され、更に、ステップS120〜ステップS180が全てのテスト対象(ビジネスロジック)について実行されると、組み合わせ生成部17は、ステップS180において生成されたテストケースに基づいてテストモデルを生成し、生成されたテストモデルの内容をテストケース表として、ユーザ端末20に送信する(S190)。
When steps S130 to S180 are executed for all test items, and further, when steps S120 to S180 are executed for all test objects (business logic), the
図11は、テストモデルの一例を示す図である。図11に示されるように、テストモデルは、テスト対象ごとに、テスト項目を含む。また、テスト項目ごとに、1以上のテストケースが含まれる。1つのテスト項目に対応するテストケースは、ステップS180において生成される。 FIG. 11 is a diagram illustrating an example of a test model. As shown in FIG. 11, the test model includes a test item for each test target. Each test item includes one or more test cases. A test case corresponding to one test item is generated in step S180.
1つのテストケースは、テストケースID、入力変数ごとの具体値、期待結果、及びテストケース特徴を含む。テストケースIDは、テストケースごとの識別情報である。入力変数ごとの具体値は、ステップS180において生成される値候補の組み合わせである。1つのテスト項目に対して複数のテストケースが生成されるのは、当該組み合わせが複数有るためである。期待結果は、テストによって期待される結果である。期待結果の内容は、設計モデルの入力制約又はドメイン定義に基づいて生成される。すなわち、入力制約に基づくテスト項目に関するテストケースの期待結果は、当該入力制約の「結果」に基づいて生成される。ドメイン定義に基づくテスト項目に関するテストケースの期待結果は、当該ドメイン定義の「結果」に基づいて生成される。テストケース特徴は、テストケースの特徴である。テストケース特徴の内容は、当該テストケースにおいて選択された値候補に関して値候補記憶部111に記憶されている特徴に基づいて生成される。
One test case includes a test case ID, a specific value for each input variable, an expected result, and a test case feature. The test case ID is identification information for each test case. The specific value for each input variable is a combination of value candidates generated in step S180. A plurality of test cases are generated for one test item because there are a plurality of such combinations. The expected result is the result expected by the test. The content of the expected result is generated based on the input constraint or domain definition of the design model. That is, the expected result of the test case related to the test item based on the input constraint is generated based on the “result” of the input constraint. The expected result of the test case regarding the test item based on the domain definition is generated based on the “result” of the domain definition. A test case feature is a feature of a test case. The content of the test case feature is generated based on the feature stored in the value
テストモデルの内容を示すテストケース表は、例えば、特許文献2に記載された手法を用いて生成されてもよい。
The test case table indicating the contents of the test model may be generated using, for example, the technique described in
なお、上記において説明したテストモデルの構造を厳密に定義すると、例えば、図12に示されるようになる。 If the structure of the test model described above is strictly defined, for example, as shown in FIG.
図12は、テストモデルのデータ構造の定義の一例を示す図である。図12では、テストモデルのデータ構造がBNFによって定義されている。 FIG. 12 is a diagram illustrating an example of the definition of the data structure of the test model. In FIG. 12, the data structure of the test model is defined by BNF.
続いて、ステップS140の詳細について説明する。図13は、入力変数の分類処理の処理手順の一例を説明するためのフローチャートである。 Next, details of step S140 will be described. FIG. 13 is a flowchart for explaining an example of a processing procedure of input variable classification processing.
ステップS200において、変数分類部15は、ステップS130において条件抽出部14によって抽出されたテストデータ生成条件を条件抽出部14から取得する。続くステップS210〜S260は、テストデータ生成条件ごとに実行される。以下、処理対象とされているテストデータ生成条件を、「着目条件」という。
In step S200, the
ステップS210において、変数分類部15は、着目条件が扱う入力変数x1〜xn(nは、着目条件が扱う入力変数の個数)を特定する。続いて、変数分類部15は、x1〜xnの全てを含む変数集合Aが生成済みであるか否かを判定する(S220)。変数集合Aが生成済みでない場合(S220でNO)、変数分類部15は、変数集合Aを生成し、着目条件を、変数集合Aに振り分ける(S230)。続いて、変数分類部15は、変数集合Aの部分集合となる変数集合Bが生成済みであるか否かを判定する(S240)。変数集合Bが生成されている場合(S240でYES)、変数分類部15は、変数集合Bに振り分けられているテストデータ生成条件を、変数集合Aに振り分け、変数集合Bを削除する(S250)。
In step S210, the
一方、x1〜xnの全てを含む変数集合Aが生成済みである場合(S220でYES)、変数分類部15は、着目条件を変数集合Aに振り分ける(S260)。
On the other hand, when the variable set A including all of x1 to xn has been generated (YES in S220), the
全てのテストデータ生成条件に関してステップS210〜S260が実行されると、変数分類部15は、設計モデルに含まれる入力変数の中で、既に生成されたいずれの変数集合にも含まれていない入力変数の有無を判定する(S270)。該当する入力変数が1以上有る場合(S270でYES)、変数分類部15は、該当する入力変数ごとに、変数集合を生成する(S280)。例えば、本実施の形態において、プラン名は、いずれのテストデータ生成条件にも含まれない。したがって、プラン名が属する変数集合は、ステップS230では生成されず、ステップS280において生成される。
When steps S210 to S260 are executed for all test data generation conditions, the
図8に示したテストデータ生成条件を、図13の処理手順に当てはめて説明する。まず、式(1)が着目条件とされる。式(1)が扱う入力変数は、夫年齢であることが特定される(S210)。夫年齢を含む変数集合は生成されていないため(S220でNO)、夫年齢を含む変数集合が生成され、当該変数集合に式(1)が振り分けられる(S230)。当該変数集合の部分集合となる変数集合は生成されていない。したがって、式(2)が着目条件とされる。式(2)〜式(4)についても、同様の手順で、それぞれの変数集合が生成される。 The test data generation conditions shown in FIG. 8 will be described with reference to the processing procedure of FIG. First, the expression (1) is set as the target condition. The input variable handled by Equation (1) is specified to be the husband's age (S210). Since a variable set including the husband's age has not been generated (NO in S220), a variable set including the husband's age is generated, and Expression (1) is assigned to the variable set (S230). A variable set that is a subset of the variable set is not generated. Therefore, the expression (2) is set as the target condition. Also for Expressions (2) to (4), each variable set is generated in the same procedure.
式(5)が着目条件とされた場合、式(5)が扱う入力変数は、夫年齢及び妻年齢であることが特定される(S210)。夫年齢及び妻年齢の双方を含む変数集合は生成されていないため(S220でNO)、夫年齢及び妻年齢の双方を含む変数集合(以下、「変数集合(5)」という。)が生成され、変数集合5に式(5)が振り分けられる(S230)。変数集合(5)の部分集合となる変数集合としては、式(1)に関して生成された変数集合(以下、「変数集合(1)」という。)と式(2)に関して生成された変数集合(以下、「変数集合(2)」という。)とが有る(S240でYES)。そこで、式(1)と式(2)とが、変数集合(5)に統合され、変数集合(1)及び変数集合(2)は削除される(S250)。その結果、図9に示したような変数集合が生成される。 When Expression (5) is set as the target condition, it is specified that the input variables handled by Expression (5) are husband age and wife age (S210). Since a variable set including both husband age and wife age has not been generated (NO in S220), a variable set including both husband age and wife age (hereinafter referred to as “variable set (5)”) is generated. The expression (5) is distributed to the variable set 5 (S230). As a variable set that is a subset of the variable set (5), a variable set generated with respect to the expression (1) (hereinafter referred to as “variable set (1)”) and a variable set generated with respect to the expression (2) ( (Hereinafter referred to as “variable set (2)”) (YES in S240). Therefore, the expressions (1) and (2) are integrated into the variable set (5), and the variable sets (1) and (2) are deleted (S250). As a result, a variable set as shown in FIG. 9 is generated.
続いて、図4のステップS170の詳細について説明する。図14は、ドメインテスト技法を用いた値候補の生成処理の処理手順の一例を説明するためのフローチャートである。 Next, details of step S170 in FIG. 4 will be described. FIG. 14 is a flowchart for explaining an example of a processing procedure of value candidate generation processing using the domain test technique.
ステップS300において、値候補生成部16は、1以上のテストデータ生成条件を読み込む。ここで読み込まれるテストデータ生成条件(以下、「着目条件」という。)は、図4のステップS170の時点の着目変数集合に振り分けられたテストデータ生成条件である。続いて、値候補生成部16は、着目条件が属する着目変数集合に含まれている入力変数のデータ型に基づいて処理を分岐させる(S310)。
In step S300, the
着目変数集合に含まれている各入力変数の全てが整数型である場合、値候補生成部16は、着目条件に関するinポイント、outポイント、onポイント、及びoffポイントを当該各入力変数の値候補として求める(S320)。
When all the input variables included in the target variable set are integer types, the value
なお、本実施の形態において、テスト項目5が着目テスト項目であり、図9の変数集合1(夫年齢、妻年齢)が着目変数集合である場合に、ステップS320が実行される。
In the present embodiment, when the
一方、着目変数集合に含まれている各入力変数の全てが文字列型である場合、値候補生成部16は、着目条件の中で当該入力変数の文字列長に関するテストデータ生成条件を抽出する(S330)。続いて、値候補生成部16は、抽出されたテストデータ生成条件に基づいて、inポイント、outポイント、onポイント、及びoffポイントを求める(S340)。続いて、値候補生成部16は、inポイント、outポイント、onポイント、及びoffポイントごとに、文字列長以外の着目条件も満たすような文字列を値候補として生成する(S350)。なお、例えば、「string1の長さ>=string2の長さ」といったような入力制約を有する入力変数(ここでは、string1及びstring2)が有る場合に、ステップS350が実行される。なお、着目条件の中に、文字列長に関するテストデータ生成条件が無い場合、ステップS340は実行されなくてよい。
On the other hand, when all of the input variables included in the target variable set are character string types, the value
また、着目変数集合に含まれている各入力変数の全てが実数型、列挙型、日付型、又は時刻型等、整数型及び文字列型のいずれでもない場合、値候補生成部16は、着目条件の境界値を、整数型に変換する(S360)。例えば、実数型であれば当該境界値に10n(nは、当該境界値の小数点以下の桁数)を乗ずることにより整数型に変換することができる。また、列挙型であれば、列挙される値を列挙の順序関係を保持したまま、整数に置換してもよい。例えば、列挙される値が{社長、部長、課長、係長、社員}であれば、これらは、{5、4、3、2、1}に置換されてもよい。その上で、着目条件の境界値が、置換後の整数に置き換えられればよい。また、日付型や時刻型については、UNIX(登録商標)時刻等のシステム時刻に変換してもよい。例えば、日本標準時の「2001−09−09 10:46:40」という値は、「1000000000」というUNIX(登録商標)時刻に変換されてもよい。
When all the input variables included in the target variable set are not of any integer type or character string type, such as a real number type, an enumeration type, a date type, or a time type, the value
続いて、値候補生成部16は、境界値が整数型に変換された着目条件に基づいて、inポイント、outポイント、onポイント、及びoffポイントを求める(S370)。続いて、値候補生成部16は、求められたinポイント、outポイント、onポイント、及びoffポイントを、ステップS360とは逆の変換を行うことにより、元のデータ型に復元する。復元後の値が、値候補である。
Subsequently, the value
ステップS320、S350、又はS380に続いて、値候補生成部16は、生成された値候補を、値候補記憶部111に記憶する(S390)。この際、値候補生成部16は、着目変数集合に含まれている各入力変数のそれぞれのデータ型に依存した単純値を取得し、取得された単純値についても、着目変数集合の値候補として、値候補記憶部111に記憶する。当該値候補には、特徴として「正常値(単純値)」が付与される。
Subsequent to step S320, S350, or S380, the value
なお、着目変数集合に属する各入力変数のデータ型が相互に異なる場合は、ステップS310の前において、ステップS360において説明したように、全ての着目条件の境界値が整数型に変換されてもよい。この場合、ステップS320の実行後に、各値候補に関して、ステップS380と同様の逆変換が行われればよい。 When the data types of the input variables belonging to the target variable set are different from each other, all the boundary values of the target condition may be converted to the integer type as described in step S360 before step S310. . In this case, after the execution of step S320, the inverse transformation similar to that in step S380 may be performed for each value candidate.
続いて、ステップS320、ステップS340、及びステップS370の詳細について説明する。 Next, details of step S320, step S340, and step S370 will be described.
図15は、値候補の生成処理の処理手順の一例を説明するためのフローチャートである。 FIG. 15 is a flowchart for explaining an example of a processing procedure of value candidate generation processing.
ステップS510において、値候補生成部16は、着目条件のinポイントを求めて値候補とし、当該値候補に、特徴として「正常値(同値分割)」を付与する。続いて、値候補生成部16は、着目条件のoutポイントを求めて値候補とし、当該値候補に、特徴として「異常値(同値分割)」を付与する(S520)。続いて、値候補生成部16は、着目条件のonポイントを求めて値候補とし、当該値候補に、特徴として「正常値(境界値分析)」又は「異常値(境界値分析)」を付与する(S530)。続いて、値候補生成部16は、着目条件のoffポイントを求めて値候補とし、当該値候補に、特徴として「異常値(境界値分析)」又は「正常値(境界値分析)」を付与する(S540)。
In step S510, the value
ステップS530及びステップS540に関して、付与される特徴が「正常値」又は「異常値」のいずれか一方に固定されないのは、onポイント及びoffポイントについては、着目条件によって、正常値又は異常値のいずれかに変化するからである。したがって、onポイント又はoffポイントが、全ての着目条件を満たす場合、当該onポイント又は当該offポイントは正常値とされ、onポイント又はoffポイントが、いずれかの着目条件を満たさない場合、当該onポイント又は当該offポイントは異常値とされればよい。 Regarding step S530 and step S540, the added feature is not fixed to either “normal value” or “abnormal value”. For the on point and the off point, either the normal value or the abnormal value is determined depending on the condition of interest. Because it changes. Therefore, when the on point or the off point satisfies all the target conditions, the on point or the off point is set to a normal value, and when the on point or the off point does not satisfy any of the target conditions, the on point Alternatively, the off point may be an abnormal value.
なお、ステップS530及びステップS540では、公知の方法を用いてonポイント又はoffポイントが求められてもよい。例えば、特許文献3に記載された方法が用いられてもよい。特許文献3に記載された方法によれば、onポイントが正常値であるか若しくは異常値であるか、offポイントが正常値であるか若しくは異常値であるかについても得ることができる。
In step S530 and step S540, an on point or an off point may be obtained using a known method. For example, the method described in
続いて、ステップS510の詳細について説明する。図16は、inポイントの値候補の生成処理の処理手順の一例を説明するためのフローチャートである。 Next, details of step S510 will be described. FIG. 16 is a flowchart for explaining an example of the processing procedure of in point value candidate generation processing.
ステップS600において、値候補生成部16は、1以上のテストデータ生成条件を読み込む(S600)。ここで読み込まれるテストデータ生成条件は、図15のステップS510の時点における着目条件である。
In step S600, the
続いて、値候補生成部16は、inポイントを求めるための制約式を生成する(S610)。具体的には、着目条件を構成する式E1〜Em(mは、着目条件の個数)が取得され、「E1 and E2 and … and Em」というような、正常値(ドメイン内に収まる値)を得るための制約式が生成される。例えば、着目変数集合が、図9の変数集合1である場合、「夫年齢>=18 and 妻年齢>=16 and |夫年齢−妻年齢|<=20」という制約式が生成される。
Subsequently, the value
続いて、値候補生成部16は、公知の制約ソルバを用いて制約式の解を得て、任意の1つの解を、inポイントの値候補として生成する(S620)。なお、着目変数集合に複数の入力変数が属する場合、複数の入力変数に関してinポイントの値候補が生成される。
Subsequently, the value
続いて、ステップS520の詳細について説明する。図17は、outポイントの値候補の生成処理の処理手順の一例を説明するためのフローチャートである。 Next, details of step S520 will be described. FIG. 17 is a flowchart for explaining an example of a processing procedure of out point value candidate generation processing.
ステップS700において、値候補生成部16は、1以上のテストデータ生成条件を読み込む(S700)。ここで読み込まれるテストデータ生成条件は、図15のステップS520の時点における着目条件である。
In step S700, the
続いて、値候補生成部16は、outポイントを求めるための制約式を生成する(S710)。具体的には、着目条件を構成する式E1〜Em(mは、着目条件の個数)が取得され、「Not(E1 and E2 and … and Em)」というような、異常値(ドメイン外となる値)を得るための制約式が生成される。例えば、着目変数集合が、図9の変数集合1である場合、「Not(夫年齢>=18 and 妻年齢>=16 and |夫年齢−妻年齢|<=20)」という制約式が生成される。
Subsequently, the value
続いて、値候補生成部16は、公知の制約ソルバを用いて制約式の解を得て、任意の1つの解を、outポイントの値候補として生成する(S720)。なお、着目変数集合に複数の入力変数が属する場合、複数の入力変数に関してoutポイントの値候補が生成される。
Subsequently, the value
続いて、図4のステップS180の詳細について説明する。図18は、テストケースの生成処理の処理手順の一例を説明するためのフローチャートである。 Next, details of step S180 in FIG. 4 will be described. FIG. 18 is a flowchart for explaining an example of a processing procedure of test case generation processing.
ステップS400において、組み合わせ生成部17は、1以上のテストデータ生成条件を読み込む。ここで読み込まれるテストデータ生成条件は、図4のステップS180の時点の着目テスト項目に関する全てのテストデータ生成条件である。例えば、テスト項目5が着目テスト項目である場合、図8に示される式(1)〜式(5)が読み込まれる。
In step S400, the
続いて、組み合わせ生成部17は、着目テスト項目に関する各変数集合に関して生成された全ての値候補を値候補記憶部111から取得する(S410)。続いて、組み合わせ生成部17は、ステップS400において読み込まれたテストデータ生成条件のうち、着目テスト項目において着目されているテストデータ生成条件を取得する(S420)。着目テスト項目において着目されているテストデータ生成条件とは、着目テスト項目の生成の元となったテストデータ生成条件をいう。例えば、テスト項目5において着目されているテストデータ生成条件は、式(5)である。以下、ステップS420において取得されたテストデータ生成条件を、「着目条件」という。
Subsequently, the
続いて、組み合わせ生成部17は、着目条件が扱う1以上の入力変数(以下、当該1以上の入力変数をまとめて「変数x」という。)が属する変数集合の値候補を、ステップS410において取得された値候補の中から取得する(S430)。例えば、着目条件が式(5)であれば、変数集合1の値候補(図10参照)が取得される。続いて、組み合わせ生成部17は、ステップS430において取得された値候補の中から、異常値である全ての値候補を選択する(S440)。異常値であるか否かは、値候補の特徴に「異常値」が含まれているか否かに基づいて特定可能である。
Subsequently, the
続いて、組み合わせ生成部17は、変数x以外の残りの入力変数(以下、「変数y1〜ym」という。mは、変数x以外の入力変数の個数である。)のそれぞれが属する変数集合の値候補を、ステップS410において取得された値候補の中から取得する(S450)。続いて、組み合わせ生成部17は、ステップS450において取得された値候補の中から、変数y1〜ymのそれぞれごとに、一つの単純値の値候補を優先的に選択する(S460)。したがって、m個の値候補が取得される。但し、境界値である正常値は極力除かれる。変数xに関するテストデータを生成する際に、変数y1〜ymに関して境界値が選択された場合、バグ発生時にどの入力変数に起因したバグかの原因の切り分けが困難になってしまうからである。なお、境界値であることは、値候補の特徴に「境界値分析」が含まれていることに基づいて特定可能である。また、組み合わせ生成部17は、プラン名のように単純値が無い入力変数については、単純値ではない一つの正常値の値候補を選択する。また、組み合わせ生成部17は、設計モデル(図6)において、入力が必須とされていない入力変数の値候補は、空欄とする。
Subsequently, the
続いて、組み合わせ生成部17は、変数xに関してステップS440において選択された1以上の異常値の値候補と、変数y1〜ymに関して、ステップS460において一つずつ選択された単純値又は正常値の値候補との全ての組み合わせをテストケースとして生成する(S470)。この際、変数xが複数の場合、変数xごとに値候補の組み合わせが生成されるが、変数y1〜ymについては、各組み合わせに対して共通の値候補が選択される。
Subsequently, the
例えば、着目テスト項目がテスト項目5であり、着目条件が式(5)である場合、変数xは、夫年齢及び妻年齢である。また、変数y1〜ymは、プラン名及び備考である。したがって、夫年齢及び妻年齢に関しては、図10に示される8通りの値候補のうち、3通りの異常値の値候補が選択される。プラン名に関しては、図10に示される3通りの値候補のうち、任意の一つの正常値の値候補が、夫年齢及び妻年齢に関する3通りの異常値に対して共通に(固定的に)選択される。備考に関しては、必須ではないため空欄とされる。すなわち、備考についても、夫年齢及び妻年齢に関する3通りの異常値に対して共通の値となる。したがって、これらの入力変数の値候補の全ての組み合わせは、3通りとなる。斯かる3通りの組み合わせが、図11において、テスト項目5に対するテストケース5−1〜5−3として示されている。図11に示されるテストケース5−1〜5−3において、プラン名の値及び備考の値は、それぞれ共通である。なお、備考が必須である場合、備考については、一つの単純値の値候補が、テストケース5−1〜5−3に対して共通に選択される。また、備考が必須でない場合であっても、備考に関する一つの単純値の値候補が、テストケース5−1〜5−3に関して共通に選択されてもよい。
For example, when the focused test item is the
また、例えば、着目テスト項目がテスト項目3であり、着目条件が式(3)である場合、変数xは、備考である。また、変数y1〜ymは、夫年齢、妻年齢、及びプラン名である。また、式(3)に関する備考の異常値の値候補としては、図10に示される4通りの異常値のうちの境界値分析に関する2通りの異常値が生成される。したがって、テスト項目3に関して、備考については、2通りの異常値の値候補が選択される。プラン名に関しては、任意の一つの正常値の値候補が選択される。夫年齢及び妻年齢については、一つの単純値が選択される。したがって、これらの入力変数の値候補の全ての組み合わせは、2通りとなる。斯かる2通りの組み合わせが、図11において、テスト項目3に対するテストケース3−1及び3−2として示されている。図11に示されるテストケース3−1及び3−2において、夫年齢及び妻年齢の値、並びにプラン名の値は、それぞれ共通である。
Further, for example, when the target test item is the
なお、図18の処理は、テスト項目ごとに実行される。各テスト項目は、入力制約又はドメイン定義の式ごとに生成される。したがって、図18の処理は、入力制約又はドメイン定義の各式について、当該式(着目条件)が扱う(当該式に関連する)入力変数(変数x)が属する第一の変数集合に関連付けられたいずれかの式を満たさない(すなわち、異常値の)値候補ごとに、前記第一の変数集合以外の第二の変数集合のそれぞれから、当該第二の変数集合に属する入力変数のデータ型に依存して設定された単純値を優先的に1つずつ選択して、値候補の組み合わせを生成する処理に相当する。更に、一つの式について前記第二のグループから選択される値候補は、当該式に関して生成される全ての前記組み合わせに対して共通である
上述したように、本実施の形態によれば、設計モデルからテストデータ生成条件が抽出され、テストデータ生成条件に基づいて、入力変数間の相互依存関係の有無が判定され、当該判定結果に基づいて、入力変数が変数集合に分類される。変数集合ごとに候補値が生成される際、一つの入力変数のみが属する変数集合と、相互に依存関係を有する複数の変数が属する変数集合とでは、相互に異なる方法によって値候補が生成される。
Note that the processing of FIG. 18 is executed for each test item. Each test item is generated for each input constraint or domain definition expression. Therefore, the processing in FIG. 18 is associated with the first variable set to which the input variable (variable x) handled (related to the formula) handled by the formula (target condition) belongs for each formula of the input constraint or domain definition. For each value candidate that does not satisfy any of the expressions (that is, an abnormal value), the data type of the input variable belonging to the second variable set is changed from each of the second variable sets other than the first variable set. This corresponds to a process of selecting one by one preferentially set depending on the priority and generating a combination of value candidates. Furthermore, value candidates selected from the second group for one expression are common to all the combinations generated for the expression. As described above, according to the present embodiment, the design model The test data generation conditions are extracted from the test data. Based on the test data generation conditions, it is determined whether or not there is an interdependency between the input variables. Based on the determination result, the input variables are classified into variable sets. When candidate values are generated for each variable set, value candidates are generated by different methods for variable sets to which only one input variable belongs and variable sets to which a plurality of variables having mutual dependency relationships belong. .
また、本実施の形態によれば、テスト項目ごとにテストデータを生成する際に、当該テスト項目の生成元となったテストデータ生成条件(図18における着目条件)が扱う入力変数(図18における変数x)に関しては、値候補の中から異常値の値候補が網羅的に選択され、当該入力変数以外の入力変数(図18における変数y1〜ym)に関しては、値候補の中から1つの単純値が優先的に選択されて、当該異常値の値候補ごとに、値候補の組み合わせが生成される。 Further, according to the present embodiment, when test data is generated for each test item, the input variable (in FIG. 18) handled by the test data generation condition (the attention condition in FIG. 18) that is the generation source of the test item. Regarding the variable x), the abnormal value candidate is comprehensively selected from the value candidates, and for the input variables other than the input variable (variables y1 to ym in FIG. 18), one simple value candidate is selected from the value candidates. A value is preferentially selected, and a combination of value candidates is generated for each value candidate of the abnormal value.
その結果、相互に依存関係の有る入力変数、依存関係を有さない入力変数を含んだ複数の入力変数に対して、各入力変数がそれぞれ仕様に違反し、かつ、データ型固有の単純値を含む異常系のテストデータを生成できる。 As a result, for input variables that have mutually dependent relationships and multiple input variables that include input variables that do not have a dependent relationship, each input variable violates the specification, and a simple value unique to the data type Including abnormal test data can be generated.
したがって、例えば、プログラムに対し異常なテストデータを入力した際に、入力チェックが正しく動作することを確認するテストにおいて、適切で、かつ、視認性が高く、レビューやテストを実施し易いテストデータを得ることができる。 Therefore, for example, when abnormal test data is input to a program, test data that is appropriate, has high visibility, and is easy to perform reviews and tests in a test that confirms that the input check operates correctly. Can be obtained.
以上、本発明の実施例について詳述したが、本発明は斯かる特定の実施形態に限定されるものではなく、特許請求の範囲に記載された本発明の要旨の範囲内において、種々の変形・変更が可能である。 As mentioned above, although the Example of this invention was explained in full detail, this invention is not limited to such specific embodiment, In the range of the summary of this invention described in the claim, various deformation | transformation・ Change is possible.
10 テストデータ生成装置
11 設計モデル抽出部
12 設計モデル分析部
13 テスト項目抽出部
14 条件抽出部
15 変数分類部
16 値候補生成部
17 組み合わせ生成部
20 ユーザ端末
100 ドライブ装置
101 記録媒体
102 補助記憶装置
103 メモリ装置
104 CPU
105 インタフェース装置
111 値候補記憶部
B バス
DESCRIPTION OF
105
Claims (5)
前記グループごとに、当該グループに関連付けられた前記条件式に基づいて、当該グループに属する入力変数の値の候補を生成する値候補生成部と、
前記各条件式について、当該条件式に関連する入力変数が属する第一のグループに関して生成された候補のうち、前記第一のグループに関連付けられたいずれかの条件式を満たさない前記候補ごとに、前記第一のグループ以外の第二のグループのそれぞれから、当該第二のグループに属する入力変数のデータ型に依存して設定された単純値を、前記条件式に基づいて生成された候補に対して優先的に1つずつ選択して、前記候補の組み合わせを生成する組み合わせ生成部とを有し、
前記組み合わせ生成部が一つの前記条件式について前記第二のグループから選択する前記単純値又は前記候補は、当該条件式に関して生成される全ての前記組み合わせに対して共通である、
ことを特徴とするテストデータ生成装置。 Based on one or more conditional expressions to be satisfied by a plurality of input variables in the program to be tested, it is determined whether or not there is a dependency relationship between the input variables, and one or more input variables are determined based on the presence or absence of the dependency relationship. A variable classifying unit that associates each conditional expression with a group to which an input variable related to the conditional expression belongs,
For each group, based on the conditional expression associated with the group, a value candidate generation unit that generates candidates for the values of input variables belonging to the group;
For each conditional expression, among the candidates generated for the first group to which the input variable related to the conditional expression belongs, for each candidate that does not satisfy any of the conditional expressions associated with the first group, From each of the second groups other than the first group, a simple value set depending on the data type of the input variable belonging to the second group is set for the candidate generated based on the conditional expression. A combination generation unit that preferentially selects one by one and generates the candidate combination,
The simple value or the candidate that the combination generation unit selects from the second group for one conditional expression is common to all the combinations generated for the conditional expression.
A test data generation apparatus characterized by the above.
ことを特徴とする請求項1記載のテストデータ生成装置。 The value candidate generation unit generates a candidate for the value of the input variable by a different method for the group including a plurality of input variables and the group including a single input variable.
The test data generation apparatus according to claim 1, wherein:
前記組み合わせ生成部は、前記複数の入力変数が含まれるグループが前記第一のグループである場合は、前記outポイント、前記onポイント、前記offポイントのうち、当該グループに関連付けられたいずれかの前記条件式を満たない候補ごとに前記組み合わせを生成し、前記複数の入力変数が含まれるグループが前記第二のグループである場合は、前記onポイント、前記inポイント、及び前記offポイントのうち、当該グループに関連付けられた全ての前記条件式を満たす候補を選択する、
ことを特徴とする請求項1又は2記載のテストデータ生成装置。 For the group including a plurality of input variables, the value candidate generator generates on-point, out-point, in-point, and off-point based on the conditional expression associated with the group as candidates for the value of the input variable. As sought
When the group including the plurality of input variables is the first group, the combination generation unit is configured to select one of the out point, the on point, and the off point associated with the group. The combination is generated for each candidate that does not satisfy the conditional expression, and when the group including the plurality of input variables is the second group, among the on point, the in point, and the off point, Selecting candidates that satisfy all the conditional expressions associated with the group;
The test data generation apparatus according to claim 1 or 2, wherein
テスト対象のプログラムにおける複数の入力変数が満たすべき1以上の条件式に基づいて、前記入力変数間の依存関係の有無を判定し、前記依存関係の有無に基づいて前記複数の入力変数を1以上のグループに分類して、前記各条件式を当該条件式に関連する入力変数が属するグループに関連付ける変数分類手順と、
前記グループごとに、当該グループに関連付けられた前記条件式に基づいて、当該グループに属する入力変数の値の候補を生成する値候補生成手順と、
前記各条件式について、当該条件式に関連する入力変数が属する第一のグループに関して生成された候補のうち、前記第一のグループに関連付けられたいずれかの条件式を満たさない前記候補ごとに、前記第一のグループ以外の第二のグループのそれぞれから、当該第二のグループに属する入力変数のデータ型に依存して設定された単純値を、前記条件式に基づいて生成された候補に対して優先的に1つずつ選択して、前記候補の組み合わせを生成する組み合わせ生成部とを有し、
前記組み合わせ手順において一つの前記条件式について前記第二のグループから選択される前記単純値又は前記候補は、当該条件式に関して生成される全ての前記組み合わせに対して共通である、
ことを特徴とするテストデータ生成方法。 Computer
Based on one or more conditional expressions to be satisfied by a plurality of input variables in the program to be tested, it is determined whether or not there is a dependency relationship between the input variables, and one or more input variables are determined based on the presence or absence of the dependency relationship. A variable classification procedure for classifying each conditional expression to a group to which an input variable related to the conditional expression belongs,
For each group, based on the conditional expression associated with the group, a value candidate generation procedure for generating candidates for values of input variables belonging to the group;
For each conditional expression, among the candidates generated for the first group to which the input variable related to the conditional expression belongs, for each candidate that does not satisfy any of the conditional expressions associated with the first group, From each of the second groups other than the first group, a simple value set depending on the data type of the input variable belonging to the second group is set for the candidate generated based on the conditional expression. A combination generation unit that preferentially selects one by one and generates the candidate combination,
The simple value or the candidate selected from the second group for one conditional expression in the combination procedure is common to all the combinations generated for the conditional expression.
A test data generation method characterized by the above.
テスト対象のプログラムにおける複数の入力変数が満たすべき1以上の条件式に基づいて、前記入力変数間の依存関係の有無を判定し、前記依存関係の有無に基づいて前記複数の入力変数を1以上のグループに分類して、前記各条件式を当該条件式に関連する入力変数が属するグループに関連付ける変数分類手順と、
前記グループごとに、当該グループに関連付けられた前記条件式に基づいて、当該グループに属する入力変数の値の候補を生成する値候補生成手順と、
前記各条件式について、当該条件式に関連する入力変数が属する第一のグループに関して生成された候補のうち、前記第一のグループに関連付けられたいずれかの条件式を満たさない前記候補ごとに、前記第一のグループ以外の第二のグループのそれぞれから、当該第二のグループに属する入力変数のデータ型に依存して設定された単純値を、前記条件式に基づいて生成された候補に対して優先的に1つずつ選択して、前記候補の組み合わせを生成する組み合わせ生成部とを有し、
前記組み合わせ手順において一つの前記条件式について前記第二のグループから選択される前記単純値又は前記候補は、当該条件式に関して生成される全ての前記組み合わせに対して共通である、
ことを特徴とするテストデータ生成プログラム。 On the computer,
Based on one or more conditional expressions to be satisfied by a plurality of input variables in the program to be tested, it is determined whether or not there is a dependency relationship between the input variables, and one or more input variables are determined based on the presence or absence of the dependency relationship. A variable classification procedure for classifying each conditional expression to a group to which an input variable related to the conditional expression belongs,
For each group, based on the conditional expression associated with the group, a value candidate generation procedure for generating candidates for values of input variables belonging to the group;
For each conditional expression, among the candidates generated for the first group to which the input variable related to the conditional expression belongs, for each candidate that does not satisfy any of the conditional expressions associated with the first group, From each of the second groups other than the first group, a simple value set depending on the data type of the input variable belonging to the second group is set for the candidate generated based on the conditional expression. A combination generation unit that preferentially selects one by one and generates the candidate combination,
The simple value or the candidate selected from the second group for one conditional expression in the combination procedure is common to all the combinations generated for the conditional expression.
A test data generation program characterized by that.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014210776A JP6007223B2 (en) | 2014-10-15 | 2014-10-15 | Abnormal system test data generation device, method, and program with high visibility for multiple input variables |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014210776A JP6007223B2 (en) | 2014-10-15 | 2014-10-15 | Abnormal system test data generation device, method, and program with high visibility for multiple input variables |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2016081231A true JP2016081231A (en) | 2016-05-16 |
JP6007223B2 JP6007223B2 (en) | 2016-10-12 |
Family
ID=55958641
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2014210776A Active JP6007223B2 (en) | 2014-10-15 | 2014-10-15 | Abnormal system test data generation device, method, and program with high visibility for multiple input variables |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6007223B2 (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001356936A (en) * | 2000-04-11 | 2001-12-26 | Fujitsu Ltd | Test support device and supporting method of gui system program |
JP2010097446A (en) * | 2008-10-17 | 2010-04-30 | Hitachi Ltd | Test data generation method, program and apparatus |
JP2010267022A (en) * | 2009-05-13 | 2010-11-25 | Nippon Telegr & Teleph Corp <Ntt> | Test data generation method, device and program |
JP2012118873A (en) * | 2010-12-02 | 2012-06-21 | Fujitsu Ltd | Data production method, program and apparatus |
-
2014
- 2014-10-15 JP JP2014210776A patent/JP6007223B2/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001356936A (en) * | 2000-04-11 | 2001-12-26 | Fujitsu Ltd | Test support device and supporting method of gui system program |
JP2010097446A (en) * | 2008-10-17 | 2010-04-30 | Hitachi Ltd | Test data generation method, program and apparatus |
JP2010267022A (en) * | 2009-05-13 | 2010-11-25 | Nippon Telegr & Teleph Corp <Ntt> | Test data generation method, device and program |
JP2012118873A (en) * | 2010-12-02 | 2012-06-21 | Fujitsu Ltd | Data production method, program and apparatus |
Also Published As
Publication number | Publication date |
---|---|
JP6007223B2 (en) | 2016-10-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11727203B2 (en) | Information processing system, feature description method and feature description program | |
JP5629239B2 (en) | Apparatus and method for testing operation of software | |
WO2019222462A1 (en) | Identification of sensitive data using machine learning | |
KR101390220B1 (en) | Method for recommending appropriate developers for software bug fixing and apparatus thereof | |
JP5521807B2 (en) | Failure cause estimation apparatus, failure cause estimation program, and failure cause estimation method | |
JPWO2018186314A1 (en) | Analyzer, analysis method and analysis program | |
CN110728328A (en) | Training method and device for classification model | |
JP6696568B2 (en) | Item recommendation method, item recommendation program and item recommendation device | |
JP2017146888A (en) | Design support device and method and program | |
CN112633461A (en) | Application assistance system and method, and computer-readable recording medium | |
JP6007221B2 (en) | Abnormal test data generation apparatus, method, and program for multiple input variables | |
JPWO2016063502A1 (en) | Knowledge management device, knowledge management method, and program recording medium | |
JP2018195643A (en) | Classification program, classification device, and classification method | |
US20200387505A1 (en) | Information processing system, feature description method and feature description program | |
JP6007220B2 (en) | Normal test data generation apparatus, method and program for multiple input variables | |
JP6007223B2 (en) | Abnormal system test data generation device, method, and program with high visibility for multiple input variables | |
JP6509590B2 (en) | User's emotion analysis device and program for goods | |
JP6007222B2 (en) | Abnormal test data generation device, method, and program capable of efficiently covering specifications for multiple input variables | |
JP6751960B1 (en) | Information processing system and information processing method | |
CN114881521A (en) | Service evaluation method, device, electronic equipment and storage medium | |
JP6190341B2 (en) | DATA GENERATION DEVICE, DATA GENERATION METHOD, AND PROGRAM | |
JP6455087B2 (en) | Form information processing program, form information processing apparatus, and form information processing method | |
CN111522748A (en) | Automatic test case generation method and device, server and storage medium | |
CN114830147A (en) | Control method, control program, and information processing apparatus | |
CN116738216B (en) | Association processing method and device for early warning big data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20160620 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20160628 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20160817 |
|
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: 20160906 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20160912 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6007223 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |