Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP4847102B2 - Test program generation method for computer program - Google Patents
[go: Go Back, main page]

JP4847102B2 - Test program generation method for computer program - Google Patents

Test program generation method for computer program Download PDF

Info

Publication number
JP4847102B2
JP4847102B2 JP2005321613A JP2005321613A JP4847102B2 JP 4847102 B2 JP4847102 B2 JP 4847102B2 JP 2005321613 A JP2005321613 A JP 2005321613A JP 2005321613 A JP2005321613 A JP 2005321613A JP 4847102 B2 JP4847102 B2 JP 4847102B2
Authority
JP
Japan
Prior art keywords
test program
component
random number
syntax
test
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP2005321613A
Other languages
Japanese (ja)
Other versions
JP2007128372A (en
Inventor
善広 深瀬
裕子 霜田
Original Assignee
日立情報通信エンジニアリング株式会社
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 日立情報通信エンジニアリング株式会社 filed Critical 日立情報通信エンジニアリング株式会社
Priority to JP2005321613A priority Critical patent/JP4847102B2/en
Publication of JP2007128372A publication Critical patent/JP2007128372A/en
Application granted granted Critical
Publication of JP4847102B2 publication Critical patent/JP4847102B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)
  • Debugging And Monitoring (AREA)
  • Devices For Executing Special Programs (AREA)

Description

本発明は、乱数を用いてテストプログラムを自動で生成するコンピュータプログラムのテストプログラム生成方法に関する。   The present invention relates to a test program generation method for a computer program that automatically generates a test program using random numbers.

従来から、コンピュータプログラムのテストプログラムを生成する方法は各種提案されている。一般的には、検査担当者などがテストプログラム構文に沿ったテストプログラムを人手により作成するが、機械的に自動で作成する方法も提案されている。   Conventionally, various methods for generating a test program for a computer program have been proposed. Generally, an inspector or the like manually creates a test program according to the test program syntax, but a method of automatically creating a test program has also been proposed.

例えば、特許文献1には、コンパイラテストプログラムを自動生成するテストプログラム発生器が記載されている。このテストプログラム発生器200は、図2に示すように、構文に従って作成した単一文を複数行集めたプログラム記述の集まりを1つの要素(プログラムセル)とする。これらを集めたプログラムセル情報210と、集められた複数のプログラムセルからテストプログラムとして選択され易さを示すセル重み情報211をプログラムセル組合わせ器230に入力し、乱数発生器220により発生させた乱数を用いて、選択されたプログラムの集まりであるプログラムセルを組み合わせて、コンパイラのテストプログラム240を自動生成するというものである。集められた複数のプログラムセルに係るテストプログラムとして選択され易さを示すセル重み情報211は、以前にテスト対象プログラムの不良を発見できたプログラムセルや、不良を発見出来そうと予測されるプログラムセルに対して与えられる。集められたプログラムセルは乱数により選択する時の選択され易さを示すセル重みが重いほど選択されやすくなる。   For example, Patent Document 1 describes a test program generator that automatically generates a compiler test program. As shown in FIG. 2, the test program generator 200 uses a set of program descriptions obtained by collecting a plurality of lines of a single sentence created according to the syntax as one element (program cell). The collected program cell information 210 and cell weight information 211 indicating the ease of being selected as a test program from the collected program cells are input to the program cell combiner 230 and generated by the random number generator 220. A compiler test program 240 is automatically generated by combining program cells, which are a collection of selected programs, using random numbers. Cell weight information 211 indicating the ease of being selected as a test program related to a plurality of collected program cells is a program cell in which a defect of a test target program has been found previously, or a program cell that is predicted to be able to find a defect. Given against. The collected program cells are more easily selected as the cell weight indicating the ease of selection when selected by random numbers is heavier.

また、特許文献2には、言語処理プログラム検証方式が記載されている。この技術は、用意された複数の構文生成規則から乱数を用いて規則を選択し、選択された規則を基にテストプログラムを生成するものである。また、特許文献3には、テストプログラム作成支援装置が記載されている。この装置は、既存のテストプログラムの文法網羅性を判定し、既存のテストプログラムから外れた文法を縮小文法仕様として出力し、その縮小文法仕様を基に追加テストプログラムを自動生成するものである。さらに、特許文献4には、テストプログラム作成支援装置が記載されている。この装置は、バッカス記法で記述された構文規則を基に文パターンを生成し、生成された文パターンを人手によって編集しテストプログラムとするものである。
特開2004―227129号公報 特開平1−220044号公報 特開平3−75840号公報 特開平6−214775号公報
Patent document 2 describes a language processing program verification method. This technique selects a rule using a random number from a plurality of prepared syntax generation rules, and generates a test program based on the selected rule. Patent Document 3 describes a test program creation support apparatus. This apparatus determines the grammatical coverage of an existing test program, outputs a grammar deviating from the existing test program as a reduced grammar specification, and automatically generates an additional test program based on the reduced grammar specification. Further, Patent Document 4 describes a test program creation support device. This apparatus generates a sentence pattern based on a syntax rule described in Bacchus notation, and manually edits the generated sentence pattern to form a test program.
JP 2004-227129 A JP-A-1-220044 Japanese Patent Laid-Open No. 3-75840 JP-A-6-214775

例えばコンパイラの不良を摘出するためには、構文の組合せを考慮し多くの構文組合せテストを実施すること、およびテストデータとしてテストプログラムを多数作成しテストを実施することが必要である。従来のような人手によりテストプログラムを作成していたのでは、その工数は膨大であり充分なテストが実施できない恐れがあるため、上記のようなテストプログラムの自動生成法が提案されてきた。   For example, in order to identify a compiler defect, it is necessary to perform many syntax combination tests in consideration of syntax combinations, and to create a number of test programs as test data and perform tests. If a test program is created manually by a conventional method, the number of steps is enormous, and there is a possibility that a sufficient test cannot be performed. Therefore, an automatic test program generation method as described above has been proposed.

しかし、構文に従って作成した単一文を複数行集めたプログラム記述の集まりを要素として使用する場合には、プログラム文内の構文組合せは乱数等により機械的に決定するのではなく作成者のセンスに依存するため、その構文の組合せもプログラム文の作成者の考える域を越えた複雑な条件の記述については作成されない。   However, when a set of program descriptions that consist of multiple lines of a single statement created according to the syntax is used as an element, the syntax combination in the program statement is not determined mechanically by random numbers, but depends on the sense of the creator. Therefore, the syntax combination is not created for the description of complicated conditions beyond the scope of the creator of the program statement.

さらに、以前に不良を発見できたプログラム記述が集まった要素及び不良を発見出来そうと予測されるプログラム記述が集まった要素に対して、乱数を利用して要素を選択しテストプログラムを生成することができるが、この場合、選択され易さを示す重みが初期に設定された内容に固定されるため、構文の使用状況に関係なく常に同じプログラム記述の集まった要素が選択されやすくなり、新たな不良の発見が難しくなる。   In addition, a test program is generated by selecting an element using random numbers for an element for which a program description that has previously found a defect is gathered and an element for which a program description that is expected to be found is gathered. However, in this case, since the weight indicating the ease of selection is fixed to the initially set content, it is always easy to select elements with the same program description regardless of the usage status of the syntax. It becomes difficult to find defects.

