JP5082797B2 - Software partial test system - Google Patents

Software partial test system Download PDF

Info

Publication number
JP5082797B2
JP5082797B2 JP2007302461A JP2007302461A JP5082797B2 JP 5082797 B2 JP5082797 B2 JP 5082797B2 JP 2007302461 A JP2007302461 A JP 2007302461A JP 2007302461 A JP2007302461 A JP 2007302461A JP 5082797 B2 JP5082797 B2 JP 5082797B2
Authority
JP
Japan
Prior art keywords
module
call
processing
software
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.)
Expired - Fee Related
Application number
JP2007302461A
Other languages
Japanese (ja)
Other versions
JP2009129133A (en
Inventor
晃宏 柴田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP2007302461A priority Critical patent/JP5082797B2/en
Publication of JP2009129133A publication Critical patent/JP2009129133A/en
Application granted granted Critical
Publication of JP5082797B2 publication Critical patent/JP5082797B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Description

本発明は、計算機ソフトウェアの一部分をテストするソフトウェア部分テストシステムに関する。 The present invention relates to a software portion testing system for testing a portion of the computer software.

モジュール化されたソフトウェアの部分的テストに関する技術として、スタブを用いてテスト対象範囲外の部分をシミュレートすることでテストを実施する方法が非特許文献1に記載されている。スタブとは、テスト対象範囲に含まれるモジュールから呼び出されるサブモジュールの動作をシミュレートするダミーのモジュールであって、本来のモジュールの振る舞いのうち、テストの実行で必要となる入力値に限って期待通りの出力を返すように作られるものである。例えば、モジュールXを別の作成途上のモジュールYを呼び出しているソフトウェアにおいて、部分的にモジュールXだけをテストしたい場合に、モジュールYが動作不能の場合でも、モジュールYをスタブに置き換えることでテストが実施可能となる。また、例えば、モジュールYの振る舞いを変更した場合のモジュールXの動作をテストしたい場合に、モジュールYをスタブに置き換えることによって目的を達成できる。   Non-Patent Document 1 describes a method for performing a test by simulating a part outside a test target range using a stub as a technique related to a partial test of modularized software. A stub is a dummy module that simulates the behavior of a submodule called from a module within the test target range, and is expected to be limited to the input values required for test execution out of the original module behavior. It is made to return street output. For example, in the case of software that calls module X as another creation module Y and wants to test only module X, even if module Y is inoperable, the test can be performed by replacing module Y with a stub. Can be implemented. Further, for example, when it is desired to test the operation of the module X when the behavior of the module Y is changed, the object can be achieved by replacing the module Y with a stub.

また、例えば、特許文献1には、スタブを呼び出しを受け付ける仮スタブと、それぞれが所定の単一動作を行う実スタブとして実現するソフトウェアテスト方法が記載されている。特許文献1に記載されているソフトウェアテスト方法では、仮スタブと実スタブとの対応関係を仮スタブ呼び出し時の引数値および内部条件を使って定義し、テスト実施時に実スタブ決定処理が、仮スタブ呼び出し時の引数値および内部条件に基づいて実行する実スタブを決定して実行する。 Further, for example, Patent Literature 1 describes a temporary stub that receives a call to a stub and a software test method that is realized as an actual stub that performs a predetermined single operation. In the software test method described in Patent Document 1, the correspondence between a temporary stub and an actual stub is defined using an argument value and an internal condition at the time of calling the temporary stub, and the actual stub determination process is performed when the test is performed. argument values and internal conditions when calling run to determine the actual stub to be executed based on.

特開2000−132425号公報JP 2000-132425 A Boris Beizer著,小野間彰訳,「ソフトウェアテスト技法」,第1版,日経BP出版センター,1994年2月,p.375Boris Beizer, Akira Onoma, "Software Test Technique", 1st edition, Nikkei BP Publishing Center, February 1994, p. 375

問題点は、テストに使用するモジュールの振るまいを、入力値全体ではなく部分的に変更したり補ったりしたい場合に、変更や補完の必要がない入力値についてもスタブに実装しなおす必要が生じることである。   The problem is that if you want to change or supplement the behavior of the module used for the test instead of the entire input value, it is necessary to re-implement the input value that does not need to be changed or completed in the stub. That is.

なお、特許文献1に記載されているテスト方法では、テスト条件に応じてスタブの動作を切り替えることはできるが、テストに使用するモジュールの振る舞いをスタブによって部分的に変更したり、補ったりしようということは何ら考慮されていない。すなわち、スタブがモジュール全体の動作を置き換えるものである点については、一般的なスタブと同様である。   In the test method described in Patent Document 1, the operation of the stub can be switched according to the test condition, but the behavior of the module used for the test is partially changed or supplemented by the stub. Nothing is taken into account. That is, it is the same as a general stub in that the stub replaces the operation of the entire module.

そこで、本発明は、ソフトウェアの一部分をテストする際に、テストに使用するモジュールの振る舞いをスタブによって部分的に変更したり、補ったりすることができるソフトウェア部分テストシステムを提供することを目的とする。 Accordingly, the present invention is, intended to provide to test a portion of software, or partially modify the behavior of the module to be used for testing by a stub, the software portion testing system that can be or supplemented To do.

本発明によるソフトウェア部分テストシステムは、計算機ソフトウェアの一部分をテストするソフトウェア部分テストシステムであって、少なくともテスト対象となっているモジュールと、該モジュールから呼び出されるサブモジュールである依存モジュールと、該依存モジュールが行う手続きの振る舞いの一部のみを代行するスタブとを、それぞれの記述内容に従って実行するモジュール実行手段を備え、モジュール実行手段はテスト対象モジュールから依存モジュールへの呼び出しを依存モジュールに代わって受け取り、呼び出しを受け取ると、当該呼び出しの処理を実行するモジュールを依存モジュールとするまたはスタブとするかを当該呼び出し時点でのプログラム中のデータの内容に関して記述された条件式に従って決定して、決定されたモジュールに当該呼び出しの処理を実行させる処理委譲手段を含むことを特徴とする。 A software partial test system according to the present invention is a software partial test system for testing a part of computer software, and includes at least a module to be tested, a dependent module that is a submodule called from the module, and the dependent module Module execution means that executes stubs that perform only part of the behavior of the procedure performed by the module according to the contents of each description, and the module execution means receives a call from the test target module to the dependent module on behalf of the dependent module. Upon receiving the call, to determine whether to or stub to the module that executes the processing of the call and the dependent module according conditional expression described with respect to the contents of the data in the program at the time the call Characterized in that it comprises a processing delegation means for the determined module to execute processing of the call.

本発明によれば、ソフトウェアの一部分をテストする際に、テストに使用するモジュールの振る舞いをスタブによって部分的に変更したり、補ったりすることができる。   According to the present invention, when a part of software is tested, the behavior of the module used for the test can be partially changed or supplemented by the stub.

以下、本発明の実施形態を図面を参照して説明する。図1は、本発明によるソフトウェア部分テストシステムの構成例を示すブロック図である。図1に示すソフトウェア部分テストシステムは、少なくともテスト対象となっているモジュールと、該モジュールから呼び出されるサブモジュールである依存モジュールと、該依存モジュールが行う手続きの振る舞いを代行するスタブとを、それぞれの記述内容に従って実行するモジュール実行手段10を備える。そして、モジュール実行手段10は、テスト対象モジュールから依存モジュールへの呼び出しを検出し、当該呼び出しの処理を実行するモジュールとして依存モジュールかスタブかを所定の条件に従って決定し、決定に応じて当該呼び出しの処理を実行させる処理委譲手段11を含む。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. FIG. 1 is a block diagram showing a configuration example of a software partial test system according to the present invention. The software partial test system shown in FIG. 1 includes at least a module to be tested, a dependent module that is a submodule called from the module, and a stub that acts as a proxy for the procedure performed by the dependent module. Module execution means 10 is provided for executing according to the description content. Then, the module execution means 10 detects a call from the test target module to the dependent module, determines whether it is a dependent module or a stub as a module for executing the processing of the call, according to a predetermined condition, and in response to the determination, Processing delegation means 11 for executing processing is included.

処理委譲手段11は、例えば、呼び出し時点でのプログラム中のデータの内容(例えば、呼び出しのパラメータ値や他の変数値)に関して記述された条件式の真偽値に基づいて、当該呼び出しの処理を実行するモジュールを決定してもよい。   For example, the process delegation unit 11 performs the process of the call based on the truth value of the conditional expression described with respect to the contents of the data in the program at the time of the call (for example, the parameter value or other variable value of the call). A module to be executed may be determined.

モジュール実行手段10は、具体的には、CPU等のプログラムに従って動作する情報処理装置によって実現される。なお、処理委譲手段11は、例えば、テストアプリケーションの一モジュールとして実装されていてもよい。また、例えば、デバッガやテストツールの一機能として組み込まれていてもよい。   Specifically, the module execution means 10 is realized by an information processing apparatus that operates according to a program such as a CPU. Note that the processing delegation unit 11 may be implemented as a module of a test application, for example. For example, it may be incorporated as a function of a debugger or a test tool.

以下、より具体的な構成について説明する。図2は、ソフトウェア部分テストシステムのより具体的な構成例を示すブロック図である。図2に示すように、本実施形態におけるソフトウェア部分テストシステムは、制御部100を備える。制御部100は、テストドライバ実行部101と、テスト対象モジュール実行部102と、委譲先制御部103と、依存モジュール実行部104と、スタブ実行部105とを含む。   Hereinafter, a more specific configuration will be described. FIG. 2 is a block diagram showing a more specific configuration example of the software partial test system. As shown in FIG. 2, the software partial test system in this embodiment includes a control unit 100. The control unit 100 includes a test driver execution unit 101, a test target module execution unit 102, a delegation destination control unit 103, a dependency module execution unit 104, and a stub execution unit 105.

テストドライバ実行部101は、テスト対象モジュール群をテストするためにテストケースに応じてテスト対象モジュールに対して手続き呼び出しを行うテストドライバを実行する。なお、テストドライバ実行部101は、図1に示すモジュール実行手段10のうちのテストドライバを実行する部分に相当する処理部である。   The test driver execution unit 101 executes a test driver that makes a procedure call to the test target module according to the test case in order to test the test target module group. Note that the test driver execution unit 101 is a processing unit corresponding to a part of the module execution unit 10 shown in FIG.

テスト対象モジュール実行部102は、テストドライバ実行部101からの手続き呼び出しに応じて、テスト対象モジュール群を実行する。なお、テスト対象モジュール実行部102は、図1に示すモジュール実行手段10のうちのテスト対象モジュールを実行する部分に相当する処理部である。   The test target module execution unit 102 executes the test target module group in response to the procedure call from the test driver execution unit 101. The test target module execution unit 102 is a processing unit corresponding to a part of the module execution unit 10 illustrated in FIG. 1 that executes the test target module.

委譲先制御部103は、テスト対象モジュールから呼び出されるサブモジュールである依存モジュールへの呼び出しを一旦横取りして受け付け、条件式201に従ってその処理の実行を依存モジュールに委譲するかスタブに委譲するかを決定し、決定に応じて当該呼び出しの処理の実行を委譲する(制御を引き渡す)。なお、委譲先制御部103は、図1に示す処理委譲手段11に相当する処理部である。本実施形態において、委譲先制御部103は、移譲先を決定するための条件式201として、呼び出し時点でのプログラム中のデータの内容(例えば、呼び出しのパラメータ値や他の変数値)に関して記述された論理式を保持している。   The delegation destination control unit 103 temporarily intercepts and accepts a call to a dependent module that is a submodule called from the test target module, and determines whether to delegate the execution of the process to the dependent module or to the stub according to the conditional expression 201. Decide and delegate execution of the processing of the call according to the decision (hand over control). The delegation destination control unit 103 is a processing unit corresponding to the processing delegation unit 11 shown in FIG. In the present embodiment, the delegation destination control unit 103 is described as the conditional expression 201 for determining the transfer destination regarding the contents of data in the program at the time of the call (for example, the parameter value of the call and other variable values). Holds logical expressions.

依存モジュール実行部104は、テスト対象モジュールとの間で手続きに対する呼び出し関係を有している依存モジュールを実行する。例えば、テスト対象モジュールA内にテスト対象モジュールではないモジュールBを呼び出すステートメントが存在するとき、テスト対象モジュールAは依存モジュールBに対する呼び出し関係を有している。なお、本実施形態では、テスト対象モジュールAから依存モジュールBへの呼び出しにおいて、依存モジュール実行部104に直接制御が引き渡されずに、委譲先制御部103に一旦引き渡される。なお、依存モジュール実行部104は、図1に示すモジュール実行手段10のうちの依存モジュールを実行する部分に相当する処理部である。   The dependency module execution unit 104 executes a dependency module having a call relationship with a procedure with the test target module. For example, when there is a statement in the test target module A that calls the module B that is not the test target module, the test target module A has a calling relationship with the dependency module B. In this embodiment, in the call from the test target module A to the dependency module B, the control is not transferred directly to the dependency module execution unit 104 but is once transferred to the delegation destination control unit 103. The dependency module execution unit 104 is a processing unit corresponding to a part that executes the dependency module in the module execution unit 10 shown in FIG.

呼び出し時における制御の引き渡しは、例えば、アスペクト指向言語を用いて、依存モジュールが行う手続きを呼び出すコードを、横断的関心事として一つのコンポーネントにまとめ、そのコンポーネント内で条件式により処理の委譲先を制御するよう記述されたプログラムに従って動作することによって実現することができる。また、例えば、予め依存モジュールが行う手続きの型を定義しておき、その型と一致する手続きを呼び出すコードをブレークポイントとして、そのブレークポイントにおいて実行コードを書き換えるようなデバッグコマンドを実装することによって実現することも可能である。   For example, using an aspect-oriented language, the code that calls the procedure performed by the dependent module is grouped into a single component as a cross-cutting concern. It can be realized by operating according to a program written to be controlled. Also, for example, by defining the type of procedure executed by the dependent module in advance, and implementing a debug command that rewrites the execution code at the breakpoint using the code that calls the procedure that matches the type as the breakpoint It is also possible to do.

スタブ実行部105は、テスト対象モジュールから呼び出されるサブモジュールである依存モジュールの手続きを代替するスタブを実行する。なお、依存モジュール実行部104は、図1に示すモジュール実行手段10のうちのスタブを実行する部分に相当する処理部である。   The stub execution unit 105 executes a stub that replaces the procedure of the dependent module that is a sub-module called from the test target module. The dependency module execution unit 104 is a processing unit corresponding to a part that executes a stub in the module execution unit 10 shown in FIG.

なお、上記例では、テストドライバ実行部101,テスト対象モジュール実行部102,委譲先制御部103,依存モジュール実行部104,スタブ実行部105を別々の処理部として示しているが、必ずしも独立して動作する処理部として実装されることを要しない。例えば、各処理部をテストアプリケーションの一モジュールとして実装することも可能である。そのような場合には、各処理部は、それぞれの処理部の動作を行うモジュールをリンカ等で結合されたアプリケーションプログラムを実行する1つのCPUによって実現される。また、例えば、各処理部をデバッガやテストツールの一機能として組み込むことも可能である。そのような場合には、各処理部は、テスト対象モジュールのソースコードやオブジェクトファイルを読み込んで、その実行コードに準じて、各処理部の動作を行うよう記述されたデバッグプログラムに従って動作するCPUによって実現される。   In the above example, the test driver execution unit 101, the test target module execution unit 102, the delegation destination control unit 103, the dependency module execution unit 104, and the stub execution unit 105 are shown as separate processing units. It is not necessary to be implemented as a processing unit that operates. For example, each processing unit can be implemented as a module of a test application. In such a case, each processing unit is realized by a single CPU that executes an application program in which modules that operate the respective processing units are combined by a linker or the like. Further, for example, each processing unit can be incorporated as a function of a debugger or a test tool. In such a case, each processing unit reads the source code or object file of the test target module, and the CPU that operates according to the debug program described to perform the operation of each processing unit according to the execution code. Realized.

なお、図3では、本発明との比較において、依存モジュールが行う手続きの全てをスタブで代替するソフトウェア部分テストシステムの構成例を示している。図2に示す実施形態との違いは、委譲先制御部103を備えていない点である。図3に示す例では、依存モジュールが行う手続きの全ては、スタブによって代行されている。一方、本発明では、依存モジュールをスタブで完全に置き換えるのではなく、委譲先制御部103で呼び出しの受け取りを代行し、その上で依存モジュールとスタブとのどちらかに処理を委譲するようにしている。   FIG. 3 shows a configuration example of a software partial test system in which all procedures performed by the dependency module are replaced with stubs in comparison with the present invention. The difference from the embodiment shown in FIG. 2 is that the delegation destination control unit 103 is not provided. In the example shown in FIG. 3, all procedures performed by the dependency module are delegated by stubs. On the other hand, in the present invention, instead of completely replacing a dependent module with a stub, the delegation destination control unit 103 receives the call and delegates the processing to either the dependent module or the stub. Yes.

次に、本実施形態の動作について説明する。図4は、本実施形態におけるソフトウェア部分テストシステムの動作の一例を示すフローチャートである。図4に示す例では、テストドライバ実行部101がテストドライバを実行することによって、テスト対象モジュール実行部102がテストドライバからの手続き呼び出しに応じて、テスト対象モジュール群を実行することにより、テスト対象モジュールに含まれる命令が順次発行される(ステップA110)。このとき、発行された命令が依存モジュールへの呼び出しでない場合には(ステップA111のNo)、テスト対象モジュール実行部102が、命令が発行されたコンテキスト(すなわち、テスト対象モジュールの記述)の内容に従い、処理を実行する(ステップA112)。そして、テスト対象モジュール内での命令に対する処理を実行しおえると、呼び出し元のテストドライバ実行部101に制御を返せばよい。   Next, the operation of this embodiment will be described. FIG. 4 is a flowchart showing an example of the operation of the software partial test system in the present embodiment. In the example illustrated in FIG. 4, the test driver execution unit 101 executes the test driver, and the test target module execution unit 102 executes the test target module group in response to the procedure call from the test driver, thereby The instructions included in the module are sequentially issued (step A110). At this time, if the issued instruction is not a call to the dependency module (No in step A111), the test target module execution unit 102 follows the content of the context in which the instruction is issued (that is, the description of the test target module). The process is executed (step A112). When the processing for the instruction in the test target module is completed, control may be returned to the call source test driver execution unit 101.

一方、発行された命令が依存モジュールへの呼び出しである場合には(ステップA111のYes)、委譲先制御部103が、当該命令による呼び出しの指示を依存モジュール実行部104に代わって受け取る(ステップA113)。   On the other hand, when the issued instruction is a call to the dependent module (Yes in Step A111), the delegation destination control unit 103 receives a call instruction by the instruction instead of the dependent module execution unit 104 (Step A113). ).

委譲先制御部103は、受け取った呼び出し命令に係る手続き(呼び出された委譲モジュールの手続き)に対応づけられている条件式201を評価する(ステップA114)。条件式201は、例えば、呼び出しのパラメータ値に関して記述された条件式である。また、例えば、呼び出し時点での変数値に関して記述された条件式であってもよい。また、例えば、呼び出しのパラメータ値および呼び出し時点での変数値に関して記述された条件式であってもよい。委譲先制御部103は、例えば、受け取った命令が発行されたコンテキストにおいてプログラムコードとして記述されている条件式201を実行することによって評価してもよい。また、例えば、プログラムコードとは独立して保持している条件式201に、現時点でのプログラム中のデータ内容を代入することによって評価してもよい。   The delegation destination control unit 103 evaluates the conditional expression 201 associated with the procedure related to the received call instruction (the procedure of the called delegation module) (step A114). The conditional expression 201 is, for example, a conditional expression described regarding the parameter value of the call. Further, for example, it may be a conditional expression described with respect to a variable value at the time of calling. Further, for example, it may be a conditional expression described with respect to the parameter value of the call and the variable value at the time of the call. For example, the delegation destination control unit 103 may evaluate by executing the conditional expression 201 described as the program code in the context in which the received instruction is issued. Further, for example, the evaluation may be performed by substituting the data contents in the program at the current time into the conditional expression 201 held independently of the program code.

