JP2023056111A - Software failure analytic device and software failure analytic method - Google Patents
Software failure analytic device and software failure analytic method Download PDFInfo
- Publication number
- JP2023056111A JP2023056111A JP2021165227A JP2021165227A JP2023056111A JP 2023056111 A JP2023056111 A JP 2023056111A JP 2021165227 A JP2021165227 A JP 2021165227A JP 2021165227 A JP2021165227 A JP 2021165227A JP 2023056111 A JP2023056111 A JP 2023056111A
- Authority
- JP
- Japan
- Prior art keywords
- software
- analysis
- satisfies
- test case
- function
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000004458 analytical method Methods 0.000 title claims description 107
- 238000012360 testing method Methods 0.000 claims abstract description 129
- 230000006870 function Effects 0.000 claims abstract description 76
- 238000012937 correction Methods 0.000 claims abstract description 26
- 230000007547 defect Effects 0.000 claims description 79
- 238000000034 method Methods 0.000 claims description 47
- 230000008439 repair process Effects 0.000 claims description 34
- 230000008569 process Effects 0.000 claims description 27
- 230000010365 information processing Effects 0.000 claims description 9
- 230000004048 modification Effects 0.000 claims description 3
- 238000012986 modification Methods 0.000 claims description 2
- 238000012545 processing Methods 0.000 abstract description 9
- 238000005516 engineering process Methods 0.000 description 3
- 230000007257 malfunction Effects 0.000 description 3
- 238000004519 manufacturing process Methods 0.000 description 3
- 230000003190 augmentative effect Effects 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 238000010187 selection method Methods 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000012913 prioritisation Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
Description
本発明は、ソフトウェア不具合分析装置及びソフトウェア不具合分析方法に関するものである。 The present invention relates to a software failure analysis device and a software failure analysis method.
ソフトウェアに含まれる不具合は、完全に事前排除する事が難しい。そのため、そうしたソフトウェアから如何に効率的に、また的確に不具合を特定し、これを取り除いて修正するか、様々な検討が進められている。
そうした不具合の検出手法としては、テストケースを用いるものが存在する。このテストケースは、仕様書で定めた或いは開発者が期待する入力及び出力(期待値)を記述したものである。
Defects included in software are difficult to completely eliminate in advance. Therefore, various studies are underway on how to efficiently and accurately identify defects in such software, remove them, and correct them.
As a method for detecting such defects, there is a method using a test case. This test case describes the inputs and outputs (expected values) defined in the specifications or expected by the developer.
不具合の検出に際しては、対象となるソフトウェアにテストケースを適用し、入力に対して正しい期待値を返すか確認する。ここで、入力に対して出力が期待値と異なる、或いはソフトウェア自体が動作停止するといった場合、当該ソフトウェアに不具合が含まれると判定される。 When detecting bugs, apply test cases to the target software and check whether the correct expected value is returned for the input. Here, if the output differs from the expected value for the input, or if the software itself stops operating, it is determined that the software contains a defect.
開発者は、上述の不具合の存在を認識すれば、当該不具合の存在箇所を解析し、適切な入出力を行うように当該ソフトウェアのロジックを修正する。しかし、大規模なソフトウェアであれば、必要となるテストケースも大量となり、手間とコストからしても現実的な手法とは言い難い。 When the developer recognizes the presence of the above-mentioned defect, the developer analyzes the location of the defect and modifies the logic of the software so that appropriate input/output is performed. However, large-scale software requires a large number of test cases, and it is difficult to say that this method is realistic in terms of time and effort and cost.
そこで、こうした不具合修正の自動化を指向する技術が提案されている。例えば、人間が生み出した1つ以上のテストオラクルとともに、自動生成された1つ以上のテストを用いて、ソフトウェアプログラムをインタラクティブに修復する方法(特許文献1参照)が提案されている。 Therefore, techniques have been proposed that aim at automating such defect correction. For example, a method has been proposed for interactively repairing a software program using one or more automatically generated tests together with one or more human-generated test oracles (see Patent Document 1).
この方法は、人間が生み出した1つ以上のテストオラクルを用いてソフトウェアプログラムをインタラクティブに修復する方法であって、ソフトウェアプログラム内の欠陥箇所を特定し、修復候補に基づき、前記欠陥箇所で、可能な修復を生成し、前記可能な修復をテストするよう第1テストを自動生成し、前記第1テストに基づき、第1テストオラクルのための第1クエリを生成し、前記第1クエリに対する応答を人間から取得し、前記第1クエリ及び該第1クエリに対する前記取得された応答に基づき、人間が提供した第1テストオラクルを生成し、拡張された第1テストを生成するよう、前記人間が提供した第1テストオラクルを前記第1テストに加え、前記拡張された第1テストを含むようテストスイートを増補し、前記増補されたテストスイートを用いて、前記可能な修復をテストするものである。 The method is a method of interactively repairing a software program using one or more human-generated test oracles to identify defects in the software program and, based on repair candidates, perform possible tests at the defects. automatically generating a first test to test the possible repair; generating a first query for a first test oracle based on the first test; generating a response to the first query; obtained from a human; generating a first human-provided test oracle based on the first query and the obtained response to the first query; and providing an extended first test. adding a first test oracle to the first test, augmenting a test suite to include the expanded first test, and using the augmented test suite to test the possible repair.
また、自動化されたソフトウェアプログラム修復候補の選択のための方法(特許文献2参照)なども提案されている。 A method for automated software program repair candidate selection (see Patent Document 2) has also been proposed.
この方法は、テストスイートを用いてテスト済みのソフトウェアプログラムにおいて欠陥の欠陥位置を特定し、前記欠陥のための修復候補を取得し、前記修復候補の修復コードパターンを取得し、複数の既存のソフトウェアプログラムの既存のコードにおける前記修復コードパターンの発生回数を決定し、前記修復コードパターンの前記発生回数に基づき、前記修復候補を、前記テスト済みソフトウェアプログラムの修復として優先順位付けし、前記修復候補の前記優先順位付けに従って、前記テスト済みソフトウェアプログラムに
対して修復動作を実行するものである。
The method locates a defect in a software program that has been tested using a test suite, obtains a repair candidate for the defect, obtains a repair code pattern for the repair candidate, obtains a repair code pattern for the repair candidate, and performs a plurality of existing software programs. determining a number of occurrences of the repair code pattern in existing code of a program; prioritizing the repair candidate as a repair of the tested software program based on the number of occurrences of the repair code pattern; A repair action is performed on the tested software program according to the prioritization.
また他にも、テストスイートを使用して、ソフトウェアプログラム内のフォールトのフォールト位置を特定するステップと、前記ソフトウェアプログラムにおいて、前記フォールトに対して修復候補を実装するステップと、前記ソフトウェアプログラムの観測された挙動に基づく複数のテストオラクルであって、前記フォールト位置に対応する複数のテストオラクルを用いて、前記テストスイートを拡張するステップと、前記の実装された修復候補を有する前記ソフトウェアプログラムに対して、前記の拡張されたテストスイートを実行するステップと、前記の拡張されたテストスイートを実行したことに対する前記複数のテストオラクルの失敗率に基づいて、前記ソフトウェアプログラムの修復として、前記修復候補を優先順位付けするステップを含む方法(特許文献3参照)なども提案されている。 Still other steps include using a test suite to identify fault locations for faults in a software program; implementing repair candidates for the faults in the software program; extending the test suite with a plurality of test oracles based on the behavior based on the fault location, the test oracles corresponding to the fault locations; , executing the expanded test suite; and prioritizing the repair candidate as a repair of the software program based on failure rates of the plurality of test oracles for executing the expanded test suite. A method including a ranking step has also been proposed (see Patent Document 3).
ところが従来技術においては、テストケース(テストスイート)が充分かどうか、人間(
開発者)が判断しており、結局のところ相応の工数が必要となる。対象となるソフトウェ
アの規模が大きくなるほど、この工数は増大し、無視できないコストにつながりうる。
また、そうした開発者の判断について、その妥当性を評価することが困難という問題もある。つまり、多大な工数をかけて行う判断であっても、その妥当性が確かなものでなければ、不十分なテストケースに基づく自動修正の精度自体も期待出来ないこととなる。
However, in the conventional technology, it is difficult for humans (
The developer) decides, and in the end, a reasonable amount of man-hours is required. As the scale of the target software increases, this man-hour increases, which can lead to non-negligible costs.
Another problem is that it is difficult to evaluate the appropriateness of such developer's judgment. In other words, even if a decision is made by spending a lot of man-hours, if the validity is not certain, the accuracy of the automatic correction itself based on insufficient test cases cannot be expected.
そこで本発明の目的は、ソフトウェアの不具合自動修正に必要なテストケースの効率的な確保及び修正支援を可能とする技術を提供することにある。 SUMMARY OF THE INVENTION Accordingly, it is an object of the present invention to provide a technique that enables efficient securing of test cases necessary for automatic correction of software defects and correction support.
上記課題を解決する本発明のソフトウェア不具合分析装置は、ソフトウェアのテストケースと、前記テストケースの適用関数における不具合の発生制約に関する情報とを保持する記憶装置と、前記テストケースのうち前記不具合の発生制約を満たすものを判定する処理と、前記判定の結果、前記発生制約を満たすテストケースについて、その期待値の修正要求の通知を出力する処理を実行する演算装置を含むことを特徴とする。
また、本発明のソフトウェア不具合分析方法は、情報処理装置が、ソフトウェアのテストケースと、前記テストケースの適用関数における不具合の発生制約に関する情報とを記憶装置にて保持し、前記テストケースのうち前記不具合の発生制約を満たすものを判定する処理と、前記判定の結果、前記発生制約を満たすテストケースについて、その期待値の修正要求の通知を出力する処理を実行する、ことを特徴とする。
A software failure analysis apparatus of the present invention for solving the above problems comprises a storage device for holding software test cases and information about failure occurrence constraints in application functions of the test cases; It is characterized by including an arithmetic unit that executes a process of judging what satisfies a constraint, and a process of outputting a notification of a correction request for an expected value for a test case that satisfies the generation constraint as a result of the judgment.
Further, in the software defect analysis method of the present invention, the information processing device holds, in a storage device, software test cases and information related to defect occurrence constraints in application functions of the test cases, and among the test cases, the The method is characterized by executing a process of judging a test case that satisfies a defect occurrence constraint and, as a result of the judgment, a process of outputting a notification requesting correction of the expected value of the test case that satisfies the occurrence constraint.
本発明によれば、ソフトウェアの不具合自動修正に必要なテストケースの効率的な確保及び修正支援が可能となる。 According to the present invention, it is possible to efficiently secure test cases necessary for automatic correction of software defects and support correction.
<概要>
図1で例示するように、本実施形態におけるソフトウェア不具合分析装置100は、いわゆるログベースAPR(Automatic Program Repair)の技術を用いて、ソフトウェアの実行ログ(不具合に関するログが含まれる)から当該不具合が発生する制約条件を求める一方、既存のテストケースを分析し、不具合修正に必要なテストケースの追加や修正を実施する。
<Overview>
As exemplified in FIG. 1, the software
また、ソフトウェア不具合分析装置は100、こうして追加、修正がされたテストケースを用いて、いわゆるテストベースAPR(Automatic Program Repair)を実施し、修正ソースコードを得るものである。
Also, the software
ここで、ソフトウェア不具合分析装置100の入力には、図2で示すように、ソフトウェア11のソースコード12と、ソフトウェア11の実行ログ13とが含まれる。実行ログ13には、実行中に呼び出された関数(メソッド)が含まれている。実行中に例外(例えば0徐算)が発生すると、実行ログ13は例外が発生した関数の呼び出し、および例外が発生したステートメント(ソースコードの行/ステップ)と発生した例外の種類で終わっている(プログラム停止を記録している)。
Here, the input of the software
ソフトウェア不具合分析装置100は、上述の実行ログ13から、例外が発生した関数のなかの徐算演算を含むソフトウェア11のステートメント(ソースコードの行/ステップ)を解析開始点と設定する。また、利用者(開発者)に問い合わせて、解析開始点を含む関数を直接または間接に呼び出す関数を、解析終了点と設定する。
The software
ソフトウェア不具合分析装置100は、上述の解析開始点から解析終了点まで、通常のソフトウェア実行とは逆方向の逆向き記号実行を行う。逆向き記号実行の間は、ソフトウェア不具合分析装置100は、実行パスとパス条件を記録する。
The software
実行パスは、解析終了点と解析開始点とを結ぶソフトウェア中のパス(ステートメント/行/ステップの並び)であり、実行パスに沿って処理が進む。実行パスは、関数の呼び出しも含む。パス条件は、例外(例えば0徐算)が発生する変数の条件、すなわち不具合の発生制約である。上述の変数には、関数内のローカル変数や関数の入力パラメータが含まれる。 An execution path is a path (a sequence of statements/lines/steps) in software that connects an analysis end point and an analysis start point, and processing proceeds along the execution path. The execution path also includes function calls. A path condition is a variable condition that causes an exception (for example, division by 0), that is, a defect occurrence constraint. The variables mentioned above include local variables within the function and input parameters of the function.
ソフトウェア不具合分析装置100は、上述のように特定した不具合の発生制約に関する情報と、上述のソフトウェア11の関数に関して予め用意しているテストケース20とに基づいて、テストケース20のうち不具合の発生制約を満たすものを判定する。
The software
また、ソフトウェア不具合分析装置100は、この判定の結果、上述の不具合の発生制約を満たすテストケースについて、当該期待値の修正要求の通知をユーザ端末200に出力し、当該テストケースの修正を開発者等に行わせる。
Further, as a result of this determination, the software
また、ソフトウェア不具合分析装置100は、上述の記判定の結果、不具合の発生制約
を満たすテストケースが無かった場合、当該発生制約に関する情報に基づき、当該発生制約を満たす入力を規定したテストケースを生成し、また、こうした入力に対する期待値の設定要求の通知をユーザ端末200に出力する。これを受けた開発者等は、当該テストケースの期待値についてユーザ端末200を通じて設定し、当該テストケースを完成させる。
If, as a result of the determination described above, there is no test case that satisfies the defect occurrence constraint, the software
なお、ソフトウェア不具合分析装置100は、SMTソルバ(Satisfiability Modulo Theories Solver)111を用いてパス条件を満足する解析終了点である関数の入力パラ
メータ値を算出する。この値を入力とするテストを行うことで、不具合を修正したソフトウェア11が正しく動作するかを確認できるようになる。SMTソルバに替えてSATソルバ(SATisfiability Solver)などの他の種類のソルバを用いても良い。
The software
また、ソフトウェアにおける不具合の修正は、既知の技術のうち、例えば、テストベースAPR(Automatic Program Repair)の技術を採用する。 In addition, for correction of defects in software, among known techniques, for example, a test-based APR (Automatic Program Repair) technique is adopted.
この技術において、ソフトウェア不具合分析装置100は、不具合修正対象となるソースコードにおける不具合を修正すべく、例えば、修復用のテンプレートと、上述のように修正、追加等を行ったテストケース20とに基づいた所定の修正処理を実行する。
In this technology, the software
上述のテンプレートは、これを実行することで、ソースコード12の不具合の存在に応じて当該ソースコード12を変更する命令等を含むものである。一方、テストケース20は、ソースコード12が仕様や開発者の指定どおりの挙動(例:所定の入力に対する期待値の出力)を示すか判定するものである。
<ソフトウェア不具合分析装置の入力>
ソフトウェア不具合分析装置100の入力には、ソースコード12、実行ログ13、およびソフトウェア仕様14が含まれる。
The template described above contains instructions and the like for changing the
<Input for software failure analyzer>
Inputs to the
ソースコード12は、分析対象であるソフトウェア11を構成する関数(メソッド)のソースコードである。ソフトウェア仕様14には、関数の名前、および、関数の入力パラメータ値と返り値(戻り値)の名前と型と範囲とが記述されている。
The
実行ログ13は、ソフトウェア11の実行中の関数呼び出しの記録を含む。実行ログ13には、呼び出された関数の名前(識別情報)の他に呼び出し時の入力パラメータ値や、呼び出しから戻るときの返り値を含んでもよい。
実行ログ13は、さらにソフトウェア11の実行中に発生した例外を含んでもよい。例外としては、0徐算やソフトウェア仕様14に記述された入力パラメータ値または返り値の違反(仕様の範囲外の値)がある。
<ソフトウェア不具合分析装置の出力>
ソフトウェア不具合分析装置100の出力には、実行パス21、入力パラメータ値22、及びテストケース20が含まれる。実行パス21は、不具合が発生するソフトウェア中のパス(ソースコード12のなかで順次処理される一連のステートメント/行/ステップ)である。
<Output of software failure analyzer>
実行パス21の一端は、不具合に係る例外(故障)が発生するステートメント/行/ステップであり、解析開始点、または単に開始点と記す。解析開始点は、例えば0徐算が発生する徐算演算を含むステートメントである。
One end of the
実行パス21の他端は、解析開始点を含む関数を直接または間接に呼び出す関数であり、解析終了点、またはエントリポイントと記す。解析終了点は、開始点を含む関数であっ
てもよい。
The other end of the
入力パラメータ値22は、エントリポイントとなる関数の、不具合が発生するときの入力パラメータ値である。
The
テストケース20は、ソースコード12の関数に関して予め用意しておいたテストケースであるが、本実施形態のソフトウェア不具合分析装置100により、適宜に修正や追加がなされたものとなる。
<ソフトウェア不具合分析装置の構成>
図2に示すソフトウェア不具合分析装置100は、例えば、ソフトウェア11のテスト環境10において配置された情報処理装置であって、当該ソフトウェア11の不具合自動修正に必要なテストケースの効率的な確保及び修正支援を可能とする。ここでは、上述のソフトウェア11がソースコード12で構成されているものとする。
The
<Configuration of software failure analysis device>
The software
ソフトウェア不具合分析装置100は、自身でユーザインターフェイスを実装するケースの他、適宜なネットワークを介して接続するユーザ端末200をユーザインターフェイスとして利用するとしてもよい。
The software
この場合、ユーザ端末200は、ソフトウェア1の開発者等が操作する端末装置となる。このユーザ端末200は、具体的には、パーソナルコンピュータ、スマートフォン、タブレット端末、などを想定できる。
In this case, the user terminal 200 is a terminal device operated by the developer of the
なお、ソフトウェア不具合分析装置100と、上述のユーザ端末200を総称してソフトウェア不具合分析システムとしてもよい。
Note that the software
このうち記憶装置101は、SSD(Solid State Drive)やハードディスクドライブなど適宜な不揮発性記憶素子で構成される。
Among them, the
また、メモリ103は、RAMなど揮発性記憶素子で構成される。
Also, the
また、演算装置104は、記憶装置101に保持されるプログラム102をメモリ103に読み出すなどして実行し装置自体の統括制御を行なうとともに各種判定、演算及び制御処理を行なうCPUである。
また、入出力装置105は、開発者等からのキー入力や音声入力を受け付け、また、処理データの表示を行う装置である。或いは、適宜なネットワークと接続してユーザ端末200との通信処理を担うネットワークインターフェイスカードも想定できる。
Also, the input/
また、記憶装置101内には、本実施形態のソフトウェア不具合分析装置100として必要な機能を実装する為のプログラム102に加えて、上述のソフトウェア11のソースコード12、当該ソフトウェア11の実行ログ13、ソフトウェア仕様14、関数呼び出し関係DB15、及びテストケース20が少なくとも記憶されている。
Further, in the
なお、関数呼び出し関係DB15には、どの関数がどの関数を呼び出すかの関係、換言すれば、呼び出し関係グラフ(関数間の呼び出し関係を表現する制御フローのグラフ)を示すデータが記憶される。
The function
また、プログラム102は、記号実行エンジン110及びSMTソルバ111を少なくとも含むものとする。
Also, the
演算装置104がプログラム102を実行することで、ソースコード12から関数の呼び出し関係を取得して、関数呼び出し関係DB15に格納する機能と、実行ログ13を解析して解析開始点を取得する機能と、解析開始点を含む関数を呼び出す関数を関数呼び出し関係DB15から取得して、エントリポイントの候補として入出力装置105またはユーザ端末200に備わるディスプレイに表示する機能と、表示させたエントリポイントの候補すなわち関数に関してユーザ(開発者)が選択したものを、解析終了点(エントリポイント)として設定する機能と、ここまでの処理で得ている不具合の発生制約の情報と、記憶装置101で保持するテストケース20とに基づいて、テストケース20のうち不具合の発生制約を満たすものを判定する機能と、この判定の結果、不具合の発生制約を満たすテストケースについて、当該期待値の修正要求の通知を入出力装置105やユーザ端末200に出力する機能と、上述の判定の結果、不具合の発生制約を満たすテストケースが無かった場合、当該発生制約に関する情報に基づき、当該発生制約を満たす入力を規定したテストケースを生成し、上述の入力に対する期待値の設定要求の通知を入出力装置105やユーザ端末200に出力する機能と、上述の処理を経たテストケース20を使用して、ソフトウェア11における不具合発生位置を特定する機能と、当該不具合に対して修復用のテンプレート及びテストケース20に基づいて修復候補を生成する機能が実装される。
By executing the
なお、記号実行エンジン110は、実行パス21およびパス条件を生成する(例:特願2020-143591参照)。パス条件は、分析対象のソフトウェアの実行が実行パス21を通るための変数(ローカル変数や入力パラメータ)の条件である。なお、以下の文献に記号実行エンジンンの詳細が記述されている: Peter Dinges and Gul Agha, "Targeted Test Input Generation Using Symbolic Concrete Backward Execution"。
The
また、SMTソルバ111(ソルバ)は、パス条件を満たす入力パラメータ値22生成する。以下の文献にSMTソルバが記述されている: Leonardo de Moura and Nikolaj Bjorner, "Z3: An Efficient SMT Solver"。
<不具合の発生制約例>
ソフトウェア11のソースコード12に関する、不具合の発生制約の例について、図3にて示す。ここで示す例では、関数「Percentage」で0割りの不具合が発生したことが実行ログ13にて判明した状況に対応したものである。
Also, the SMT solver 111 (solver) generates an
<Example of restrictions on the occurrence of defects>
FIG. 3 shows an example of defect occurrence restrictions regarding the
そこで、関数「Percentage」を起点に、上述のログベースでの不具合解析を実行すると、の不具合箇所に到達する実行パスとパス条件すなわち発生制約が3通り求まったとする。 Therefore, when the above log-based failure analysis is executed starting from the function "Percentage", it is assumed that three execution paths and path conditions, that is, occurrence constraints to reach the failure location are obtained.
この場合、ソフトウェア不具合分析装置100は、実行ログ13を解析することで、関数「Percentage」の行10が、徐算演算を含むステートメント/行であるから、開始点を関数「Percentage」の行10に設定する。
In this case, the software
パス条件は、例外が発生する条件/制約である。解析開始点である関数「Percentage」の行10におけるパス条件は「max=0」である。
A path condition is a condition/constraint under which an exception occurs. The path condition in
記号実行エンジン110は、開始点から始めて、通常の(前向き)実行とは反対の方向にソースコード12のなかを、エントリポイントに到達するまで探索(逆向き記号実行とも記す)する。エントリポイントが複数ある場合には、記号実行エンジン110は、何れか1つのエントリポイントに到達するまで探索する。
Beginning at a starting point, the
また、記号実行エンジン110は、関数「Percentage」を呼び出すステートメントを探索する。図3の場合、関数「Percentage」を呼び出すステートメン
トは、関数「abs max」であり、記号実行エンジン110は、当該行から探索を継続し、解析終了点までで探索を終了する。ここまでの時点で判明した実行パスとパス条件(エントリポイント(解析終了点)の入力パラメータ値の条件を含んでいる)が、不具合の発生制約となる。なお、SMTソルバ111は、上述のパス条件を解いて、エントリポイントである関数の、パス条件を満たす入力パラメータ値22を算出する。
The
こうした発生制約の特定を、ソースコード12に関して実行した結果、図3~図5に例示する。なお、ここで例示する制約はint型が32ビット符号付き整数である環境を仮定しており、実際の値は実行環境により異なる。図3で示す発生制約は、¬(A>B)∩¬(B>0)∩(B-A=0)、入力パラメータ値は、(a,b)=(0,0)となった。
The results of identifying these generation constraints performed on the
また、図4で示す発生制約は、¬(0<A)∩¬(0-A<0)∩(B=0)、入力パラメータ値は、(a,b)=(-2147483648,0)となった。 In addition, the generation constraint shown in FIG. became.
また、図5で示す発生制約は、¬(0>B)∩¬(0>0-B)∩(A=0)、入力パラメータ値は、(a,b)=(0,-2147483648)となった。
<ソフトウェア不具合分析処理>
続いて、本実施形態の本実施形態のソフトウェア不具合分析方法のフロー例について、図6に基づき説明する。まず、ソフトウェア不具合分析装置100は、ソースコード12に関する実行ログ13に基づき、不具合の発生パス(実行パス)毎の不具合の発生制約を、既に述べたようにログベースAPRの技術により取得する(s1)。
In addition, the generation constraint shown in FIG. became.
<Software defect analysis processing>
Next, an example flow of the software failure analysis method of this embodiment will be described with reference to FIG. First, the software
続いて、ソフトウェア不具合分析装置100は、上述の不具合の発生箇所たる対象関数のテストケース20を記憶装置101から取得する(s2)。
Subsequently, the software
また、ソフトウェア不具合分析装置100は、当該対象関数に関してs1で得ている発生制約を一つ選択する(s3)。この選択方法に関して特に限定しない。
Also, the software
また、ソフトウェア不具合分析装置100は、s2で取得しているテストケースのうち一つを選択する(s4)。この選択方法に関して特に限定しない。
Also, the software
ここで、ソフトウェア不具合分析装置100は、s4で選択したテストケースの入力値は、s3で選択した発生制約を満たすか判定する(s5)。具体的には、図7で示すように、不具合の発生制約C1~C3と、関数「abs max」に関するテストケース20のケースT1~T4をそれぞれ比較することとなる。この場合の比較は、関数「abs max」のテストケースそれぞれの入力値と期待値の関係を、不具合の発生制約それぞれが満たすか検証する動作となる。
Here, the software
s5の判定の結果、上述の発生制約を満たすテストケースが特定できた場合(s5:Yes)、ソフトウェア不具合分析装置100は、当該テストケースを要修正テストケースとして記録する(s6)。
As a result of the determination in s5, if a test case that satisfies the occurrence constraint described above can be identified (s5: Yes), the software
この場合、図8の出力例に示すように、テストケースT1に関して、発生制約C1が条件を満たすと判定されたため(不具合が発生する、修正が必要なテストケースと判明)、ソフトウェア不具合分析装置100は、s6において、テストケースT1の出力すなわち期待値の修正を開発者に要求する通知を、入出力装置105またはユーザ端末200に出力する。
In this case, as shown in the output example of FIG. 8, it is determined that the occurrence constraint C1 satisfies the conditions for the test case T1 (it is determined that the test case causes a defect and requires correction), so the software
一方、開発者は、入出力装置105ないしユーザ端末200を操作し、テストケースT
1の期待値について入力する。ソフトウェア不具合分析装置100は、この入力を受けてテストケースT1の修正を完了する。
On the other hand, the developer operates the input/
Input about the expected value of 1. Software
一方、上述の判定の結果、発生制約を満たすテストケースが特定できなかった場合(s5:No)、ソフトウェア不具合分析装置100は、s2で得ているテストケースのうち残りのテストケース(すなわち未処理のもの)があるか判定する(s7)。
On the other hand, as a result of the determination described above, if a test case satisfying the generation constraint could not be specified (s5: No), the software
この判定の結果、残りのテストケースが存在することが判明した場合(s7:Yes)、ソフトウェア不具合分析装置100は処理をs4に戻す。
As a result of this determination, if it is found that there are remaining test cases (s7: Yes), the software
一方、上述の判定の結果、残りのテストケースが存在しないことが判明した場合(s7:No)、ソフトウェア不具合分析装置100は、当該不具合の発生制約を満たすテストケースが1個以上存在したか判定する(s8)。
On the other hand, if it is determined that there are no remaining test cases as a result of the above determination (s7: No), the software
この判定の結果、不具合の発生制約を満たすテストケースが存在しないことが判明した場合(s8:No)、ソフトウェア不具合分析装置100は、図8で例示するように、当該不具合の発生制約C2、C3を満たす入力パラメータ値を入力としたテストケースT5、T6を追加する(s9)。
As a result of this determination, if it is found that there is no test case that satisfies the defect occurrence constraint (s8: No), the software
この場合、ソフトウェア不具合分析装置100は、s9において、ここで追加したテストケースT5、T6に関して、関数「abs max」の期待値の設定要求を、入出力装置105またはユーザ端末200に出力する。
In this case, the software
一方、開発者は、入出力装置105ないしユーザ端末200を操作し、テストケースT5、T6の各期待値について入力する。ソフトウェア不具合分析装置100は、この入力を受けてテストケースT5、T6の追加を完了する。
On the other hand, the developer operates the input/
一方、上述の判定の結果、 当該不具合の発生制約を満たすテストケースが1個以上存在したことが判明した場合(s8:Yes)、ソフトウェア不具合分析装置100は、s1で取得している不具合の発生制約のうち未処理である、残りの発生制約があるか判定する(s10)。
On the other hand, as a result of the determination described above, if it is found that there is one or more test cases that satisfy the defect occurrence constraint (s8: Yes), the software
この判定の結果、残りの発生制約が存在する場合(s10:Yes)、ソフトウェア不具合分析装置100は、処理をs3に戻す。
As a result of this determination, if there are remaining generation constraints (s10: Yes), the software
一方、上述の判定の結果、残りの発生制約が存在しないことが判明した場合(s10:No)、ソフトウェア不具合分析装置100は、ここまで修正、追加が完了したテストケース20を使用して、ソフトウェア11における不具合の発生位置を特定し、この不具合に対して修復用のテンプレート及びテストケース20に基づいて、不具合修正を実行し(s11)、処理を終了する。この不具合の修正処理については、既存のテストケースベースの自動修正技術を適宜採用すればよい。
On the other hand, as a result of the above determination, if it is found that the remaining generation constraints do not exist (s10: No), the software
以上、本発明を実施するための最良の形態などについて具体的に説明したが、本発明はこれに限定されるものではなく、その要旨を逸脱しない範囲で種々変更可能である。 Although the best mode for carrying out the present invention has been specifically described above, the present invention is not limited to this, and can be variously modified without departing from the scope of the invention.
こうした本実施形態によれば、ソフトウェアの不具合自動修正に必要なテストケースの効率的な確保及び修正支援が可能となる。 According to this embodiment, it is possible to efficiently secure test cases necessary for automatic correction of software defects and support correction.
本明細書の記載により、少なくとも次のことが明らかにされる。すなわち、本実施形態のソフトウェア不具合分析装置において、前記演算装置は、前記判定の結果、前記発生制
約を満たすテストケースが無かった場合、前記発生制約に関する情報に基づき、当該発生制約を満たす入力を規定したテストケースを生成し、前記入力に対する期待値の設定要求の通知を出力するものである、としてもよい。
At least the following will be clarified by the description of this specification. That is, in the software failure analysis apparatus of the present embodiment, if the result of the determination is that there is no test case that satisfies the occurrence constraint, the arithmetic device defines an input that satisfies the occurrence constraint based on the information on the occurrence constraint. and outputting a notification requesting to set an expected value for the input.
これによれば、ソフトウェアの不具合修正に必要となるテストケースを不足なく確保可能となる。ひいては、ソフトウェアの不具合自動修正に必要なテストケースのより効率的な確保及び修正支援が可能となる。 According to this, it is possible to ensure sufficient test cases necessary for correcting software defects. As a result, more efficient securing of test cases required for automatic correction of software defects and correction support can be achieved.
また、本実施形態のソフトウェア不具合分析装置において、前記演算装置は、前記ソフトウェアの実行ログに基づき、例外が発生したステートメントを解析開始点として取得する処理と、前記解析開始点を含む関数を直接または間接に呼び出す関数を解析終了点として取得する処理と、前記解析開始点から前記解析終了点に向けて逆向き記号実行を行って実行パスを特定し、前記例外が発生する条件であるパス条件を算出する処理と、前記パス条件を満たす前記解析終了点となる関数の入力パラメータ値の条件、または、前記パス条件を満たす前記解析終了点となる関数の入力パラメータ値を、前記発生制約として前記記憶装置に保持する処理を実行するものである、としてもよい。 Further, in the software failure analysis device of the present embodiment, the computing device acquires the statement in which the exception occurred as an analysis start point based on the execution log of the software, and directly or A process of acquiring a function to be indirectly called as an analysis end point, performing backward symbolic execution from the analysis start point toward the analysis end point to identify an execution path, and determining a path condition that is a condition for the exception to occur. The calculation process and the condition of the input parameter value of the function serving as the analysis end point satisfying the path condition, or the input parameter value of the function serving as the analysis end point satisfying the path condition are stored as the generation constraint. It may be assumed that it executes a process held in the device.
これによれば、いわゆるログベースAPR(Automatic Program Repair)における技術を採用し、不具合の発生制約を的確かつ効率的に特定することができる。ひいては、ソフトウェアの不具合自動修正に必要なテストケースのより効率的な確保及び修正支援が可能となる。 According to this, a technique in so-called log-based APR (Automatic Program Repair) is adopted, and the failure occurrence constraint can be specified accurately and efficiently. As a result, more efficient securing of test cases required for automatic correction of software defects and correction support can be achieved.
また、本実施形態のソフトウェア不具合分析装置において、前記演算装置は、前記テストケースを使用して、前記ソフトウェアにおける不具合発生位置を特定する処理と、前記不具合に対して修復用のテンプレート及びテストケースに基づいて修復候補を生成する処理をさらに実行するものである、としてもよい。 Further, in the software defect analysis apparatus of the present embodiment, the arithmetic unit uses the test case to specify a defect occurrence position in the software, and prepares a repair template and test case for the defect. A process of generating a repair candidate based on this may be further executed.
これによれば、いわゆるテストベースAPR(Automatic Program Repair)を上述のログベースAPR(Automatic Program Repair)に適用し、ソフトウェアの不具合自動修正に必要なテストケースの効率的な確保と、当該テストケースに基づくソフトウェア自動修正が可能となる。 According to this, the so-called test-based APR (Automatic Program Repair) is applied to the above-mentioned log-based APR (Automatic Program Repair) to efficiently secure test cases necessary for automatically correcting software defects, and automatic software modification based on
また、本実施形態のソフトウェア不具合分析方法において、前記情報処理装置が、前記判定の結果、前記発生制約を満たすテストケースが無かった場合、前記発生制約に関する情報に基づき、当該発生制約を満たす入力を規定したテストケースを生成し、前記入力に対する期待値の設定要求の通知を出力する、としてもよい。 Further, in the software failure analysis method of the present embodiment, if the result of the determination is that there is no test case that satisfies the occurrence constraint, the information processing device generates an input that satisfies the occurrence constraint based on the information on the occurrence constraint. A defined test case may be generated, and a notification requesting the setting of expected values for the input may be output.
また、本実施形態のソフトウェア不具合分析方法において、前記情報処理装置が、前記ソフトウェアの実行ログに基づき、例外が発生したステートメントを解析開始点として取得する処理と、前記解析開始点を含む関数を直接または間接に呼び出す関数を解析終了点として取得する処理と、前記解析開始点から前記解析終了点に向けて逆向き記号実行を行って実行パスを特定し、前記例外が発生する条件であるパス条件を算出する処理と、前記パス条件を満たす前記解析終了点となる関数の入力パラメータ値の条件、または、前記パス条件を満たす前記解析終了点となる関数の入力パラメータ値を、前記発生制約として前記記憶装置に保持する処理を実行する、としてもよい。 Further, in the software defect analysis method of the present embodiment, the information processing device obtains a statement in which an exception occurred as an analysis start point based on the execution log of the software, and directly obtains a function including the analysis start point. Alternatively, a process of obtaining an indirectly called function as an analysis end point, performing reverse symbolic execution from the analysis start point toward the analysis end point to identify an execution path, and a path condition that is a condition for the exception to occur and the condition of the input parameter value of the function serving as the analysis end point that satisfies the path condition, or the input parameter value of the function serving as the analysis end point that satisfies the path condition as the generation constraint. It is also possible to execute the processing held in the storage device.
また、本実施形態のソフトウェア不具合分析方法において、前記情報処理装置が、前記テストケースを使用して、前記ソフトウェアにおける不具合発生位置を特定する処理と、前記不具合に対して修復用のテンプレート及びテストケースに基づいて修復候補を生成する処理をさらに実行する、としてもよい。 Further, in the software defect analysis method of the present embodiment, the information processing apparatus uses the test case to identify a defect occurrence position in the software, and a template and test case for repairing the defect. Further processing may be performed to generate repair candidates based on .
10 テスト環境
11 ソフトウェア
12 ソースコード
13 実行ログ
14 ソフトウェア仕様
15 関数呼び出し関係DB
20 テストケース
21 実行パス
22 入力パラメータ値
100 ソフトウェア不具合分析装置
101 記憶装置
102 プログラム
103 メモリ
104 演算装置
105 入出力装置
110 記号実行エンジン
111 SMTソルバ
200 ユーザ端末
10
20
Claims (8)
前記テストケースのうち前記不具合の発生制約を満たすものを判定する処理と、前記判定の結果、前記発生制約を満たすテストケースについて、その期待値の修正要求の通知を出力する処理を実行する演算装置と、
を含むことを特徴とするソフトウェア不具合分析装置。 a storage device that holds software test cases and information about failure occurrence constraints in application functions of the test cases;
An arithmetic unit that executes a process of determining which of the test cases satisfies the defect occurrence constraint, and a process of outputting a notification of a correction request for the expected value of the test case that satisfies the occurrence constraint as a result of the determination. and,
A software failure analysis device comprising:
前記判定の結果、前記発生制約を満たすテストケースが無かった場合、前記発生制約に関する情報に基づき、当該発生制約を満たす入力を規定したテストケースを生成し、前記入力に対する期待値の設定要求の通知を出力するものである、
ことを特徴とする請求項1に記載のソフトウェア不具合分析装置。 The computing device is
As a result of the determination, if there is no test case that satisfies the generation constraint, based on the information on the generation constraint, generate a test case that defines an input that satisfies the generation constraint, and notify a request to set an expected value for the input. which outputs
2. The software failure analysis device according to claim 1, wherein:
前記ソフトウェアの実行ログに基づき、例外が発生したステートメントを解析開始点として取得する処理と、前記解析開始点を含む関数を直接または間接に呼び出す関数を解析終了点として取得する処理と、前記解析開始点から前記解析終了点に向けて逆向き記号実行を行って実行パスを特定し、前記例外が発生する条件であるパス条件を算出する処理と、前記パス条件を満たす前記解析終了点となる関数の入力パラメータ値の条件、または、前記パス条件を満たす前記解析終了点となる関数の入力パラメータ値を、前記発生制約として前記記憶装置に保持する処理を実行するものである、
ことを特徴とする請求項1に記載のソフトウェア不具合分析装置。 The computing device is
Based on the execution log of the software, a process of acquiring a statement in which an exception occurred as an analysis start point, a process of acquiring a function that directly or indirectly calls a function containing the analysis start point as an analysis end point, and the analysis start point. A process of performing reverse symbolic execution from a point toward the analysis end point to identify an execution path, calculating a path condition that is a condition for the exception to occur, and a function that becomes the analysis end point that satisfies the path condition. or the input parameter value of the function serving as the analysis end point that satisfies the path condition is stored in the storage device as the generation constraint.
2. The software failure analysis device according to claim 1, wherein:
前記テストケースを使用して、前記ソフトウェアにおける不具合発生位置を特定する処理と、前記不具合に対して修復用のテンプレート及びテストケースに基づいて修復候補を生成する処理をさらに実行するものである、
ことを特徴とする請求項1に記載のソフトウェア不具合分析装置。 The computing device is
Using the test case, a process of identifying a defect occurrence position in the software, and a process of generating a repair candidate based on a repair template and test case for the defect are further executed.
2. The software failure analysis device according to claim 1, wherein:
ソフトウェアのテストケースと、前記テストケースの適用関数における不具合の発生制約に関する情報とを記憶装置にて保持し、
前記テストケースのうち前記不具合の発生制約を満たすものを判定する処理と、前記判定の結果、前記発生制約を満たすテストケースについて、その期待値の修正要求の通知を出力する処理を実行する、
ことを特徴とするソフトウェア不具合分析方法。 The information processing device
holding software test cases and information about failure occurrence constraints in the application function of the test cases in a storage device;
Determining which of the test cases satisfies the defect occurrence constraint, and as a result of the determination, executing a process of outputting a notification requesting modification of the expected value of the test case satisfying the occurrence constraint,
A software failure analysis method characterized by:
前記判定の結果、前記発生制約を満たすテストケースが無かった場合、前記発生制約に関する情報に基づき、当該発生制約を満たす入力を規定したテストケースを生成し、前記入力に対する期待値の設定要求の通知を出力する、
ことを特徴とする請求項5に記載のソフトウェア不具合分析方法。 The information processing device
As a result of the determination, if there is no test case that satisfies the generation constraint, based on the information on the generation constraint, generate a test case that defines an input that satisfies the generation constraint, and notify a request to set an expected value for the input. which outputs
6. The software failure analysis method according to claim 5, wherein:
前記ソフトウェアの実行ログに基づき、例外が発生したステートメントを解析開始点として取得する処理と、前記解析開始点を含む関数を直接または間接に呼び出す関数を解析終了点として取得する処理と、前記解析開始点から前記解析終了点に向けて逆向き記号実行を行って実行パスを特定し、前記例外が発生する条件であるパス条件を算出する処理と
、前記パス条件を満たす前記解析終了点となる関数の入力パラメータ値の条件、または、前記パス条件を満たす前記解析終了点となる関数の入力パラメータ値を、前記発生制約として前記記憶装置に保持する処理を実行する、
ことを特徴とする請求項5に記載のソフトウェア不具合分析方法。 The information processing device
Based on the execution log of the software, a process of acquiring a statement in which an exception occurred as an analysis start point, a process of acquiring a function that directly or indirectly calls a function containing the analysis start point as an analysis end point, and the analysis start point. A process of performing reverse symbolic execution from a point toward the analysis end point to identify an execution path, calculating a path condition that is a condition for the exception to occur, and a function that becomes the analysis end point that satisfies the path condition. or the input parameter value of the function serving as the analysis end point that satisfies the path condition is stored in the storage device as the generation constraint.
6. The software failure analysis method according to claim 5, wherein:
前記テストケースを使用して、前記ソフトウェアにおける不具合発生位置を特定する処理と、前記不具合に対して修復用のテンプレート及びテストケースに基づいて修復候補を生成する処理をさらに実行する、
ことを特徴とする請求項5に記載のソフトウェア不具合分析方法。 The information processing device
Using the test case, further performing a process of identifying a defect occurrence location in the software and a process of generating a repair candidate for the defect based on a repair template and test case,
6. The software failure analysis method according to claim 5, wherein:
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2021165227A JP2023056111A (en) | 2021-10-07 | 2021-10-07 | Software failure analytic device and software failure analytic method |
PCT/JP2022/037007 WO2023058611A1 (en) | 2021-10-07 | 2022-10-03 | Software failure analysis apparatus and software failure analysis method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2021165227A JP2023056111A (en) | 2021-10-07 | 2021-10-07 | Software failure analytic device and software failure analytic method |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2023056111A true JP2023056111A (en) | 2023-04-19 |
Family
ID=85804286
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2021165227A Pending JP2023056111A (en) | 2021-10-07 | 2021-10-07 | Software failure analytic device and software failure analytic method |
Country Status (2)
Country | Link |
---|---|
JP (1) | JP2023056111A (en) |
WO (1) | WO2023058611A1 (en) |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2009205239A (en) * | 2008-02-26 | 2009-09-10 | Hitachi Ltd | Software verification system |
US20120159133A1 (en) * | 2010-12-17 | 2012-06-21 | Microsoft Corporation | Business exception management pattern for business processes |
JP2016164727A (en) * | 2015-03-06 | 2016-09-08 | 株式会社 日立産業制御ソリューションズ | Test case selection device |
KR101904911B1 (en) * | 2017-10-13 | 2018-10-08 | 한국인터넷진흥원 | Method for Automatically Detecting Security Vulnerability Based on Hybrid Fuzzing, and Apparatus thereof |
-
2021
- 2021-10-07 JP JP2021165227A patent/JP2023056111A/en active Pending
-
2022
- 2022-10-03 WO PCT/JP2022/037007 patent/WO2023058611A1/en active Application Filing
Also Published As
Publication number | Publication date |
---|---|
WO2023058611A1 (en) | 2023-04-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106294120B (en) | Method, apparatus and computer program product for testing code | |
US20090319829A1 (en) | Pattern extraction method and apparatus | |
CN109977012B (en) | Joint debugging test method, device, equipment and computer readable storage medium of system | |
JP2018026135A (en) | System and method for cause point analysis for effective handling of static analysis alarms | |
CN111611172A (en) | Project test defect analysis method, device, equipment and storage medium | |
Kadry | A new proposed technique to improve software regression testing cost | |
CN109101410B (en) | Risk drive testing method and device and computer readable storage medium | |
CN112395202B (en) | Interface automation test method and device, computer equipment and storage medium | |
CN110990289B (en) | Method and device for automatically submitting bug, electronic equipment and storage medium | |
CN110543429B (en) | Test case debugging method, device and storage medium | |
US11960862B2 (en) | Source code correction assistance apparatus and source code correction assistance method | |
EP3734460B1 (en) | Probabilistic software testing via dynamic graphs | |
JP7190246B2 (en) | Software failure prediction device | |
WO2019142266A1 (en) | Test case generation device, test case generation method, and test case generation program | |
WO2023058611A1 (en) | Software failure analysis apparatus and software failure analysis method | |
CN116431522A (en) | Automatic test method and system for low-code object storage gateway | |
JP4957521B2 (en) | Software partial test system, method and program used therefor | |
CN115034165A (en) | Chip simulation verification method, system, equipment and storage medium | |
CN114116470A (en) | Automatic static model checking method and device | |
CN111198798A (en) | Service stability measuring method and device | |
CN111752823A (en) | Method, device and equipment for testing vehicle-mounted power supply application software | |
WO2023058609A1 (en) | Defect analysis device and defect analysis method | |
CN112905438A (en) | Automatic testing method and device | |
JP7549992B2 (en) | Fault analysis device, program, and fault analysis method | |
CN113343659B (en) | Analysis report generation method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20240312 |