また、あらかじめ用意した構文生成規則の中から、乱数により生成規則を選択しそれをもとにテストプログラムを生成する場合には、上記のように用意する構文生成規則はテストプログラム作成者の考える域を超えないため、同様な問題がある。さらに、用意した構文の情報を人手により選択することでテストプログラムを生成、あるいは文法網羅によるテストプログラムを生成する場合には、テストしたい単純な内容・項目については可能であるが、複雑な条件で発生する不良を検出することは困難である。   In addition, when generating a test program based on a random generation rule selected from among the syntax generation rules prepared in advance, the syntax generation rule prepared as described above is an area considered by the test program creator. There is a similar problem. Furthermore, when generating a test program by manually selecting the syntax information prepared, or generating a test program with grammar coverage, it is possible for simple contents / items to be tested, but under complicated conditions. It is difficult to detect defects that occur.

従って本発明の目的は、テスト対象プログラムに対し、複雑な条件で発生する不良の摘出が可能なテストプログラムを自動で生成するコンピュータプログラムのテストプログラム生成方法を提供することにある。   Accordingly, an object of the present invention is to provide a test program generation method for a computer program that automatically generates a test program capable of extracting defects generated under complicated conditions for a test target program.

上記目的は、テスト対象のコンピュータプログラムのテストプログラム生成用部品を複数集めたテストプログラム生成用部品群の中から乱数を用いて前記テストプログラム生成用部品の1つを第1部品として選択し確定する第1工程と、選択し確定した第(n−1)部品を構成する複数の第n部品の中から乱数を用いて前記第n部品の1つを選択し確定する工程を前記nを2から始めて順次大きくなる整数で繰返し行う第2工程と、前記選択し確定した第n部品がそれを構成する部品を持たない場合に前記選択し確定した第n部品の情報をテストプログラムの構成要素として選択し確定する第3工程とを備え、前記第1工程乃至第3工程を繰返し行うことにより得られた複数のテストプログラムの構成要素に基づいてテストプログラムを生成するコンピュータプログラムのテストプログラム生成方法により、達成される。   The object is to select and confirm one of the test program generation components as a first component using a random number from a group of test program generation components obtained by collecting a plurality of test program generation components of a computer program to be tested. The first step and the step of selecting and confirming one of the n-th components from among a plurality of n-th components constituting the selected (n-1) -th component by using a random number from n to 2 The second step, which is repeated for an integer that increases sequentially for the first time, and when the selected and confirmed n-th component does not have a component constituting it, the information on the selected and confirmed n-th component is selected as a component of the test program And generating a test program based on a plurality of test program components obtained by repeatedly performing the first to third steps. The test program generation method of a computer program that is achieved.

ここで、前記第1工程における前記第1部品の選択は、前記各テストプログラム生成用部品にそれぞれ対応して設けられた部品の選択され易さを示す重み情報を考慮して行うことができる。また、前記第2工程における前記第n部品の1つの選択は、前記各第n部品にそれぞれ対応して設けられた部品の選択され易さを示す重み情報を考慮して行うことができる。前記第2工程における前記第n部品の選択の際に、テストプログラムの構文上の制約条件が発生した場合、前記部品の選択され易さを示す重み情報が、前記制約条件に応じて変更され得る。また、前記テストプログラムを生成したときの乱数の乱数値を再現情報として保持し、前記テストプログラムを再現する場合に、前記再現情報として保持している前記乱数値を用いることができる。   Here, the selection of the first component in the first step can be performed in consideration of weight information indicating the ease of selection of components provided corresponding to the test program generation components. In addition, the selection of one of the n-th components in the second step can be performed in consideration of weight information indicating the ease of selection of components provided corresponding to the respective n-th components. When a constraint condition in the syntax of the test program occurs during the selection of the n-th component in the second step, weight information indicating the ease of selecting the component can be changed according to the constraint condition. . Further, when the test program is generated, the random number value of the random number is held as reproduction information, and when the test program is reproduced, the random number value held as the reproduction information can be used.

本発明によれば、テスト対象プログラムに対し、複雑な条件で発生する不良の摘出が可能なテストプログラムを自動で生成するコンピュータプログラムのテストプログラム生成方法を得ることができる。即ち、本発明では、テストプログラムの構文が要素単位で分割できるのを利用し、実測データ及び人手によって作成したテストプログラムでは見つけづらい複雑な条件で発生する不良の摘出が可能なテストプログラムを、効率的に自動で生成することができる。また、再テスト時には、再現情報として保持する乱数値を用いて、当該テストプログラムを再現することで、テスト対象プログラムのデバッグ効率及び品質の向上を図ることができる。このように、本発明のテストプログラム生成方法では、テストプログラムの構文を要素単位に分割し、乱数により選択された各構文の展開および使用状況にあった設定で部品として具現化していくことで、多種多様なテストに対応したテストプログラムを生成することができる。   ADVANTAGE OF THE INVENTION According to this invention, the test program production | generation method of the computer program which produces | generates automatically the test program which can extract the defect which generate | occur | produces on complicated conditions with respect to a test object program can be obtained. That is, the present invention utilizes the fact that the syntax of the test program can be divided into element units, and the test program capable of extracting defects that occur under complicated conditions that are difficult to find with actual measurement data and manually created test programs. Can be generated automatically. Further, at the time of retesting, the debugging efficiency and quality of the test target program can be improved by reproducing the test program using a random number value held as reproduction information. As described above, in the test program generation method of the present invention, the syntax of the test program is divided into element units, and each syntax selected by a random number is embodied as a component with settings corresponding to the development and usage status. A test program corresponding to various tests can be generated.

以下、本発明に係るコンピュータプログラムのテストプログラム生成方法の一実施例を図面を用いて説明する。
図1は、コンピュータプログラムのテストプログラムを自動生成するテストプログラム生成器100の構成例を示す図である。本実施例で示すテストプログラム生成器100は、例えばパーソナルコンピュータ上で動作するソフトウェアにより実現されるもので、図示のように、テストプログラム生成用部品群101と、テストプログラム生成用部品具現化部102と、乱数器103と、テストプログラム出力部104とを備える。テストプログラム生成用部品具現化部102は、部品重み情報105から部品の選択され易さを示す重み情報を得ることができる。テストプログラム出力部104は、生成したテストプログラムをテストプログラム106に出力するものである。乱数器103は、再現情報107との間で情報の授受を行う。ここでテストプログラムは例えばコンパイラのテストプログラムであるが、これに限定されない。
Hereinafter, an embodiment of a computer program test program generation method according to the present invention will be described with reference to the drawings.
FIG. 1 is a diagram illustrating a configuration example of a test program generator 100 that automatically generates a test program of a computer program. The test program generator 100 shown in the present embodiment is realized by, for example, software running on a personal computer. As shown in the figure, a test program generation component group 101 and a test program generation component realization unit 102 are provided. And a random number machine 103 and a test program output unit 104. The test program generation component realization unit 102 can obtain weight information indicating the ease of selecting a component from the component weight information 105. The test program output unit 104 outputs the generated test program to the test program 106. The random number device 103 exchanges information with the reproduction information 107. Here, the test program is, for example, a compiler test program, but is not limited thereto.

ここでは、構文を構成する要素単位で分割したプログラム構文情報と、使用状況に応じて構文を定義した部品を乱数によって選択する際に使用する選択され易さを示す重みが定義されており、プログラム文(複数文)から変数の宣言文まで生成可能なように、プログラムとして実行できる構文が部品として登録されている。   Here, the program syntax information divided in units of elements constituting the syntax, and the weight indicating the ease of selection used when selecting a part for which the syntax is defined by a random number according to the usage status, are defined. A syntax that can be executed as a program is registered as a component so that statements from a plurality of statements to variable declaration statements can be generated.

図1において、テストプログラム生成用部品群101とは、生成するテストプログラムの構文を分割可能な要素単位で分割し、それを一つの部品として定義した部品の集まり(群)である。すなわち、分割可能な要素とは、構文を構成する各部品のことである。次に、この部品の例を図4〜図6を用いて説明する。   In FIG. 1, a test program generation component group 101 is a group (group) of components in which the syntax of a test program to be generated is divided into units that can be divided and defined as one component. That is, the element that can be divided is each part that constitutes the syntax. Next, an example of this component will be described with reference to FIGS.

図4は、テストデータとなるテストプログラムのC言語構文例(バッカス記法)の一部を示す図である。本例は、C言語でexpressionの構文を要素で分割しバッカス記法で表現したものである。本図において、expression内の”assignment−expression”、および、”expression,assignment−expression”等が構文を構成する部品である。   FIG. 4 is a diagram showing a part of a C language syntax example (Bacchus notation) of a test program serving as test data. In this example, the expression syntax in C language is divided into elements and expressed in Bacchus notation. In this figure, “assignment-expression” in the expression, “expression, assignment-expression”, and the like are components constituting the syntax.

図5は、テストデータとなるテストプログラムのC言語構文例(構文木)の一部を示す図である。本例は、C言語でexpressionの構文を要素で分割し木構造で表現したものである。本図において、expressionにつながる”assignment−expression”、および、”expression,assignment−expression”等が構文を構成する部品である。   FIG. 5 is a diagram illustrating a part of a C language syntax example (syntax tree) of a test program serving as test data. In this example, the expression syntax in C language is divided into elements and expressed in a tree structure. In this figure, “assignment-expression”, “expression, assignment-expression”, etc. that lead to expression are components that constitute the syntax.

図4および図5に示す構文例はともに、expressionがassignment−expression、またはexpression,assignment−expressionのいずれかの構文を選択するように定義されている。しかし、構文としては単純でも、それを使用する場面は複数あり、その意味合いも異なっている。   Both the syntax examples shown in FIGS. 4 and 5 are defined such that expression selects one of the syntaxes of assignment-expression or expression, assignment-expression. However, even though the syntax is simple, there are several situations where it is used, and the meanings are different.

図6は、テストデータとなるテストプログラムのC言語構文例(バッカス記法)の一部を示す図である。本例は、C言語でforの構文を要素で分割しバッカス記法で表現したものである。ここで、for構文も部品であり、それを構成しているexpression群もfor構文を構成する部品である。このfor構文について、forの第1expression、第2expression、および第3expressionは、全てexpressionと表現されているが、それぞれ初期化用の代入文、判定用の比較文、および加減算文というように意味が異なっており、そのためテストプログラムの自動生成を考慮した場合、その状況に合った構文情報を多数用意する必要がある。   FIG. 6 is a diagram showing a part of a C language syntax example (Bacchus notation) of a test program serving as test data. In this example, the syntax of “for” in C language is divided into elements and expressed in Bacchus notation. Here, the for syntax is also a part, and the expression group constituting the for syntax is also a part constituting the for syntax. Regarding the for syntax, the first expression, the second expression, and the third expression of the for are all expressed as expressions, but have different meanings such as an assignment statement for initialization, a comparison statement for determination, and an addition / subtraction statement, respectively. Therefore, when automatic generation of test programs is considered, it is necessary to prepare a lot of syntax information suitable for the situation.

そこで、構文を要素単位に分割し、使用状況に応じて選択される構文と処理を部品に定義することにより意味のあるテストプログラムが生成可能であり、かつ構文の組合せ情報数を増やすことなく、乱数による部品選択により構文の組合せを決定していくため、多くのテストプログラムを生成すれば構文の組合せも自動で増えていくことになり、人手を介在させることなく意味のあるテストプログラムが生成でき、かつ構文組合せのテストプログラムも生成できる。   Therefore, it is possible to generate a meaningful test program by dividing the syntax into element units and defining the syntax and processing selected according to the usage status as parts, and without increasing the number of syntax combination information, Since the combination of syntax is determined by selecting parts using random numbers, the number of combinations of syntax will automatically increase if many test programs are generated, and a meaningful test program can be generated without human intervention. And a test program of syntax combination can be generated.

図3は、テストプログラム生成器100で処理するテストプログラム生成時の全体フローを示す図である。まず、ステップ301にて、再現情報指示の有無を検査する。ここで、再現情報とは、乱数器103より出力されるテストプログラムの再現情報107のことである。これが「なし」の場合、後述のステップ303に移行する。また「あり」の場合、ステップ302にて、再現情報設定処理を行う。この再現情報設定処理302では、テストプログラムを生成する初期段階にて、乱数器103より出力されるテストプログラムの再現情報107を乱数器103に指定することで、該当するテストプログラムの再現が可能となる。この再現情報設定処理302(テストプログラムの再現)については、後で図11を用いて詳述する。   FIG. 3 is a diagram showing an overall flow when generating a test program to be processed by the test program generator 100. First, in step 301, the presence / absence of a reproduction information instruction is checked. Here, the reproduction information is the reproduction information 107 of the test program output from the random number device 103. When this is “None”, the process proceeds to Step 303 described later. If “Yes”, in step 302, reproduction information setting processing is performed. In the reproduction information setting process 302, by specifying the reproduction information 107 of the test program output from the random number device 103 to the random number device 103 at the initial stage of generating the test program, the corresponding test program can be reproduced. Become. The reproduction information setting process 302 (reproduction of a test program) will be described in detail later with reference to FIG.

次に、ステップ303にて、部品重み指示の有無を検査する。これが「なし」の場合、後述のステップ305に移行する。また「あり」の場合、ステップ304にて、部品重み情報設定処理を行う。この部品重み情報設定処理302では、部品重み情報105において定義されている要素単位に分割した構文の使用状況に合った選択部品別の重み割合を、該当する部品に対して設定する。この部品重み情報設定処理304については、後で図10を用いて詳述する。   Next, in step 303, the presence / absence of a component weight instruction is inspected. When this is “None”, the process proceeds to Step 305 described later. If “Yes”, in step 304, component weight information setting processing is performed. In the component weight information setting process 302, a weight ratio for each selected component that matches the usage status of the syntax divided into element units defined in the component weight information 105 is set for the corresponding component. The component weight information setting process 304 will be described in detail later with reference to FIG.

