JP6503724B2 - Stub method, program and apparatus - Google Patents
Stub method, program and apparatus Download PDFInfo
- Publication number
- JP6503724B2 JP6503724B2 JP2014252989A JP2014252989A JP6503724B2 JP 6503724 B2 JP6503724 B2 JP 6503724B2 JP 2014252989 A JP2014252989 A JP 2014252989A JP 2014252989 A JP2014252989 A JP 2014252989A JP 6503724 B2 JP6503724 B2 JP 6503724B2
- Authority
- JP
- Japan
- Prior art keywords
- stub
- description
- program
- unit
- symbolic execution
- 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
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Description
本発明は、スタブ化方法、プログラム及び装置に関する。 The present invention relates to a stubbing method, program and apparatus.
プログラムテストにおいて、プログラム中の変数値を具体化せずに、記号(シンボル値)のまま実行する技術(シンボリック実行技術)が用いられることがある。このプログラムテストでは、シンボリック実行によって得たパス条件の充足値をテストデータとして用いる。 In program testing, a technique (symbolic execution technique) may be used which executes as it is (symbol value) without embodying variable values in the program. In this program test, the satisfaction value of the path condition obtained by symbolic execution is used as test data.
しかしながら、実際のプログラムには、シンボリック実行エンジンが解析対象とできないが、一般的な処理系では実行可能な記述が存在する。このような記述が存在する場合、当該記述を置き換えるスタブを用意して使用する必要がある。なお、スタブは一般的には人手で記述する必要があり、手間が掛かる。 However, an actual program can not be analyzed by the symbolic execution engine, but there is an executable description in a general processing system. If such a description exists, it is necessary to prepare and use a stub that replaces the description. Generally, stubs need to be described manually, which takes time and effort.
これに対し、JUnit(Java(登録商標)で開発されたプログラムにおいてユニットテスト(単体テスト)の自動化を行うためのフレームワーク)では、戻り値の型に応じて予め決められた定数を返すスタブの自動生成は可能である。例えば、戻り値の型が整数であれば、0を返すスタブを生成し、戻り値の型が真偽値であれば、falseを返すスタブを生成するなどである。しかし、このように予め決められた定数を返すスタブを生成すると、プログラムのうち元々実行し得ない文まで実行されてしまい、テスト結果の信頼性が低下するおそれがある。 On the other hand, in JUnit (a framework for unit test (unit test) automation in a program developed with Java (registered trademark)), an automatic stub that returns a constant determined according to the return value type Generation is possible. For example, if the return type is an integer, a stub that returns 0 is generated, and if the return type is a boolean, a stub that returns false is generated. However, if a stub that returns a constant determined in this way is generated, even a statement that can not be originally executed in the program is executed, which may lower the reliability of the test result.
なお、従来においては、特許文献1のような技術も知られているが、本技術ではスタブの自動生成はできない。
In addition, although a technique like
1つの側面では、本発明は、プログラムのテスト結果の信頼性低下を抑制することが可能なプログラムのスタブ化方法、プログラム及び装置を提供することを目的とする。 In one aspect, the present invention aims to provide a program stubbing method, program, and apparatus capable of suppressing deterioration in reliability of a test result of a program.
一つの態様では、スタブ化方法は、シンボリック実行エンジンによるテスト対象のプログラムに含まれる前記シンボリック実行エンジンが解析できないスタブ化対象の記述を検出し、検出された前記スタブ化対象の記述が実行される際のパス条件を充足する変数値を設定し、設定された前記変数値を用いて前記スタブ化対象の記述を前記シンボリック実行エンジンが解析できない記述を解析できる情報処理部に実行させ、該情報処理部からの返却値に基づいてスタブを生成し、前記テスト対象のプログラムの前記スタブ化対象の記述を前記スタブで置換する、処理をコンピュータが実行する。 In one aspect, the stubbing method detects a description of a stubbed object that can not be analyzed by the symbolic execution engine included in a program to be tested by a symbolic execution engine , and the description of the detected stubbed object is executed Setting a variable value that satisfies the path condition at the time of execution, causing the information processing unit capable of analyzing a description that can not be analyzed by the symbolic execution engine to execute the description of the stub target using the set variable value; The computer executes processing for generating a stub based on a return value from the unit and replacing the description of the stub target of the program to be tested with the stub.
プログラムのテスト結果の信頼性低下を抑制することができる。 It is possible to suppress the decrease in the reliability of program test results.
以下、情報処理装置の一実施形態について、図1〜図9に基づいて詳細に説明する。本実施形態の情報処理装置は、テスト対象のプログラム(スタブ化前プログラム)の入力を受け付け、スタブ化を実行した後、スタブ化後プログラムを出力するスタブ化装置としての機能を有している。 Hereinafter, an embodiment of the information processing apparatus will be described in detail based on FIGS. 1 to 9. The information processing apparatus according to the present embodiment has a function as a stubbing apparatus that receives an input of a program to be tested (a program before stubbing), executes stubbing, and then outputs the program after stubbing.
図1には、本実施形態にかかる情報処理装置10のハードウェア構成が示されている。図1に示すように、情報処理装置10は、CPU(Central Processing Unit)90、ROM(Read Only Memory)92、RAM(Random Access Memory)94、記憶部(ここではHDD(Hard Disk Drive))96、ネットワークインタフェース97、表示部93、入力部95、及び可搬型記憶媒体用ドライブ99等を備えている。これら情報処理装置10の構成各部は、バス98に接続されている。表示部93は、液晶ディスプレイ等を含み、入力部95は、キーボードやマウス、タッチパネル等を含む。情報処理装置10では、ROM92あるいはHDD96に格納されているプログラム(スタブ化プログラムを含む)、或いは可搬型記憶媒体用ドライブ99が可搬型記憶媒体91から読み取ったプログラム(スタブ化プログラムを含む)をCPU90が実行することにより、図2に示す各部としての機能が実現されている。
FIG. 1 shows the hardware configuration of the information processing apparatus 10 according to the present embodiment. As shown in FIG. 1, the information processing apparatus 10 includes a central processing unit (CPU) 90, a read only memory (ROM) 92, a random access memory (RAM) 94, and a storage unit (here, HDD (hard disk drive)) 96. , A
図2は、情報処理装置10の機能ブロック図である。図2に示すように、CPU90がプログラムを実行することにより、シンボリック実行部12、検出部としてのスタブ化対象記述検出部14、設定部としての具体値入力生成部16、生成部としてのスタブ生成部18、置換部としてのスタブ挿入部20、として情報処理装置10を機能させる。なお、図2には、HDD96等に格納されている格納部としてのスタブ化対象記述DB40も記載されている。また、図2には、シンボリック実行部12(シンボリック実行エンジン)とは異なる一般的な処理系である情報処理部としての処理部30も記載されている。
FIG. 2 is a functional block diagram of the information processing apparatus 10. As shown in FIG. 2, when the
シンボリック実行部12は、テスト対象のプログラムをシンボリック実行する。本実施形態では、シンボリック実行部12は、スタブ化前プログラムの入力を受け付け、スタブ化後プログラムを出力する。
The
スタブ化対象記述検出部14は、シンボリック実行部12から入力されるプログラム内の各記述を、スタブ化対象記述データベース(DB)40の内容と比較し、スタブ化対象とするかを判定する。すなわち、スタブ化対象記述検出部14は、プログラムに含まれるスタブ化対象の記述を検出する。なお、スタブ化対象記述DB40には、スタブ化する必要のある記述(スタブ化対象記述)、すなわちシンボリック実行部12では解析できないが一般的な処理系(処理部30)では解析できる記述を格納しているものとする。なお、スタブ化対象記述は、スタブ化対象記述DB40に対して人手で入力されてもよいが、過去のテストにおいてシンボリック実行部12が処理できなかった記述をスタブ化対象記述DB40に自動的に格納してもよい。
The stub target
具体値入力生成部16は、スタブ化対象記述が実行される際のパス条件を充足する各変数の具体値(変数値)をSMT(Satisfiability Modulo Theories)ソルバを用いて算出する。この場合、過去に同一のスタブ化対象記述がスタブ化されていた場合であっても、具体値入力生成部16は、実行時のパス条件が異なる場合にはそのパス条件に応じた各変数の具体値を新たに算出する。
The specific value
スタブ生成部18は、具体値入力生成部16で得られた具体値入力を用いて一般的な処理系(処理部30)にスタブ化対象記述を実行させる。処理部30では、シンボリック実行部12が解析対象とできない記述も実行可能であり、スタブ生成部18は、処理部30からの返却値を取得すると、当該返却値に基づいてスタブを生成する。
The
スタブ挿入部20は、スタブ生成部18において生成されたスタブによって、テスト対象のプログラムのスタブ化対象記述を置換することで、プログラムにスタブを挿入し、シンボリック実行部12の解析対象にできるようにする。
The
(情報処理装置10の処理)
次に、情報処理装置10の処理について、図3のフローチャートに沿って、その他図面を適宜参照しつつ、詳細に説明する。
(Processing of the information processing apparatus 10)
Next, the process of the information processing apparatus 10 will be described in detail along the flowchart of FIG. 3 with reference to other drawings as appropriate.
ステップS10では、シンボリック実行部12が、スタブ化前プログラムの入力を受け付け、初期パス条件をcとする。例えば、シンボリック実行部12は、スタブ化前プログラムとして、図4(a)に示すようなテスト対象関数main2の入力を受け付けたものとする。なお、テスト対象関数main2の制御構造は、図4(d)に示すようになっている。また、シンボリック実行においては、テスト対象関数main2の引数aをシンボルとして指定する。また、プログラム実行中においてシンボルの値が満たすべき条件をパス条件と呼ぶものとする。なお、本実施形態では、説明の簡素化のため、図4(b)に示すように、関数func1(a)(a>0)をスタブ化対象関数と仮定し、図4(c)に示すように、関数func2(a)(a==0)をスタブ化対象外関数と仮定している。
In step S10, the
次いで、ステップS12では、シンボリック実行部12が、スタブ化前プログラム内の次命令iを読み出す。ここでは、シンボリック実行部12は、図4(a)のテスト対象関数main2のfunc2を読み出したものとする。なお、シンボリック実行部12は、読み出した命令iをスタブ化対象記述検出部14に送信する。
Next, in step S12, the
ステップS14では、スタブ化対象記述検出部14が、シンボリック実行部12から受信した命令iがスタブ化対象記述DB40に含まれるか否かを判断する。ここで、func2は、図4(c)に示すようにスタブ化対象外関数であるものとする。すなわち、func2は、スタブ化対象記述DB40に含まれていないため、ステップS14の判断は否定され、ステップS26に移行する。
In step S14, the stubification target
ステップS26に移行すると、シンボリック実行部12は、命令iのシンボリック実行を行いパス条件cを更新する(ここでは、a==0とする)。その後は、ステップS28に移行し、シンボリック実行部12は、プログラムの次命令が存在しないか否かを判断する。ここでは、次の命令が存在しているので、ステップS28の判断は否定され、ステップS12に戻る。
At step S26, the
ステップS12に戻ると、シンボリック実行部12は、スタブ化前プログラム内の次命令iを読み出す。ここでは、シンボリック実行部12は、図4(a)のテスト対象関数main2のfunc1を読み出したものとする。
Returning to step S12, the
次いで、ステップS14では、スタブ化対象記述検出部14が、シンボリック実行部12から受信した命令i(func1)がスタブ化対象記述DB40に含まれるか否かを判断する。ここで、func1は、図4(b)に示すようにスタブ化対象関数であるものとする。すなわち、func1は、スタブ化対象記述DB40に含まれているため、ステップS14の判断は肯定され、ステップS16に移行する。
Next, in step S14, the stubification target
ステップS16に移行すると、具体値入力生成部16が、パス条件c(a==0)を充足する具体値入力を生成する。ここでは、図5(a)に示すように、具体値(変数値)として、パス条件c(a==0)を充足するa=0が生成される。
In step S16, the specific value
次いで、ステップS18では、スタブ生成部18が、具体値入力を用いて、処理部30において命令iまでスタブ化前プログラムを実行する。この場合、図5(b)に示すように、処理部30では、func1(a)=func1(0)=falseという返却値が得られるので、処理部30は、この返却値(false)をスタブ生成部18に戻す。
Next, in step S18, the
次いで、ステップS20では、スタブ生成部18が、処理部30による命令iの返却値(評価値)に基づいてスタブを生成する。この場合、スタブ生成部18は、図6において太線枠で示すようなスタブ関数を生成する。次いで、ステップS22では、スタブ挿入部20が、生成されたスタブをプログラムに挿入する。なお、スタブ挿入部20は、スタブ挿入後のプログラムをシンボリック実行部12に送信する。
Next, in step S20, the
次いで、ステップS24では、シンボリック実行部12が、スタブ挿入後のプログラムを命令iまでシンボリック実行し、パス条件cを更新する。この場合、シンボリック実行部12は、スタブ化前に実行し得ない記述、すなわち、図6において下線を付して示すif-if側の分岐内記述(print(“positive”))を実行しないようにすることができる。また、シンボリック実行部12は、パス条件cを、次のパス条件(a!=0)に更新する。
Next, in step S24, the
次いで、ステップS28では、シンボリック実行部12が、プログラムの次命令が存在しないか否かを判断するが、プログラムには、次命令が存在しているので、ステップS12に再度戻る。
Next, in step S28, the
ステップS12に戻ると、シンボリック実行部12は、スタブ化前プログラム内の次命令iを読み出す。ここでは、シンボリック実行部12は、図4(a)のテスト対象関数main2の下側のfunc1(else-if側のfunc1(a))を読み出したものとする。
Returning to step S12, the
次いで、ステップS14では、スタブ化対象記述検出部14が、シンボリック実行部12から受信した命令i(func1)がスタブ化対象記述DB40に含まれるか否かを判断する。ここで、func1は、スタブ化対象記述DB40に含まれているため、ステップS14の判断は肯定され、ステップS16に移行する。
Next, in step S14, the stubification target
ステップS16に移行すると、具体値入力生成部16が、パス条件c(a!=0)を充足する具体値入力を生成する。ここでは、一例として、図7(a)に示すように、具体値(変数値)として、パス条件c(a!=0)を充足するa=1が生成されたものとする。
At step S16, the specific value
次いで、ステップS18では、スタブ生成部18が、具体値入力を用いて、処理部30において命令iまでスタブ化前プログラムを実行する。この場合、図5(b)に示すように、処理部30では、func1(a)=func1(1)=trueという返却値が得られるので、処理部30は、この返却値(true)をスタブ生成部18に戻す。
Next, in step S18, the
次いで、ステップS20では、スタブ生成部18が、処理部30による命令iの返却値(評価値)に基づいてスタブを生成する。この場合、スタブ生成部18は、図8において太線枠で示すようなスタブ関数を生成する。次いで、ステップS22では、スタブ挿入部20が、生成されたスタブをプログラムに挿入し、該プログラムをシンボリック実行部12に送信する。
Next, in step S20, the
次いで、ステップS24では、シンボリック実行部12が、スタブ挿入後のプログラムを命令iまでシンボリック実行し、パス条件cを更新する。ここで、シンボリック実行部12は、図8において下線を付して示すelse-if側の分岐内記述(print(“positive”))をシンボリック実行する。なお、この段階では、パス条件cは更新されずに、ステップS28に移行する。
Next, in step S24, the
なお、パス条件cがa!=0の場合、例えば、具体値入力をa=−1とすることもできる(S16)。このようにした場合、処理部30からの返却値はfalseとなるので、シンボリック実行部12は、else-else側の分岐内記述(print(“negative”))を実行することになる(S24)。
When the pass condition c is a! = 0, for example, the specific value input can be a = −1 (S16). In this case, since the return value from the
次いで、ステップS28では、シンボリック実行部12が、プログラムの次命令が存在しないか否かを判断するが、プログラムには、次命令が存在していないので、ステップS30に移行する。
Next, in step S28, the
ステップS30に移行した場合、シンボリック実行部12は、スタブ化後プログラムを出力する。
When the process proceeds to step S30, the
ここで、本実施形態では、図9(a)において×印で示すように、スタブ化前に実行し得ない記述であるif-if側の分岐内記述が実行されることがなく、スタブ化前に実行可能な記述のみが実行されるようになっている。これにより、テスト結果において一定の信頼性を確保することができるようになる。なお、比較例としては、予めfunc1に対しては、trueなどの定数を返却するスタブを生成する技術がある。このような比較例では、func1に対してはtrueが返却されると、スタブ化前に実行し得ない記述であるif-if側の分岐内記述(図9(a)において×印で示す記述)が実行されてしまうため、テスト結果において信頼性が低くなるおそれがある。
Here, in the present embodiment, as indicated by a cross in FIG. 9A, the in-branch description on the if-if side, which is a description that can not be executed before stubbing, is not executed, and stubbing is performed. Only previously executable descriptions are to be executed. This makes it possible to ensure a certain level of reliability in the test results. As a comparative example, there is a technique of generating a stub that returns a constant such as true for func1 in advance. In such a comparative example, if “true” is returned for “
また、本実施形態では、スタブ化対象記述の処理及び返却値の決定処理を一般的な処理系である処理部30が実行するため、シンボリック実行部(シンボリック実行エンジン)が解析対象とできない記述も解析することが可能となる。この結果、図9(b)に太線及び白抜きの線にて示すように、関数func1の記述を解析できずに、解析が停止してしまうのを防止することができる。なお、図9(b)のように解析が停止した場合、解析を継続するためには、func1のスタブを手動で記述する必要があるが、本実施形態では、このような人手の介入が不要である。
Further, in the present embodiment, since the
以上、詳細に説明したように、本実施形態によると、スタブ化対象記述検出部14がシンボリック実行によるテスト対象のプログラムに含まれるスタブ化対象記述を検出し(S14:肯定)、具体値入力生成部16が、スタブ化対象記述が実行される際のパス条件を充足する変数値を生成し(S16)、スタブ生成部18が、生成された変数値を用いてスタブ化対象記述を処理部30に実行させ、処理部30からの返却値に基づいてスタブを生成し(S18、S20)、スタブ挿入部20が、スタブ化対象記述を生成されたスタブで置換する(プログラムにスタブを挿入する)(S22)。これにより、プログラム実行時のパス条件を考慮したスタブが生成されるので、スタブ化前プログラムで実行可能な記述のみが実行され、スタブ化前プログラムでは実行され得ない記述が実行されるのを防止することができる。これにより、テスト結果の信頼性の低下を抑制することが可能である。また、処理部30にスタブ化対象記述を実行させ、スタブを自動生成し、スタブ化後のプログラムをシンボリック実行部12がシンボリック実行するため、シンボリック実行部12による解析が停止することがなくなる。これにより、人手によるスタブの記述の手間を省くことが可能となる。
As described above in detail, according to the present embodiment, the stub target
また、本実施形態では、スタブ化対象記述検出部14は、スタブ化する必要のある記述(スタブ化対象記述)を格納したスタブ化対象記述DB40に基づいて、プログラム中の記述がスタブ化対象記述であるかを判断する。これにより、簡易に、スタブ化対象記述であるかどうかの判断を行うことができる。
Further, in the present embodiment, the stubbed object
なお、上記実施形態では、情報処理装置10が処理部30を有する場合について説明したが、これに限らず、情報処理装置10とネットワーク等により接続された外部の装置が処理部30と同等の機能を有していてもよい。
Although the above embodiment describes the case where the information processing apparatus 10 includes the
なお、上記の処理機能は、コンピュータによって実現することができる。その場合、処理装置が有すべき機能の処理内容を記述したプログラムが提供される。そのプログラムをコンピュータで実行することにより、上記処理機能がコンピュータ上で実現される。処理内容を記述したプログラムは、コンピュータで読み取り可能な記録媒体(ただし、搬送波は除く)に記録しておくことができる。 The above processing functions can be realized by a computer. In that case, a program is provided which describes the processing content of the function that the processing device should have. The above processing functions are realized on the computer by executing the program on the computer. The program in which the processing content is described can be recorded on a computer readable recording medium (except for the carrier wave).
プログラムを流通させる場合には、例えば、そのプログラムが記録されたDVD(Digital Versatile Disc)、CD−ROM(Compact Disc Read Only Memory)などの可搬型記録媒体の形態で販売される。また、プログラムをサーバコンピュータの記憶装置に格納しておき、ネットワークを介して、サーバコンピュータから他のコンピュータにそのプログラムを転送することもできる。 In the case of distributing the program, for example, the program is sold in the form of a portable recording medium such as a DVD (Digital Versatile Disc), a CD-ROM (Compact Disc Read Only Memory) or the like in which the program is recorded. Alternatively, the program may be stored in the storage device of the server computer, and the program may be transferred from the server computer to another computer via a network.
プログラムを実行するコンピュータは、例えば、可搬型記録媒体に記録されたプログラムもしくはサーバコンピュータから転送されたプログラムを、自己の記憶装置に格納する。そして、コンピュータは、自己の記憶装置からプログラムを読み取り、プログラムに従った処理を実行する。なお、コンピュータは、可搬型記録媒体から直接プログラムを読み取り、そのプログラムに従った処理を実行することもできる。また、コンピュータは、サーバコンピュータからプログラムが転送されるごとに、逐次、受け取ったプログラムに従った処理を実行することもできる。 The computer executing the program stores, for example, the program recorded on the portable recording medium or the program transferred from the server computer in its own storage device. Then, the computer reads the program from its storage device and executes processing according to the program. The computer can also read the program directly from the portable recording medium and execute processing in accordance with the program. The computer can also execute processing in accordance with the received program each time the program is transferred from the server computer.
上述した実施形態は本発明の好適な実施の例である。但し、これに限定されるものではなく、本発明の要旨を逸脱しない範囲内において種々変形実施可能である。 The embodiments described above are examples of preferred implementations of the invention. However, the present invention is not limited to this, and various modifications can be made without departing from the scope of the present invention.
なお、以上の実施形態の説明に関して、更に以下の付記を開示する。
(付記1) シンボリック実行によるテスト対象のプログラムに含まれるスタブ化対象の記述を検出し、
検出された前記スタブ化対象の記述が実行される際のパス条件を充足する変数値を設定し、
設定された前記変数値を用いて前記スタブ化対象の記述を情報処理部に実行させ、該情報処理部からの返却値に基づいてスタブを生成し、
前記テスト対象のプログラムの前記スタブ化対象の記述を前記スタブで置換する、処理をコンピュータが実行するスタブ化方法。
(付記2) 前記検出する処理では、スタブ化する必要のある記述を格納した格納部に基づいて、前記テスト対象のプログラムの中から前記スタブ化対象の記述を検出することを特徴とする付記1に記載のスタブ化方法。
(付記3) シンボリック実行によるテスト対象のプログラムに含まれるスタブ化対象の記述を検出し、
検出された前記スタブ化対象の記述が実行される際のパス条件を充足する変数値を設定し、
設定された前記変数値を用いて前記スタブ化対象の記述を情報処理部に実行させ、該情報処理部からの返却値に基づいてスタブを生成し、
前記テスト対象のプログラムの前記スタブ化対象の記述を前記スタブで置換する、処理をコンピュータに実行させるスタブ化プログラム。
(付記4) 前記検出する処理では、スタブ化する必要のある記述を格納した格納部に基づいて、前記テスト対象のプログラムの中から前記スタブ化対象の記述を検出することを特徴とする付記3に記載のスタブ化プログラム。
(付記5) シンボリック実行によるテスト対象のプログラムに含まれるスタブ化対象の記述を検出する検出部と、
前記検出部が検出した前記スタブ化対象の記述が実行される際のパス条件を充足する変数値を設定する設定部と、
前記設定部が設定した前記変数値を用いて前記スタブ化対象の記述を情報処理部に実行させ、該情報処理部からの返却値に基づいてスタブを生成する生成部と、
前記テスト対象のプログラムの前記スタブ化対象の記述を前記スタブで置換する置換部と、を備えるスタブ化装置。
(付記6) スタブ化する必要のある記述を格納した格納部を更に備え、
前記検出部は、前記格納部に基づいて、前記テスト対象のプログラムの中から前記スタブ化対象の記述を検出することを特徴とする付記5に記載のスタブ化装置。
In addition, the following additional remarks are disclosed regarding description of the above embodiment.
(Supplementary note 1) Detect the description of stubbed target included in the program to be tested by symbolic execution,
Set a variable value that satisfies the path condition when the detected description of stub object is executed,
Causing the information processing unit to execute the description of the stub target using the set variable value, and generating a stub based on a return value from the information processing unit;
A stubbing method in which a computer executes processing for replacing the stubbed description of the program to be tested with the stub.
(Supplementary Note 2) In the detection process, the description of the stub target is detected from the program to be tested based on the storage unit storing the description that needs to be stubbed. The stubbing method described in.
(Supplementary note 3) Detect the description of stubbed target included in the program to be tested by symbolic execution,
Set a variable value that satisfies the path condition when the detected description of stub object is executed,
Causing the information processing unit to execute the description of the stub target using the set variable value, and generating a stub based on a return value from the information processing unit;
A stubbed program that causes a computer to execute processing for replacing the stubbed description of the program to be tested with the stub.
(Supplementary Note 4) In the detection process, the description of the stub target is detected from the program to be tested based on the storage unit storing the description that needs to be stubbed. The stubbed program described in.
(Supplementary Note 5) A detection unit that detects a description of a stub target included in a program to be tested by symbolic execution;
A setting unit configured to set a variable value that satisfies a path condition when the description of the stub target detected by the detection unit is executed;
A generation unit that causes the information processing unit to execute the description of the stub target using the variable value set by the setting unit, and generates a stub based on a return value from the information processing unit;
A replacing unit that replaces the description of the stub target of the program to be tested with the stub.
(Supplementary Note 6) A storage unit storing a description that needs to be stubbed is further provided,
The stub generation device according to claim 5, wherein the detection unit detects a description of the stub target from the program to be tested based on the storage unit.
10 情報処理装置(スタブ化装置)
14 スタブ化対象記述検出部(検出部)
16 具体値入力生成部(設定部)
18 スタブ生成部(生成部)
20 スタブ挿入部(置換部)
30 処理部(情報処理部)
40 スタブ化対象記述DB(格納部)
10 Information processing device (stub device)
14 Stubification target description detection unit (detection unit)
16 Specific value input generation unit (setting unit)
18 Stub generation unit (generation unit)
20 stub insertion part (replacement part)
30 processing unit (information processing unit)
40 Stubification target description DB (storage unit)
Claims (4)
検出された前記スタブ化対象の記述が実行される際のパス条件を充足する変数値を設定し、
設定された前記変数値を用いて前記スタブ化対象の記述を前記シンボリック実行エンジンが解析できない記述を解析できる情報処理部に実行させ、該情報処理部からの返却値に基づいてスタブを生成し、
前記テスト対象のプログラムの前記スタブ化対象の記述を前記スタブで置換する、処理をコンピュータが実行するスタブ化方法。 Detect a description of a stub target that can not be analyzed by the symbolic execution engine included in a program to be tested by the symbolic execution engine ,
Set a variable value that satisfies the path condition when the detected description of stub object is executed,
The information processing unit capable of analyzing the description that can not be analyzed by the symbolic execution engine is executed using the set variable value, and the stub is generated based on the return value from the information processing unit.
A stubbing method in which a computer executes processing for replacing the stubbed description of the program to be tested with the stub.
検出された前記スタブ化対象の記述が実行される際のパス条件を充足する変数値を設定し、
設定された前記変数値を用いて前記スタブ化対象の記述を前記シンボリック実行エンジンが解析できない記述を解析できる情報処理部に実行させ、該情報処理部からの返却値に基づいてスタブを生成し、
前記テスト対象のプログラムの前記スタブ化対象の記述を前記スタブで置換する、処理をコンピュータに実行させるスタブ化プログラム。 Detect a description of a stub target that can not be analyzed by the symbolic execution engine included in a program to be tested by the symbolic execution engine ,
Set a variable value that satisfies the path condition when the detected description of stub object is executed,
The information processing unit capable of analyzing the description that can not be analyzed by the symbolic execution engine is executed using the set variable value, and the stub is generated based on the return value from the information processing unit.
A stubbed program that causes a computer to execute processing for replacing the stubbed description of the program to be tested with the stub.
前記検出部が検出した前記スタブ化対象の記述が実行される際のパス条件を充足する変数値を設定する設定部と、
前記設定部が設定した前記変数値を用いて前記スタブ化対象の記述を前記シンボリック実行エンジンが解析できない記述を解析できる情報処理部に実行させ、該情報処理部からの返却値に基づいてスタブを生成する生成部と、
前記テスト対象のプログラムの前記スタブ化対象の記述を前記スタブで置換する置換部と、を備えるスタブ化装置。
A detection unit that detects a description of a stub target that can not be analyzed by the symbolic execution engine included in a program to be tested by the symbolic execution engine ;
A setting unit configured to set a variable value that satisfies a path condition when the description of the stub target detected by the detection unit is executed;
The information processing unit capable of analyzing the description that can not be analyzed by the symbolic execution engine is executed using the variable value set by the setting unit, and the stub is generated based on the return value from the information processing unit. A generation unit to generate
A replacing unit that replaces the description of the stub target of the program to be tested with the stub.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014252989A JP6503724B2 (en) | 2014-12-15 | 2014-12-15 | Stub method, program and apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014252989A JP6503724B2 (en) | 2014-12-15 | 2014-12-15 | Stub method, program and apparatus |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2016115124A JP2016115124A (en) | 2016-06-23 |
JP6503724B2 true JP6503724B2 (en) | 2019-04-24 |
Family
ID=56141958
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2014252989A Expired - Fee Related JP6503724B2 (en) | 2014-12-15 | 2014-12-15 | Stub method, program and apparatus |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6503724B2 (en) |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4957521B2 (en) * | 2007-11-22 | 2012-06-20 | 日本電気株式会社 | Software partial test system, method and program used therefor |
JPWO2013161195A1 (en) * | 2012-04-26 | 2015-12-21 | 日本電気株式会社 | Program unit test support device |
US9081892B2 (en) * | 2013-03-14 | 2015-07-14 | Fujitsu Limited | Software verification |
-
2014
- 2014-12-15 JP JP2014252989A patent/JP6503724B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2016115124A (en) | 2016-06-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9507943B1 (en) | Analysis tool for data security | |
US10545855B1 (en) | Software testing assurance through inconsistent treatment detection | |
US8370945B2 (en) | Identifying security breaches caused by web-enabled software applications | |
US9128723B2 (en) | Method and apparatus for dynamic document object model (DOM) aware code editing | |
US20170031800A1 (en) | Determining code complexity scores | |
US20130007887A1 (en) | Black-box testing of web applications with client-side code evaluation | |
US9471790B2 (en) | Remediation of security vulnerabilities in computer software | |
US8607193B2 (en) | Tracking stale comments in source code listings | |
US20150007330A1 (en) | Scoring security risks of web browser extensions | |
JP5110640B2 (en) | Accessibility information obtaining method, computer program, and accessibility information device | |
US20120192155A1 (en) | Code advisor for web compatibility and interoperability | |
US20180260308A1 (en) | Checking a computer processor design for soft error handling | |
US11797639B2 (en) | Systems and methods for development of web products | |
US10380313B1 (en) | Implementation and evaluation of designs for heterogeneous computing platforms with hardware acceleration | |
US20160112285A1 (en) | Apparatus and method for detecting abnormal connection | |
van Riet et al. | From 6.2 to 0.15 seconds–an industrial case study on mobile web performance | |
Ochin | Cross browser incompatibility: reasons and solutions | |
JP6503724B2 (en) | Stub method, program and apparatus | |
US20150082278A1 (en) | Clone detection method and clone function commonalizing method | |
US20140067854A1 (en) | Crawling of generated server-side content | |
US10127202B2 (en) | Detecting overlapping web elements in a graphical user interface | |
US20240202109A1 (en) | Test support apparatus, test support method, and program | |
US8397192B2 (en) | Proof based bounded model checking | |
US11354440B1 (en) | Analyzing and mitigating privacy issues on a computing device using cookie generation flows | |
US20150095304A1 (en) | Crawling computer-based objects |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20171113 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20180718 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20180731 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20180925 |
|
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: 20190226 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20190311 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6503724 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |