JP7629880B2 - Program modification support system and program modification support method - Google Patents
Program modification support system and program modification support method Download PDFInfo
- Publication number
- JP7629880B2 JP7629880B2 JP2022009741A JP2022009741A JP7629880B2 JP 7629880 B2 JP7629880 B2 JP 7629880B2 JP 2022009741 A JP2022009741 A JP 2022009741A JP 2022009741 A JP2022009741 A JP 2022009741A JP 7629880 B2 JP7629880 B2 JP 7629880B2
- Authority
- JP
- Japan
- Prior art keywords
- test
- code
- source code
- input
- program
- 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.)
- Active
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Description
本発明は、プログラム修正支援システム、プログラム修正支援方法に関する。 The present invention relates to a program correction support system and a program correction support method.
従来から、プログラムの単体テストにおけるデバッグ作業において、不具合を含む箇所を特定し、当該箇所に対する修正パッチを生成する技術がある。このような技術として、例えば、特許文献1がある。特許文献1には、ソフトウェアプログラム内の欠陥箇所を特定し、修復候補に基づき、前記欠陥箇所で、可能な修復を生成し、前記可能な修復をテストするよう第1テストを自動生成し、前記第1テストに基づき、第1テストオラクルのための第1クエリを生成し、前記第1クエリに対する応答を人間から取得し、前記第1クエリ及び該第1クエリに対する前記取得された応答に基づき、人間が提供した第1テストオラクルを生成し、拡張された第1テストを生成するよう、前記人間が提供した第1テストオラクルを前記第1テストに加え、前記拡張された第1テストを含むようテストスイートを増補し、前記増補されたテストスイートを用いて、前記可能な修復をテストする、ことが記載されている。
There has been a technique for identifying a location containing a defect and generating a patch for the location in the debugging work in the unit test of a program. For example,
上記特許文献1では、テストケースの入力を生成する方法として、引数を並べ替えることしか開示されていない。この方法では、必ずしもパッチ候補の検証に有効なテストケースを生成できないことがある。
The above-mentioned
例えば、中央値を求める機能median(n1,n2,n3)のテストケースとして、元々「median(2,6,8)の出力が6である」がある場合、新たな入力として、median(8,6,2)やmedian(6,8,2)を生成することができない。また、例えば、元のソースコードにおいて、引数に負の数が入るときに不具合が発生する場合、不具合箇所の特定において見落としが生じてしまう。さらに、生成されたパッチにおいて同様の不具合が発生する場合、パッチ候補の検証で見落としてしまい、不具合が発生するパッチを出力してしまう。 For example, if the test case for the function median(n1, n2, n3) that finds the median is originally "the output of median(2, 6, 8) is 6," it is not possible to generate median(8, 6, 2) or median(6, 8, 2) as new inputs. Also, for example, if a defect occurs when a negative number is entered as an argument in the original source code, the defect will be overlooked when identifying the defective location. Furthermore, if a similar defect occurs in the generated patch, it will be overlooked when verifying the patch candidate, and the patch with the defect will be output.
一方で、網羅的(brute-force)またはランダムにテストケースの入力を生成すると、無駄に多くのテストケースが生成され、開発者が出力(期待値)を設定する手間が増えてしまう。 On the other hand, brute-force or random generation of test case inputs generates many unnecessary test cases and increases the effort required of developers to set the outputs (expectations).
本発明は、パッチ候補の検証に効果的なテストケースを、無駄なテストケースを生成することなく生成することが可能な技術を提供することを目的とする。 The present invention aims to provide a technology that can generate test cases that are effective for verifying patch candidates without generating unnecessary test cases.
本発明にかかるプログラム修正支援システムは、演算部と記憶部とを有したコンピュータにより、プログラムの修正を支援するプログラム修正支援システムであって、前記演算部は、ソースコードを解析し、当該解析により得られた前記ソースコードの入力値の条件と出力とを取得し、前記入力値の条件と出力とについての修正に関する候補を示す修正時情報と、テストコードにより前記ソースコードをテストするテストケースを増やすためのテスト追加基準とに基づいて、前記テストケースを拡充する、ことを特徴とするプログラム修正支援システムとして構成される。 The program correction support system according to the present invention is a program correction support system that supports program correction using a computer having a calculation unit and a storage unit, and is configured as a program correction support system characterized in that the calculation unit analyzes source code, obtains input value conditions and outputs of the source code obtained by the analysis, and expands the test cases based on correction time information indicating candidates for correction of the input value conditions and outputs and test addition criteria for increasing the number of test cases that test the source code using test code.
本発明によれば、パッチ候補の検証に効果的なテストケースを、無駄なテストケースを生成することなく生成することができる。 According to the present invention, it is possible to generate test cases that are effective for verifying patch candidates without generating unnecessary test cases.
以下、図面を参照して本発明の実施形態を説明する。以下の記載および図面は、本発明を説明するための例示であって、説明の明確化のため、適宜、省略および簡略化がなされている。本発明は、他の種々の形態でも実施する事が可能である。特に限定しない限り、各構成要素は単数でも複数でも構わない。 The following describes an embodiment of the present invention with reference to the drawings. The following description and drawings are examples for explaining the present invention, and some parts have been omitted or simplified as appropriate for clarity of explanation. The present invention can also be implemented in various other forms. Unless otherwise specified, each component may be singular or plural.
図面において示す各構成要素の位置、大きさ、形状、範囲などは、発明の理解を容易にするため、実際の位置、大きさ、形状、範囲などを表していない場合がある。このため、本発明は、必ずしも、図面に開示された位置、大きさ、形状、範囲などに限定されない。 The position, size, shape, range, etc. of each component shown in the drawings may not represent the actual position, size, shape, range, etc., in order to facilitate understanding of the invention. Therefore, the present invention is not necessarily limited to the position, size, shape, range, etc. disclosed in the drawings.
以下の説明では、「データベース」、「テーブル」、「リスト」等の表現にて各種情報を説明することがあるが、各種情報は、これら以外のデータ構造で表現されていてもよい。データ構造に依存しないことを示すために「XXテーブル」、「XXリスト」等を「XX情報」と呼ぶことがある。識別情報について説明する際に、「識別情報」、「識別子」、「名」、「ID」、「番号」等の表現を用いた場合、これらについてはお互いに置換が可能である。 In the following explanation, various types of information may be explained using expressions such as "database," "table," and "list," but the various types of information may be expressed in data structures other than these. To indicate independence from data structure, "XX table," "XX list," and the like may be referred to as "XX information." When explaining identification information, when expressions such as "identification information," "identifier," "name," "ID," and "number" are used, these are interchangeable.
同一あるいは同様な機能を有する構成要素が複数ある場合には、同一の符号に異なる添字を付して説明する場合がある。ただし、これらの複数の構成要素を区別する必要がない場合には、添字を省略して説明する場合がある。 When there are multiple components with the same or similar functions, they may be described using the same reference numerals with different subscripts. However, when there is no need to distinguish between these multiple components, the subscripts may be omitted.
また、以下の説明では、プログラムを実行して行う処理を説明する場合があるが、プログラムは、プロセッサ(例えばCPU(Central Processing Unit)、GPU(Graphics Processing Unit))によって実行されることで、定められた処理を、適宜に記憶資源(例えばメモリ)および/またはインターフェースデバイス(例えば通信ポート)等を用いながら行うため、処理の主体がプロセッサとされてもよい。同様に、プログラムを実行して行う処理の主体が、プロセッサを有するコントローラ、装置、システム、計算機、ノードであってもよい。プログラムを実行して行う処理の主体は、演算部であれば良く、特定の処理を行う専用回路(例えばFPGA(Field-Programmable Gate Array)やASIC(Application Specific Integrated Circuit))を含んでいてもよい。 In addition, the following description may describe processing performed by executing a program, but the program is executed by a processor (e.g., a CPU (Central Processing Unit), a GPU (Graphics Processing Unit)) to perform a specified process using storage resources (e.g., memory) and/or interface devices (e.g., communication ports) as appropriate, so the subject of the processing may be the processor. Similarly, the subject of the processing performed by executing a program may be a controller, device, system, computer, or node having a processor. The subject of the processing performed by executing a program may be a calculation unit, and may include a dedicated circuit (e.g., an FPGA (Field-Programmable Gate Array) or an ASIC (Application Specific Integrated Circuit)) that performs a specific process.
プログラムは、プログラムソースから計算機のような装置にインストールされてもよい。プログラムソースは、例えば、プログラム配布サーバまたは計算機が読み取り可能な記憶メディアであってもよい。プログラムソースがプログラム配布サーバの場合、プログラム配布サーバはプロセッサと配布対象のプログラムを記憶する記憶資源を含み、プログラム配布サーバのプロセッサが配布対象のプログラムを他の計算機に配布してもよい。また、以下の説明において、2以上のプログラムが1つのプログラムとして実現されてもよいし、1つのプログラムが2以上のプログラムとして実現されてもよい。 The program may be installed in a device such as a computer from a program source. The program source may be, for example, a program distribution server or a computer-readable storage medium. When the program source is a program distribution server, the program distribution server may include a processor and a storage resource that stores the program to be distributed, and the processor of the program distribution server may distribute the program to be distributed to other computers. Also, in the following description, two or more programs may be realized as one program, and one program may be realized as two or more programs.
以下、本実施例にかかるプログラム修正支援システム、プログラム修正支援方法の一実施例の構成について説明する。 The following describes the configuration of one embodiment of the program correction support system and program correction support method according to this embodiment.
図1は、本実施例におけるプログラム修正支援システムのハードウェア構成の一例を示す図である。以下では、プログラム修正支援システムが、ある1つのコンピュータであるプログラム修正装置100により構成される場合を例示するが、これらの機能の全部または一部が、クラウドのような1または複数のコンピュータに分散して設けられ、ネットワークを介して互いに通信することにより同様の機能を実現してもよい。プログラム修正装置100を構成する各部が行う具体的な処理については、フローチャートを用いて後述する。
図1に示すようにプログラム修正装置100は、CPU等のプロセッサ110と、メモリ等の主記憶装置120と、HDD(Hard Disk Drive)等の補助記憶装置130と、スキャナ、キーボード、マウスといった入力装置140と、ディスプレイ等の出力装置150と、通信ネットワークに接続するためのNIC(Network Interface Card)等の通信装置160と、を備えた一般的なコンピュータにより実現できる。
1 is a diagram showing an example of the hardware configuration of a program modification support system in this embodiment. In the following, an example is shown in which the program modification support system is configured by a
As shown in FIG. 1, the
図2は、図1に示したプログラム修正装置100の機能的な構成の一例を示す図である。図2に示すように、本実施例にかかるプログラム修正装置100は、不具合箇所特定部210と、パッチ候補生成部220と、テスト生成部230と、パッチ候補検証部240と、情報記憶部290とを有して構成される。また、情報記憶部290には、ソースコード291と、テストコード292と、不具合箇所候補293と、パッチ候補294と、テスト追加基準295と、生成後テストコード296と、修正結果297とが記憶される。
Figure 2 is a diagram showing an example of the functional configuration of the
プログラム修正装置100に記憶され、あるいは処理に用いられる様々なデータ(例えば、ソースコード291、テストコード292、不具合箇所候補293、パッチ候補294、テスト追加基準295、生成後テストコード296、修正結果297)は、プロセッサ110が主記憶装置120または補助記憶装置130から読み出して利用することにより実現可能である。また、プログラム修正装置100の各機能部(例えば、不具合箇所特定部210、パッチ候補生成部220、テスト生成部230、パッチ候補検証部240)は、プロセッサ110が補助記憶装置130に記憶されている所定のプログラムを主記憶装置120にロードして実行することにより実現可能である。
The various data stored in the
上述した所定のプログラムは、通信装置160を介してネットワークから、あるいはUSB(Universal Serial Bus)等の記憶媒体から、補助外部記憶装置130に記憶(ダウンロード)され、それから、主記憶装置120上にロードされて、プロセッサ110により実行されるようにしてもよいし、主記憶装置120上に直接ロードされ、プロセッサ110により実行されるようにしてもよい。
The above-mentioned specific program may be stored (downloaded) into the auxiliary
不具合箇所特定部210は、ソースコード291と、ソースコード291をテストするためのテストコード292とを用いて、ソースコード291の不具合箇所の候補を特定する。
The
パッチ候補生成部220は、所定の修正パタンに基づいて、ソースコードの不具合箇所の候補を修正したパッチ候補を生成する。
The patch
テスト生成部230は、上記ソースコードの不具合箇所の候補または/および上記パッチ候補の検証に関するテスト基準や後述するテスト追加基準に基づいて、前記ソースコードに対するテストケースを生成する。
The
図3は、ソースコード291の一例を示す図である。ソースコード291は、不具合を含むコードである。具体的には後述するが、図3では、例えば、ソースコード291に、本来であれば「false」が記述されるべきところ、「true」が記述された不具合箇所301が含まれていることを示している。
Figure 3 is a diagram showing an example of
図4は、テストコード292の一例を示す図である。テストコード292は、ソースコード291の不具合箇所を特定するためのコードである。図4では、例えば、数値「5」をソースコード291に入力した場合の期待値は「false」であり(test1)、数値「20」をソースコード291に入力した場合の期待値は「false」である(test2)ことを示している。
Figure 4 is a diagram showing an example of
図5は、不具合箇所候補293の一例を示す図である。不具合箇所候補293は、ソースコード291の含まれる不具合箇所の候補を記憶したテーブルである。図5に示すように、不具合箇所候補293は、不具合箇所を識別するためのIDと、当該IDで識別される不具合箇所の候補とが対応付けて記憶される。図5では、例えば、ID「1」で識別される不具合箇所の候補は「2行目」であることを示している。
Figure 5 is a diagram showing an example of
図6は、パッチ候補294の一例を示す図である。パッチ候補294は、ソースコード291を所定の修正パタンで修正したコードである。図6に示すように、パッチ候補294は、パッチの候補を識別するためのIDと、当該IDで識別されるパッチの候補とが対応付けて記憶される。図6では、例えば、ID「1」で識別されるパッチの候補は、ソースコード291の2行目の「x>1」を「x>=1」に修正したコードであることを示している。
Figure 6 is a diagram showing an example of a
図7は、テスト追加基準295の一例を示す図である。テスト追加基準295は、テストケースを追加する基準を定めたテーブルである。図7に示すように、テスト追加基準295は、追加する基準を識別するためのIDと、当該IDで識別されるテストの追加基準とが対応付けて記憶される。本例では特に例示していないが、追加される前のテスト基準については、従来から知られている様々な方法により定められているものとする。
Figure 7 is a diagram showing an example of
図7では、例えば、ID「1」で識別されるテストの追加基準は、「不具合箇所候補のカバレッジを上げる入力値」であることを示している。特許文献1では、テストケースの入力を生成する方法として、引数を並べ替えることが記載されているが、どのような基準でテストを行うのかについては開示されておらず、必ずしも適切にソースコードの不具合をテストすることができない。この例では、「不具合箇所候補のカバレッジを上げる入力値」のほか、「パッチ候補の条件式の境界値」をテスト追加基準として例示する。具体的には後述するが、前者の例では、不具合箇所特定の結果、不具合のある(あるいは可能性の高い)メソッドや命令ブロックに対してテストコードを生成するため、当該箇所のカバレッジ(テストで実行される処理、条件分岐、実行パスの網羅率)が向上することで、パッチ候補の検証精度を向上できる。また、後者の例では、パッチ候補生成の結果、出力されたパッチ候補に基づいてテストコードを生成するため、例えば、境界値を生成することで、パッチ候補の検証精度を向上できる。一例を示すと、if(x>0)をif(x>1)に修正すべきところ、パッチ候補としてif(x≧1)が生成された場合、境界値x=1を入力とするテストを追加することで、誤ったパッチ候補を落とすことができる。
In FIG. 7, for example, the additional criterion for the test identified by ID "1" is "input value that increases the coverage of the defective part candidate".
図8は、生成後テストコード296の一例を示す図である。生成後テストコード296は、テストコード292に、テスト追加基準295で定められた基準のテストコードが追加されたコードである。図8に示すように、生成後テストコード296は、図4に示したテストコード292に含まれるtest1、test2に、新たにtest3、test4、test5で示すコードが追加されていることを示している。
Figure 8 is a diagram showing an example of generated
図9は、修正結果297の一例を示す図である。修正結果297は、ソースコード291を修正した結果を示すコードである。図9に示すように、修正結果297は、図2に示したソースコード291を、図6に示したパッチ候補294のID「3」のコードで修正されていることを示している。
Figure 9 is a diagram showing an example of the
図10は、本実施例において行われるプログラム修正処理の処理手順を示すフローチャートの一例を示す図である。 Figure 10 is an example of a flowchart showing the processing steps of the program correction process performed in this embodiment.
S1010において、不具合箇所特定部210は、図4に示したテストコード292を図3に示したソースコード291に適用し、ソースコード291の不具合箇所を特定する。例えば、不具合箇所特定部210は、ソースコード中の各行に対し、不具合を含む可能性の高さを計算し、計算した結果が所定の閾値以上となる行を不具合箇所として特定する。不具合箇所特定部210は、特定した不具合箇所を、図5に示した不具合箇所候補293として出力する。
In S1010, the
S1020において、パッチ候補生成部220は、ソースコード291において、出力された不具合箇所を、所定の修正パタンにより修正したソースコードを、パッチ候補294として出力する。このように、パッチ候補生成部220は、不具合を含む可能性の高い行を書き換えることで、テストに通るような修正パッチ案を複数生成する。上記所定の修正パタンは、例えば、不足する文の挿入、インスタンス生成方法の変更、条件式の変更等、修正内容を記述したパタンをあらかじめ定めておけばよい。
In S1020, the patch
S1030において、テスト生成部230は、出力されたパッチ候補のそれぞれについて、テスト追加基準295に基づいたテストコードを生成する。S1003の具体的な処理については、図11を用いて後述する。
In S1030, the
S1040において、パッチ候補検証部240は、生成されたテストコードを実行し、あらかじめ定められた各種テストに成功するパッチ候補を、最終的なパッチ案として出力する。
At S1040, the patch
図11は、図10に示したS1003において行われるテスト生成処理の処理手順を示すフローチャートの一例を示す図である。 Figure 11 is an example of a flowchart showing the processing steps of the test generation process performed in S1003 shown in Figure 10.
S1110において、テスト生成部230は、修正前のソースコード291を解析し、入力値の条件と出力値の組を取得する。例えば、テスト生成部230は、図3に示したソースコード291を解析し、入力条件として、「x>1」および「x≦1」、それぞれに対応する出力「true」、「false」を取得する。これらの情報は、記号実行(シンボリック実行)等の技術を用いて実現することができる。
In S1110, the
S1120において、テスト生成部230は、追加される前のテストコードで実行されていない命令または条件を実行するような入力値と期待値を取得する。期待値は、修正前のソースコードの出力値としてもよい。例えば、図4に示したテストコード292では、ソースコード291における「x≦1」を満たすテストケースが記載されていない。したがって、テスト生成部230は、例えば、当該「x≦1」を満たすテストケースを満たすような「X=0」の入力値を取得する。S1120に示したように、テスト生成部230は、図7に示したテスト追加基準295を読み出し、ID「1」に対応する「不具合箇所候補のカバレッジを上げる入力値」を取得する。
In S1120, the
S1130において、テスト生成部230は、パッチ候補のそれぞれを解析し、入力条件の境界値を取得する。当該境界値の取得は、記号実行(シンボリック実行)等の技術を用いて実現することができる。例えば、テスト生成部230は、図6に示したID「1」のパッチ候補について、境界値として「x=1」を取得する。また、テスト生成部230は、ID「2」、「3」のパッチ候補について、境界値として「x=10」を取得する。S1130に示したように、テスト生成部230は、図7に示したテスト追加基準295を読み出し、ID「2」に対応する「パッチ候補の条件式の境界値」を取得する。
In S1130, the
S1140において、テスト生成部230は、取得したテストの入力値を開発者に提示し、正しい期待値を開発者から取得する。例えば、テスト生成部230は、出力装置150の一例であるディスプレイに、取得した境界値「x=1」、あるいは「x=10」を表示する。また、例えば、テスト生成部230は、開発者から、入力装置140の一例であるキーボードから入力された期待値「true」あるいは「false」を取得する。
In S1140, the
S1150において、テスト生成部230は、S1120、S1130において取得した入力値、およびS1140において取得した期待値をテストケースとするテストコードを生成する。例えば、テスト生成部230は、S1120で取得した入力値「X=0」および期待値「false」を含むコード801を、生成後テストコード296に追加する。また、テスト生成部230は、S1130で取得した入力値「X=1」および期待値「false」を含むコード802、および入力値「X=10」および期待値「true」を含むコード803を、生成後テストコード296に追加する。
In S1150, the
このように、本実施例では、演算部(例えば、CPU)と記憶部(例えば、メモリ)とを有したコンピュータにより、プログラムの修正を支援するプログラム修正支援システムにおいて、上記演算部は、ソースコード(例えば、ソースコード291)を解析し、当該解析により得られた上記ソースコードの入力値の条件と出力(例えば、「x>1」および「true」、「x≦1」および「false」の組)とを取得し、上記入力値の条件と出力とについての修正に関する候補を示す修正時情報(例えば、不具合箇所候補293、パッチ候補294)と、テストコード(例えば、テストコード292)により上記ソースコードをテストするテストケースを増やすためのテスト追加基準(例えば、テスト追加基準295)とに基づいて、上記テストケースを拡充する。このように、修正時情報とテスト追加基準に基づいたテストケースを拡充することで、パッチ候補検証において,正しくないパッチ候補を高い精度で除外できる。また、修正時情報とテスト追加基準に基づいたテストケースのみを拡充することで、開発者が期待値を設定する手間を削減できる。
In this embodiment, in a program correction support system that supports program correction using a computer having a calculation unit (e.g., a CPU) and a storage unit (e.g., a memory), the calculation unit analyzes source code (e.g., source code 291), obtains input value conditions and outputs (e.g., a set of "x>1" and "true", "x≦1" and "false") of the source code obtained by the analysis, and expands the test cases based on correction time information (e.g.,
また、上記修正時情報には、上記ソースコードの不具合箇所の候補(例えば、不具合箇所候補293に示したソースコード291の「2行目」)を含み、上記演算部は、上記不具合箇所のカバレッジが増加する入力を含むテストケース(例えば、ソースコード291における「x≦1」を満たすテストケース「X=0」)を生成し、上記テストケースを含むテストコードを出力する。したがって、パッチ候補検証において、不具合箇所のカバレッジを考慮しつつ、正しくないパッチ候補を高い精度で除外できる。
The modification time information also includes a candidate for the defective part of the source code (e.g., "
また、上記修正時情報には、上記ソースコードのパッチ候補(例えば、ソースコード291を所定の修正パタンで修正したパッチ候補294)を含み、上記演算部は、上記パッチ候補における境界値の入力を含むテストケース(例えば、パッチ候補294のID「1」のパッチ候補についての境界値「x=1」)を生成し、上記テストケースを含むテストコードを出力する。したがって、パッチ候補検証において、パッチ候補における境界値を考慮しつつ、正しくないパッチ候補を高い精度で除外できる。
The modification time information also includes a patch candidate for the source code (e.g.,
また、上記演算部は、テストの入力値(例えば、上記「X=0」の入力値)を生成し、生成した入力値に対する期待値を上記プログラム修正支援システムの外部から取得(例えば、開発者が入力した期待値「true」を取得)し、上記入力値と上記期待値を含むテストケースを生成し、上記テストケースを含むテストコードを生成する。したがって、開発者の想定(設計)通りのテストケースを生成でき、その結果、生成されるテストケースの品質を向上させることができる。 The calculation unit also generates a test input value (e.g., the input value of "X=0"), obtains an expected value for the generated input value from outside the program correction support system (e.g., obtains the expected value "true" input by the developer), generates a test case including the input value and the expected value, and generates test code including the test case. Therefore, it is possible to generate test cases as expected (designed) by the developer, and as a result, the quality of the generated test cases can be improved.
なお、本実施例では、取得した境界値を出力装置150の一例であるディスプレイに表示し、あるいは入力装置140の一例であるキーボードから入力された期待値を取得することとした。しかし、入力装置140としてマイクのような音声入力装置や、出力装置150としてスピーカのような音声出力装置を有する場合には、当該装置を通じた音声により境界値を出力したり、あるいは期待値の入力を受け付ける等、ユーザが認識可能な他の態様のインタフェースを用いてもよい。
In this embodiment, the acquired boundary value is displayed on a display, which is an example of the
本発明は、上記実施の形態そのままに限定されるものではなく、実施段階ではその要旨を逸脱しない範囲で構成要素を変形して具体化したり、上記実施の形態に開示されている複数の構成要素を適宜組み合わせて実施することができる。 The present invention is not limited to the above-described embodiment as it is, and in the implementation stage, the components can be modified and embodied without departing from the spirit of the invention, or multiple components disclosed in the above-described embodiment can be appropriately combined.
100 プログラム修正装置
210 不具合箇所特定部
220 パッチ候補生成部
230 テスト生成部
240 パッチ候補検証部
290 情報記憶部
291 ソースコード
292 テストコード
293 不具合箇所候補
294 パッチ候補
295 テスト追加基準
296 生成後テストコード
297 修正結果
100
Claims (6)
前記演算部は、
ソースコードを解析し、当該解析により得られた前記ソースコードの入力値の条件と出力とを取得し、
前記入力値の条件と出力とについての修正に関する候補を示す修正時情報と、テストコードにより前記ソースコードをテストするテストケースを増やすためのテスト追加基準とに基づいて、前記テストケースを拡充する場合において、
前記修正時情報には、前記ソースコードの不具合箇所の候補を含み、
前記演算部は、前記不具合箇所のカバレッジが増加する入力として、テストで実行される処理、条件分岐、実行パスの網羅率を向上させる入力を含むテストケースを生成し、前記テストケースを含むテストコードを出力する、
ことを特徴とするプログラム修正支援システム。 A program correction support system that supports program correction by a computer having a calculation unit and a storage unit,
The calculation unit is
Analyzing a source code, and obtaining input value conditions and outputs of the source code obtained by the analysis;
In a case where the test cases are expanded based on modification time information indicating candidates for modification of the input value conditions and the output and test addition criteria for increasing the number of test cases for testing the source code by the test code,
The modification time information includes candidates for defect locations in the source code,
the calculation unit generates a test case including an input that increases coverage of the defective portion, the input improving coverage of a process, a conditional branch, and an execution path executed in a test, and outputs a test code including the test case;
A program correction support system comprising:
前記演算部は、前記パッチ候補における境界値の入力を含むテストケースを生成し、前記テストケースを含むテストコードを出力する、
ことを特徴とする請求項1に記載のプログラム修正支援システム。 The modification time information includes a patch candidate for the source code,
the calculation unit generates a test case including an input of a boundary value in the patch candidate, and outputs a test code including the test case.
2. The program correction support system according to claim 1.
ことを特徴とする請求項1に記載のプログラム修正支援システム。 the calculation unit generates a test input value, acquires an expected value for the generated input value from outside the program correction support system, generates a test case including the input value and the expected value, and generates a test code including the test case;
2. The program correction support system according to claim 1.
ソースコードを解析し、当該解析により得られた前記ソースコードの入力値の条件と出力とを取得し、
前記入力値の条件と出力とについての修正に関する候補を示す修正時情報と、テストコードにより前記ソースコードをテストするテストケースを増やすためのテスト追加基準とに基づいて、前記テストケースを拡充する場合において、
前記修正時情報には、前記ソースコードの不具合箇所の候補を含み、
前記演算部は、前記不具合箇所のカバレッジが増加する入力として、テストで実行される処理、条件分岐、実行パスの網羅率を向上させる入力を含むテストケースを生成し、前記テストケースを含むテストコードを出力する、
ことを特徴とするプログラム修正支援方法。 A program modification support method performed in a program modification support system that supports program modification using a computer having a calculation unit and a storage unit, comprising:
Analyzing a source code, and obtaining input value conditions and outputs of the source code obtained by the analysis;
In a case where the test cases are expanded based on modification time information indicating candidates for modification of the input value conditions and the output and test addition criteria for increasing the number of test cases for testing the source code by the test code,
The modification time information includes candidates for defect locations in the source code,
the calculation unit generates a test case including an input that increases coverage of the defective portion, the input improving coverage of a process, a conditional branch, and an execution path executed in a test, and outputs a test code including the test case;
23. A program modification support method comprising:
前記パッチ候補における境界値の入力を含むテストケースを生成し、前記テストケースを含むテストコードを出力する、
ことを特徴とする請求項4に記載のプログラム修正支援方法。 The modification time information includes a patch candidate for the source code,
generating a test case including an input of a boundary value in the patch candidate, and outputting a test code including the test case;
5. The program correction support method according to claim 4 .
ことを特徴とする請求項4に記載のプログラム修正支援方法。 generating input values for a test, acquiring expected values for the generated input values from outside the program correction support system, generating test cases including the input values and the expected values, and generating test code including the test cases;
5. The program correction support method according to claim 4 .
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2022009741A JP7629880B2 (en) | 2022-01-25 | 2022-01-25 | Program modification support system and program modification support method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2022009741A JP7629880B2 (en) | 2022-01-25 | 2022-01-25 | Program modification support system and program modification support method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2023108555A JP2023108555A (en) | 2023-08-04 |
| JP7629880B2 true JP7629880B2 (en) | 2025-02-14 |
Family
ID=87475199
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2022009741A Active JP7629880B2 (en) | 2022-01-25 | 2022-01-25 | Program modification support system and program modification support method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP7629880B2 (en) |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2000029741A (en) | 1998-07-09 | 2000-01-28 | Fujitsu Ltd | Program test item creation device |
| JP2012248101A (en) | 2011-05-30 | 2012-12-13 | Ntt Data Corp | Program test support device, program test support method, and program test support program |
| WO2016170937A1 (en) | 2015-04-20 | 2016-10-27 | 三菱電機株式会社 | Test automation device, test automation method, and test automation program |
| JP2019029015A (en) | 2017-08-03 | 2019-02-21 | 富士通株式会社 | Interactive software program repair |
-
2022
- 2022-01-25 JP JP2022009741A patent/JP7629880B2/en active Active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2000029741A (en) | 1998-07-09 | 2000-01-28 | Fujitsu Ltd | Program test item creation device |
| JP2012248101A (en) | 2011-05-30 | 2012-12-13 | Ntt Data Corp | Program test support device, program test support method, and program test support program |
| WO2016170937A1 (en) | 2015-04-20 | 2016-10-27 | 三菱電機株式会社 | Test automation device, test automation method, and test automation program |
| JP2019029015A (en) | 2017-08-03 | 2019-02-21 | 富士通株式会社 | Interactive software program repair |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2023108555A (en) | 2023-08-04 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10671516B2 (en) | Method, device, and computer program product for testing code | |
| US8621441B2 (en) | System and method for software immunization based on static and dynamic analysis | |
| CN110532185B (en) | Test method, test device, electronic equipment and computer readable storage medium | |
| US11113183B2 (en) | Automated device test triaging system and techniques | |
| US11663113B2 (en) | Real time fault localization using combinatorial test design techniques and test case priority selection | |
| JP6878707B2 (en) | Test equipment, test methods and test programs | |
| US10761962B1 (en) | Automated software program repair | |
| US20140047276A1 (en) | Model-based testing of a graphical user interface | |
| JP2019029015A (en) | Interactive software program repair | |
| JP2015011372A (en) | Debug support system, method, program, and recording medium | |
| JP6567212B2 (en) | Equivalence verification device and equivalence verification program | |
| WO2025246269A1 (en) | Test code repairing method and related device | |
| EP3734460B1 (en) | Probabilistic software testing via dynamic graphs | |
| CN110609786A (en) | Software testing method and device, computer equipment and storage medium | |
| JP7629880B2 (en) | Program modification support system and program modification support method | |
| US10642716B1 (en) | Automated software program repair | |
| US10481969B2 (en) | Configurable system wide tests | |
| JP4957521B2 (en) | Software partial test system, method and program used therefor | |
| US10503854B1 (en) | Method and system for generating validation tests | |
| US20120167037A1 (en) | Software static testing apparatus and method | |
| CN114253828B (en) | Method, device, computing device and storage medium for determining test template | |
| JP2023042058A (en) | Information processing apparatus and information processing method | |
| WO2023058611A1 (en) | Software failure analysis apparatus and software failure analysis method | |
| US20260003772A1 (en) | Method for generating a fuzzing harness | |
| CN119556938B (en) | Code checking 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: 20240222 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20241120 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20241126 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20250115 |
|
| 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: 20250128 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20250203 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 7629880 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |