JP2008234405A - Abnormal system test support device, method, and program - Google Patents

Abnormal system test support device, method, and program Download PDF

Info

Publication number
JP2008234405A
JP2008234405A JP2007074306A JP2007074306A JP2008234405A JP 2008234405 A JP2008234405 A JP 2008234405A JP 2007074306 A JP2007074306 A JP 2007074306A JP 2007074306 A JP2007074306 A JP 2007074306A JP 2008234405 A JP2008234405 A JP 2008234405A
Authority
JP
Japan
Prior art keywords
file
function
test
test pattern
stub
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2007074306A
Other languages
Japanese (ja)
Other versions
JP5067705B2 (en
Inventor
Takayuki Imoto
崇之 井元
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP2007074306A priority Critical patent/JP5067705B2/en
Publication of JP2008234405A publication Critical patent/JP2008234405A/en
Application granted granted Critical
Publication of JP5067705B2 publication Critical patent/JP5067705B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To automatically test error processing of a program described in C language and the like. <P>SOLUTION: Test patterns, for generating an error dependent on an environment in execution at probable timing of occurrence, are comprehensively generated. When a function is replaced by a stub function at a timing conforming to the generated test patterns, error processing is automatically tested. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、異常系テスト支援装置に関し、特にC言語等で記述されたプログラムのエラー処理のテストを行う異常系テスト支援装置に関する。   The present invention relates to an abnormal system test support apparatus, and more particularly to an abnormal system test support apparatus that tests an error process of a program written in C language or the like.

ソフトウェア開発において、開発の全工数に占めるテスト工数の割合は非常に大きい。   In software development, the ratio of test man-hours to the total man-hours for development is very large.

特に、異常系の一部であるネットワークエラー、メモリ不足、ファイルアクセスエラー等実行時の環境に依存して発生するエラーのテストは実環境がないと困難である。その対策として実施されているエラーを擬似的に発生させるスタブコードを利用したテストは、実コードとスタブコードの切り替えが煩雑で、多くの工数を必要としていた。   In particular, it is difficult to test errors that occur depending on the execution environment, such as network errors, memory shortages, and file access errors, which are part of an abnormal system, without an actual environment. As a countermeasure, a test using a stub code that artificially generates an error is complicated to switch between an actual code and a stub code, and requires a lot of man-hours.

なお、スタブコードとは、あるプログラムが他のプログラムを呼び出す際に仲介となるプログラムコードのことである。例えば、ユーザープログラムからシステムコールやデバイスドライバ等を利用する際に、その仲立ちとなって、複雑なインターフェイスを簡略化するために利用される。   A stub code is a program code that acts as an intermediary when a program calls another program. For example, when using a system call, a device driver, or the like from a user program, it is used to simplify a complicated interface.

特開平5−257740号公報(特許文献1)に「単体テスト実行方式」に関する技術が開示されている。この従来技術は、プログラム実行中にオブジェクトを動的に置き換える方法が記述されている。この技術を利用することで、プログラム実行中に呼び出すべき関数と、そのスタブコードを切り替えることができる。しかし、スタブコードの切り替えはそのつどユーザが何かしらの入力を行わなければならず、自動的に切り替えることについては特に述べられていない。   Japanese Patent Laid-Open No. 5-257740 (Patent Document 1) discloses a technique related to a “unit test execution method”. This prior art describes a method for dynamically replacing an object during program execution. By using this technology, it is possible to switch between a function to be called during program execution and its stub code. However, each time the stub code is switched, the user has to input something, and there is no particular description about automatic switching.

また、特開2005−338987号公報(特許文献2)に「例外テスト支援プログラム及び例外テスト支援装置」に関する技術が開示されている。この従来技術は、ソースコードを解析して、ソースコードのカバレッジを満たすドライバを作成し、例外を発生する関数とスタブコードを切り替えるテストを行うことで例外テストの自動実行を行う。この従来技術では、例外を発生する関数は全てスタブコードに切り替えるので、ある特定のタイミングでしか例外を発生させることはできない。例えば、特許文献2の関数と例外出力の対応関係を参照すると分かるように、この従来技術では同じ関数は1箇所でしか例外を出力することができない。また、ファイルアクセス、ネットワークエラー等のエラーは任意のタイミングで発生するので、擬似エラーも任意のタイミングで発生させる必要がある。   Japanese Patent Laid-Open No. 2005-338987 (Patent Document 2) discloses a technique related to “exception test support program and exception test support device”. In this conventional technique, a source code is analyzed, a driver that satisfies the coverage of the source code is created, and a test that switches between a function that generates an exception and a stub code is performed, and an exception test is automatically executed. In this prior art, since all functions that generate exceptions are switched to stub code, exceptions can be generated only at a specific timing. For example, as can be seen by referring to the correspondence relationship between the function and the exception output in Patent Document 2, in this conventional technique, the same function can output an exception only at one location. In addition, since errors such as file access and network errors occur at arbitrary timings, pseudo errors must also be generated at arbitrary timings.

また、特開2000−181749号公報(特許文献3)に「ソフトウェアのエラー処理テストシステム、テスト方法及びテストプログラムの記録媒体」に関する技術が開示されている。この従来技術では、テスト対象プログラムの実行を指示後テスト対象プログラムによるオペレーティングシステムのアプリケーションインタフェース部の呼び出し状況を監視し、該状況を記憶装置に記憶する。該記憶された呼び出しの一つについてアプリケーションインタフェース部にてエラーとなるための細工をする。該設定後に実行されるテスト対象プログラムのエラー処理内容について判定するための実行指示後、記憶された呼び出し状況内の呼び出しの一つを実行順に選択し該呼び出しについてのエラー設定、テスト対象プログラムの実行指示、該実行に於けるエラー処理内容の判定を、呼び出し状況内の個々の呼び出しについて順次実施し判定結果を出力する。これにより、プログラムのエラー処理テストを自動実行する。この従来技術は、決められたタイミングの例外を発生する異常系テストを対象としており、任意のタイミングでの例外のテストは実行できない。   Japanese Patent Laid-Open No. 2000-181749 (Patent Document 3) discloses a technique relating to “software error processing test system, test method, and test program recording medium”. In this prior art, after instructing the execution of the test target program, the calling state of the application interface unit of the operating system by the test target program is monitored, and the state is stored in the storage device. One of the stored calls is crafted to cause an error in the application interface unit. After execution instruction to determine the error processing contents of the test target program executed after the setting, one of the calls in the stored call status is selected in the execution order, error setting for the call, execution of the test target program The instruction and determination of the error processing contents in the execution are sequentially performed for each call in the call status, and the determination result is output. As a result, an error processing test of the program is automatically executed. This conventional technique is intended for an abnormal test that generates an exception at a predetermined timing, and cannot perform an exception test at an arbitrary timing.

また、特開平3−010436号公報(特許文献4)に「電子メールシステムにおける異常処理の切り分け方式」に関する技術が開示されている。この従来技術は、異常処理を1パターン実装するだけでなく、パターンの選択を行う基となる情報を持ち動的に情報を変更可能とすることにより、全パターンを実装する。これにより、異常が発生した時の処理をユーザが設定できるようにしている。   Japanese Patent Application Laid-Open No. 3-010436 (Patent Document 4) discloses a technique relating to “anomaly processing classification method in an electronic mail system”. In this conventional technique, not only one pattern of abnormal processing is mounted, but all patterns are mounted by having information as a basis for selecting a pattern and dynamically changing the information. This allows the user to set the process when an abnormality occurs.

特開平5−257740号公報JP-A-5-257740 特開2005−338987号公報JP 2005-338987 A 特開2000−181749号公報JP 2000-181749 A 特開平3−010436号公報JP-A-3-010436

本発明の目的は、実行時の環境に依存したエラーを、その発生の可能性のあるタイミングで発生させるテストパターンを網羅的に作成し、作成したテストパターンに沿ったタイミングで関数をスタブ関数に置き換えることでエラー処理のテストを自動的に行う異常系テスト支援装置を提供することである。   An object of the present invention is to comprehensively create a test pattern that generates an error that depends on the environment at the time of occurrence at a timing when the error may occur, and to convert the function into a stub function at a timing according to the created test pattern. It is to provide an abnormal system test support device that automatically performs error processing tests by replacing them.

以下に、[発明を実施するための最良の形態]で使用される番号を括弧付きで用いて、課題を解決するための手段を説明する。これらの番号は、[特許請求の範囲]の記載と[発明を実施するための最良の形態]との対応関係を明らかにするために付加されたものである。但し、それらの番号を、[特許請求の範囲]に記載されている発明の技術的範囲の解釈に用いてはならない。   In the following, means for solving the problem will be described using the numbers used in [Best Mode for Carrying Out the Invention] in parentheses. These numbers are added to clarify the correspondence between the description of [Claims] and [Best Mode for Carrying Out the Invention]. However, these numbers should not be used to interpret the technical scope of the invention described in [Claims].

本発明の異常系テスト支援装置は、テスト対象のソースファイル(1)を読み込んで実行し、実行時の関数呼び出しの順序からテストパターン雛形ファイルを作成するテストパターン雛形作成処理部(5)と、ソースファイル(1)に対応するスタブファイル(3)及びテストパターン雛形ファイルを読み込み、全探索法アルゴリズムを実行し、テストパターン雛形ファイルに記述されている関数がスタブファイル(3)中に存在する場合、テストパターン雛形ファイルから全探索で得られる全てのテストパターンを含むテストパターンファイルを作成するテストパターン作成処理部(7)と、ソースファイル(1)及びスタブファイル(3)を読み込んで実行し、動的に標準関数とスタブ関数を切り替え、テストパターンファイルに含まれるテストパターンに沿ったテストを実行するテスト実行処理部(9)とを具備する。   The abnormal system test support apparatus of the present invention reads and executes a source file (1) to be tested, and executes a test pattern template creation processing unit (5) for creating a test pattern template file from the order of function calls at the time of execution; When the stub file (3) and test pattern template file corresponding to the source file (1) are read, the full search algorithm is executed, and the function described in the test pattern template file exists in the stub file (3) The test pattern creation processing unit (7) for creating a test pattern file including all test patterns obtained by the full search from the test pattern template file, the source file (1) and the stub file (3) are read and executed, Dynamic switching between standard and stub functions, included in test pattern file Comprising test execution processor for executing the test along a test pattern and (9).

テストパターン雛形作成処理部(5)は、ソースファイル(1)をビルドしてステップ実行し、実行ステップが終了するまでのステップ中に関数が存在した場合、関数名をテストパターン雛形ファイルに書き込む。   The test pattern template creation processing unit (5) builds the source file (1), performs step execution, and writes a function name to the test pattern template file when there is a function in the steps until the execution step ends.

テストパターン作成処理部(7)は、テストパターン雛形ファイルに記述されている関数のうち、スタブファイル(3)が用意されている関数に切り替えフラグを付加したテストパターンファイルを作成する。テスト実行処理部(9)は、ソースファイル(1)及びスタブファイル(3)をビルドしてステップ実行し、最終ステップに到達するまでのステップ中に関数が存在した場合、テストパターンファイルを順に読み込み、対象の関数の切り替えフラグの値を取得し、対象の関数の切り替えフラグの値が0又は空のときはそのまま関数を実行し、1のときはスタブ関数を実行する。   The test pattern creation processing unit (7) creates a test pattern file in which a switching flag is added to the function for which the stub file (3) is prepared among the functions described in the test pattern template file. The test execution processing unit (9) builds the source file (1) and the stub file (3) and executes the steps. If there is a function in the steps up to the final step, the test execution file is read in order. When the value of the target function switching flag is 0 or empty, the function is executed as it is. When the value of the target function switching flag is 1, the stub function is executed.

テスト実行処理部(9)は、実行した関数の切り替えフラグが同じテストパターンを削除する。   The test execution processing unit (9) deletes test patterns having the same function switching flag.

言い換えると、本発明の異常系テスト支援装置は、実行時の環境に依存したエラーを、発生の可能性のあるタイミングで発生させるテストパターンを網羅的に作成するテストパターン作成処理部(7)と、作成されたテストパターンに沿ったタイミングで関数をスタブ関数に置き換え、エラー処理のテストを自動的に行うテスト実行処理部(9)とを具備する。   In other words, the abnormal test support apparatus of the present invention includes a test pattern creation processing unit (7) that comprehensively creates test patterns that generate errors depending on the environment at the time of occurrence at a timing that may occur. A test execution processing unit (9) that automatically replaces a function with a stub function at a timing according to the created test pattern and automatically performs an error processing test.

本発明の異常系テスト支援方法は、テスト対象のソースファイル(1)を実行し、実行時の関数呼び出しの順序からテストパターン雛形ファイルを作成するステップと、ソースファイル(1)に対応するスタブファイル(3)及びテストパターン雛形ファイルを読み込み、全探索法アルゴリズムを実行し、テストパターン雛形ファイルに記述されている関数がスタブファイル(3)中に存在する場合、テストパターン雛形ファイルから全探索で得られる全てのテストパターンを含むテストパターンファイルを作成するステップと、ソースファイル(1)及びスタブファイル(3)をビルドして実行し、動的に標準関数とスタブ関数を切り替え、テストパターンファイルに含まれるテストパターンに沿ったテストを実行するステップとを具備する。   The abnormal system test support method of the present invention includes a step of executing a source file (1) to be tested and creating a test pattern template file from a function call sequence at the time of execution, and a stub file corresponding to the source file (1) (3) When the test pattern template file is read, the full search algorithm is executed, and the function described in the test pattern template file exists in the stub file (3), it is obtained from the test pattern template file by a full search. Create a test pattern file that includes all the test patterns that are created, build and execute the source file (1) and stub file (3), dynamically switch between the standard function and the stub function, and include in the test pattern file Performing a test according to a test pattern .

本発明の異常系テスト支援方法は、ソースファイル(1)をビルドし、ステップ実行できる環境で実行するステップと、実行ステップ中に関数が存在するか確認するステップと、実行ステップ中に関数が存在した場合、関数名をテストパターン雛形ファイルに書き込むステップと、最終ステップに到達したか否か判定するステップと、最終ステップに到達した場合、テストパターン雛形ファイルを保存するステップとを更に具備する。   The abnormal system test support method of the present invention includes the steps of building a source file (1) and executing it in an environment where step execution is possible, a step of checking whether a function exists in the execution step, and a function existing in the execution step In this case, the method further includes a step of writing the function name in the test pattern template file, a step of determining whether or not the final step has been reached, and a step of saving the test pattern template file if the final step has been reached.

本発明の異常系テスト支援方法は、テストパターン雛形ファイルをファイルの末尾まで順に読み込むステップと、テストパターン雛形ファイル中の関数が、スタブファイル(3)中に存在するとき、テストパターン雛形ファイルに記述されている関数のうち、スタブファイル(3)が用意されている関数に切り替えフラグを付加したテストパターンファイルを作成するステップと、ファイルの末尾に到達したか判定するステップと、ファイルの末尾に到達すれば、作成したテストパターンファイルを保存するステップとを更に具備する。   The abnormal system test support method of the present invention includes a step of reading a test pattern template file in order to the end of the file and a function in the test pattern template file described in the test pattern template file when it exists in the stub file (3). The test pattern file in which the switch flag is added to the function for which the stub file (3) is prepared, the step of determining whether the end of the file has been reached, and the end of the file are reached In this case, the method further includes a step of storing the created test pattern file.

本発明の異常系テスト支援方法は、ソースファイル(1)及びスタブファイル(3)をビルドし、ステップ実行するステップと、スタブファイル(3)をビルドする際に、通常の関数とスタブ関数名が同じにならないようにスタブ関数に接頭詞をつけるステップと、
実行ステップ中に関数が存在するか確認するステップと、ステップ中に関数が存在した場合、テストパターンファイルを順に読み込み、対象の関数の切り替えフラグの値を取得するステップと、対象の関数の切り替えフラグの値が0か1か判定するステップと、対象の関数の切り替えフラグの値が0のとき、又は、対象の関数の切り替えフラグが空のとき(スタブ関数が存在しないとき)は、そのまま関数を実行するステップと、対象の関数の切り替えフラグの値が1のときは、スタブ関数に制御を変更し、スタブ関数を実行するステップとを更に具備する。
The abnormal system test support method of the present invention builds a source file (1) and a stub file (3), performs step execution, and builds the stub file (3). Prefixing the stub functions so that they are not the same,
A step for checking whether a function exists in the execution step, a step for reading the test pattern file in order when a function exists in the step, obtaining the value of the target function switching flag, and a target function switching flag If the value of the target function switching flag is 0, or the target function switching flag is empty (no stub function), the function is left as is. And a step of changing the control to the stub function and executing the stub function when the value of the target function switching flag is 1.

本発明の異常系テスト支援方法は、テストパターンに沿ったテストを実行する際、実行した関数を記憶するステップと、実行したテストパターンのうち実行していない関数が存在するか確認するステップと、実行していない関数が存在する場合、実行した関数の切り替えフラグが同じテストパターンを削除するステップとを更に具備する。   The abnormal system test support method of the present invention, when executing a test according to a test pattern, the step of storing the executed function, the step of checking whether there is a function that is not executed among the executed test pattern, And a step of deleting a test pattern having the same function switching flag when there is a function that has not been executed.

言い換えると、本発明の異常系テスト支援方法は、実行時の環境に依存したエラーを、発生の可能性のあるタイミングで発生させるテストパターンを網羅的に作成するステップと、作成されたテストパターンに沿ったタイミングで関数をスタブ関数に置き換え、エラー処理のテストを自動的に行うステップとを具備する。   In other words, the abnormal system test support method according to the present invention includes a step of comprehensively creating a test pattern for generating an error depending on an environment at the time of execution at a timing that may occur, and the created test pattern. And replacing the function with a stub function at the same timing, and automatically performing an error processing test.

本発明のプログラムは、上記のいずれかの異常系テスト支援方法をコンピュータに実行させる。   The program of the present invention causes a computer to execute one of the abnormal system test support methods described above.

異常系のテストをより効率的にかつ網羅的にできる。その理由は、テストパターンファイルを網羅的に自動作成することができ、任意のタイミングでエラー処理を擬似的に発生することができるからである。   Abnormal test can be performed more efficiently and comprehensively. The reason is that a test pattern file can be created automatically and comprehensively, and error processing can be generated in a pseudo manner at an arbitrary timing.

以下に、本発明の第1実施形態について添付図面を参照して説明する。
図1を参照すると、本発明の異常系テスト支援装置は、ソースファイル1と、ソースファイル格納部2と、スタブファイル3と、スタブファイル格納部4と、テストパターン雛形作成処理部5と、テストパターン雛形ファイル格納部6と、テストパターン作成処理部7と、テストパターンファイル格納部8と、テスト実行処理部9と、テスト結果ファイル10を備える。
Hereinafter, a first embodiment of the present invention will be described with reference to the accompanying drawings.
Referring to FIG. 1, the abnormal system test support apparatus of the present invention includes a source file 1, a source file storage unit 2, a stub file 3, a stub file storage unit 4, a test pattern template creation processing unit 5, and a test. A pattern template file storage unit 6, a test pattern creation processing unit 7, a test pattern file storage unit 8, a test execution processing unit 9, and a test result file 10 are provided.

ソースファイル1は、テスト対象のソースコードが記述されたソースファイルである。ここでは、C言語等で記述されたプログラムのソースファイルを示す。ソースファイル1は、入力装置から入力しても良いし、通信装置を介してネットワーク上のサーバ等から取得しても良い。   The source file 1 is a source file in which source code to be tested is described. Here, a source file of a program written in C language or the like is shown. The source file 1 may be input from an input device, or may be acquired from a server on the network via a communication device.

ソースファイル格納部2は、情報を記憶する記憶装置である。ここでは、ソースファイル1を格納する。   The source file storage unit 2 is a storage device that stores information. Here, the source file 1 is stored.

スタブファイル3は、テスト対象のソースファイルのメタデータと移動先を示すシステムファイルである。ここでは、テスト対象のソースファイル内の関数に対応するスタブ関数が記述されている。スタブファイル3は、入力装置から入力しても良いし、通信装置を介してネットワーク上のサーバ等から取得しても良い。   The stub file 3 is a system file indicating the metadata of the source file to be tested and the destination. Here, a stub function corresponding to the function in the source file to be tested is described. The stub file 3 may be input from an input device, or may be acquired from a server on the network via a communication device.

スタブファイル格納部4、情報を記憶する記憶装置である。ここでは、スタブファイル3を格納する。   The stub file storage unit 4 is a storage device for storing information. Here, the stub file 3 is stored.

テストパターン雛形作成処理部5は、プログラム制御により動作するデータ処理装置である。テスト対象のソースファイルをステップ実行できる環境を備え、実行時の関数呼び出しの順序からテストパターン雛形ファイルを作成する。   The test pattern template creation processing unit 5 is a data processing device that operates under program control. An environment that allows step execution of source files to be tested is provided, and a test pattern template file is created from the order of function calls during execution.

テストパターン雛形ファイル格納部6は、情報を記憶する記憶装置である。ここでは、テストパターン雛形作成処理部5により作成されたテストパターン雛形ファイルを格納する。   The test pattern template file storage unit 6 is a storage device that stores information. Here, the test pattern template file created by the test pattern template creation processing unit 5 is stored.

テストパターン作成処理部7は、プログラム制御により動作するデータ処理装置である。全探索法アルゴリズムを実行できる環境を備え、テストパターンの雛形から全探索で得られる全てのテストパターンを作成し、テストパターンファイルを作成する。   The test pattern creation processing unit 7 is a data processing device that operates under program control. An environment capable of executing the full search algorithm is prepared, and all test patterns obtained by the full search are created from the test pattern template, and a test pattern file is created.

テストパターンファイル格納部8は、情報を記憶する記憶装置である。ここでは、テストパターン作成処理部7により作成されたテストパターンファイルを格納する。   The test pattern file storage unit 8 is a storage device that stores information. Here, the test pattern file created by the test pattern creation processing unit 7 is stored.

テスト実行処理部9は、プログラム制御により動作するデータ処理装置である。テスト対象のソースファイルをステップ実行できる環境と、動的に標準関数とスタブ関数を切り替えることができる環境を備え、テストパターンに沿ったテストを実行する。   The test execution processing unit 9 is a data processing device that operates under program control. A test file according to a test pattern is executed by providing an environment in which a source file to be tested can be stepped and an environment in which a standard function and a stub function can be dynamically switched.

テスト結果ファイル10は、テスト実行処理部9により実行されたテストの結果を示すデータファイルである。   The test result file 10 is a data file indicating the result of the test executed by the test execution processing unit 9.

以下に、図2を参照して、全体の処理フローについて説明する。
(1)ステップS101
テストパターン雛形作成処理部5で、テスト対象のソースファイル1を実行し、テストパターン雛形ファイルを作成する。
(2)ステップS102
次に、テストパターン作成処理部7で、テストパターン雛形ファイルから、テストパターンファイルを作成する。テストパターン雛形ファイルに記述されている関数のうち、スタブファイル3が用意されている関数に切り替えフラグ(0,1)を付加する。切り替えフラグが0のときは通常の関数を実行し、1のときはスタブ関数を実行することを意味する。
(3)ステップS103
次に、テスト実行処理部でテストパターンファイルに沿ったテストを行う。
Hereinafter, the entire processing flow will be described with reference to FIG.
(1) Step S101
The test pattern template creation processing unit 5 executes the source file 1 to be tested and creates a test pattern template file.
(2) Step S102
Next, the test pattern creation processing unit 7 creates a test pattern file from the test pattern template file. Of the functions described in the test pattern template file, a switching flag (0, 1) is added to the function for which the stub file 3 is prepared. When the switching flag is 0, a normal function is executed, and when it is 1, a stub function is executed.
(3) Step S103
Next, the test execution processing unit performs a test along the test pattern file.

以下に、図3を参照して、テストパターン雛形作成処理部5でのテストパターン雛形ファイルの作成を行う場合の動作を説明する。
(1)ステップS201
まず、ソースファイル格納部からテスト対象のソースファイル1を取得する。
(2)ステップS202
取得したテスト対象のソースファイル1をコンパイラ等でビルドし、デバッガ等ステップ実行できる環境で実行する。なお、ビルドとは、ソースコードのコンパイルやライブラリのリンクなどを行い、最終的な実行可能ファイルを作成することである。
(3)ステップS203
実行ステップが終了するまで、順にステップを進める。
(4)ステップS204
最終ステップに到達したか否か判定する。
(5)ステップS205
最終ステップに到達していなければ、次のステップ実行し、実行ステップ中に関数が存在するか確認する。
(6)ステップS206
実行ステップ中に関数が存在した場合、関数名をテストパターン雛形ファイルに書き込む。
(7)ステップS207
最終ステップに到達した場合、作成したテストパターン雛形ファイルをテストパターン雛形ファイル格納部6に保存する。
Hereinafter, with reference to FIG. 3, an operation when the test pattern template creation processing unit 5 creates a test pattern template file will be described.
(1) Step S201
First, the source file 1 to be tested is acquired from the source file storage unit.
(2) Step S202
The acquired source file 1 to be tested is built with a compiler or the like and executed in an environment where step execution is possible such as a debugger. Note that building means creating a final executable file by compiling source code and linking libraries.
(3) Step S203
Steps are advanced in order until the execution step ends.
(4) Step S204
It is determined whether or not the final step has been reached.
(5) Step S205
If the final step has not been reached, the next step is executed to check whether a function exists in the execution step.
(6) Step S206
If a function exists during the execution step, the function name is written to the test pattern template file.
(7) Step S207
When the final step is reached, the created test pattern template file is stored in the test pattern template file storage unit 6.

図4に、テスト対象のソースファイル1の例を示す。
図4に示すテスト対象のソースファイルでは、繰り返し構文により「read関数」を3回呼び出し、最後に「print関数」を1回呼び出す内容となっている。
FIG. 4 shows an example of the source file 1 to be tested.
In the source file to be tested shown in FIG. 4, the “read function” is called three times by the repetition syntax, and finally the “print function” is called once.

図5に、図4のソースファイルをステップ実行した結果を示す。
図5のステップ実行では、図4のソースファイルの内容に従い、ステップ実行中に、「read関数」を3回、「print関数」を1回呼び出している。すなわち、1回目の繰り返しで「read関数」を1回、2回目の繰り返しで「read関数」を1回、3回目の繰り返しで「read関数」を1回呼び出し、最後に「print関数」を1回呼び出している。
FIG. 5 shows the result of stepping the source file of FIG.
In the step execution of FIG. 5, according to the contents of the source file of FIG. 4, the “read function” is called three times and the “print function” is called once during the step execution. That is, “read function” is called once in the first iteration, “read function” is called once in the second iteration, “read function” is called once in the third iteration, and “print function” is finally set to 1. Called times.

図6に、図5のステップ実行で、実行した関数を書き込んだテストパターン雛形ファイルの例を示す。
図5のステップ実行を見ると、ステップ実行中に、「read関数」を3回、「print関数」を1回呼び出しているので、テストパターン雛形ファイルは図6のようになる。図6に示すテストパターン雛形ファイルでは、「read」、「read」、「read」、「print」と書き込まれている。
FIG. 6 shows an example of a test pattern template file in which the function executed in the step execution of FIG. 5 is written.
Looking at the step execution in FIG. 5, since the “read function” is called three times and the “print function” is called once during the step execution, the test pattern template file is as shown in FIG. In the test pattern template file shown in FIG. 6, “read”, “read”, “read”, and “print” are written.

以下に、図7を参照して、テストパターン作成処理部7でのテストパターンファイルの作成のを行う場合の動作を説明する。
(1)ステップS301
テストパターン雛形ファイル格納部6からテストパターン雛形ファイルを読み込む。
(2)ステップS302
スタブファイル格納部4からスタブファイル3を読み込む。
(3)ステップS303
テストパターン雛形ファイルをファイルの末尾まで順に読み込む。
(4)ステップS304
ファイルの末尾に到達したか判定する。
(5)ステップS305
テストパターン雛形ファイルをファイルの末尾まで読み込んでいる間、読み込んだテストパターン雛形ファイル中の関数が、スタブファイル3中に存在するとき、テストパターンファイルを作成する。
(6)ステップS306
これまでに作成したテストパターンファイルから、切り替えフラグを追加したテストパターンファイルを新規に作成する。
(7)ステップS307
ファイルの末尾に到達すれば、作成したテストパターンファイルを全てテストパターンファイル格納部8に保存する。
Hereinafter, with reference to FIG. 7, an operation in the case of creating a test pattern file in the test pattern creation processing unit 7 will be described.
(1) Step S301
A test pattern template file is read from the test pattern template file storage unit 6.
(2) Step S302
The stub file 3 is read from the stub file storage unit 4.
(3) Step S303
Read the test pattern template file to the end of the file in order.
(4) Step S304
Determine if the end of the file has been reached.
(5) Step S305
While the test pattern template file is being read to the end of the file, when a function in the read test pattern template file exists in the stub file 3, a test pattern file is created.
(6) Step S306
A new test pattern file with a switching flag added is created from the test pattern files created so far.
(7) Step S307
When the end of the file is reached, all the created test pattern files are stored in the test pattern file storage unit 8.

図8にスタブファイル3の例を示す。
このスタブファイル3は、ファイル読み込みに失敗しNULLを返すスタブ関数readを含む。
FIG. 8 shows an example of the stub file 3.
The stub file 3 includes a stub function read that fails to read the file and returns NULL.

図9に、テストパターンファイルの新規作成の例を示す。
これまでに作成したテストパターンファイルD1,D2に、「read関数」に切り替えフラグ(0、1)をそれぞれ追加したテストパターンファイルを新規に作成する。1つのテストパターンファイルから、新たに2つのテストパターンファイルを作成する。また、作成元のテストパターンファイルD1,D2は削除する。
FIG. 9 shows an example of creating a new test pattern file.
A new test pattern file is created by adding a switching flag (0, 1) to the “read function” to the test pattern files D1, D2 created so far. Two new test pattern files are created from one test pattern file. Further, the test pattern files D1 and D2 that are the creation sources are deleted.

図10に、テストパターン雛形ファイルから作成されるテストパターンファイルの例を示す。
これまでに作成したテストパターンファイルD1,D2に、「read関数」に切り替えフラグ(0、1)をそれぞれ追加することで、図6のテストパターン雛形ファイルから8通りのテストパターンファイルが作成される。
FIG. 10 shows an example of a test pattern file created from the test pattern template file.
By adding a switching flag (0, 1) to the “read function” to the test pattern files D1 and D2 created so far, eight test pattern files are created from the test pattern template file of FIG. .

以下に、図11を参照して、テストパターンファイルに沿ったテストの実行を行う場合の動作を説明する。
(1)ステップS401
ソースファイル格納部からテスト対象のソースファイル1を取得する。
(2)ステップS402
テストパターンファイル格納部8からテストパターンファイルを取得する。
(3)ステップS403
スタブファイル格納部4からスタブファイル3を取得する。
(4)ステップS404
ソースファイル1、スタブファイル3をビルドし、デバッガ等ステップ実行、ユーザ入力による制御分岐ができる環境でステップ実行する。ここで、スタブファイル3をビルドする際に、通常の関数と、スタブ関数名が同じにならないようにスタブ関数に接頭詞をつける。
(5)ステップS405
最終ステップに到達するまで順にステップを進める。
(6)ステップS406
最終ステップに到達したか否か判定する。
(7)ステップS407
最終ステップに到達していなければ、次のステップ実行し、実行ステップ中に関数が存在するか確認する。
(8)ステップS408
ステップ中に関数が存在した場合、テストパターンファイルを順に読み込み、対象の関数の切り替えフラグの値を取得する。
(9)ステップS409
対象の関数の切り替えフラグの値が、0か1か判定する。
(10)ステップS410
対象の関数の切り替えフラグの値が0のとき、又は、対象の関数の切り替えフラグが空のとき(スタブ関数が存在しないとき)は、そのまま関数を実行する。
(11)ステップS411
対象の関数の切り替えフラグの値が1のときは、スタブ関数に制御を変更し、スタブ関数を実行する。スタブ関数への制御の変更はデバッガの制御分岐の機能を使って行う。
Hereinafter, with reference to FIG. 11, an operation in the case of executing a test along the test pattern file will be described.
(1) Step S401
The test source file 1 is acquired from the source file storage unit.
(2) Step S402
A test pattern file is acquired from the test pattern file storage unit 8.
(3) Step S403
The stub file 3 is acquired from the stub file storage unit 4.
(4) Step S404
Source file 1 and stub file 3 are built, and step execution is performed in an environment where step execution such as a debugger and control branching by user input are possible. Here, when the stub file 3 is built, a prefix is added to the stub function so that the stub function name is not the same as the normal function.
(5) Step S405
Step in order until the final step is reached.
(6) Step S406
It is determined whether the final step has been reached.
(7) Step S407
If the final step has not been reached, the next step is executed to check whether a function exists in the execution step.
(8) Step S408
If there is a function in the step, the test pattern file is read in order, and the value of the target function switching flag is acquired.
(9) Step S409
It is determined whether the value of the target function switching flag is 0 or 1.
(10) Step S410
When the value of the target function switching flag is 0, or when the target function switching flag is empty (no stub function exists), the function is executed as it is.
(11) Step S411
When the value of the target function switching flag is 1, the control is changed to the stub function and the stub function is executed. The control change to the stub function is performed using the control branch function of the debugger.

図12に、図3のソースファイルを図6のテストパターンに沿ってテスト実行する際の例を示す。
ステップ実行を繰り返すと、「main関数」のステップ4に「read関数」が存在する。このとき、テストパターンファイルを順に読み込み、対応する関数の切り替えフラグを取得する。切り替えフラグが0なので、「read関数」をそのまま実行する。次に、ステップ実行を進めると、「main関数」のステップ6に「read関数」が存在する。テストパターンファイルを読み込み、切り替えフラグを取得する。切り替えフラグが1なので、「read関数」はスタブ関数に制御を移す。次に、ステップ実行を進めると、「main関数」のステップ8に「read関数」が存在する。対応する切り替えフラグの値が0なので「read関数」をそのまま実行する。更に、ステップ実行を進めると 「main関数」のステップ11に「print関数」が存在する。「print関数」にはスタブ関数が無く、対応する切り替えフラグの値が存在しないので、「print関数」をそのまま実行する。
FIG. 12 shows an example when the source file of FIG. 3 is tested according to the test pattern of FIG.
When step execution is repeated, a “read function” exists in step 4 of the “main function”. At this time, the test pattern file is read in order, and the switching flag of the corresponding function is acquired. Since the switching flag is 0, the “read function” is executed as it is. Next, when step execution proceeds, a “read function” exists in step 6 of the “main function”. Read the test pattern file and get the switching flag. Since the switching flag is 1, the “read function” transfers control to the stub function. Next, when step execution proceeds, a “read function” exists in step 8 of the “main function”. Since the value of the corresponding switching flag is 0, the “read function” is executed as it is. Further, when the step execution is advanced, a “print function” exists in step 11 of the “main function”. Since there is no stub function in the “print function” and there is no corresponding switching flag value, the “print function” is executed as it is.

図11に示す処理でテストを実行し、テスト実行結果をテスト実行ファイルとして出力する。テスト実行結果の出力は、既存のテストの方法を使い、本特特許では特にその手法は特定しない。   The test is executed by the process shown in FIG. 11, and the test execution result is output as a test execution file. The output of the test execution result uses an existing test method, and this patent does not particularly specify the method.

次に、本発明の第2実施形態について詳細に説明する。
本実施形態は、テスト実行処理部でテストパターンファイルに沿ったテストを行う際、すべてのテストを行うのではなく不必要なテストを実行しないようにする。
Next, a second embodiment of the present invention will be described in detail.
In the present embodiment, when the test execution processing unit performs a test according to the test pattern file, not all the tests are performed but unnecessary tests are not performed.

以下に、図13を参照して、テスト実行処理部でテストを行う場合の動作について説明する。
(1)ステップS501
まず、テストパターンに沿ったテストを実行する。このとき、実行した関数を記憶する。
(2)ステップS502
実行したテストパターンのうち実行していない関数が存在するか確認する。実行していない関数が存在しなければ、次のテストパターンに沿ったテストを実行する。
(3)ステップS503
実行していない関数が存在する場合、実行した関数の切り替えフラグが同じテストパターンを全て削除する。
Hereinafter, with reference to FIG. 13, an operation when a test is performed by the test execution processing unit will be described.
(1) Step S501
First, a test according to the test pattern is executed. At this time, the executed function is stored.
(2) Step S502
Check if there are any unexecuted functions among the executed test patterns. If there is no function that has not been executed, the test according to the following test pattern is executed.
(3) Step S503
If there are unexecuted functions, all test patterns with the same function switching flag are deleted.

図14に不必要なテストパターンを削除する例を示す。
図14のテストパターン1では、「read関数」を3回呼び出し、「print関数」を1回呼び出す。1回目と2回目の「read関数」は、切り替えフラグの値が1となっており、3回目の「read関数」は、切り替えフラグの値が0となっている。テストパターン1をテストした結果、3回目の「read関数」を実行する前にエラーが発生し以降の処理を行わずプログラムが終了したとする。このとき、図14で示すとおり「read関数」を2回実行している。ここでは、テストパターン1のうち、3回目の「read関数」と、「print関数」を実行していないので、テストパターン削除の処理を行うステップに進む。
FIG. 14 shows an example of deleting unnecessary test patterns.
In the test pattern 1 of FIG. 14, the “read function” is called three times, and the “print function” is called once. The first and second “read functions” have a switching flag value of 1, and the third “read function” has a switching flag value of 0. As a result of testing the test pattern 1, it is assumed that an error occurs before the third “read function” is executed and the program is terminated without performing the subsequent processing. At this time, as shown in FIG. 14, the “read function” is executed twice. Here, since the third “read function” and “print function” of the test pattern 1 are not executed, the process proceeds to a step of performing test pattern deletion processing.

図14で示すとおり、実行した関数とテストパターン2の対応する切り替えフラグは同じなので、テストパターン2を削除しこのテストを行わない。   As shown in FIG. 14, since the executed function and the corresponding switching flag of the test pattern 2 are the same, the test pattern 2 is deleted and this test is not performed.

その他の処理については、本発明の第1実施形態と同じ処理を行う。   Other processes are the same as those in the first embodiment of the present invention.

本発明によれば、従来のテスト工程をより網羅的、効率的にできるようにする用途で使用できる。また、従来のテスト支援ツールでより多くのテスト項目を自動的にテストできるように強化する用途で利用できる。   According to the present invention, the conventional test process can be used in an application that enables more comprehensive and efficient operation. In addition, it can be used for the purpose of strengthening the conventional test support tool so that more test items can be automatically tested.

以上のように、本発明では、実行時エラーが発生する可能性のあるタイミングのパターンを網羅的に作成し、そのパターンに沿って、テストの実行中に呼び出すべき関数と、そのスタブコードを自動的に切り替えることで、エラー処理のテストを効率的に行う仕組みを提供する。これにより、C言語等で記述されたプログラムのエラー処理のテストを自動的に行う。   As described above, in the present invention, a pattern of timing that may cause a run-time error is comprehensively created, and a function to be called during test execution and its stub code are automatically generated according to the pattern. By switching between them, a mechanism to efficiently test error handling is provided. As a result, a test for error handling of a program written in C language or the like is automatically performed.

図1は、本発明の異常系テスト支援装置の構成を示す概念図である。FIG. 1 is a conceptual diagram showing a configuration of an abnormal system test support apparatus of the present invention. 図2は、全体の処理フローを示すフローチャートである。FIG. 2 is a flowchart showing the overall processing flow. 図3は、テストパターン雛形ファイルを作成する場合のフローチャートである。FIG. 3 is a flowchart for creating a test pattern template file. 図4は、ソースファイルの例を示す図である。FIG. 4 is a diagram illustrating an example of a source file. 図5は、ソースファイルをステップ実行した結果を示す図である。FIG. 5 is a diagram showing the result of stepping the source file. 図6は、実行した関数を書き込んだテストパターン雛形ファイルの例を示す図である。FIG. 6 is a diagram illustrating an example of a test pattern template file in which the executed function is written. 図7は、テストパターンファイルを作成する場合のフローチャートである。FIG. 7 is a flowchart for creating a test pattern file. 図8は、スタブファイルの例を示す図である。FIG. 8 is a diagram illustrating an example of a stub file. 図9は、テストパターンファイルの新規作成の例を示す図である。FIG. 9 is a diagram illustrating an example of creating a new test pattern file. 図10は、8通りのテストパターンファイルの例を示す図である。FIG. 10 is a diagram illustrating examples of eight test pattern files. 図11は、テストパターンファイルに沿ったテストを実行する場合のフローチャートである。FIG. 11 is a flowchart for executing a test along the test pattern file. 図12は、ソースファイルをテストパターンに沿ってテスト実行する際の例を示す図である。FIG. 12 is a diagram illustrating an example when a source file is tested according to a test pattern. 図13は、テスト実行処理部でテストを行う場合のフローチャートである。FIG. 13 is a flowchart when the test is executed by the test execution processing unit. 図14は、不必要なテストパターンを削除する例を示す図である。FIG. 14 is a diagram illustrating an example of deleting unnecessary test patterns.

符号の説明Explanation of symbols

1… ソースファイル
2… ソースファイル格納部
3… スタブファイル
4… スタブファイル格納部
5… テストパターン雛形作成処理部
6… テストパターン雛形ファイル格納部
7… テストパターン作成処理部
8… テストパターンファイル格納部
9… テスト実行処理部
10… テスト結果ファイル
DESCRIPTION OF SYMBOLS 1 ... Source file 2 ... Source file storage part 3 ... Stub file 4 ... Stub file storage part 5 ... Test pattern template creation processing part 6 ... Test pattern template file storage part 7 ... Test pattern creation processing part 8 ... Test pattern file storage part 9 ... Test execution processing part 10 ... Test result file

Claims (12)

テスト対象のソースファイルを読み込んで実行し、実行時の関数呼び出しの順序からテストパターン雛形ファイルを作成するテストパターン雛形作成処理部と、
前記ソースファイルに対応するスタブファイル及び前記テストパターン雛形ファイルを読み込み、全探索法アルゴリズムを実行し、前記テストパターン雛形ファイルに記述されている関数が前記スタブファイル中に存在する場合、前記テストパターン雛形ファイルから全探索で得られる全てのテストパターンを含むテストパターンファイルを作成するテストパターン作成処理部と、
前記ソースファイル及び前記スタブファイルを読み込んで実行し、動的に標準関数とスタブ関数を切り替え、前記テストパターンファイルに含まれるテストパターンに沿ったテストを実行するテスト実行処理部と
を具備する
異常系テスト支援装置。
A test pattern template creation processing unit that reads and executes a source file to be tested and creates a test pattern template file from the order of function calls at the time of execution,
When the stub file corresponding to the source file and the test pattern template file are read, a full search algorithm is executed, and the function described in the test pattern template file exists in the stub file, the test pattern template A test pattern creation processing unit for creating a test pattern file including all test patterns obtained by full search from the file;
A test execution processing unit that reads and executes the source file and the stub file, dynamically switches between a standard function and a stub function, and executes a test according to a test pattern included in the test pattern file. Test support device.
請求項1に記載の異常系テスト支援装置であって、
前記テストパターン雛形作成処理部は、前記ソースファイルをビルドしてステップ実行し、実行ステップが終了するまでのステップ中に関数が存在した場合、関数名を前記テストパターン雛形ファイルに書き込む
異常系テスト支援装置。
The abnormal system test support device according to claim 1,
The test pattern template creation processing unit builds the source file, performs step execution, and writes a function name to the test pattern template file when a function exists during the steps until the execution step ends. Abnormal test support apparatus.
請求項1又は2に記載の異常系テスト支援装置であって、
前記テストパターン作成処理部は、前記テストパターン雛形ファイルに記述されている関数のうち、前記スタブファイルが用意されている関数に切り替えフラグを付加したテストパターンファイルを作成し、
前記テスト実行処理部は、前記ソースファイル及び前記スタブファイルをビルドしてステップ実行し、最終ステップに到達するまでのステップ中に関数が存在した場合、前記テストパターンファイルを順に読み込み、対象の関数の切り替えフラグの値を取得し、対象の関数の切り替えフラグの値が0又は空のときはそのまま関数を実行し、1のときはスタブ関数を実行する
異常系テスト支援装置。
The abnormal system test support device according to claim 1 or 2,
The test pattern creation processing unit creates a test pattern file in which a switching flag is added to a function for which the stub file is prepared among the functions described in the test pattern template file,
The test execution processing unit builds the source file and the stub file, executes the steps, and when there is a function in the steps until the final step is reached, reads the test pattern file in order, An abnormal system test support apparatus that acquires a value of a switching flag, executes the function as it is when the value of the switching flag of the target function is 0 or empty, and executes a stub function when the value is 1.
請求項3に記載の異常系テスト支援装置であって、
前記テスト実行処理部は、実行した関数の切り替えフラグが同じテストパターンを削除する
異常系テスト支援装置。
The abnormal system test support device according to claim 3,
The abnormal test support apparatus, wherein the test execution processing unit deletes a test pattern having the same function switching flag.
実行時の環境に依存したエラーを、発生の可能性のあるタイミングで発生させるテストパターンを網羅的に作成するテストパターン作成処理部と、
作成されたテストパターンに沿ったタイミングで関数をスタブ関数に置き換え、エラー処理のテストを自動的に行うテスト実行処理部と
を具備する
異常系テスト支援装置。
A test pattern creation processing unit that comprehensively creates test patterns that generate errors that depend on the environment at the time of occurrence at a timing that may occur,
An abnormal system test support apparatus comprising: a test execution processing unit that automatically replaces a function with a stub function at a timing according to a created test pattern and automatically performs an error processing test.
テスト対象のソースファイルを実行し、実行時の関数呼び出しの順序からテストパターン雛形ファイルを作成するステップと、
前記ソースファイルに対応するスタブファイル及び前記テストパターン雛形ファイルを読み込み、全探索法アルゴリズムを実行し、前記テストパターン雛形ファイルに記述されている関数が前記スタブファイル中に存在する場合、前記テストパターン雛形ファイルから全探索で得られる全てのテストパターンを含むテストパターンファイルを作成するステップと、
前記ソースファイル及び前記スタブファイルをビルドして実行し、動的に標準関数とスタブ関数を切り替え、前記テストパターンファイルに含まれるテストパターンに沿ったテストを実行するステップと
を具備する
異常系テスト支援方法。
Executing the source file to be tested and creating a test pattern template file from the order of function calls at the time of execution;
When the stub file corresponding to the source file and the test pattern template file are read, a full search algorithm is executed, and the function described in the test pattern template file exists in the stub file, the test pattern template Creating a test pattern file that includes all test patterns obtained from a full search from the file;
An abnormal test support comprising: building and executing the source file and the stub file, dynamically switching between a standard function and a stub function, and executing a test according to a test pattern included in the test pattern file Method.
請求項6に記載の異常系テスト支援方法であって、
前記ソースファイルをビルドし、ステップ実行できる環境で実行するステップと、
実行ステップ中に関数が存在するか確認するステップと、
実行ステップ中に関数が存在した場合、関数名を前記テストパターン雛形ファイルに書き込むステップと、
最終ステップに到達したか否か判定するステップと、
最終ステップに到達した場合、前記テストパターン雛形ファイルを保存するステップと
を更に具備する
異常系テスト支援方法。
The abnormal system test support method according to claim 6,
Building the source file and executing it in an environment capable of stepping;
Checking whether the function exists during the execution step;
If a function exists during the execution step, writing the function name to the test pattern template file;
Determining whether the final step has been reached;
An abnormal system test support method, further comprising a step of storing the test pattern template file when the final step is reached.
請求項6又は7に記載の異常系テスト支援方法であって、
前記テストパターン雛形ファイルをファイルの末尾まで順に読み込むステップと、
前記テストパターン雛形ファイル中の関数が、前記スタブファイル中に存在するとき、前記テストパターン雛形ファイルに記述されている関数のうち、前記スタブファイルが用意されている関数に切り替えフラグを付加したテストパターンファイルを作成するステップと、
ファイルの末尾に到達したか判定するステップと、
ファイルの末尾に到達すれば、作成したテストパターンファイルを保存するステップと
を更に具備する
異常系テスト支援方法。
The abnormal system test support method according to claim 6 or 7,
Sequentially reading the test pattern template file to the end of the file;
When a function in the test pattern template file exists in the stub file, among the functions described in the test pattern template file, a test pattern in which a switching flag is added to a function for which the stub file is prepared Creating a file;
Determining whether the end of the file has been reached;
An abnormal test support method, further comprising a step of saving the created test pattern file when the end of the file is reached.
請求項6乃至8のいずれか一項に記載の異常系テスト支援方法であって、
前記ソースファイル及び前記スタブファイルをビルドし、ステップ実行するステップと、
前記スタブファイルをビルドする際に、通常の関数とスタブ関数名が同じにならないようにスタブ関数に接頭詞をつけるステップと、
実行ステップ中に関数が存在するか確認するステップと、
ステップ中に関数が存在した場合、テストパターンファイルを順に読み込み、対象の関数の切り替えフラグの値を取得するステップと、
対象の関数の切り替えフラグの値が0か1か判定するステップと、
対象の関数の切り替えフラグの値が0のとき、又は、対象の関数の切り替えフラグが空のとき(スタブ関数が存在しないとき)は、そのまま関数を実行するステップと、
対象の関数の切り替えフラグの値が1のときは、スタブ関数に制御を変更し、スタブ関数を実行するステップと
を更に具備する
異常系テスト支援方法。
The abnormal system test support method according to any one of claims 6 to 8,
Building the source file and the stub file and executing them;
When building the stub file, prefixing the stub function so that the normal function and the stub function name are not the same;
Checking whether the function exists during the execution step;
If there is a function in the step, reading the test pattern file in order and obtaining the value of the target function switching flag;
Determining whether the value of the switching flag of the target function is 0 or 1,
When the value of the target function switching flag is 0, or when the target function switching flag is empty (when there is no stub function), executing the function as it is;
An abnormal system test support method, further comprising: when the value of the target function switching flag is 1, changing the control to a stub function and executing the stub function.
請求項6乃至9のいずれか一項に記載の異常系テスト支援方法であって、
テストパターンに沿ったテストを実行する際、実行した関数を記憶するステップと、
実行したテストパターンのうち実行していない関数が存在するか確認するステップと、
実行していない関数が存在する場合、実行した関数の切り替えフラグが同じテストパターンを削除するステップと
を更に具備する
異常系テスト支援方法。
An abnormal system test support method according to any one of claims 6 to 9,
When executing a test according to a test pattern, storing the executed function;
A step of checking whether there are unexecuted functions among the executed test patterns;
And a step of deleting a test pattern having the same switching flag of the executed function when there is an unexecuted function.
実行時の環境に依存したエラーを、発生の可能性のあるタイミングで発生させるテストパターンを網羅的に作成するステップと、
作成されたテストパターンに沿ったタイミングで関数をスタブ関数に置き換え、エラー処理のテストを自動的に行うステップと
を具備する
異常系テスト支援方法。
A step of comprehensively creating a test pattern that generates an error that depends on the environment at the time of occurrence,
An abnormal system test support method comprising a step of automatically performing an error processing test by replacing a function with a stub function at a timing according to a created test pattern.
請求項6乃至11のいずれか一項に記載の異常系テスト支援方法を、コンピュータに実行させるためのプログラム。   A program for causing a computer to execute the abnormal system test support method according to any one of claims 6 to 11.
JP2007074306A 2007-03-22 2007-03-22 Abnormal test support device, abnormal test support method, and program Expired - Fee Related JP5067705B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007074306A JP5067705B2 (en) 2007-03-22 2007-03-22 Abnormal test support device, abnormal test support method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007074306A JP5067705B2 (en) 2007-03-22 2007-03-22 Abnormal test support device, abnormal test support method, and program

Publications (2)

Publication Number Publication Date
JP2008234405A true JP2008234405A (en) 2008-10-02
JP5067705B2 JP5067705B2 (en) 2012-11-07

Family

ID=39907092

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007074306A Expired - Fee Related JP5067705B2 (en) 2007-03-22 2007-03-22 Abnormal test support device, abnormal test support method, and program

Country Status (1)

Country Link
JP (1) JP5067705B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013041546A (en) * 2011-08-19 2013-02-28 Fujitsu Ltd Debug support program, debug support method and debug support system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08272649A (en) * 1995-03-28 1996-10-18 Nippon Telegr & Teleph Corp <Ntt> Method for generating test item slip used for unit testing of program module
JP2000010820A (en) * 1998-06-26 2000-01-14 Hitachi Ltd Method and device for testing one process of multiprocess system
JP2005338987A (en) * 2004-05-25 2005-12-08 Fujitsu Ltd Exception test support program and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08272649A (en) * 1995-03-28 1996-10-18 Nippon Telegr & Teleph Corp <Ntt> Method for generating test item slip used for unit testing of program module
JP2000010820A (en) * 1998-06-26 2000-01-14 Hitachi Ltd Method and device for testing one process of multiprocess system
JP2005338987A (en) * 2004-05-25 2005-12-08 Fujitsu Ltd Exception test support program and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013041546A (en) * 2011-08-19 2013-02-28 Fujitsu Ltd Debug support program, debug support method and debug support system

Also Published As

Publication number Publication date
JP5067705B2 (en) 2012-11-07

Similar Documents

Publication Publication Date Title
KR101581001B1 (en) Dynamic instrumentation method and apparatus of program
US10133560B2 (en) Link time program optimization in presence of a linker script
US7500149B2 (en) Generating finite state machines for software systems with asynchronous callbacks
JP2000181725A (en) Method and system for altering executable code and giving addition function
JP2006268833A (en) Method of instrumenting code having restrictive calling conventions
US20110145799A1 (en) Path-sensitive dataflow analysis including path refinement
US8402446B2 (en) Associating probes with test cases
US8769498B2 (en) Warning of register and storage area assignment errors
CN111400256B (en) Method and device for calling resource file by application program
US20180129490A1 (en) Object ordering preservation during lto link stage
JP5067705B2 (en) Abnormal test support device, abnormal test support method, and program
US20130111432A1 (en) Validation of a system model including an activity diagram
US6438725B2 (en) Apparatus and method for fast code coverage analysis
CN115809076A (en) ECU software automation integration method and system
JP5082797B2 (en) Software partial test system
JP2008140263A (en) Unit test support device
CN107562430B (en) Compiling method for file processing function of mobile pi-calculus language
JP2005174045A (en) Source program conversion device, source program conversion method, source program conversion program and program recording medium
CN111488275A (en) UI automation test method and device, storage medium and electronic equipment
JPH09237191A (en) Programming supporting device, programming supporting method and medium recording programming supporting program
KR102600294B1 (en) Apparatus and method for automatically generating arinc based operating system health monitoring setup code for vehicle platform
JP2007219893A (en) Firmware evaluation system and firmware evaluation method
KR101225577B1 (en) Apparatus and method for analyzing assembly language code
JP6639238B2 (en) Programs and computers
JP3368795B2 (en) Compilation control method, compilation device, and recording medium

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100401

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110311

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110509

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20111125

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120105

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20120327

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120620

A911 Transfer of reconsideration by examiner before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20120627

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

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

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

Free format text: PAYMENT UNTIL: 20150824

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120805

LAPS Cancellation because of no payment of annual fees