ここで、委譲先制御部103は、条件式201の評価結果が真であれば、依存モジュールにより当該呼び出し命令に係る手続きの処理を実行させるため、依存モジュール実行部104に処理の実行を委譲する(ステップA115,A116)。   Here, if the evaluation result of the conditional expression 201 is true, the delegation destination control unit 103 delegates the execution of the process to the dependent module execution unit 104 in order to cause the dependent module to execute the procedure related to the call instruction. (Steps A115 and A116).

一方、条件式201の評価結果が偽であれば、スタブにより当該呼び出し命令に係る手続きの処理を実行させるため、スタブ実行部105に処理の実行を委譲する(ステップA115,A117)。   On the other hand, if the evaluation result of the conditional expression 201 is false, the execution of the procedure is delegated to the stub execution unit 105 in order to cause the stub to execute the procedure related to the call instruction (steps A115 and A117).

なお、図4のフローチャートに示す処理は、テスト対象モジュール群に含まれる命令が実行されるたびに繰り返される。   The process shown in the flowchart of FIG. 4 is repeated each time an instruction included in the test target module group is executed.

次に、具体例を用いて本実施形態の動作を説明する。図5は、ソフトウェア部分テストシステムにおいて実施対象となるプログラムモジュールの例を示す説明図である。図5に示すJava(登録商標)プログラムでは、テスト対象モジュールXは、依存モジュールYと依存モジュールZに対して呼び出し関係を有している。テスト対象モジュールXが持つ唯一のメソッドfunc1は、依存モジュールYが持つメソッドfunc2と、依存モジュールZが持つメソッドfunc31,func32およびfunc33とを利用して実現されている。   Next, the operation of this embodiment will be described using a specific example. FIG. 5 is an explanatory diagram showing an example of a program module to be implemented in the software partial test system. In the Java (registered trademark) program shown in FIG. 5, the test target module X has a calling relationship with the dependency module Y and the dependency module Z. The only method func1 that the test target module X has is realized by using the method func2 that the dependency module Y has and the methods func31, func32, and func33 that the dependency module Z has.