続いて、ステップ305にて、テストプログラム生成用部品具現化処理を行う。この部品具現化処理305では、テストプログラム生成用部品具現化部102において、テストプログラム生成用部品群101から乱数器103が発生する乱数により選択した部品の具現化を行う。ここで、具現化とは、選択した部品に実体を持たせることでその部品を確定することをいう。実体を持たせるとは、部品の使用状況に特化した内容で動的にメモリを確保することをいう。具現化(確定)された部品は更にそれを構成する部品に何回か展開可能である。展開可能の間、この具現化処理を繰返し行う。具現化された部品がそれ以上展開できなくなった時点で具現化処理を終了する。そして、この末端となる具現化された部品(末端部品)の情報(型、定数、変数、演算子等)を構文の使用状況により選択し確定する。この末端部品の情報がテストプログラムを構成する。以上の処理を次々に行うことにより、テストプログラム出力処理306によりテストプログラムを出力する。上記テストプログラム生成用部品具現化処理305について、以下図7〜図9を用いて説明する。   Subsequently, in step 305, test program generation component realization processing is performed. In the component realization process 305, the test program generation component realization unit 102 realizes the component selected by the random number generated by the random number generator 103 from the test program generation component group 101. Here, the realization means that the selected part is given an entity to determine the part. Having an entity means dynamically allocating memory with contents specialized to the usage status of the component. The embodied (determined) part can be further expanded several times to the parts constituting it. While the deployment is possible, the realization process is repeated. The realization process ends when the embodied parts can no longer be developed. Then, the information (type, constant, variable, operator, etc.) of the embodied part (terminal part) at the end is selected and confirmed according to the usage status of the syntax. This end part information constitutes a test program. By performing the above processes one after another, the test program output process 306 outputs a test program. The test program generation component realization process 305 will be described below with reference to FIGS.

図7は、テストプログラム生成用部品具現化処理(具現化処理終了フラグのOFFの場合)の一例を説明するための図である。本例は、構文expressionをテストプログラム生成用部品701として登録したものである。expression部品701は、乱数により選択する具現化対象部品702別に、構文の使用状況に合わせて与えられるexpression部品701に対する展開指示703単位に、乱数により選択され易さを示す具現化対象部品の重みの割合(重み情報)が定義されている。   FIG. 7 is a diagram for explaining an example of a test program generation component realization process (when the realization process end flag is OFF). In this example, the syntax expression is registered as a test program generation component 701. The expression component 701 is a weight of the component to be realized that indicates the ease of being selected by the random number in units of the expansion instruction 703 for the expression component 701 given according to the usage status of the syntax for each component 702 to be selected by the random number. A ratio (weight information) is defined.

expression部品701が持つ構文の部品(具現化対象部品)として、図7に示すように、assignment−expression704,およびComma−Exp705がある。選択対象となるこれらの部品は、具現化処理にて実体を持つまでは単なる構文の情報に過ぎない。また、Comma−Exp705は構文上存在する定義ではないが、”expression,assignment−expression”は通常カンマ演算子と呼ばれており、選択される部品単位として”expression,assignment−expression”を一つにまとめて便宜上使用しているものである。以降、構文を要素単位に分割した部品の具現化処理について説明する。   As parts of the syntax (implementation target parts) of the expression part 701, there are assignment-expression 704 and Comma-Exp 705 as shown in FIG. These parts to be selected are merely syntax information until they are actualized in the realization process. Further, although Comma-Exp 705 is not a definition that exists in the syntax, “expression, assignment-expression” is usually called a comma operator, and “expression, assignment-expression” is selected as one component unit to be selected. They are collectively used for convenience. Hereinafter, the realization process of the component in which the syntax is divided into element units will be described.

図8は、部品の具現化処理フローの一例を示す図である。以下、本図と図7にそって部品の具現化処理について説明する。図7に示すように、expression部品701に対し、展開指示として「for第1式(代入文の重み)」707が与えられた場合、まず図8のステップ801にて、具現化処理で構文の制約条件が発生したかどうかを検査する。その結果、制約条件が未発生の場合は、ステップ803に移行する。一方、制約条件が発生の場合は、ステップ802にて、構文制約条件に沿った部品の重み割合に変更する。次に、ステップ803にて、具現化処理終了フラグのON,OFFの検査、即ち具現化処理終了の判定を実施する。具現化処理終了の判定とは、構文に沿って具現化されてきた部品について、これ以上の選択要素の存在有無を確認するものであり、expression部品701に定義されている具現化処理終了フラグ706のOFF/ONがその情報を示す。   FIG. 8 is a diagram illustrating an example of a component realization process flow. Hereinafter, the component realization process will be described with reference to FIGS. As shown in FIG. 7, when “for first expression (assignment statement weight)” 707 is given as an expansion instruction to the expression component 701, first, in step 801 of FIG. Check whether a constraint condition has occurred. As a result, if no constraint condition has occurred, the process proceeds to step 803. On the other hand, if a constraint condition occurs, in step 802, the weighting ratio of the component is changed in accordance with the syntax constraint condition. Next, in step 803, the ON / OFF check of the realization process end flag, that is, the determination of the realization process end is performed. The determination of the end of the realization process is to confirm the presence / absence of further selection elements for the parts that have been realized according to the syntax. The realization process end flag 706 defined in the expression part 701 is used. OFF / ON indicates the information.

図7の例では、具現化処理終了フラグ706がOFFと表示されており、これは具現化処理終了でないことを示す。具現化処理終了でない場合、図8のステップ804にて、与えられた展開指示別で具現化対象部品別に設定されている重み割合を取得する。図7の例の場合、太点線で囲まれたfor第1式部分708がそれに該当する。続いて、ステップ805にて、乱数器より発生した乱数と取得した重み割合を元に具現化する部品を選択し、ステップ806にて、選択した部品に実体を持たせることで部品を具現化する(図7のブロック709)。図7では、assignment−expression704が乱数により選択され具現化された部品に該当する。そして、ステップ807にて、具現した部品assignment−expression704に対して、対応する展開指示を与え(図7の矢印710)、以降の構文を決定するための部品の具現化処理を実行する。この具現化処理は繰返し行われる。その結果、具現化処理終了フラグが“ON”となった場合を次に説明する。   In the example of FIG. 7, the realization process end flag 706 is displayed as OFF, which indicates that the realization process has not ended. If it is not the end of the realization process, in step 804 in FIG. 8, the weight ratio set for each realization target part is acquired for each given development instruction. In the case of the example in FIG. 7, the for first formula portion 708 surrounded by a thick dotted line corresponds to this. Subsequently, in step 805, a part to be realized is selected based on the random number generated from the random number generator and the acquired weight ratio, and in step 806, the part is realized by giving an entity. (Block 709 in FIG. 7). In FIG. 7, assignment-expression 704 corresponds to a part selected and embodied by a random number. Then, in step 807, a corresponding deployment instruction is given to the implemented component assignment-expression 704 (arrow 710 in FIG. 7), and component realization processing for determining the subsequent syntax is executed. This realization process is repeated. As a result, the case where the realization end flag is set to “ON” will be described next.

図9は、テストプログラム生成用部品具現化処理(具現化処理終了フラグのONの場合)の一例を説明するための図である。部品の具現化処理を繰返し行った結果、該当する部品内の具現化処理フラグが“ON”となった場合、該当する部品は、構文の末端部品であることを示す。図9において、assignment_operator901は、代入文の代入演算子構文の部品である。assignment_operator901も、先に説明したexpression701と同様に、乱数により選択する具現化対象部品902別に、構文の使用状況に合わせて与えられるassignment_operator部品901に対する展開指示903単位に、乱数により選択され易さを示す具現化対象部品の重みの割合が定義されている。代入演算子構文では、構文の使用状況により使用可能な演算子は制限されるが、代入演算子以降の構文の展開はない。つまり、具現化処理終了フラグが“ON”の場合は、末端となる具現化部品の情報(型、定数、変数、演算子等)を構文の使用状況により選択し確定し、そして以降の具現処理を行わず、呼出元に戻ることになる。すなわち、図8のステップ808にて、末端となる具現化部品(末端部品)の情報(型、定数、変数、演算子等)を構文の使用状況により選択し確定する。これがテストプログラムの構成要素となる。次に、以上の具現化処理に基づいて行われるテストプログラムの生成方法を説明する。   FIG. 9 is a diagram for explaining an example of a test program generation component realization process (when the realization process end flag is ON). As a result of repetitive component realization processing, if the realization processing flag in the corresponding component is “ON”, this indicates that the corresponding component is a terminal component of the syntax. In FIG. 9, assignment_operator 901 is a part of the assignment operator syntax of the assignment statement. Similarly to the expression 701 described above, the assignment_operator 901 also indicates the ease of being selected by a random number in units of the deployment instruction 903 for the assignment_operator component 901 given according to the usage status of the syntax, depending on the implementation target component 902 selected by the random number. The weight ratio of the parts to be realized is defined. In the assignment operator syntax, the operators that can be used are limited by the usage of the syntax, but there is no syntax expansion after the assignment operator. That is, when the implementation process end flag is “ON”, information (type, constant, variable, operator, etc.) of the implementation component at the end is selected and determined according to the usage status of the syntax, and the subsequent implementation process Without returning to the caller. That is, in step 808 of FIG. 8, the information (type, constant, variable, operator, etc.) of the realization component (terminal component) that is the terminal is selected and confirmed according to the usage status of the syntax. This is a component of the test program. Next, a test program generation method performed based on the above-described implementation process will be described.

図12は、テストプログラム生成用部品の具現化処理によるテストプログラム生成方法の一例を示す図である。図示のように、まず、テストプログラム生成用部品群の中から構文の基礎となる部品109を選択し確定する。次に、この部品109に対して具現すべき部品をテストプログラム生成用部品群の中から乱数を用いて部品110を選択し具現化(確定)する。このとき、部品110では代入文の構文が確定されたとして以後説明する。まず代入文を構成するために、テストプログラム生成用部品群の中から乱数を用いてテストプログラム生成用部品の1つを部品111として選択し確定する。次に、この部品111を構成する部品の1つを選択し具現化(確定)することで具現化部品112を得る。同様にして、この部品112を構成する部品の1つを乱数を用いて選択し具現化(確定)することで具現化部品113を得る。さらに同様にして、順次、具現化部品114・・・11aを得る。この場合、構成部品を持たない部品11aが末端部品(最終要素)となる。その末端部品の情報(型、定数、変数、演算子等)を構文の使用状況により選択し確定する。ここで選択し確定した末端部品の情報は本図では例えば「A」である。これがテストプログラムの構成要素となる。続いて、元に戻り、テストプログラム生成用部品群の中から乱数を用いてテストプログラム生成用部品の1つを部品112として選択し確定し、上記と同様にして具現化部品122、123、124・・・12bを得る。この場合、構成部品を持たない部品12bが末端部品(最終要素)となる。その末端部品の情報(型、定数、変数、演算子等)を構文の使用状況により選択し確定する。ここで選択し確定した末端部品の情報は本図では例えば「=」である。これがテストプログラムの構成要素となる。本例では、このようにしてテストプログラムの構成要素を次々と選択し確定し、これに基づいてテストプログラムを生成する。以上の工程を一般化すると次のようになる。すなわち、テスト対象のコンピュータプログラムのテストプログラム生成用部品を複数集めたテストプログラム生成用部品群の中から乱数を用いてテストプログラム生成用部品の1つを第1部品として選択し確定する第1工程と、選択し確定した第(n−1)部品を構成する複数の第n部品の中から乱数を用いて第n部品の1つを選択し確定する工程をnを2から始めて順次大きくなる整数で繰返し行う第2工程と、前記選択し確定した第n部品がそれを構成する部品を持たない場合に前記選択し確定した第n部品の情報をテストプログラムの構成要素として選択し確定する第3工程とを備え、第1工程乃至第3工程を繰返し行うことにより得られた複数のテストプログラムの構成要素に基づいてテストプログラムを生成するものである。   FIG. 12 is a diagram illustrating an example of a test program generation method based on a process for realizing a test program generation component. As shown in the figure, first, a part 109 that is the basis of the syntax is selected and confirmed from the test program generation part group. Next, a part 110 to be implemented with respect to the part 109 is selected from a group of test program generation parts by using a random number to be implemented (determined). At this time, the description will be made hereinafter assuming that the syntax of the assignment statement is determined in the component 110. First, in order to construct an assignment statement, one of the test program generation components is selected as the component 111 from the test program generation component group using a random number and determined. Next, one of the components constituting the component 111 is selected and embodied (determined) to obtain the embodied component 112. Similarly, one of the components constituting the component 112 is selected using a random number and embodied (determined) to obtain the embodied component 113. In the same manner, the embodied parts 114... 11a are obtained sequentially. In this case, the component 11a having no component is the terminal component (final element). The information (type, constant, variable, operator, etc.) of the end part is selected and confirmed according to the syntax usage. In this figure, for example, the information of the terminal part selected and confirmed here is “A”. This is a component of the test program. Subsequently, returning to the original, one of the test program generation components is selected and determined as a component 112 from the test program generation component group using a random number, and the embodied components 122, 123, 124 are the same as described above. ... 12b is obtained. In this case, the component 12b having no component is the end component (final element). The information (type, constant, variable, operator, etc.) of the end part is selected and confirmed according to the syntax usage. In this figure, for example, the information of the terminal part selected and confirmed here is “=”. This is a component of the test program. In this example, the constituent elements of the test program are selected and determined one after another in this way, and the test program is generated based on this. The above process is generalized as follows. That is, a first step of selecting and confirming one of the test program generation parts as a first part from a group of test program generation parts obtained by collecting a plurality of test program generation parts of a computer program to be tested using a random number. And a step of selecting and confirming one of the n-th components from among a plurality of n-th components composing the selected (n-1) -th component using a random number, starting from 2 and increasing in order. A second step that is repeated in step 3 and a third step of selecting and confirming information on the selected and confirmed n-th component as a component of the test program when the selected and confirmed n-th component does not have a component constituting it. And a test program is generated based on the components of a plurality of test programs obtained by repeatedly performing the first to third steps.

以上のテストプログラムの生成において、選択部品の重み割合変更について説明する。図9には、制約事項による選択部品重み割合変更の一例が示されている。部品の具現化処理において、確定した構文により以降の構文確定に制約が発生する場合がある。例えば、代入先の変数型がポインタ型と確定された場合(図9のブロック905)、部品assignment_operator901に対してポインタ代入式のみ(=,+=,−=のみ可)という構文制約条件が発生(図9のブロック906)する。既に具現化されているassignment_operator901には「代入式(all)」の展開指示907が既に指示されており、この重み割合のままでは、構文の制約に当てはまらない構文が選択されてしまうことになる。そこで、この場合、図8のステップ801からステップ802に移行する。このステップ802にて、assignment_operator901に与えられた展開指示907の具現化対象部品の重み割合を、構文制約条件に沿った具現化部品の重み割合に変更する(図9の太点線908)する。これにより、以降の部品選択処理において、構文制約外の部品が選択されることをなくすることができる。   In the above test program generation, the weight ratio change of the selected component will be described. FIG. 9 shows an example of changing the selected component weight ratio due to restrictions. In the component realization process, there are cases where restrictions are imposed on the subsequent syntax determination due to the determined syntax. For example, when the substitution target variable type is determined to be a pointer type (block 905 in FIG. 9), a syntax constraint condition that only a pointer substitution expression (=, + =,-= only possible) occurs for the component assignment_operator 901 ( Block 906 of FIG. An assignment instruction 907 for “assignment formula (all)” has already been instructed in the assignment_operator 901 that has already been realized, and a syntax that does not meet the syntax restrictions is selected with this weight ratio. Therefore, in this case, the process proceeds from step 801 to step 802 in FIG. In this step 802, the weight ratio of the realization target part of the deployment instruction 907 given to the assignment_operator 901 is changed to the weight ratio of the realization part in accordance with the syntax constraint condition (thick dotted line 908 in FIG. 9). As a result, it is possible to eliminate the selection of a component outside the syntax constraint in the subsequent component selection process.

図10は、部品重み情報を指定した場合の選択部品重み割合変更の一例を示す図である。図示のように、部品重み情報1001を指定した場合(図3のステップ303で指示ありの場合)、選択部品の重み変更は次のようにして行われる。すなわち、部品重み情報1001には、該当する具現化部品1002とそれに与えられる展開指示1003別に、具現化対象部品単位の選択され易さを示す重み割合1004が定義されている。テストプログラム生成時、具現化用部品重み指示がされていた場合に、具現化用部品重み情報設定処理1005(図3のステップ304)では、指示された部品重み情報1001を展開し、該当する具現化部品expression1006の展開指示部分情報1007を、展開した内容1008に変更する。これにより、以降のテストプログラム生成用部品具現処理(図3のステップ305)では、乱数により選択される具現化対象部品の重み割合が、部品重み情報1001で指示された内容に変更される。これにより、使用者が期待する構文の部品が選択されやすくなる。   FIG. 10 is a diagram illustrating an example of changing the selected component weight ratio when the component weight information is designated. As shown in the figure, when the component weight information 1001 is designated (when an instruction is given in step 303 in FIG. 3), the weight of the selected component is changed as follows. That is, in the part weight information 1001, a weight ratio 1004 indicating the ease of selection of the realization target part unit is defined for each corresponding realization part 1002 and a development instruction 1003 given thereto. When the component weight instruction for realization is given at the time of test program generation, the component weight information setting process 1005 for realization (step 304 in FIG. 3) expands the designated component weight information 1001 and the corresponding realization. The expansion instruction partial information 1007 of the converted component expression 1006 is changed to the expanded content 1008. Thus, in the subsequent test program generation component realization process (step 305 in FIG. 3), the weight ratio of the realization target component selected by the random number is changed to the content instructed by the component weight information 1001. As a result, it is easy to select a part having a syntax expected by the user.

図11は、乱数器および乱数利用処理の一例を説明するための図である。以下、本図に沿って、テストプログラムの再現について説明する。図1のテストプログラム生成器100では、本図に示す乱数利用処理1110が行われる。乱数利用処理1110は、部品選択による具現化処理1103、変数の再利用処理1104、数値処理1105など構文・数値等を決定する処理毎に、乱数器1101を実行し、乱数値1102を発生させ、その値を基に部品の選択、変数再利用、数値設定を決定している。   FIG. 11 is a diagram for explaining an example of a random number generator and random number use processing. Hereinafter, the reproduction of the test program will be described with reference to FIG. In the test program generator 100 of FIG. 1, the random number use processing 1110 shown in this figure is performed. The random number use process 1110 executes the random number unit 1101 to generate a random number value 1102 for each process of determining syntax / numerical value such as an implementation process 1103 by component selection, a variable reuse process 1104, a numerical value process 1105, and the like. Based on the value, selection of parts, reuse of variables, and numerical setting are determined.

乱数器1101は、乱数基準値設定処理1106、乱数基準値1107、および乱数値発生器1108を備える。乱数基準値設定処理1106は、乱数値発生器1108で使用する最初の乱数基準値1107を生成して設定する。この最初に設定する基準値は実行毎にユニークとなるように生成される。また、乱数基準値1107の内容は、再現情報1109として外部に出力される。乱数値発生器1108は、乱数器1101に乱数発生の依頼があると、乱数基準値1107を入力し、乱数値1102を出力する。また、その時に生成した乱数値を乱数基準値1107に設定し、次回に乱数値発生の基準値にする。これにより、毎回設定されるユニークな値の乱数基準値1107を自動で設定することで、次回の乱数値生成を可能としている。この乱数器1101では、乱数基準値1107を基に乱数値を発生させるため、乱数器を使用するときは必ず乱数基準値1107を毎回ユニークにする必要がある。また、最初に設定する乱数基準値1107を前回と同じにすると、以降の乱数器1101から生成される乱数値1102は、前に生成した内容と同一になる。これを利用し乱数基準値設定処理1106で出力した再現情報1109をテストプログラム生成時に乱数基準値設定処理1106を介して乱数基準値1107に設定することで、乱数器1101から生成される乱数値が前回と同一なため選択される部品・具現処理も同じものとなり、前回生成したテストプログラムの再現が可能となる。また、再現情報1109は、乱数基準値設定処理1106が出力した内容だけでなく、テストプログラム生成器を実行させるときに使用者が設定可能である。
テストプログラム生成器100に関する内容は、テストプログラムの構文が要素単位に分割可能なもので部品化することが出来るものであれば他のテストプログラム生成方式でも使用可能である。また、コンピュータプログラムの検査システムは、例えば特許文献1のコンパイラ検査システムと同様に構成することができる。
The random number device 1101 includes a random number reference value setting process 1106, a random number reference value 1107, and a random value generator 1108. The random number reference value setting processing 1106 generates and sets the first random number reference value 1107 used by the random number generator 1108. The reference value to be set first is generated so as to be unique every execution. Further, the content of the random number reference value 1107 is output to the outside as reproduction information 1109. The random number generator 1108 receives the random number generation request from the random number generator 1101, inputs the random number reference value 1107, and outputs the random value 1102. In addition, the random value generated at that time is set as the random number reference value 1107, and is set as the reference value for generating the random number next time. Thus, the next random number value can be generated by automatically setting the random number reference value 1107 of a unique value set every time. Since the random number generator 1101 generates a random number value based on the random number reference value 1107, it is necessary to make the random number reference value 1107 unique every time when the random number device is used. If the random number reference value 1107 set first is the same as the previous one, the random value 1102 generated from the subsequent random number generator 1101 is the same as the previously generated content. Using this, the reproduction information 1109 output in the random number reference value setting process 1106 is set as the random number reference value 1107 via the random number reference value setting process 1106 when the test program is generated, whereby the random number value generated from the random number generator 1101 is changed. Since it is the same as the previous time, the selected part / embodiment process is the same, and the test program generated last time can be reproduced. Further, the reproduction information 1109 can be set not only by the contents output by the random number reference value setting processing 1106 but also by the user when the test program generator is executed.
The content related to the test program generator 100 can be used in other test program generation methods as long as the syntax of the test program can be divided into elements and can be divided into parts. Further, the computer program inspection system can be configured in the same manner as the compiler inspection system disclosed in Patent Document 1, for example.

本発明は、乱数を用いてテストプログラムを自動で生成するコンピュータプログラムのテストプログラム生成方法に関するものであり、産業上の利用可能性を有する。   The present invention relates to a test program generation method for a computer program that automatically generates a test program using random numbers, and has industrial applicability.

コンピュータプログラムのテストプログラムを自動生成するテストプログラム生成器100の構成例を示す図である。It is a figure which shows the structural example of the test program generator 100 which produces | generates the test program of a computer program automatically. 従来のテストプログラム生成方法の一例を示す図である。It is a figure which shows an example of the conventional test program production | generation method. テストプログラム生成器で処理するテストプログラム生成時の全体フローを示す図である。It is a figure which shows the whole flow at the time of the test program production | generation processed with a test program generator. テストデータとなるテストプログラムのC言語構文例(バッカス記法)の一部を示す図である。It is a figure which shows a part of C language syntax example (Bacchus notation) of the test program used as test data. テストデータとなるテストプログラムのC言語構文例(構文木)の一部を示す図である。It is a figure which shows a part of C language syntax example (syntax tree) of the test program used as test data. テストデータとなるテストプログラムのC言語構文例(バッカス記法)の一部を示す図である。It is a figure which shows a part of C language syntax example (Bacchus notation) of the test program used as test data. テストプログラム生成用部品具現化処理(具現化処理終了フラグのOFFの場合)の一例を説明するための図である。It is a figure for demonstrating an example of the component realization process for test program generation | occurrence | production (when the realization process completion flag is OFF). 部品の具現化処理フローの一例を示す図である。It is a figure which shows an example of the implementation process flow of components. テストプログラム生成用部品具現化処理(具現化処理終了フラグのONの場合)の一例を説明するための図である。It is a figure for demonstrating an example of the component realization process for test program generation | occurrence | production (when the realization process completion flag is set to ON). 部品重み情報を指定した場合の選択部品重み割合変更の一例を示す図である。It is a figure which shows an example of the selection component weight ratio change at the time of specifying component weight information. 乱数器および乱数利用処理の一例を説明するための図である。It is a figure for demonstrating an example of a random number machine and a random number utilization process. テストプログラム生成用部品の具現化処理によるテストプログラム生成方法の一例を示す図である。It is a figure which shows an example of the test program production | generation method by the implementation process of the components for test program production | generation parts.

符号の説明Explanation of symbols

100 テストプログラム生成器
101 テストプログラム生成用部品群
102 テストプログラム生成用部品具現化部
103 乱数器
104 テストプログラム出力部
105 部品重み情報
106 テストプログラム
107 再現情報
301 再現情報指示
302 再現情報設定処理
303 テストプログラム生成用部品重み指示
304 部品重み情報設定処理
305 テストプログラム生成用部品具現化処理
306 テストプログラム出力処理
701 expression部品
702 expressionが持つ具現化対象部品
703 具現されたexpressionに与えられる展開指示
704 assignment−expression部品
705 Comma−Exp部品
706 expressionの具現化処理終了フラグ
707 expressionに与えられた展開指示(for第1式)
708 for第1式時の選択部品重み割合
709 乱数による部品の選択
710 乱数により選択した部品の具現化処理
801 構文制約条件
802 構文制約発生時の処理
803 具現化処理終了フラグ
804 展開指示別重み割合取得
805 乱数による部品選択
806 選択部品の具現化
807 部品に対する具現化処理
808 具現化処理終了時の処理
901 assignment_operator部品
902 assignment_operatorが持つ具現化対象部品
903 assignment_operatorに与えられる展開指示
904 assignment_operatorの具現化処理終了フラグ
905 構文の制約発生条件例
906 発生した構文制約条件例
907 assignment_operatorに与えられる展開指示
908 構文制約条件により変更された展開指示別の選択部品重み割合
1001 部品重み情報
1002 具現化部品
1003 具現化部品別展開指示
1004 具現化対象部品重み割合
1005 具現化用部品重み情報設定処理
1006 expression部品
1007 expressionの該当展開指示
1008 変更された具現化対象部品の重み割合
1110 乱数利用処理
1101 乱数器
1102 乱数値
1103 乱数を利用する部品の具現化処理
1104 乱数を利用する変数再利用処理
1105 乱数を利用する数値処理
1106 乱数基準値設定処理
1107 乱数基準値
1108 乱数値発生器
1109 再現情報
100 Test Program Generator 101 Test Program Generation Component Group 102 Test Program Generation Component Realization Unit 103 Random Number Unit 104 Test Program Output Unit 105 Component Weight Information 106 Test Program 107 Reproduction Information 301 Reproduction Information Instruction 302 Reproduction Information Setting Process 303 Test Program generation component weight instruction 304 Component weight information setting processing 305 Test program generation component realization processing 306 Test program output processing 701 expression component 702 Expression target component 703 included in the expression Deployment instruction 704 assignment- given to the realized expression expression component 705 Comma-Exp component 706 expression embodying process end flag 707 express ion deployment instructions given to (for the first type)
708 for Selected Formula Weight Ratio in Formula 1 709 Component Selection by Random Number 710 Realization Processing of Components Selected by Random Number 801 Syntax Constraint Condition 802 Processing at Generation of Syntax Constraint 803 Realization Processing End Flag 804 Weight Ratio by Deployment Instruction Acquisition 805 Component selection by random number 806 Realization of selected component 807 Realization processing for component 808 Processing at the end of realization processing 901 assignment_operator component 902 Implementation target component 903 assignment_operator's implementation instruction 904 entition_entrification process End flag 905 Syntax constraint generation condition example 906 Generated syntax constraint condition example 907 given to assignment_operator Expansion instruction 908 Selected part weight ratio for each expansion instruction changed by the syntax constraint condition 1001 Component weight information 1002 Realization part 1003 Realization part-specific expansion instruction 1004 Realization target part weight ratio 1005 Realization part weight information setting processing 1006 Expression component 1007 Expression corresponding deployment instruction 1008 Weight ratio 1110 of the changed realization target component 1110 Random number use processing 1101 Random number 1102 Random value 1103 Realization processing of component using random number 1104 Variable reuse processing 1105 using random number Random number 1106 random number reference value setting process 1107 random number reference value 1108 random number generator 1109 reproduction information

Claims (5)

生成するテストプログラムを記述するためのプログラミング言語の構文分割可能なものであり前記構文を要素単位で分割し、それを1つのテストプログラム生成用部品として定義した部品の集まりであるテストプログラム生成用部品群の中から乱数を用いて前記テストプログラム生成用部品の1つを第1部品として選択し確定する第1工程と、選択し確定した第(n−1)部品を構成する複数の第n部品について前記テストプログラム生成用部品群の中から乱数を用いて前記第n部品の1つを選択し確定する工程を前記nを2から始めて順次大きくなる整数で繰返し行う第2工程と、前記選択し確定した第n部品がそれを構成する部品を持たない場合に前記選択し確定した第n部品の情報をテストプログラムの構成要素として選択し確定する第3工程とを備え、前記第1工程乃至第3工程を繰返し行うことにより得られた複数のテストプログラムの構成要素に基づいてテストプログラムを生成することを特徴とするコンピュータプログラムのテストプログラム生成方法。
Programming language syntax for describing a test program generated by dividing the at and the syntax capable division element by element, the test program for generating a collection of components that define it as one test program generation parts A first step of selecting and confirming one of the test program generation parts as a first part from a part group using a random number, and a plurality of nth parts constituting the selected and confirmed (n-1) part. A second step in which a step of selecting and confirming one of the n-th components from a group of test program generation components for the component by using a random number is repeated with an integer that starts from 2 and increases sequentially, and the selection If the confirmed n-th part does not have a part constituting it, the information on the selected and confirmed n-th part is selected and confirmed as a component of the test program. A test program generating method for a computer program, comprising: a third step, wherein a test program is generated based on a plurality of test program components obtained by repeating the first to third steps .
前記第1工程における前記第1部品の選択は、前記各テストプログラム生成用部品にそれぞれ対応して設けられた部品の選択され易さを示す重み情報を考慮して行われることを特徴とする請求項1記載のコンピュータプログラムのテストプログラム生成方法。   The selection of the first component in the first step is performed in consideration of weight information indicating ease of selection of a component provided corresponding to each of the test program generation components. A test program generation method for a computer program according to Item 1. 前記第2工程における前記第n部品の1つの選択は、前記各第n部品にそれぞれ対応して設けられた部品の選択され易さを示す重み情報を考慮して行われることを特徴とする請求項1または2記載のコンピュータプログラムのテストプログラム生成方法。   The selection of one of the n-th components in the second step is performed in consideration of weight information indicating ease of selection of components provided corresponding to the respective n-th components. Item 3. A test program generation method for a computer program according to Item 1 or 2. 前記第2工程における前記第n部品の選択の際に、テストプログラムの構文上の制約条件が発生した場合、前記部品の選択され易さを示す重み情報が、前記制約条件に応じて変更されることを特徴とする請求項3記載のコンピュータプログラムのテストプログラム生成方法。   When a constraint condition in the syntax of the test program occurs when selecting the n-th component in the second step, weight information indicating the ease of selecting the component is changed according to the constraint condition. The test program generation method for a computer program according to claim 3. 前記テストプログラムを生成したときの乱数の乱数値を再現情報として保持し、前記テストプログラムを再現する場合に、前記再現情報として保持している前記乱数値を用いることを特徴とする請求項1乃至4のいずれかに記載のコンピュータプログラムのテストプログラム生成方法。   The random number value of the random number when the test program is generated is held as reproduction information, and when reproducing the test program, the random number value held as the reproduction information is used. 5. A test program generation method for a computer program according to any one of 4 above.
JP2005321613A 2005-11-04 2005-11-04 Test program generation method for computer program Expired - Lifetime JP4847102B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005321613A JP4847102B2 (en) 2005-11-04 2005-11-04 Test program generation method for computer program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005321613A JP4847102B2 (en) 2005-11-04 2005-11-04 Test program generation method for computer program

Publications (2)

Publication Number Publication Date
JP2007128372A JP2007128372A (en) 2007-05-24
JP4847102B2 true JP4847102B2 (en) 2011-12-28

Family

ID=38150965

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005321613A Expired - Lifetime JP4847102B2 (en) 2005-11-04 2005-11-04 Test program generation method for computer program

Country Status (1)

Country Link
JP (1) JP4847102B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6921976B2 (en) * 2017-10-20 2021-08-18 株式会社日立製作所 Diagnostic model parts reuse support device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01155438A (en) * 1987-12-12 1989-06-19 Hitachi Ltd Compiler test method
JPH01220044A (en) * 1988-02-29 1989-09-01 Fujitsu Ltd Language processing program testing system
JPH1131090A (en) * 1997-07-14 1999-02-02 Fujitsu Ltd Medium recording processor system and selection program

Also Published As

Publication number Publication date
JP2007128372A (en) 2007-05-24

Similar Documents

Publication Publication Date Title
JP6973846B2 (en) Systems and methods for automated test case expansion for coverage-based design models
JP5874891B2 (en) Program test apparatus, program test method, and program
CN111679979A (en) Destructive testing method and device
EP3264274A1 (en) Input discovery for unknown program binaries
JP6310527B1 (en) Object analysis apparatus, object analysis method, and program
KR20190094779A (en) Automatically Generate Device for PLC Instruction Compiler Test-Case
JP4847102B2 (en) Test program generation method for computer program
JP2011191985A (en) Symbolic execution support program, method and device
JP2010102620A (en) User operation scenario generating device, method and program
JP6723483B2 (en) Test case generation device, test case generation method, and test case generation program
JP2012181666A (en) Information processing device, information processing method and information processing program
JP2010250669A (en) Test case generation device, object inspection device, and program
JP2001273169A (en) Program test specification generator
JP6547345B2 (en) Test case generation program, test case generation method and test case generation apparatus
JP5811978B2 (en) Test case generation apparatus and test case generation method for model-based control apparatus
CN115114136A (en) Test data generation method and device, electronic equipment and program product
US10579761B1 (en) Method and system for reconstructing a graph presentation of a previously executed verification test
JP2020098413A (en) Test support device, test support method and computer program
WO2004068347A1 (en) Method and apparatus for categorising test scripts
JP2005316710A (en) Software test support device
CN112527662A (en) Test script generation method and device
JP2012059202A (en) Test case generation device, test case generation method and test case generation program
JP2006259820A (en) Failure detection improvement device, failure detection improvement program, failure detection improvement method
CN112527574A (en) Processor testing method, device, equipment and readable storage medium
JP7059827B2 (en) Source code generator

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20081023

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100721

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100824

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20101022

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110215

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110415

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20111013

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20141021

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4847102

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250