JP2022178542A - Program correction device, program correction method, and program correction program - Google Patents
Program correction device, program correction method, and program correction program Download PDFInfo
- Publication number
- JP2022178542A JP2022178542A JP2021085420A JP2021085420A JP2022178542A JP 2022178542 A JP2022178542 A JP 2022178542A JP 2021085420 A JP2021085420 A JP 2021085420A JP 2021085420 A JP2021085420 A JP 2021085420A JP 2022178542 A JP2022178542 A JP 2022178542A
- Authority
- JP
- Japan
- Prior art keywords
- correction
- correction candidate
- program
- candidate
- value
- 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
- 238000000034 method Methods 0.000 title claims abstract description 40
- 238000012937 correction Methods 0.000 claims abstract description 209
- 238000007689 inspection Methods 0.000 claims abstract description 30
- 230000004048 modification Effects 0.000 claims description 38
- 230000008569 process Effects 0.000 claims description 32
- 238000012986 modification Methods 0.000 claims description 31
- 230000002159 abnormal effect Effects 0.000 claims description 4
- 230000010365 information processing Effects 0.000 claims description 4
- 230000007547 defect Effects 0.000 abstract description 11
- 238000012360 testing method Methods 0.000 description 67
- 238000012545 processing Methods 0.000 description 26
- 238000010586 diagram Methods 0.000 description 15
- 230000014509 gene expression Effects 0.000 description 12
- 230000006870 function Effects 0.000 description 7
- 230000002950 deficient Effects 0.000 description 6
- 238000004891 communication Methods 0.000 description 3
- 238000012217 deletion Methods 0.000 description 2
- 230000037430 deletion Effects 0.000 description 2
- 239000000284 extract Substances 0.000 description 2
- 230000008439 repair process Effects 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 238000012790 confirmation Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000007717 exclusion Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000004807 localization Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
Description
本発明は、プログラム修正装置、プログラム修正方法、及びプログラム修正プログラムに関する。 The present invention relates to a program correction device, a program correction method, and a program correction program.
ソフトウェアに含まれる不具合(バグ)を特定し修正する技術として、Automated Program Repair(APR)が提案されている。APRは、例えば、「不具合箇所の特定」及び「パッチの生成」の2つのフェーズで構成される。具体的には、所定の不具合箇所検出プログラムにより、修正対象のソフトウェアにおける不具合箇所を特定した後、その不具合箇所に関する部分を書き換えることでソフトウェアを修正することが可能な修正プログラム(パッチ候補)を複数作成する。そして、作成した各パッチ候補の検証を行うことで、最適なパッチ候補(パッチ案)を特定する。このパッチ案を修正対象のソフトウェアに適用することで、バグが修復される。 Automated Program Repair (APR) has been proposed as a technique for identifying and correcting defects (bugs) included in software. APR is composed of, for example, two phases of "identification of defect location" and "generation of patch". Specifically, after identifying the defect in the software to be corrected by a predetermined defect detection program, a plurality of correction programs (patch candidates) that can correct the software by rewriting the part related to the defect create. Then, by verifying each created patch candidate, an optimum patch candidate (patch plan) is specified. By applying this patch proposal to the software to be fixed, the bug will be fixed.
しかしながら、このパッチ案が必ずしもソフトウェアの開発にとって最良であるとは限らない。例えば、上記のパッチ候補の検証が不充分である場合には多くのパッチ案が出力されて、ソフトウェアの開発者による追加的な確認作業が発生する。 However, this patch proposal is not necessarily the best for software development. For example, if the verification of the patch candidates is insufficient, many patch proposals are output, requiring additional confirmation work by the software developer.
ここで、ソフトウェアの修正プログラムの適否を判定する方法として、特許文献1には、テストスーツを利用してソフトウェアプログラム中の誤りを特定し、誤りの特定に応じて、ソフトウェアプログラムを修復テンプレートで修正し、その修正が不適切であるか否かを示すアンチパターン条件を充足するか否かを判定し、修正がアンチパターン条件を充足することに応じてその修正を不許可にし、あるいは、修正がアンチパターン条件を充足しないことに応じて修正後のソフトウェアプログラムについて更なるテストを実行することが記載されている。
Here, as a method for judging the propriety of a software modification program,
特許文献1は、所定のステートメントの削除といった不適切な修正を「アンチパターン」として事前定義し、このアンチパターンと一致するパッチ案を除外するものである。しかしながら、プログラムを具体的に実行させて判明するような不適正(例えば、特定の変数や式の内容に依存して現れる修正の不具合)を検知することが難しいという問題がある。 US Pat. No. 6,200,000 predefines an inappropriate modification, such as deletion of a given statement, as an "anti-pattern" and excludes patch proposals that match this anti-pattern. However, there is a problem that it is difficult to detect inadequacies (for example, correction defects that appear depending on the content of specific variables or expressions) that are found by actually executing the program.
本発明はこのような問題に鑑みてなされたもので、その目的は、プログラムの不具合をその内部関係に即して修正することが可能な、プログラム修正装置、プログラム修正方法、及びプログラム修正プログラムを提供することにある。 SUMMARY OF THE INVENTION The present invention has been made in view of such problems, and its object is to provide a program correction device, a program correction method, and a program correction program capable of correcting defects in a program according to its internal relationship. to provide.
上記課題を解決するための本発明の一つは、プロセッサ及びメモリを有し、元のプログラムに対し修正が行われたプログラムである修正候補を取得する修正候補取得部と、前記取得した修正候補において修正が行われた部分に対する入力値を複数パターン設定し、前
記修正候補を実行する修正候補実行部と、前記実行された修正候補において修正が行われた部分の出力値が前記入力値に依存するか否かを判定し、前記修正が行われた部分の出力値が前記入力値に依存すると判定した場合に、前記修正候補を前記元のプログラムに対する修正案として出力する修正候補検査部と、を備えるプログラム修正装置、とする。
One of the present inventions for solving the above problems is a correction candidate acquisition unit having a processor and a memory and acquiring a correction candidate that is a program obtained by correcting an original program; a correction candidate execution unit for setting a plurality of patterns of input values for the corrected portion in the above, and executing the correction candidate; and an output value of the corrected portion in the executed correction candidate depends on the input value. a correction candidate inspecting unit for determining whether or not to modify the original program, and outputting the correction candidate as a correction proposal for the original program when it is determined that the output value of the modified portion depends on the input value; and a program modification device comprising:
また、上記課題を解決するための本発明の一つは、情報処理装置が、元のプログラムに対し修正が行われたプログラムである修正候補を取得する修正候補取得処理と、前記取得した修正候補において修正が行われた部分に対する入力値を複数パターン設定し、前記修正候補を実行する修正候補実行処理と、前記実行された修正候補において修正が行われた部分の出力値が前記入力値に依存するか否かを判定し、前記修正が行われた部分の出力値が前記入力値に依存すると判定した場合に、前記修正候補を前記元のプログラムに対する修正案として出力する修正候補検査処理と、を実行するプログラム修正方法、とする。 According to another aspect of the present invention for solving the above problems, an information processing apparatus acquires a correction candidate, which is a program obtained by correcting an original program; a correction candidate execution process for setting a plurality of patterns of input values for a portion corrected in the above, and executing the correction candidate; and an output value of the corrected portion in the executed correction candidate depends on the input value. correction candidate inspection processing for outputting the correction candidate as a correction proposal for the original program when it is determined that the output value of the corrected portion depends on the input value; and a program modification method that executes
また、上記課題を解決するための本発明の一つは、情報処理装置に、元のプログラムに対し修正が行われたプログラムである修正候補を取得する修正候補取得処理と、前記取得した修正候補において修正が行われた部分に対する入力値を複数パターン設定し、前記修正候補を実行する修正候補実行処理と、前記実行された修正候補において修正が行われた部分の出力値が前記入力値に依存するか否かを判定し、前記修正が行われた部分の出力値が前記入力値に依存すると判定した場合に、前記修正候補を前記元のプログラムに対する修正案として出力する修正候補検査処理と、を実行させるプログラム修正プログラム、とする。 According to another aspect of the present invention for solving the above problems, an information processing apparatus is provided with a correction candidate acquisition process for acquiring a correction candidate that is a program obtained by correcting an original program; a correction candidate execution process for setting a plurality of patterns of input values for a portion corrected in the above, and executing the correction candidate; and an output value of the corrected portion in the executed correction candidate depends on the input value. correction candidate inspection processing for outputting the correction candidate as a correction proposal for the original program when it is determined that the output value of the corrected portion depends on the input value; Suppose that the program modification program that causes the
本発明によれば、プログラムの不具合をその内部関係に即して修正することができる。 According to the present invention, program defects can be corrected in accordance with their internal relationships.
上記した以外の課題、構成及び効果は、以下の実施形態の説明により明らかにされる。 Problems, configurations, and effects other than those described above will be clarified by the following description of the embodiments.
-実施例1-
図1は、実施例1に係るプログラム修正装置100の構成の一例を示す図である。プログラム修正装置100は、プログラムのソースコードに存在する不具合(バグ)を修正するためのプログラム(パッチ)をそれぞれ候補として複数作成し、それらのパッチ(パッチ候補)をそれぞれ適用したソースコード(以下、修正プログラム、又は修正候補という)を作成する。そして、プログラム修正装置100は、予め作成したテストコードを実行
することで、各修正候補の実行結果及び、パッチを適用したソースコードの部分(以下、パッチ部分という)の処理結果に基づき、最も適切なパッチ候補(パッチ案)を特定する。これにより、プログラム修正装置100は、ソースコードの修正を行う。
-Example 1-
FIG. 1 is a diagram showing an example of the configuration of a
すなわち、プログラム修正装置100は、修正候補生成部210、修正候補取得部215、修正候補実行部220、及び修正候補検査部230の各機能部を備える。
That is, the
また、プログラム修正装置100は、ソースコード291、テストコード292、修正候補情報293、テスト実行結果情報294、テスト実行時情報295、及び修正結果情報296の各情報を記憶する。
The
修正候補生成部210は、ソースコード291に適用するパッチ(パッチ候補)を複数生成し、各パッチを適用したソースコード(修正候補)をそれぞれ生成する。修正候補生成部210は、生成した修正候補を記憶する。
The modification
なお、ソースコード291は、任意の言語で記述されたプログラムのソースコードである。また、パッチは、例えば、条件分岐式の変更又は追加を行うプログラムである。
The
修正候補取得部215は、修正候補生成部210が生成した修正候補を取得する。
The correction
修正候補実行部220は、修正候補取得部215が取得した修正候補におけるパッチ部分に複数パターンの入力値を設定することで、修正候補をそれぞれ実行する。本実施形態では、複数パターンの入力値を設定したテストコードを実行して修正候補を呼び出すことで、修正候補を実行するものとする。
The correction
修正候補検査部230は、修正候補実行部220で実行された修正候補におけるパッチ部分の出力値が、修正候補実行部220で設定した入力値に依存するか否かを判定し、その修正部分の出力値が設定入力値に依存すると判定した場合に、修正候補を元のソースコード291に適用してこれを新たなプログラム(新たなソースコード)として生成する。
The correction
なお、修正候補検査部230は、修正候補におけるパッチ部分と、修正部分の出力値とを対応づけた情報としてテスト実行時情報295を生成する。
The correction
ここで、図2は、プログラム修正装置100が備えるハードウェアの一例を説明する図である。プログラム修正装置100は、CPU(Central Processing Unit)、MPU(Micro Processing Unit)、又はGPU(Graphics Processing Unit)等のプロセッサ110と、ROM(Read Only Memory)、又はRAM(Random Access Memory)等の主記憶装置120と、ハードディスクドライブ(Hard Disk Drive)、フラッシュメモリ(Flash Memory)、又はSSD(Solid State Drive)等の補助記憶装置130と、キーボード、マウス、カードリーダ、又はタッチパネル等の入力装置140と、LCD(Liquid Crystal
Display)、音声出力装置(スピーカ)、又は印字装置等の出力装置150と、NIC(Network Interface Card)、無線通信モジュール、USB(Universal Serial Interface)モジュール、又はシリアル通信モジュール等の通信装置160とを備える。
Here, FIG. 2 is a diagram for explaining an example of hardware included in the
Display), audio output device (speaker), or an
プログラム修正装置100の機能は、プロセッサ311が、主記憶装置120又は補助記憶装置130に格納されているプログラムを読み出して実行することにより実現される。また上記のプログラムは、例えば、記録媒体に記録して配布することができる。
次に、プログラム修正装置100が行う処理について説明する。
The functions of the
Next, processing performed by the
<プログラム修正処理>
図3は、ソースコードを修正する処理であるプログラム修正処理の一例を説明するフロー図である。プログラム修正処理は、例えば、プログラム修正装置100にユーザから所定の入力が行われたことを契機に実行される。
<Program Correction Processing>
FIG. 3 is a flowchart for explaining an example of program correction processing, which is processing for correcting source code. The program correction process is executed, for example, when a user inputs a predetermined value to the
まず、プログラム修正装置100の修正候補生成部210は、不具合箇所をパッチ候補により修正したソースコードである修正候補を生成する修正候補生成処理を実行する(s111)。
First, the correction
修正候補実行部220は、修正候補生成処理s111で生成した修正候補におけるパッチ部分に複数パターンの入力値を設定したテストプログラムを実行することで、そのテストプログラムによる修正候補の実行結果の情報(テスト実行結果情報294)及び、修正候補におけるパッチ部分の処理結果の情報(テスト実行時情報295)を生成する修正候補実行処理を実行する(s112)。
The correction
修正候補検査部230は、修正候補実行処理s112で生成した情報に基づき、そのテストプログラムの実行に成功しかつ、そのパッチ部分がテストプログラムで設定した各入力値に依存しない修正候補を特定することで、最終的な修正候補を決定する修正候補検査処理を実行する(s113)。その後、修正候補検査部230は、最終的な修正候補を正式なパッチ案として出力し、ユーザに提示する(例えば、ファイルに出力し、又は画面に表示する)。以上でプログラム修正処理は終了する。
以下、これらの処理の詳細を説明する。
Based on the information generated in the modification candidate execution process s112, the modification
Details of these processes will be described below.
<修正候補生成処理>
図4は、修正候補生成処理s111の詳細を説明するフロー図である。
修正候補生成部210は、ソースコード291を取得し、取得したソースコード291における不具合箇所(バグの箇所)を特定する(s1111)。例えば、修正候補生成部210は、ソースコード291のために用意されたテストケースを実行してそのソースコード291を呼び出す(実行させる)ことで、ソースコード291内の処理の実行経路を特定する。修正候補生成部210は、特定した実行経路に基づきソースコード291内の各処理の疑惑値等を算出し、不具合箇所を特定する(例えば、Spectrum-Based Fault Localization:SBFL)。なお、ここで説明した不具合箇所の特定方法は一例であり、実
行内容と所定のデータベースとの内容比較、又は人手によるチェック等任意の方法を採用できる。
<Correction candidate generation processing>
FIG. 4 is a flowchart for explaining the details of the correction candidate generation processing s111.
The correction
(ソースコード)
なお、図5は、ソースコード291の一例を示す図である。ソースコード291は、例えば、入力される変数2911に対する出力を行う関数2912によって構成され、関数2912は、さらに1又は複数の関数2913を含む。
(Source code)
5 is a diagram showing an example of the
次に、図4に示すように修正候補生成部210は、s1111で特定したソースコード291の不具合箇所を修正するパッチ候補を複数生成する(s1112)。パッチ候補は、例えば、不具合箇所に対する条件分岐、定数、変数若しくは関数式の追加、不具合箇所の変更、又は不具合箇所の削除等を行うプログラムである。
Next, as shown in FIG. 4, the correction
そして、修正候補生成部210は、s1112で生成した各パッチをソースコード291に適用した新たなソースコード(すなわち、修正候補)をそれぞれ生成し、修正候補情報293に記憶する(s1113)。以上で修正候補生成処理s111は終了する。
Then, the correction
(修正候補情報)
図6は、修正候補情報293の一例を示す図である。修正候補情報293は、各修正候
補のID2931と、修正候補2932とを含む。修正候補2932は、修正前のソースコードにパッチ2933を適用したソースコードである。
(Correction candidate information)
FIG. 6 is a diagram showing an example of the
<修正候補実行処理>
図7は、修正候補実行処理s112の詳細を説明するフロー図である。修正候補取得部215は、修正候補生成処理s111で生成した各修正候補を取得する。そして、修正候補実行部220は、所定のテストコードを実行することで、各修正候補を実行させる(s1121)。
<Correction candidate execution processing>
FIG. 7 is a flowchart for explaining the details of the correction candidate execution process s112. The correction
(テストコード)
ここで、図8は、修正候補に対するテストコード292の一例を示す図である。テストコード292は、1又は複数のテスト部2921を有する。各テスト部2921は、修正候補に異なる入力値2922を代入して修正候補を実行する呼び出し部2923と、呼び出し部2923に基づく修正候補の実行結果と予め指定した正解値とが一致するか否かを判定する判定部2924とを含む。
(test code)
Here, FIG. 8 is a diagram showing an example of
判定部2924は、テストの「成功」(実行結果と正解値が一致した場合)又はテストの「失敗」(実行結果と正解値が一致しなかった場合)を出力する。
The
次に、図7のs1122に示すように修正候補実行部220は、s1121で実行したテストコードに基づくテストコードの実行結果(成功又は失敗)を、テスト実行結果情報294に記憶する。また、修正候補実行部220は、s1121で実行したテストコードにおける、パッチ部分の出力値(例えば、条件分岐における条件判断部分の出力値)の情報を、テスト実行時情報295に記憶する(s1123)。
Next, as shown in s1122 of FIG. 7, the correction
修正候補実行部220は、s1122及びs1123の処理を、各修正候補について実行する。なお、s1122及びs1123の実行順序は問わない。以上で修正候補実行処理s112は終了する。
The correction
ここで、テスト実行結果情報294及びテスト実行時情報295の具体例を説明する。
Specific examples of the test execution result
(テスト実行結果情報)
図9は、テスト実行結果情報294の一例を示す図である。テスト実行結果情報294は、各修正候補のID2941と、テストコードの実行結果2942(具体的には、各判定部の実行結果(成功又は失敗))とを含む。
(Test execution result information)
FIG. 9 is a diagram showing an example of the test execution result
(テスト実行時情報)
図10は、テスト実行時情報295の一例を示す図である。テスト実行時情報295は、各修正候補のID2951と、その修正候補においてパッチが適用された部分である修正後の式2952と、テストコード292の各テスト部2921における修正後の式2952の出力値たる実行時の値2953とを含む。
(test execution time information)
FIG. 10 is a diagram showing an example of the test
なお、修正後の式2952は、例えば、パッチが条件分岐処理の追加又は変更であればその条件の判定部分であり、パッチが変数又は数式の追加又は変更であればその変数又は数式である。また、実行時の値2953については、修正後の式2952が条件の判定部分である場合には、条件式の値である真(true)、偽(false)、又は例外発生(異常発生)のいずれかの値が設定される。また、修正後の式2952が変数又は数式である場合には、変数又は数式の値が設定される。
Note that the modified
<修正候補検査処理>
次に、図11は、修正候補検査処理s113の詳細を説明するフロー図である。
<Correction candidate inspection process>
Next, FIG. 11 is a flowchart for explaining the details of the correction candidate inspection process s113.
修正候補検査部230は、修正候補実行処理s112で生成したテスト実行結果情報294に基づき、テストコードの実行に成功した修正候補を抽出する(s1131)。具体的には、修正候補検査部230は、テスト実行結果情報294の各レコードのうち、テスト実行結果2942の全ての項目が「成功」であるレコードを抽出する。
Based on the test execution result
さらに、修正候補検査部230は、s1131で抽出した修正候補のうち、当該修正候補に係るパッチ部分の結果(出力値)がテストコード292のテストパターン(テスト部2921)に依存する修正候補を、最終的な修正候補として特定する(s1132)。
Furthermore, among the correction candidates extracted in step s1131, the correction
例えば、修正候補検査部230は、テスト実行時情報295における、s1131で抽出した修正候補に係るレコードのうち、実行時の値2953の全項目が全て同じである(例えば、全てtrue又はfalseである)レコードを、最終的な修正候補から除外する。
For example, the correction
また、例えば、修正候補検査部230は、テスト実行時情報295における、s1131で抽出した修正候補に係るレコードのうち、実行時の値2953の全項目のうち所定割合以上(例えば、90%以上)の項目の値が同じである(例えば、true又はfalseで共通である)レコードを、最終的な修正候補から除外する。
Further, for example, the correction
また、例えば、修正候補検査部230は、テスト実行時情報295における、s1131で抽出した修正候補に係るレコードのうち、実行時の値2953の各項目の値が所定のパターンとなっているレコードを、最終的な修正候補から除外する。
Further, for example, the correction
また、例えば、修正候補検査部230は、テスト実行時情報295における、s1131で抽出した修正候補に係るレコードのうち、実行時の値2953のいずれかの項目に異常値(例えば、例外発生、又は空値)があるレコードを、最終的な修正候補から除外する。
Further, for example, the correction
そして、修正候補検査部230は、s1132で特定した最終的な修正候補を、画面に表示する(s1133)。また、修正候補検査部230は、最終的な修正候補を修正結果情報296に記憶する(s1133)。
Then, correction
(修正結果情報)
図12は、修正結果情報296の一例を示す図である。この修正結果情報296は、最終的な修正候補(つまり修正されたソースコード)のID2961と、その修正候補の内容たる修正結果2962とを記憶している。
(correction result information)
FIG. 12 is a diagram showing an example of the correction result
同図に示す修正結果2962に関しては、テストコード292の各テスト部2921の実行結果が全て「成功」であった(テスト実行結果情報294)ことが示されている。さらに、この修正結果情報296におけるパッチ2963(条件分岐式「w != null」を含
む処理)の処理結果は「true」、「true」、及び「false」であるのでs1132で説明した除外事由のいずれにもあてはまらない(テスト実行時情報295)。
As for the
このように、本実施形態のプログラム修正装置100は、テストコード292を用い、修正候補内のパッチ部分に対して複数パターンの入力値を設定して修正候補を実行し、修正候補におけるパッチ部分の出力値(修正後の式2952)がテスト部2921の上記入力値に依存する場合に、その修正候補をソースコード291に適用して修正プログラム(修正ソースコード)を生成する。
As described above, the
すなわち、本実施形態のプログラム修正装置100は、修正候補に適用されたパッチが修正候補への入力値に依存しないような場合、すなわちパッチが、様々な内部条件下でソースコードが実行された場合でもソースコードのバグを解消しうるものである正しいプログラムである場合にのみ、これに対応する修正候補を最終的なパッチ案とする。このように、本実施形態のプログラム修正装置100によれば、プログラムの不具合をその内部関係に即して修正することができる。
That is, the
また、本実施形態のプログラム修正装置100は、最終的な修正候補の特定において、修正部分(パッチ)の各出力値が互いに同一である場合に、修正部分の出力値が入力値に依存しないと判定し、修正候補から除外するので、正常に動作しないと考えられる修正候補を確実に除外することができる。
In addition, the
同様に、本実施形態のプログラム修正装置100は、最終的な修正候補の特定において、修正部分の各出力値のうち少なくともいずれかが異常値(例外発生等)である場合に、修正部分の出力値が入力値に依存しないと判定し、修正候補から除外するので、正常に動作しないと考えられる修正候補を確実に除外することができる。
Similarly, the
また、本実施形態のプログラム修正装置100は、修正候補における修正部分の情報(修正後の式2952)と、修正部分の出力値(実行時の値2953)とを対応づけたテスト実行時情報295を生成することで、最終的な修正候補の特定において参照すべき情報を最小限に抑えることができる。これにより、最終的な修正候補の特定に係るリソース負荷を軽減することができる。
In addition, the
-実施例2-
実施例1では、プログラム修正装置100は、テスト実行時情報295として、パッチ部分の式(修正後の式2952)とその出力値との関係の情報を生成したが、テスト実行時情報295は、その他の形式の情報であってもよい。
-Example 2-
In the first embodiment, the
図13は、実施例2に係るテスト実行時情報298の一例を示す図である。このテスト実行時情報298は、各修正候補のID2981と、その修正候補における行番号2982(処理の番号でもよい)と、修正候補を各テスト部2921により実行した場合に、修正候補の行番号2982が実行された否かを示す情報である実行有無2983とを含む。実行有無2983は、パッチ部分を含む修正候補の全ての行における実行の有無の情報が設定される。なお、異常値が出力された場合には、その行番号の実行有無2983には「例外発生」等の情報が設定される。
FIG. 13 is a diagram showing an example of the test execution time information 298 according to the second embodiment. This test execution time information 298 includes an
ここで、図14は、実施例2に係る修正候補検査処理の一例を説明するフロー図である。修正候補検査部230のs1141の処理は、実施例1のs1131と同様である。
Here, FIG. 14 is a flowchart for explaining an example of the correction candidate inspection process according to the second embodiment. The processing of s1141 of the correction
そして、修正候補検査部230は、s1131で抽出した各修正候補について、テスト実行時情報298を参照することにより、その修正候補内でテストコードにより実行された処理(実行経路)を特定し、特定した実行経路における実行有無のパターンがテスト部2921間で同一又は類似しているか否かを判定する。修正候補検査部230は、実行有無のパターンが同一又は類似している場合には、その修正候補を最終的な修正候補から除外する。
Then, the correction
なお、実行有無のパターンの類似の程度は、例えば、修正候補の全行のうち、実行有無が同じであった行の割合によって判定する。その割合が所定値以上の場合には、類似と判定される。 Note that the degree of similarity of execution/non-execution patterns is determined, for example, by the ratio of lines having the same execution/non-execution among all correction candidate lines. If the ratio is equal to or greater than a predetermined value, it is determined to be similar.
次に行われるs1133の処理は、実施例1のs1133の処理と同様である。 The processing of s1133 that is performed next is the same as the processing of s1133 of the first embodiment.
このように、修正候補内で実行されたパッチ部分を含む各処理の実行パターンがテスト部2921(入力値)間で同一又は互いに類似している場合には、その修正候補を最終的な修正候補から除外することで、修正候補が任意の処理経路を辿り正しく実行されるようなパッチを特定し、それに対応した修正候補を特定することができる。 In this way, when the execution pattern of each process including the patch portion executed in the correction candidate is the same or similar between the test sections 2921 (input values), the correction candidate is used as the final correction candidate. , it is possible to identify a patch in which a modification candidate traces an arbitrary processing path and is correctly executed, and to identify a modification candidate corresponding to the patch.
本発明は以上に説明した実施形態に限定されるものではなく、様々な変形例が含まれる。上記した実施形態は本発明のより良い理解のために詳細に説明したものであり、必ずしも説明の全ての構成を備えるものに限定されるものではない。 The present invention is not limited to the embodiments described above, and includes various modifications. The above-described embodiments have been described in detail for better understanding of the present invention, and are not necessarily limited to those having all the configurations described.
例えば、各実施例の各装置が備える各機能の一部は他の装置に設けてもよいし、別装置が備える機能を同一の装置に設けてもよい。 For example, part of each function provided by each device of each embodiment may be provided in another device, or functions provided by another device may be provided in the same device.
100 プログラム修正装置、220 修正候補実行部、230 修正候補検査部 100 program correction device, 220 correction candidate execution unit, 230 correction candidate inspection unit
Claims (8)
元のプログラムに対し修正が行われたプログラムである修正候補を取得する修正候補取得部と、
前記取得した修正候補において修正が行われた部分に対する入力値を複数パターン設定し、前記修正候補を実行する修正候補実行部と、
前記実行された修正候補において修正が行われた部分の出力値が前記入力値に依存するか否かを判定し、前記修正が行われた部分の出力値が前記入力値に依存すると判定した場合に、前記修正候補を前記元のプログラムに対する修正案として出力する修正候補検査部と、
を備えるプログラム修正装置。 having a processor and memory,
a correction candidate acquiring unit that acquires a correction candidate that is a program obtained by correcting the original program;
a correction candidate executing unit that sets a plurality of patterns of input values for the corrected portion of the acquired correction candidate and executes the correction candidate;
determining whether or not the output value of the modified portion in the executed modification candidate depends on the input value, and determining that the output value of the modified portion depends on the input value; a correction candidate inspection unit that outputs the correction candidate as a correction proposal for the original program;
program correction device.
請求項1に記載のプログラム修正装置。 The correction candidate inspection unit determines that the output value of the corrected portion does not depend on the input value when each output value of the corrected portion is the same.
2. The program correction device according to claim 1.
請求項1に記載のプログラム修正装置。 The correction candidate inspection unit determines that the output value of the corrected portion does not depend on the input value when at least one of the output values of the corrected portion is an abnormal value. do,
2. The program correction device according to claim 1.
前記修正候補検査部は、前記生成した情報に基づき、前記修正が行われた部分の出力値が前記入力値に依存するか否かを判定する、
請求項1に記載のプログラム修正装置。 The correction candidate execution unit generates information in which information on the corrected portion of the correction candidate is associated with an output value of the corrected portion, and
The correction candidate inspection unit determines whether or not the output value of the corrected portion depends on the input value based on the generated information.
2. The program correction device according to claim 1.
請求項1に記載のプログラム修正装置。 The correction candidate inspecting unit identifies each process executed in the executed correction candidate, including the process of the corrected portion, and the identified pattern is a pattern of the input values of the plurality of patterns. determining whether the patterns are the same or similar to each other, and if it is determined that the patterns are the same or similar to the input values of the plurality of patterns, the plurality of acquired output values depend on the variable decide not to
2. The program correction device according to claim 1.
請求項1に記載のプログラム修正装置。 The correction candidate checking unit determines whether the execution of the correction candidate is successful and whether an output value of the corrected portion of the correction candidate depends on the input value; When it is determined that the execution of the correction candidate is successful and the output value of the corrected portion depends on the input value, the correction candidate is output as a correction proposal for the original program;
2. The program correction device according to claim 1.
元のプログラムに対し修正が行われたプログラムである修正候補を取得する修正候補取得処理と、
前記取得した修正候補において修正が行われた部分に対する入力値を複数パターン設定し、前記修正候補を実行する修正候補実行処理と、
前記実行された修正候補において修正が行われた部分の出力値が前記入力値に依存するか否かを判定し、前記修正が行われた部分の出力値が前記入力値に依存すると判定した場合に、前記修正候補を前記元のプログラムに対する修正案として出力する修正候補検査処理と、
を実行するプログラム修正方法。 The information processing device
a correction candidate acquisition process for acquiring a correction candidate, which is a program obtained by correcting the original program;
a correction candidate execution process of setting a plurality of patterns of input values for the corrected portion of the acquired correction candidate and executing the correction candidate;
determining whether or not the output value of the modified portion in the executed modification candidate depends on the input value, and determining that the output value of the modified portion depends on the input value; a modification candidate inspection process for outputting the modification candidate as a modification proposal for the original program;
How to fix a program that runs
元のプログラムに対し修正が行われたプログラムである修正候補を取得する修正候補取得処理と、
前記取得した修正候補において修正が行われた部分に対する入力値を複数パターン設定し、前記修正候補を実行する修正候補実行処理と、
前記実行された修正候補において修正が行われた部分の出力値が前記入力値に依存するか否かを判定し、前記修正が行われた部分の出力値が前記入力値に依存すると判定した場合に、前記修正候補を前記元のプログラムに対する修正案として出力する修正候補検査処理と、
を実行させるプログラム修正プログラム。 information processing equipment,
a correction candidate acquisition process for acquiring a correction candidate, which is a program obtained by correcting the original program;
a correction candidate execution process of setting a plurality of patterns of input values for the corrected portion of the acquired correction candidate and executing the correction candidate;
determining whether or not the output value of the modified portion in the executed modification candidate depends on the input value, and determining that the output value of the modified portion depends on the input value; a modification candidate inspection process for outputting the modification candidate as a modification proposal for the original program;
A program fix that causes the .
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2021085420A JP2022178542A (en) | 2021-05-20 | 2021-05-20 | Program correction device, program correction method, and program correction program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2021085420A JP2022178542A (en) | 2021-05-20 | 2021-05-20 | Program correction device, program correction method, and program correction program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2022178542A true JP2022178542A (en) | 2022-12-02 |
Family
ID=84239131
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2021085420A Pending JP2022178542A (en) | 2021-05-20 | 2021-05-20 | Program correction device, program correction method, and program correction program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2022178542A (en) |
-
2021
- 2021-05-20 JP JP2021085420A patent/JP2022178542A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8621441B2 (en) | System and method for software immunization based on static and dynamic analysis | |
US8756460B2 (en) | Test selection based on an N-wise combinations coverage | |
US10296447B2 (en) | Automated software program repair | |
US8397104B2 (en) | Creation of test plans | |
US10089218B2 (en) | Methods circuits apparatuses systems and associated computer executable code for generating a software unit test | |
JP2017151977A (en) | Method and program for repairing software program | |
JP7404839B2 (en) | Identification of software program defect location | |
US10268572B2 (en) | Interactive software program repair | |
Delgado-Pérez et al. | Evaluation of mutation testing in a nuclear industry case study | |
Kadry | A new proposed technique to improve software regression testing cost | |
US9396097B2 (en) | Methods, circuits, devices, systems and associated computer executable code for testing software code | |
Chekam et al. | Assessing and comparing mutation-based fault localization techniques | |
JP7384054B2 (en) | automated software program repair | |
US10761962B1 (en) | Automated software program repair | |
JP2020126603A (en) | Automatic candidate correction patch generation | |
JP2016164727A (en) | Test case selection device | |
CN111552641A (en) | Method, device, equipment and storage medium for judging quality of software product | |
JP2022178542A (en) | Program correction device, program correction method, and program correction program | |
US11520689B2 (en) | System and method for automatic program repair using fast-result test cases | |
JP6369269B2 (en) | Verification support apparatus, verification support method, and computer program | |
US10586014B1 (en) | Method and system for verification using combined verification data | |
JPH11224211A (en) | Software inspection support device | |
WO2023058611A1 (en) | Software failure analysis apparatus and software failure analysis method | |
WO2022196219A1 (en) | Program analysis device, program analysis method, and tracing process addition device | |
JP2023108555A (en) | Program correction support system and program correction support method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20240213 |