JP2011159008A - Device and method for testing program - Google Patents
Device and method for testing program Download PDFInfo
- Publication number
- JP2011159008A JP2011159008A JP2010018639A JP2010018639A JP2011159008A JP 2011159008 A JP2011159008 A JP 2011159008A JP 2010018639 A JP2010018639 A JP 2010018639A JP 2010018639 A JP2010018639 A JP 2010018639A JP 2011159008 A JP2011159008 A JP 2011159008A
- Authority
- JP
- Japan
- Prior art keywords
- function
- test
- data
- program
- changed
- 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.)
- Pending
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
Description
本発明はプログラムテスト装置およびプログラムテスト方法に関する。 The present invention relates to a program test apparatus and a program test method.
プログラムテスト装置が一般に知られている。プログラムテスト装置では、個々のモジュール(部品)のみを対象としてテストを行い、対象のモジュールが要求された機能や性能を満たしているかどうかについてテストを行う。
近年、組み込みシステムの規模の拡大に伴い、プログラム量も増加する傾向にある。プログラム開発における品質確保のための手段として、関数を対象としたプログラムテスト装置での単体テストによる大量のテスト実行が可能となっている。
Program test devices are generally known. The program test apparatus tests only individual modules (components), and tests whether the target module satisfies the required functions and performance.
In recent years, the amount of programs tends to increase as the scale of embedded systems increases. As a means for ensuring quality in program development, it is possible to execute a large amount of tests by unit tests in a program test apparatus for functions.
しかし、プログラム量の増加に伴いテスト対象となる関数が以前に比べて莫大に増えており、今後も規模(テスト対象となる関数の数)が拡大することが予測される。
その流れの中でプログラムテスト装置では、変更したプログラムに対して作成済みテストデータがそのまま使えるか、それともテストデータの修正が必要かどうかの確認に時間がかかっており、この時間の短縮が望まれている。すなわち、処理結果の出力が終わってから、次の要求の受け入れが可能になるまでの時間(TAT: Turn Around Time)を短縮化したいという要望がある。
However, with the increase in the amount of programs, the functions to be tested have increased enormously compared to before, and the scale (number of functions to be tested) is expected to increase in the future.
In the process, the program test equipment takes time to check whether the test data already created for the changed program can be used as it is or whether the test data needs to be corrected. ing. That is, there is a desire to shorten the time (TAT: Turn Around Time) from when the processing result is output until the next request can be accepted.
特許文献1には、再テストすべきテストデータの抽出を容易にする再テスト方法およびそのための装置に関する技術が開示されている。図12は、特許文献1に開示されたプログラムテスト装置のシステム構成図である。 Patent Document 1 discloses a technique relating to a retest method and apparatus for facilitating extraction of test data to be retested. FIG. 12 is a system configuration diagram of the program test apparatus disclosed in Patent Document 1.
このプログラムテスト装置は、端末装置1と、再テスト装置2と、を備え、再テスト装置2は、テストデータ抽出部3と、テスト実行部4と、テストデータ把握部5と、テスト結果検証部6と、を備える。
The program test device includes a terminal device 1 and a retest device 2. The retest device 2 includes a test
端末装置1は、テストデータ抽出部3に修正モジュール名称15の入力を行う。ここで修正モジュール名称15とは、プログラム内において、修正が行われたモジュールの名称である。
The terminal device 1 inputs the
テストデータ関連情報ファイル7には、テストデータとモジュールの名称とを対応させた対応表が格納されている。ここでテストデータとは、モジュールのテストの際に入力されるデータである。
テストデータ抽出部3は、テストデータ関連情報ファイル7から修正モジュール名称15に関連するテストデータを抽出し、その結果をテストデータ抽出ファイル8に出力する。
The test data
The test
テストデータファイル9には、テストデータが格納されている。また、テスト対象プログラムファイル10には、テスト対象であるプログラムが格納されている。
テスト実行部4は、テストデータ抽出ファイル8の情報を基に、テストデータファイル9からテストデータを、テスト対象プログラムファイル10からテスト対象プログラムを読み込み、テストを実行する。すなわち、テスト対象となるテスト対象プログラムファイル10について、テストデータファイル9から抽出したテストデータでテストを行い、結果を検証用テスト結果ファイル12に出力する。ここで、検証用テスト結果ファイル12には例えば、テストデータの名称、テストの検証用キー、テスト時の確認内容(テスト結果)などが格納される。検証用キーとは、例えばテスト対象のプログラム名称と、テスト対象のモジュール名称と、実行中断位置と、のそれぞれの情報を備えたものである。
また、テスト実行部4は、テストカバレッジ情報ファイル11からテストカバレージ情報を読み込み、テスト時にテストカバレージの採取を行う。
The
The
In addition, the
テストデータ把握部5は、テスト実行部4で採取したテストカバレージ率の変化したモジュールをテストデータと関連付ける。
The test
検証用データファイル13には、例えば、前回のテストにおける検証用キーや確認内容が記録されている。
テスト結果検証部6は、検証用テスト結果ファイル12中のテスト結果と検証用データファイル13中の前回のテスト結果とを比較して、その結果を検証結果ファイル14に出力する。
In the
The test
図13は、テスト結果検証部6の処理フロー図である。図13を用いて、テスト結果検証部6の動作について説明する。
FIG. 13 is a process flow diagram of the test
まず、検証用テスト結果ファイル12から検証用テスト結果を読み込む(ステップ222)。次に、検証用データファイル13から前回のテスト結果を読み込む(ステップ223)。 First, a verification test result is read from the verification test result file 12 (step 222). Next, the previous test result is read from the verification data file 13 (step 223).
それぞれの検証用キーおよび確認内容を比較し(ステップ224)、一致していない場合は、検証用データファイル13の検証用データとテスト結果を検証結果ファイル14に出力し(ステップ225)、一致している場合は、テスト結果が一致していることを検証結果ファイル14に出力する(ステップ226)。すべてのテスト結果の検証が終わるまで、ステップ224からステップ226を繰り返す(ステップ227)。
これにより、検証用テスト結果ファイル12から、検証用キーおよび確認内容が前回のテスト結果と一致しないものを抽出することができる。すなわち、再テストすべきテストデータを自動的に抽出することができる。
The respective verification keys and confirmation contents are compared (step 224). If they do not match, the verification data in the
As a result, it is possible to extract from the verification
特許文献1に開示されている技術は、テストデータの修正が必要かどうかの確認作業に、時間がかかるという問題がある。これは、再テストすべきテストデータの箇所を変更するにあたり、テスト対象プログラムを変更した後に再度テストを実行したテスト結果と、前回のテスト結果とを比較し、テスト結果の異なる箇所を取り出しているためである。すなわち、テストデータの修正が必要な箇所の確認作業のために予備的にテストを実行させなければならない。その上で変更したテストデータでプログラムのテストを行わねばならない。このようにプログラムテストを複数回実行する場合には時間がかかる。特に近年はプログラム量が増加しているためテスト実行に時間がかかる。 The technique disclosed in Patent Document 1 has a problem that it takes time to confirm whether or not the test data needs to be corrected. This means that when changing the location of the test data to be retested, the test result that was executed again after changing the program to be tested is compared with the previous test result, and the test results that are different are extracted. Because. In other words, a test must be executed in advance for the confirmation work of the place where the test data needs to be corrected. The program must be tested with the modified test data. As described above, it takes time to execute the program test a plurality of times. In particular, since the amount of programs has increased in recent years, test execution takes time.
本発明の第1の態様は、プログラムデータが変更されたときに変更後プログラムを動作テストするプログラムテスト装置であって、変更前のプログラムデータにより作成されたテストデータのうち、プログラムの変更にともなって変更された関数に関する箇所を抽出する変更関数抽出部と、テストデータのうち前記変更された関数に関係する箇所を書き換え、かつ、変更されなかった部分は流用して変更後プログラム用のテストデータを作成するテストデータ作成部と、前記テストデータ作成部で作成されたテストデータを用いてテストを実行するテスト実行部と、を備えるプログラムテスト装置である。 A first aspect of the present invention is a program test apparatus for performing an operation test on a program after change when the program data is changed. Of the test data created by the program data before change, the program is changed. And a modified function extracting unit for extracting a portion related to the function that has been changed, and rewriting the portion related to the changed function in the test data, and diverting the portion that has not been changed to test data for the changed program Is a program test apparatus comprising: a test data creation unit that creates a test data; and a test execution unit that executes a test using the test data created by the test data creation unit.
本発明の第2の態様は、プログラムデータが変更されたときに変更後プログラムを動作テストするプログラムテスト装置の制御方法であって、変更前のプログラムデータにより作成されたテストデータから、プログラムの変更にともなって変更された関数に関する箇所を抽出し、テストデータのうち前記変更された関数に関係する箇所を書き換え、かつ、変更されなかった部分は流用して変更後プログラム用のテストデータを作成し、前記作成されたテストデータを用いてテストを実行する、プログラムテスト装置の制御方法である。 According to a second aspect of the present invention, there is provided a method for controlling a program test apparatus for performing an operation test on a program after change when the program data is changed, wherein the program is changed from test data created by the program data before the change. The part related to the function that has been changed is extracted, the part related to the changed function in the test data is rewritten, and the part that has not been changed is used to create test data for the changed program. A program test apparatus control method for executing a test using the created test data.
これにより、プログラムの変更にともなってテストデータの中で修正が必要とされる箇所を関数段階で比較して抽出することにより、プログラムのテスト結果で比較するより予備的なテスト実行を行う必要が無く、プログラムテストにかかる時間が短縮化される。 As a result, it is necessary to perform preliminary test execution rather than comparing with the test result of the program by extracting the part that needs to be corrected in the test data according to the program change at the function stage. And the time required for the program test is shortened.
プログラムテストにかかる時間を短縮することができる。 The time required for the program test can be shortened.
実施の形態1
以下、図面を参照して本発明の実施の形態について説明する。
図1は、プログラムテスト装置のシステム構成図である。
プログラムテスト装置100は、変更関数抽出部115と、テストデータ作成部102と、テスト実行部103と、を備える。
変更関数抽出部115は、テスト対象ソースファイル106に記載されているソースプログラムについて、前回のテスト時から変更がなされていない関数を抽出する。
変更関数抽出部115は、全関数情報抽出部101と、関数変更検知用データ作成部104と、未変更関数一覧データ作成部105と、関数対比部116と、を備える。
Embodiment 1
Embodiments of the present invention will be described below with reference to the drawings.
FIG. 1 is a system configuration diagram of a program test apparatus.
The
The change
The changed
図1において、テスト対象ソースファイル106は、テスト対象となるソースコードが記載されているファイルである。すなわち、プログラムデータである。
言語ツール120は、典型的にはコンパイラやアセンブラである。例えば、言語ツールは、プログラミング言語で書かれたテスト対象ソースファイル106を、コンピュータが直接実行可能な機械語のプログラムに変換して、テスト対象ロードモジュールファイル107を作成する。
テスト対象ロードモジュールファイル107は、言語ツール120がテスト対象ソースファイル106に基づいて出力したファイルである。
In FIG. 1, a test target source file 106 is a file in which source code to be tested is described. That is, program data.
The
The test target
全関数情報抽出部101は、テスト対象ロードモジュールファイル107からデータを読み込み、関数情報を抽出する。ここで、テスト対象ロードモジュールファイル107は、テストの対象であり関数を含んで構成され、テスト対象ソースファイル106が変更にされることにより、前回のテスト時から変更されている。全関数情報抽出部101が抽出する関数情報は、典型的には関数名である。全関数情報抽出部101は、抽出した関数情報をテスト対象関数データ108として出力する。全関数情報抽出部101は、例えばデバッガを用いることにより、テスト対象ロードモジュールファイル107から、関数情報を抽出することができる。
The all function
テスト対象関数データ108は、全関数情報抽出部101から出力された関数情報を格納している。図2は、テスト対象関数データ108の構成図である。テスト対象関数データ108は、複数の関数名200で構成されている。
The test
関数変更検知用データ作成部104は、テスト対象となるテスト対象ソースファイル106に基づいて、関数変更検知用データ112を作成して出力する。
The function change detection
関数変更検知用データ112は、関数変更検知用データ作成部104から出力したデータを格納している。
図6は、関数変更検知用データ112の構成図である。関数変更検知用データ112は、複数の関数名700と、関数名700に関連付けられた検知用データ701と、で構成されている。検知用データ701については、図7を参照して後述する。
The function
FIG. 6 is a configuration diagram of the function
未変更関数一覧データ作成部105は、関数変更検知用データ112と前回のテスト実行結果データ113と、に基づいて、未変更関数一覧データを作成する。未変更関数一覧データは、変更されていない関数の関数名のデータである。未変更関数一覧データ作成部105は、作成したデータを未変更関数一覧データ114として出力する。未変更関数一覧データ作成部105については、図8を参照して後述する。
The unchanged function list
図5は、未変更関数一覧データ114の構成図である。未変更関数一覧データ114は、複数の変更されなかった関数名500を備えている。
FIG. 5 is a configuration diagram of the unchanged
関数対比部116は、テスト対象関数データ108に格納されているデータと、未変更関数一覧データ114に格納されているデータとを対比し、変更がなされた関数を抽出する。
The
テストデータ作成部102は、関数対比部116により抽出された関数情報と、前回のテストデータ109と、を入力としてテストデータを作成する。テストデータ作成部102は、作成したテストデータをテストデータ110として出力する。テストデータ作成部102については、図9を参照して後述する。
The test
図3は、テストデータ110の構成図である。テストデータ110は、複数の関数名300と、変更有無情報301と、テスト項目302と、で構成されている。変更有無情報301は、テストデータ110が前回のテストデータ109から変更があったか否かを表す情報である。変更有無情報301は、関数名300に関連付けられている。
テスト項目302には、テスト項目が記録されている。複数のテスト項目302は関数名300に関連付けられている。
前回のテストデータ109は、先のテストで作成されたテストデータであり、テストデータ110と同様の構成である。前回のテストデータ109は、前回のテスト実行時に作成されたテストデータ110を格納している。
FIG. 3 is a configuration diagram of the
In the
The
テスト実行部103は、テスト対象ロードモジュールファイル107とテストデータ110と関数変更検知用データ112から入力されたデータに基づき、テストを実行する。テスト実行部103は、テストの実行結果データをテスト実行結果データ111として出力する。
The
テスト実行結果データ111は、テスト実行部103から出力されたテスト実行結果データを格納している。
図4は、テスト実行結果データ111の構成図である。テスト実行結果データ111は、複数の関数名400と、関数名400に関連付けられた変更検知用データ401と、関数名400に関連付けられた判定結果402と、を備えている。
また、前回のテスト実行結果データ113は、テスト実行結果データ111と同様の構成である。前回のテスト実行結果データ113は、前回のテストにおけるテスト実行結果データ111のテスト実行結果を格納している。
The test
FIG. 4 is a configuration diagram of the test
The previous test
次に、本実施の形態にかかるプログラムテスト装置の動作について説明する。 Next, the operation of the program test apparatus according to this embodiment will be described.
まず、プログラム作成者が、順次変更修正を加えながら、テスト対象ソースファイル106を作成する。
テスト対象ソースファイル106は、言語ツール120により、テスト対象ロードモジュールファイル107に展開される。そしてテスト対象ロードモジュールファイル107は、全関数情報抽出部101に読み込まれる。全関数情報抽出部101は、テスト対象ロードモジュールファイル107に含まれる全ての関数の関数名を抽出し、テスト対象関数データ108として出力する。
First, the program creator creates the test source file 106 while sequentially changing and correcting it.
The test target source file 106 is expanded into the test target
また一方、関数変更検知用データ作成部104により、テスト対象ソースファイル106から、関数変更検知用データ112が作成される。
On the other hand, the function change detection
図7は、関数変更検知用データの作成例である。図7を用いて関数変更検知用データ作成部104の動作を説明する。
FIG. 7 is an example of creating function change detection data. The operation of the function change detection
初回のテスト実行後、テスト対象ソースファイル106が関数変更後にテスト対象関数ソースコード1000のように修正された場合、関数変更検知用データ作成部104が関数変更後にテスト対象関数ソースコード1000に対してコンパイラのプリプロセス相当の処理を行う。すなわち、テスト対象関数ソースコード1000のマクロの文字列"NEXT_INDEX"を"4"に置き換え、コメントの文字列"/* コメント */"の削除を行い、中間コード1001を作成する。
After the first test execution, when the test source file 106 is modified as the test target
次に、関数変更検知用データ作成部104は、前記中間コード1001を関数の先頭行から関数の末尾行のブロック毎に分割した関数別中間コード1002を作成する。関数"function"に対しては、文字列"int function(int arg)"が記述されている行の先頭から、関数の末尾を示す記号"}"が記述されている行の末尾までが一つのブロックとなる。
Next, the function change detection
次に、関数変更検知用データ作成部104は、前記関数別中間コード1002から空白文字とタブと改行コードを削除した検知データ1003を作成する。たとえば図7の例では、関数"function"に対する検知データは一つの文字列"intfunction(intarg){arg+=4;returnarg;}"となる。ここではfunctionが関数名にあたる。
この検知データ1003が、関数変更検知用データ112内の関数名700と関連付けられた検知用データ701とする。
Next, the function change detection
This
関数変更検知用データ112から関数名700と検知用データ701が未変更関数一覧データ作成部105に入力される。
The
図8は、未変更関数一覧データ作成部105の動作を示すフローチャートである。
FIG. 8 is a flowchart showing the operation of the unchanged function list
未変更関数一覧データ作成部105は、関数変更検知用データ112内の確認が終わってない関数名700を一つ選択する(ステップS900)
The unchanged function list
次に、未変更関数一覧データ作成部105に入力される。未変更関数一覧データ作成部105は、前回のテスト実行結果データ113の中に、ステップS901で選択した関数名700の名称と一致する関数名400が存在するか否かを確認する(ステップS901)。
Next, it is input to the unchanged function list
ここで、関数名700の名称と一致する関数名400がない場合とは、新たに関数が作成されたということである。そこで、この場合には関数の変更があると判断する。
Here, the case where there is no
一方、関数名700の名称と一致する関数名400がある場合とは、検知を行っている関数名が、前回のテスト時に存在したということになる。そこでこの場合には、関数名700に関連付けられた検知用データ701と関数名400に関連付けられた変更検知用データ401が一致するか確認する(ステップS902)。
検知用データ701と変更検知用データ401が一致する場合には、未変更関数一覧データ作成部105は、関数の変更が無いと判断し、未変更関数一覧データ114に関数名500を出力する(ステップS903)。なお、変更検知用データ401は、関数名700と一致する関数名400に関連付けられたものとする。その後、ステップS904に進む。
検知用データ701と変更検知用データ401が一致しない場合には、関数の変更があると判断し(ステップS902でNO)、ステップS904へ進む。
On the other hand, when there is a
If the
If the
次に、関数変更検知用データ112内の全ての関数名700の確認が終わっているかを判断(ステップS904)し、確認が終わっている場合は(ステップS904でYES)処理を終了する。
確認が終わっていない場合には(ステップS904でNO)、ステップS900に戻り処理を繰り返す。
これにより、未変換関数の一覧データが作成され、未変更関数一覧データ114に格納される。
Next, it is determined whether all the
If the confirmation has not been completed (NO in step S904), the process returns to step S900 and is repeated.
As a result, list data of unconverted functions is created and stored in the unmodified
次に、関数対比部116により、テスト対象関数データ108に格納されたデータと、未変更関数一覧データ114に格納されたデータとの対比が行われる。
Next, the
次に、テストデータ作成部102の動作について説明する。
Next, the operation of the test
図9は、テストデータ作成部102の制御フローチャートである。
FIG. 9 is a control flowchart of the test
最初に、テストデータ作成部102は、テスト対象関数データ108からまだテストデータ110に存在していない関数名200を一つ選択する(ステップS700)。
First, the test
次にテストデータ作成部102は、選択した関数名200と同じ関数名が未変更関数一覧データ114内の関数名500に存在するか否かを、関数対比部で対比を行った結果に基づいて確認する(ステップS701)。
選択した関数名200と同じ名称の関数名500が存在しない場合には(ステップS701でNO)、テストデータ110内に関数名300を作成し、その関数については変更有無情報301を変更ありに設定する(ステップS702)。
選択した関数名200と同じ名称の関数名500が存在する場合には、関数が変更されてないと判断でき(ステップS701でYES)、テストデータ110内に関数名300を作成し、その関数については関連する変更有無情報301を変更なしに設定する(ステップS703)。
Next, the test
If the
If there is a
次に、前回のテストデータ109内に一致する関数名300の存在を確認し、変更有無情報301が変更なしである事を確認した場合にテスト項目が流用できると判断する(ステップS704)。
テスト項目が流用できる場合には(ステップS704でYES)、テストデータ作成部102が前回のテストデータ109から関数名300に関連付けられているテスト項目302をテストデータ110にコピーする(ステップS705)。
テスト項目が流用できない場合には(ステップS704でNO)、テストデータ作成部102が、関数名300に関連した新たなテスト項目302を作成する(ステップS706)。なお、テスト項目302は、プログラムテスト装置利用者が、テストデータ作成部を操作して作成してもよく、プログラムテスト装置100にテスト項目302を作成する機能を持たせてもよい。また、テスト項目302に格納されているデータは、テスト対象の関数の引数や、テスト対象の関数が参照する変数等である。
Next, the presence of the
If the test item can be diverted (YES in step S704), the test
If the test item cannot be diverted (NO in step S704), the test
テスト対象関数データ108内にテスト項目を作成していない関数が残っているかを判断し(ステップS707)、テスト対象関数データ108内の全ての関数に対して、テスト項目を作成している場合には(ステップS707でYES)、処理を終了する。
テスト項目を作成していない関数が残っている場合には(ステップS707でNO)、ステップS700に戻り、処理を繰り返す。
It is determined whether or not a function for which a test item has not been created remains in the test target function data 108 (step S707), and test items have been created for all the functions in the test
If there remains a function for which no test item has been created (NO in step S707), the process returns to step S700 and the process is repeated.
次に、テスト実行部103は、テスト対象ロードモジュールファイル107と、テストデータ110と、関数変更検知用データ112に基づいて、テスト実行結果をテスト実行結果データ111に出力する。
なおテスト実行結果データ111は、次回のテスト時に前回のテスト実行結果データ113として使用される。また、テストデータ110は、次回のテスト時に前回のテストデータ109として使用される。
Next, the
The test
図10は、テスト実行部103の動作を表すフローチャートである。図10を用いてテスト実行部103の制御フローを説明する。
FIG. 10 is a flowchart showing the operation of the
最初にテスト実行部103は、テストデータ110からテストが終わってない関数名300を一つ選択する(ステップS800)。
First, the
次に、テスト実行部103は、選択した関数名300に関連付けられた、未実行のテスト項目302を一つ選択する(ステップS801)。次にテスト実行部103が選択したテスト項目302を実行する(ステップS802)。
Next, the
関数名300に対して全てのテスト項目302の実行が終わってない場合、ステップS801に戻り処理を繰り返す(ステップS803でNO)。
関数名300に対して全てのテスト項目の実行が終わっている場合(ステップS803でYES)、テスト実行部103がテスト実行結果データ111に、関数名400と関数名400に関連付けられた判定結果402を作成する。さらに、関数変更検知用データ112から入力された検知用データ701を利用して、関数名400と関連した変更検知用データ401を作成して出力する(ステップS804)。この変更検知用データは、次のテスト実行時に、未変更関数一覧データ作成部105において、変更された関数を抽出するために用いられる。
If all the
If all test items have been executed for the function name 300 (YES in step S803), the
テストデータ110内の全ての関数名300のテスト実行が終了を確認し(ステップS805)、テスト実行が終わっている場合は処理を終了する(ステップS805でYES)。
テスト実行が終わっていない場合は(ステップS805でNO)、ステップS800に戻り処理を繰り返す。
It is confirmed that the test execution of all the
If the test execution has not ended (NO in step S805), the process returns to step S800 to repeat the process.
このような本実施の形態のプログラムテスト装置によれば、次の効果を奏することができる。
修正したテスト対象ソースファイルに対してテストデータの修正が必要かどうかの確認作業を短時間で行うことができる。
修正したテスト対象ソースファイルから関数変更検知用データを作成し、前回のテスト実行結果データ内の変更検知データと比較することで、未変更関数一覧情報を作成することにより、テストデータの修正が不要な関数を抽出することができるためである。
According to such a program test device of the present embodiment, the following effects can be obtained.
It is possible to confirm in a short time whether the test data needs to be corrected for the corrected test target source file.
By creating function change detection data from the modified test source file and comparing it with the change detection data in the previous test execution result data, it is not necessary to modify the test data by creating the unchanged function list information This is because a simple function can be extracted.
テスト対象ソースファイル106内に書かれたコメントや空白に関わらず、同一の関数を用いているか否かを判断することができる。また、前回のテスト時に用いられた関数か否かを判断するための変更検知用データを用いることができる。変更された関数か否かを判断する際に、関数名のみを先に比較することにより、処理時間の短縮を図ることができる。
It is possible to determine whether or not the same function is used regardless of comments or blanks written in the
実施の形態2
図11は、プログラムテスト装置のシステム構成図の他の例である。実施の形態1に示したプログラムテスト装置のシステム構成と同一の構成要素に対しては、同一の符号を付加し、該構成要素に関する説明を省略する。
Embodiment 2
FIG. 11 is another example of a system configuration diagram of the program test apparatus. The same components as those of the system configuration of the program test apparatus shown in the first embodiment are denoted by the same reference numerals, and description thereof is omitted.
図11に示したプログラムテスト装置のシステム構成は、図1に示したプログラムテスト装置のシステム構成に比べ、未変更関数一覧データの作成にあたり、今回の関数変更検知用データ112と前回の関数変更検知用データ118を対比する点に特徴を有する。
The system configuration of the program test apparatus shown in FIG. 11 is the same as that of the program test apparatus shown in FIG. It is characterized in that the
次に動作について説明する。
関数変更検知用データ作成部104で作成された関数変更検知用データ112は、バッファ117に格納される。次のテスト実行の際には、前回の関数変更検知用データ118はバッファ117に格納された情報を読み出し、これを前回の関数変更検知用データとして用いる。
Next, the operation will be described.
The function
未変更関数一覧データ作成部105は、関数変更検知用データ112と前回の関数変更検知用データ118からデータを読み出して比較を行う。すなわち、未変更関数一覧データ作成部105は、まず関数変更検知用データ112と前回の関数変更検知用データ118に格納されている関数名をそれぞれ比較し、現在テストを行っている関数名が、前回のテスト時に存在していたか否かを確認する。
The unchanged function list
前回のテスト時から関数名が存在する場合には、未変更関数一覧データ作成部105は、関数変更検知用データ112と前回の関数変更検知用データ118に格納されている検知用データを比較し、検知用データが一致すれば、その関数は前回のテスト時から変更されていないものとして、関数名を未変更関数一覧データ114に記録する。
When the function name exists from the previous test, the unchanged function list
なお、関数変更検知用データ112から読み出した関数名を前回の関数変更検知用データ118で発見できなかった場合や、同一の関数名で関数変更検知用データ112と前回の関数変更検知用データ118に格納されている検知用データが異なる場合には、その関数は変更がなされたものと判断される。この場合、その関数名は未変更関数一覧データ114に記録されない。
If the function name read from the function
なお、実施の形態2では、テスト実行結果データ111の変更検知用データは使用しない。したがって、テスト実行部103は、関数変更検知用データ112から検知用データ701を読み込む必要がない。この場合、テスト実行部103はテスト実行結果データ111として関数名400と判定結果402を出力し、変更検知用データ401を出力しない。
In the second embodiment, the change detection data of the test
このような実施の形態2のプログラムテスト装置によれば、テスト実行の際に、テスト結果に検出用データを埋め込む必要がない。 According to such a program test apparatus of the second embodiment, it is not necessary to embed detection data in the test result at the time of test execution.
なお、本発明は上記実施の形態に限られたものではなく、趣旨を逸脱しない範囲で適宜変更することが可能である。 Note that the present invention is not limited to the above-described embodiment, and can be changed as appropriate without departing from the spirit of the present invention.
100 プログラムテスト装置
101 全関数情報抽出部
102 テストデータ作成部
103 テスト実行部
104 関数変更検知用データ作成部
105 未変更関数一覧データ作成部
106 テスト対象ソースファイル
107 テスト対象ロードモジュールファイル
108 テスト対象関数データ
109 テストデータ
110 テストデータ
111 テスト実行結果データ
112 関数変更検知用データ
113 テスト実行結果データ
114 未変更関数一覧データ
115 変更関数抽出部
116 関数対比部
117 バッファ
118 前回の関数変更検知用データ
120 言語ツール
300 関数名
301 変更有無情報
302 テスト項目
400 関数名
401 変更検知用データ
402 判定結果
500 関数名
700 関数名
701 検知用データ
1000 ソースコード
1001 中間コード
1002 関数別中間コード
1003 検知データ
DESCRIPTION OF
Claims (7)
プログラムの変更にともなって変更された関数の関数名を抽出する変更関数抽出部と、
テストデータのうち前記変更された関数に関係する箇所を書き換え、かつ、変更されなかった部分は前回のテストデータから流用して変更後プログラム用のテストデータを作成するテストデータ作成部と、
前記テストデータ作成部で作成されたテストデータを用いて、前記変更後プログラムのテストを実行するテスト実行部と、を備える、
プログラムテスト装置。 A program test device that tests an operation of a program after change when program data is changed,
A change function extraction unit that extracts a function name of a function that has been changed according to a program change;
Rewriting the part related to the changed function among the test data, and the test data creating unit for creating the test data for the changed program by diverting the part not changed from the previous test data,
Using the test data created by the test data creation unit, a test execution unit that executes the test of the changed program,
Program test device.
変更後プログラムデータに含まれる全ての関数の関数名を抽出する全関数情報抽出部と、
前記変更後プログラムデータに含まれる関数の関数名およびその関数の文字列を関数変更検知用データとして抽出する関数変更検知用データ作成部と、
前記関数変更検知用データ作成部により作成された検知用データと、変更前のプログラムデータをテストしたときに作成された検知用データと、に基づいて、前記関数のうちプログラムデータの変更前後において変更されていない関数の一覧データを作成する未変更関数一覧データ作成部と、を備え、
前記全関数情報抽出部により抽出された関数情報と、前記未変更関数一覧データと、に基づいて、変更された関数情報を抽出する、
請求項1に記載のプログラムテスト装置。 The change function extraction unit includes:
An all-function information extraction unit that extracts function names of all functions included in the program data after the change;
A function change detection data creation unit that extracts a function name of the function included in the program data after change and a character string of the function as data for function change detection;
Based on the detection data created by the function change detection data creation unit and the detection data created when testing the program data before the change, the function is changed before and after the change of the program data. An unmodified function list data creation unit that creates list data of functions that have not been performed,
Based on the function information extracted by the all function information extraction unit and the unmodified function list data, the changed function information is extracted.
The program test apparatus according to claim 1.
プログラムデータ内の関数内で使用されているマクロの定義を展開し、コメントを削除したコードを生成し、
前記生成されたコードを関数単位に分割し、
関数単位に分割したコードから空白と改行を削除した文字列を作成して関数変更検知用データを作成する、
請求項2に記載のプログラムテスト装置。 The function change detection data creation unit
Expand the definition of the macro used in the function in the program data, generate the code with the comment removed,
The generated code is divided into function units,
Create a function change detection data by creating a character string with spaces and line breaks removed from the code divided into function units.
The program test apparatus according to claim 2.
前記未変更関数一覧データ作成部により作成された未変更関数一覧データ内に同じ名称の関数名が存在するか否かを判定し、
前記判定により前記テスト対象関数データが変更されたと判定された場合には、関数名に関連した新たなテスト項目を作成し、
前記テスト対象関数データ対象関数データが変更されていないと判定された場合には、前回のテストデータを流用し、
前記テスト対象関数データの全てについて上記の判定作業を行う、
請求項2または請求項3に記載のプログラムテスト装置。 The test data creation unit
Determine whether there is a function name of the same name in the unchanged function list data created by the unchanged function list data creation unit,
When it is determined that the test target function data has been changed by the determination, a new test item related to the function name is created,
When it is determined that the test target function data target function data is not changed, the previous test data is diverted,
Perform the above-described determination work for all of the test target function data,
The program test apparatus according to claim 2 or claim 3.
前記関数変更検知用データから検知を行う関数名を選択し、変更前のプログラムデータにより出力されたテスト実行結果データ中に、関数名と一致する前記関数名が存在するか否かを確認し、
一致する関数名がある場合には、前記関数名に関連付けられた検知用データと前記関数名に関連付けられた前記変更検知用データが一致するか確認し、
前記検知用データと前記変更検知用データが一致する場合には、関数の変更がないと判断して、前記関数名を未変更関数一覧データに関数名として記録する、
請求項2乃至請求項4のいずれか1項に記載のプログラムテスト装置。 The unmodified function list data creation unit
Select the function name to be detected from the function change detection data, check whether the function name that matches the function name exists in the test execution result data output by the program data before the change,
If there is a matching function name, check whether the detection data associated with the function name matches the change detection data associated with the function name,
If the detection data matches the change detection data, it is determined that there is no function change, and the function name is recorded as a function name in the unchanged function list data.
The program test apparatus according to any one of claims 2 to 4.
テストの実行を行った関数名に関連付けられた判定結果を作成し、
前記関数変更検知用データと前記判定結果とを合わせてテスト実行結果データとして出力し、
次のテスト時には、前記未変更関数抽出部は、前記関数変更検知用データとテスト実行結果データとの対比により未変更関数を抽出する、
請求項2乃至請求項5のいずれか1項に記載のプログラムテスト装置。 The test execution unit
Create a decision result associated with the name of the function that performed the test,
Output the function change detection data and the determination result together as test execution result data,
At the time of the next test, the unchanged function extraction unit extracts an unchanged function by comparing the function change detection data with the test execution result data.
The program test apparatus according to any one of claims 2 to 5.
プログラムの変更にともなって変更された関数の関数名を抽出し、
テストデータのうち前記変更された関数に関係する箇所を書き換え、かつ、変更されなかった部分は流用して変更後プログラム用のテストデータを作成し、
前記作成されたテストデータを用いてテストを実行する、
プログラムテスト方法。 A program test method for executing an operation test of a program after change when program data is changed,
Extract the function name of the function that has been changed with the program change,
Rewrite the part related to the changed function in the test data, and create the test data for the changed program by diverting the part that has not been changed,
A test is executed using the created test data.
Program test method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010018639A JP2011159008A (en) | 2010-01-29 | 2010-01-29 | Device and method for testing program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010018639A JP2011159008A (en) | 2010-01-29 | 2010-01-29 | Device and method for testing program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2011159008A true JP2011159008A (en) | 2011-08-18 |
Family
ID=44590928
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2010018639A Pending JP2011159008A (en) | 2010-01-29 | 2010-01-29 | Device and method for testing program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2011159008A (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0279126A (en) * | 1988-09-16 | 1990-03-19 | Hitachi Ltd | Developing and supporting system for compiler and software |
JPH0962498A (en) * | 1995-08-29 | 1997-03-07 | Nec Corp | Logical difference discrimination system for source program |
JP2004118403A (en) * | 2002-09-25 | 2004-04-15 | Fujitsu Ltd | Software function test data preparation program, and software function test data preparation method |
JP2004355304A (en) * | 2003-05-29 | 2004-12-16 | Hitachi Ltd | Information terminal update system |
JP2007133800A (en) * | 2005-11-14 | 2007-05-31 | Fujitsu Ltd | Program, device, and method for software test management |
JP2008129661A (en) * | 2006-11-16 | 2008-06-05 | Internatl Business Mach Corp <Ibm> | Information processor, method, and program for determining priority of test case to be executed in regression test |
-
2010
- 2010-01-29 JP JP2010018639A patent/JP2011159008A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0279126A (en) * | 1988-09-16 | 1990-03-19 | Hitachi Ltd | Developing and supporting system for compiler and software |
JPH0962498A (en) * | 1995-08-29 | 1997-03-07 | Nec Corp | Logical difference discrimination system for source program |
JP2004118403A (en) * | 2002-09-25 | 2004-04-15 | Fujitsu Ltd | Software function test data preparation program, and software function test data preparation method |
JP2004355304A (en) * | 2003-05-29 | 2004-12-16 | Hitachi Ltd | Information terminal update system |
JP2007133800A (en) * | 2005-11-14 | 2007-05-31 | Fujitsu Ltd | Program, device, and method for software test management |
JP2008129661A (en) * | 2006-11-16 | 2008-06-05 | Internatl Business Mach Corp <Ibm> | Information processor, method, and program for determining priority of test case to be executed in regression test |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6003699B2 (en) | Test data generation program, method and apparatus | |
JP2008191963A (en) | Source code verification system, source code verification method and source code verification program | |
JP2016115175A (en) | Software test apparatus and software test program | |
JP6440895B2 (en) | Software analysis apparatus and software analysis method | |
JP5176478B2 (en) | Data flow analysis device, data flow analysis method, and data flow analysis program | |
JP5440287B2 (en) | Symbolic execution support program, method and apparatus | |
JP6567212B2 (en) | Equivalence verification device and equivalence verification program | |
JP4888790B2 (en) | Contract definition function verification apparatus, method and program thereof | |
JP6451417B2 (en) | Debug support device, debug support system, debug support method, and debug support program | |
JP5811859B2 (en) | Source code static analysis device, system, method, and program therefor | |
JP2016128941A (en) | Output determination device, output determination method, output determination program, and static analysis device | |
JP2011159008A (en) | Device and method for testing program | |
JP6369177B2 (en) | Development support program, development support method, and development support apparatus | |
JP2015056140A (en) | Clone detection method and clone common function method | |
JP2007257397A (en) | Contention state detection process additional program, contention state detection process adding apparatus and contention state detection process adding method | |
JP6547345B2 (en) | Test case generation program, test case generation method and test case generation apparatus | |
JP6748357B2 (en) | Analysis device, analysis program, and analysis method | |
JP2013206310A (en) | Model inspection device, model inspection method, and program | |
JP2015094964A (en) | Adverse effect detector | |
JP2013008304A (en) | Program analysis device, program analysis method, and program | |
CN110888803B (en) | Method and system for converting test decision table into test case | |
JP6012414B2 (en) | Information processing apparatus, information processing method, and program | |
JP5343840B2 (en) | Program analysis apparatus and analysis method | |
JP6556091B2 (en) | System specification verification support apparatus and system specification verification support method | |
JP2009217720A (en) | Program generating device and program generating method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20120816 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20130918 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20131008 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20140401 |