今、func2は未完成であり、引数nが正の場合に限って正しい動作が保証されているが、それ以外では例外を発生する状況にある。このような状況において、例外の発生を抑えてテストを完遂させるために、本実施例では、依存モジュールYの振る舞いを部分的に変更させる。   Now, func2 is incomplete and correct operation is guaranteed only when the argument n is positive. Otherwise, an exception is generated. In this situation, in order to suppress the occurrence of exceptions and complete the test, in this embodiment, the behavior of the dependency module Y is partially changed.

図6は、本実施形態におけるソフトウェア部分テストシステムの一実施例を示す説明図である。図6に示す例では、処理委譲用のコンポーネントとして、アスペクトY_delegatorがアスペクト指向言語によって定義されている。アスペクト指向言語では、関係するコンポーネントやオブジェクトにまたがるように、ばらばらに割り当てられてた機能(アスペクト指向言語では”関心事”と呼ばれる。モデル上のエンティティや分散処理などの実装上の留意点となるような観点を含む。)を、横断的関心事(crosscutting concern)と呼び、これを独立したコンポーネントとしてまとめる機能を実装することを目標とした言語である。図6に示す例は、Java言語にアスペクト指向技術のための拡張を施したプログラミング言語であるAspectJを用いてプログラムを作成することにより、委譲先制御部103を実現させた例である。   FIG. 6 is an explanatory diagram showing an example of the software partial test system in the present embodiment. In the example shown in FIG. 6, an aspect Y_deregulator is defined by an aspect-oriented language as a component for processing delegation. In aspect-oriented languages, functions that have been assigned apart so as to span related components and objects (called “interests” in aspect-oriented languages. These are points to consider in implementation such as entities on the model and distributed processing. Is a language whose goal is to implement a function that bundles it as an independent component. The example shown in FIG. 6 is an example in which the delegation destination control unit 103 is realized by creating a program using AspectJ, which is a programming language in which an extension for the aspect-oriented technology is applied to the Java language.

AspectJでは、横断関心事を単一コンポーネントにまとめられるようにするため、classやinterfaceといったコンポーネントの他にも、aspectというコンポーネントを宣言できる。aspectコンポーネントでは、いくつかのアドバイスを記述することができる。ここでいうアドバイスとは、classでいうメソッドに相当する。例えば、メソッドが継承機構によって子クラスの定義に自動的に挿入されるように、アドバイスの本体は、メソッド本体の中のポイントカットで指定された場所に自動的に挿入される。従って、ポイントカットで指定された場所にプログラムの実行が到着すると、アドバイスの本体をメソッドのように実行させることができる。   In AspectJ, in addition to components such as class and interface, a component called aspect can be declared so that crossing concerns can be combined into a single component. In the aspect component, some advice can be described. The advice here corresponds to a method called class. For example, the body of advice is automatically inserted at the location specified by the pointcut in the method body so that the method is automatically inserted into the child class definition by the inheritance mechanism. Therefore, when the execution of the program arrives at the location specified by the pointcut, the advice body can be executed like a method.

図6に示すアスペクトY_delegatorは、依存モジュールYが持つメソッドfunc2を呼び出すコードをポイントカットとするアスペクトコンポーネントであって、アドバイスとして、条件式によって依存モジュールYが持つメソッドfunc2をそのまま呼び出すか、スタブとして代替されているメソッドY_stub_func2を呼び出すかを切り替えるコードが記述されている。   The aspect Y_deregulator shown in FIG. 6 is an aspect component whose point cut is the code that calls the method func2 possessed by the dependency module Y, and as an advice, the method func2 possessed by the dependency module Y is called as it is based on a conditional expression or is replaced with a stub. A code for switching whether to call the method Y_stub_func2 is written.

図6において、”pointcut atFunc2(int n):call (int Y.func2(int n) && (args(i)) ”で、依存モジュールYのメソッドfunc2への呼び出しを引数情報とともに横取りするためのポイントカットが定義されている。また、”int around (int n):atFunc2”とは、横取りした呼び出しに対する処理内容をその後につづくブロック内に定義することを表している。また、”proceed(n)”は、もともとの呼び出し先の手続きを実行することを表している。   In FIG. 6, “pointcut atFunc2 (int n): call (int Y.func2 (int n) && (args (i))” is a point for intercepting the call to the method func2 of the dependent module Y together with the argument information. Cut is defined, and “int around (int n): atFunc2” means that the processing contents for the intercepted call are defined in the subsequent block, and “proceed (n) "" Indicates that the procedure of the original call destination is executed.

本例において、”func1(5,10)>0”および”func1(−5,10)<0”となることを確認するテストを実行すると、メソッドfunc1の第1引数p=5のとき、メソッドfunc2に対しては引数n=5が渡されるので、条件式”(n>0)?”に従い、本来の依存モジュールYのメソッドfunc2のロジックが実行される。メソッドfunc1の第1引数p=−5のとき、メソッドfunc2に対しては引数n=−5が渡されるので、同様の条件式に従い、依存モジュールYのスタブとして実装されているメソッドY_stub_func2のロジックが実行される。   In this example, when a test for confirming that “func1 (5,10)> 0” and “func1 (−5,10) <0” is executed, when the first argument p = 5 of the method func1, Since the argument n = 5 is passed to func2, the logic of the method func2 of the original dependency module Y is executed according to the conditional expression “(n> 0)?”. Since the argument n = -5 is passed to the method func2 when the first argument p = -5 of the method func1, the logic of the method Y_stub_func2 implemented as a stub of the dependency module Y follows the similar conditional expression. Executed.

ここで、例えば、テストパターンとして、メソッドfunc1の第1引数p=7,10をテストする必要が生じたとしても、それに応じてスタブを変更する必要はなく、条件式”(n>0)?”で動作保証されているfunc2のロジックがそのまま利用できる。   Here, for example, even if it becomes necessary to test the first argument p = 7, 10 of the method func1 as a test pattern, there is no need to change the stub accordingly, and the conditional expression “(n> 0)? The logic of func2 whose operation is guaranteed with "" can be used as it is.

以上のように、本実施形態によれば、依存モジュールの全てをスタブで代替する必要がなく、部分的な振る舞いだけをスタブに代行させることができる。例えば、依存モジュールの振る舞いを一部の入力値域についてのみ変更したい場合に、その変更したい入力値域に関する振る舞いだけをスタブに定義すればよい。本実施形態では、委譲先制御部103を備えているため、依存モジュールへの呼び出しをそのまま依存モジュールで処理するか、またはスタブで処理するかを条件式で切り替えることができるからである。   As described above, according to the present embodiment, it is not necessary to substitute all of the dependent modules with stubs, and only partial behavior can be delegated to stubs. For example, when it is desired to change the behavior of the dependency module only for a part of the input range, only the behavior related to the input range to be changed needs to be defined in the stub. This is because, in the present embodiment, since the delegation destination control unit 103 is provided, it is possible to switch whether the call to the dependency module is directly processed by the dependency module or the stub by a conditional expression.

なお、上記実施形態には、少なくともテスト対象となっているモジュールと、該モジュールから呼び出されるサブモジュールである依存モジュールと、該依存モジュールが行う手続きの振る舞いを代行するスタブとを、それぞれの記述内容に従って実行するモジュール実行手段を備え、前記モジュール実行手段は、テスト対象モジュールから依存モジュールへの呼び出しを検出し、当該呼び出しの処理を実行するモジュールとして依存モジュールかスタブかを所定の条件に従って決定し、決定に応じて当該呼び出しの処理を実行させる処理委譲手段を含むソフトウェア部分テストシステムの構成例が示されている(図1参照。)。   In the above-described embodiment, at least the module to be tested, the dependent module that is a sub-module called from the module, and the stub that substitutes the behavior of the procedure performed by the dependent module are described in the respective contents. The module execution means detects a call from the test target module to the dependent module and determines whether the module that executes the processing of the call is a dependent module or a stub according to a predetermined condition. A configuration example of a software partial test system including a process delegation unit that executes the process of the call according to the determination is shown (see FIG. 1).

また、上記実施形態には、処理委譲手段が、呼び出し時点でのプログラム中のデータの内容に関して記述された条件式の真偽値に基づいて、当該呼び出しの処理を実行するモジュールを決定するソフトウェア部分テストシステムの構成例が示されている。   In the above embodiment, the software delegation unit determines a module that executes the process of the call based on the truth value of the conditional expression described with respect to the content of the data in the program at the time of the call. A configuration example of the test system is shown.

また、上記実施形態には、処理委譲手段が、呼び出しのパラメータ値に関して記述された条件式の真偽値に基づいて、当該呼び出しの処理を実行するモジュールを決定するソフトウェア部分テストシステムの構成例が示されている。   In the above embodiment, there is a configuration example of the software partial test system in which the process delegation unit determines a module that executes the process of the call based on the truth value of the conditional expression described with respect to the parameter value of the call. It is shown.

また、上記実施形態には、処理委譲手段が、呼び出し時点での変数値に関して記述された条件式の真偽値に基づいて、当該呼び出しの処理を実行するモジュールを決定するソフトウェア部分テストシステムの構成例が示されている。   In the above-described embodiment, the configuration of the software partial test system in which the process delegation unit determines the module that executes the process of the call based on the truth value of the conditional expression described with respect to the variable value at the time of the call. An example is shown.

また、上記実施形態には、処理委譲手段が、呼び出しのパラメータ値および呼び出し時点での変数値に関して記述された条件式の真偽値に基づいて、当該呼び出しの処理を実行するモジュールを決定するソフトウェア部分テストシステムの構成例が示されている。   In the above-described embodiment, the process delegation means determines the module for executing the call processing based on the truth value of the conditional expression described with respect to the parameter value of the call and the variable value at the time of the call. A configuration example of a partial test system is shown.

また、上記実施形態には、処理委譲手段が、アスペクト指向言語を用いて、依存モジュールが行う手続きを呼び出すコードをポイントカットとするアスペクトコンポーネント内で、条件式により処理の委譲先を制御するよう記述されたプログラムに従って動作する情報処理装置によって実現されるソフトウェア部分テストシステムの構成例が示されている。   Also, in the above embodiment, the process delegation means uses an aspect-oriented language to control the delegation destination of the process by a conditional expression in an aspect component whose point cut is a code that calls a procedure performed by a dependent module. A configuration example of a software partial test system realized by an information processing apparatus that operates according to a programmed program is shown.

本発明は、ソフトウェアを複数のモジュールに分割して並行開発する際の部分テストに好適に適用可能である。   The present invention can be suitably applied to a partial test when software is divided into a plurality of modules and developed in parallel.

本発明によるソフトウェア部分テストシステムの構成例を示すブロック図である。It is a block diagram which shows the structural example of the software partial test system by this invention. ソフトウェア部分テストシステムのより具体的な構成例を示すブロック図である。It is a block diagram which shows the more specific structural example of a software partial test system. 依存モジュールが行う手続きの全てをスタブで代替するソフトウェア部分テストシステムの構成例を示す説明図である。It is explanatory drawing which shows the structural example of the software partial test system which substitutes all the procedures which a dependence module performs with a stub. 本実施形態におけるソフトウェア部分テストシステムの動作の一例を示すフローチャートである。It is a flowchart which shows an example of operation | movement of the software partial test system in this embodiment. 実施対象となるプログラムモジュールの例を示す説明図である。It is explanatory drawing which shows the example of the program module used as implementation object. ソフトウェア部分テストシステムの一実施例を示す説明図である。It is explanatory drawing which shows one Example of a software partial test system.

符号の説明Explanation of symbols

10 モジュール実行手段
11 処理委譲手段
100 制御部
101 テストドライバ実行部
102 テスト対象モジュール実行部
103 委譲先制御部
104 依存モジュール実行部
105 スタブ実行部
DESCRIPTION OF SYMBOLS 10 Module execution means 11 Processing delegation means 100 Control part 101 Test driver execution part 102 Test object module execution part 103 Delegation destination control part 104 Dependent module execution part 105 Stub execution part

Claims (5)

計算機ソフトウェアの一部分をテストするソフトウェア部分テストシステムであって、
少なくともテスト対象となっているモジュールと、該モジュールから呼び出されるサブモジュールである依存モジュールと、該依存モジュールが行う手続きの振る舞いの一部のみを代行するスタブとを、それぞれの記述内容に従って実行するモジュール実行手段を備え、
前記モジュール実行手段は
テスト対象モジュールから前記依存モジュールへの呼び出しを前記依存モジュールに代わって受け取り、前記呼び出しを受け取ると、当該呼び出しの処理を実行するモジュールを依存モジュールとするまたはスタブとするかを当該呼び出し時点でのプログラム中のデータの内容に関して記述された条件式に従って決定して、決定されたモジュールに当該呼び出しの処理を実行させる処理委譲手段を含む
ことを特徴とするソフトウェア部分テストシステム。
A software partial test system for testing a part of computer software,
A module that executes at least a module to be tested, a dependent module that is a submodule called from the module, and a stub that performs only a part of the behavior of the procedure performed by the dependent module in accordance with each description content With execution means,
Said module execution means
Receiving from the test target module on behalf of the call to the dependent module to the dependent module, upon receiving the call, or to or stub to the module that executes the processing of the call and the dependent module at the time the call A software partial test system comprising processing delegation means for determining according to a conditional expression described with respect to data contents in a program and causing the determined module to execute the processing of the call.
処理委譲手段は、呼び出しのパラメータ値に関して記述された条件式の真偽値に基づいて、当該呼び出しの処理を実行するモジュールを決定する
請求項に記載のソフトウェア部分テストシステム。
Processing delegation means, software portions testing system of claim 1, based on the truth value of the described condition with respect to calls of parameter values to determine a module for executing the processing of the call.
処理委譲手段は、呼び出し時点での変数値に関して記述された条件式の真偽値に基づいて、当該呼び出しの処理を実行するモジュールを決定する
請求項に記載のソフトウェア部分テストシステム。
Processing delegation means, software portions testing system according to claim 1 for determining based on the truth value of the described condition with respect to the variable value of a call point, the module for executing the processing of the call.
処理委譲手段は、呼び出しのパラメータ値および呼び出し時点での変数値に関して記述された条件式の真偽値に基づいて、当該呼び出しの処理を実行するモジュールを決定する
請求項に記載のソフトウェア部分テストシステム。
Processing delegation means, based on the truth value of the described condition with respect to the variable value at the time of parameter values and call invocation, software portions testing according to claim 1 for determining a module that performs processing of the call system.
処理委譲手段は、アスペクト指向言語を用いて、依存モジュールが行う手続きを呼び出すコードをポイントカットとするアスペクトコンポーネント内で、条件式により処理の委譲先を制御するよう記述されたプログラムに従って動作する情報処理装置によって実現される
請求項1から請求項のうちのいずれか1項に記載のソフトウェア部分テストシステム。
The process delegation means uses an aspect-oriented language to process information according to a program written to control the process delegation destination by a conditional expression within an aspect component whose point cut is the code that calls the procedure performed by the dependent module. software portion testing system according to any one of claims 1 to 4 which is realized by the device.
JP2007302461A 2007-11-22 2007-11-22 Software partial test system Expired - Fee Related JP5082797B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007302461A JP5082797B2 (en) 2007-11-22 2007-11-22 Software partial test system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007302461A JP5082797B2 (en) 2007-11-22 2007-11-22 Software partial test system

Publications (2)

Publication Number Publication Date
JP2009129133A JP2009129133A (en) 2009-06-11
JP5082797B2 true JP5082797B2 (en) 2012-11-28

Family

ID=40819996

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007302461A Expired - Fee Related JP5082797B2 (en) 2007-11-22 2007-11-22 Software partial test system

Country Status (1)

Country Link
JP (1) JP5082797B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9317405B2 (en) * 2014-01-31 2016-04-19 Fujitsu Limited Test double generation
JP6512032B2 (en) * 2015-08-21 2019-05-15 富士通株式会社 Stub target determination apparatus, method, and program
JP6879046B2 (en) 2017-05-15 2021-06-02 トヨタ自動車株式会社 Test method and program

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09265414A (en) * 1996-03-28 1997-10-07 Hitachi Ltd Test environment construction supporting system
JP2000020349A (en) * 1998-07-06 2000-01-21 Toshiba Corp Device and method for supporting program development and medium recording program for program development support
JP2000132425A (en) * 1998-10-26 2000-05-12 Hitachi Ltd Software testing method
JP2005228183A (en) * 2004-02-16 2005-08-25 Hitachi Ltd Program execution method and computer system for executing the program
JP2006301983A (en) * 2005-04-21 2006-11-02 Hitachi Ltd Information processing apparatus, and method for testing program

Also Published As

Publication number Publication date
JP2009129133A (en) 2009-06-11

Similar Documents

Publication Publication Date Title
Tanter et al. A versatile kernel for multi-language AOP
US6243864B1 (en) Compiler for optimizing memory instruction sequences by marking instructions not having multiple memory address paths
US10579349B2 (en) Verification of a dataflow representation of a program through static type-checking
US10133560B2 (en) Link time program optimization in presence of a linker script
JPH0760324B2 (en) Sequential circuit, generation method thereof, controller, and finite state machine
JP2004164554A (en) Device and method for executing and monitoring program
US20180203676A1 (en) Removing library objects from a static library
JP5082797B2 (en) Software partial test system
KR101266565B1 (en) Test case creating mehtod and running method of robot software component using specifications of required interface
CN105204837A (en) Realizing method and device for logic programming
JP2016128941A (en) Output determination device, output determination method, output determination program, and static analysis device
US20020073133A1 (en) Register allocation method and software development method for various execution environments and LSI for executing developed software
JP2009258796A (en) Program development device and program development method
JP5067705B2 (en) Abnormal test support device, abnormal test support method, and program
JP2016029547A (en) Execution module generation apparatus and electronic control unit
Ribeiro et al. COFIE: a regex-like interaction and control flow description
US9830174B2 (en) Dynamic host code generation from architecture description for fast simulation
JP2011191843A (en) Interrupt interference analysis device, interrupt interference analysis method and interrupt interference analysis program
Jeon et al. SP-Fuzz: Fuzzing Soft PLC with Semi-automated Harness Synthesis
CN102902532B (en) Tool chain conversion and extension method in integrated development environment
JP5755103B2 (en) Block diagram processing apparatus and block diagram processing method
JP2018147114A (en) Test case generation method, computer, and program
JP2006146731A (en) Program, storage medium, assembler device, compiler device, simulator device and emulator device
JP3368795B2 (en) Compilation control method, compilation device, and recording medium
JPH11212807A (en) Program execution method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20101012

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20111110

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20111122

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120123

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

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

R150 Certificate of patent or registration of utility model

Ref document number: 5082797

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20150914

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees