WO2020262257A1 - バグ同定支援装置、バグ同定支援方法及びプログラム - Google Patents

バグ同定支援装置、バグ同定支援方法及びプログラム Download PDF

Info

Publication number
WO2020262257A1
WO2020262257A1 PCT/JP2020/024227 JP2020024227W WO2020262257A1 WO 2020262257 A1 WO2020262257 A1 WO 2020262257A1 JP 2020024227 W JP2020024227 W JP 2020024227W WO 2020262257 A1 WO2020262257 A1 WO 2020262257A1
Authority
WO
WIPO (PCT)
Prior art keywords
bug
source file
value
line
bug identification
Prior art date
Application number
PCT/JP2020/024227
Other languages
English (en)
French (fr)
Inventor
治門 丹野
利行 倉林
弘之 切貫
芳樹 肥後
真佑 ▲松▼本
楠本 真二
Original Assignee
日本電信電話株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 日本電信電話株式会社 filed Critical 日本電信電話株式会社
Publication of WO2020262257A1 publication Critical patent/WO2020262257A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/10Services

Definitions

  • the present invention relates to a bug identification support device, a bug identification support method, and a program.
  • SBFL Spectrum-Based Fault Localization
  • SBFL a value indicating the high possibility that the line is the cause of the bug (hereinafter referred to as "suspicious value”) is used by using information on how many times each line is executed in the failure test case and the success test case. ) Is calculated.
  • the suspicious value is given only from the execution path (execution line) at the time of test case execution and the information on the success / failure of the test. Therefore, for example, as shown in FIG. , If there are many lines of suspicious value with the same value in multiple source files, it is not possible to rank them. As a result, it becomes difficult to narrow down the bugs.
  • FIG. 1 shows an example in which the same suspicious value of 0.7 is given to six locations L11 to L13 of the source file A and L12 to L14 of the source file B. In this case, there is no difference in the ranking of the relevant parts, and the part causing the bug cannot be narrowed down.
  • the present invention has been made in view of the above points, and an object of the present invention is to support narrowing down of the cause of a bug.
  • the bug identification support device violates the predefined rules for the source file in which the value indicating the high possibility of causing the bug is given to each line. It has a counting unit that counts the number of characters, and a changing unit that changes the value given to each line of the source file based on the number.
  • FIG. 2 is a diagram showing a hardware configuration example of the bug identification support device 10 according to the embodiment of the present invention.
  • the bug identification support device 10 of FIG. 2 has a drive device 100, an auxiliary storage device 102, a memory device 103, a CPU 104, an interface device 105, a display device 106, an input device 107, and the like, which are connected to each other by a bus B, respectively. ..
  • the program that realizes the processing by the bug identification support device 10 is provided by a recording medium 101 such as a CD-ROM.
  • a recording medium 101 such as a CD-ROM.
  • the program is installed in the auxiliary storage device 102 from the recording medium 101 via the drive device 100.
  • the program does not necessarily have to be installed from the recording medium 101, and may be downloaded from another computer via the network.
  • the auxiliary storage device 102 stores the installed program and also stores necessary files, data, and the like.
  • the memory device 103 reads and stores the program from the auxiliary storage device 102 when the program is instructed to start.
  • the CPU 104 realizes the function related to the bug identification support device 10 according to the program stored in the memory device 103.
  • the interface device 105 is used as an interface for connecting to a network.
  • the display device 106 displays a programmatic GUI (Graphical User Interface) or the like.
  • the input device 107 is composed of a keyboard, a mouse, and the like, and is used for inputting various operation instructions.
  • FIG. 3 is a diagram showing a functional configuration example of the bug identification support device 10 according to the embodiment of the present invention.
  • the bug identification support device 10 has a bug identification unit 11 and a suspicious value correction unit 12. Each of these parts is realized by a process of causing the CPU 104 to execute one or more programs installed in the bug identification support device 10.
  • the bug identification support device 10 also uses the code convention storage unit 13.
  • the code convention storage unit 13 can be realized by using, for example, a storage device that can be connected to the auxiliary storage device 102 or the bug identification support device 10 via a network.
  • the bug identification unit 11 uses SBFL (Spectrum-Based Fault Localization) disclosed in Non-Patent Document 1 to indicate that the line is the cause of the bug for each line of each source file of the program to be debugged.
  • SBFL Spectrum-Based Fault Localization
  • a value indicating a high possibility hereinafter referred to as "suspicious value" is given. That is, the suspicious value is given to each row using information about how many times each row was executed in the failure test case and the success test case.
  • the suspicious value correction unit 12 counts (counts) the number of times the code convention is violated in the source file for each source file to which the suspicious value is assigned to each line by the bug identification unit 11, and based on the number of times. Then, the suspicious value of each line of the source file is changed (corrected). That is, the suspicious value correction unit 12 considers that the source file that violates the code convention more frequently is more likely to be the cause of the bug, and the suspicious value correction unit 12 is based on the idea that the suspicious value of each line of the source file that violates the code convention more frequently. Is executed so that is relatively high.
  • the code convention storage unit 13 stores the code convention. Examples of code conventions include "do not declare unused local variables" and "naming conventions for variables and functions".
  • FIG. 4 is a flowchart for explaining an example of the processing procedure executed by the suspicious value correction unit 12.
  • the auxiliary storage device 102 stores a group of source files in which a suspicious value is assigned to each line by the bug identification unit 11 for the program to be debugged.
  • step S101 the suspicious value correction unit 12 reads into the memory device 103 one source file of the source files that is not the target of execution of the processing procedure of FIG.
  • the read source file is referred to as a "target file”.
  • the suspicious value correction unit 12 determines the number of locations in the target file that violate each code convention stored in the code convention storage unit 13 (that is, the number of times that the code convention is violated in the target file). ) Is counted, and the count result is substituted into the code convention violation number C (S102).
  • the suspicious value correction unit 12 outputs (saves) the target file whose suspicious value has been corrected to, for example, the auxiliary storage device 102 (S104).
  • Steps S101 to S104 are executed for all the source files constituting the target source file group (S105).
  • FIG. 5 is a diagram for explaining the effect of the embodiment of the present invention.
  • the suspicious value of each line (each statement) of the source file B is corrected and increased by the operation described in step S103.
  • the user can presume that the source file B is more likely to be the cause of the bug when the source file A and the source file B have the same suspicious value.
  • each line of the source file that frequently violates the code convention is displayed. A higher suspicion value can be given. As a result, it is possible to help narrow down the cause of the bug.
  • the code convention violation number C is a value indicating a part that violates the code convention in the source file.
  • the type of code convention that is violated in the source file The number may be the number C of code convention violations.
  • the suspicious value correction unit 12 is an example of a counting unit and a changing unit.
  • Bug identification support device 11
  • Bug identification unit 12
  • Suspicious value correction unit 13
  • Code convention storage unit 100
  • Drive device 101
  • Recording medium 102
  • Auxiliary storage device 103
  • Memory device 104
  • Interface device 106
  • Display device 107

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Tourism & Hospitality (AREA)
  • General Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Health & Medical Sciences (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Human Resources & Organizations (AREA)
  • General Health & Medical Sciences (AREA)
  • Economics (AREA)
  • Primary Health Care (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • General Engineering & Computer Science (AREA)
  • Debugging And Monitoring (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Stored Programmes (AREA)

Abstract

バグ同定支援装置は、各行に対してバグの原因である可能性の高さを示す値が付与されたソースファイルについて、予め定義された規約に対して違反している数を計数する計数部と、前記数に基づいて、前記ソースファイルの各行に付与された前記値を変更する変更部と、を有することで、バグの原因箇所の絞り込みを支援する。

Description

バグ同定支援装置、バグ同定支援方法及びプログラム
 本発明は、バグ同定支援装置、バグ同定支援方法及びプログラムに関する。
 ソフトウェア開発には様々な工程があり、その中でもデバッグ作業には多くの時間を要する。そのため、開発工程を短縮するためにデバッグ支援の研究が盛んに行われている。これまでに、デバッグにおけるバグ原因箇所特定のために、バグ同定の自動化が行われてきた。
 従来、様々な自動バグ同定手法が提案されている。その中で近年最も盛んに研究されている手法が、テストケースによるソースファイル(ソースコード)内の実行経路の情報を用いて自動バグ同定を行うSpectrum-Based Fault Localization(SBFL)(非特許文献1)である。SBFLは、ソースファイル内の各行のうち、失敗テストケースで実行された行はバグ原因箇所である可能性が高く、成功テストケースで実行された行はバグ原因箇所である可能性が低い、というアイデアに基づいてバグ同定を行う手法である。SBFLでは、各行が失敗テストケース、及び成功テストケースで何回実行されたかという情報を用いて、その行がバグ原因箇所である可能性の高さを示す値(以下、「疑惑値」という。)が計算される。
Souza, Higor Amario de, Marcos Lordello Chaim and Fabio Kon. "Spectrum-based Software Fault Localization: A Survey of Techniques, Advances, and Challenges." CoRR abs/1607.04347 (2016): n. pag.
 しかしながら、既存のバグ同定技術では、テストケース実行時の実行経路(実行した行)と、テストの成功/失敗に関する情報のみから疑惑値を付与しているため、例えば、図1に示されるように、複数のソースファイルにおいて同じ値の疑惑値の行が多く存在すると、その中で順位付けをすることができない。その結果、バグ箇所の絞り込みが困難になる。
 具体的には、図1には、ソースファイルAのL11~L13、ソースファイルBのL12~L14の6箇所に対して、同じ疑惑値0.7が付与された例が示されている。この場合、当該箇所に順位の差はなく、バグ原因箇所を絞りきれていない。
 本発明は、上記の点に鑑みてなされたものであって、バグの原因箇所の絞り込みを支援することを目的とする。
 そこで上記課題を解決するため、バグ同定支援装置は、各行に対してバグの原因である可能性の高さを示す値が付与されたソースファイルについて、予め定義された規約に対して違反している数を計数する計数部と、前記数に基づいて、前記ソースファイルの各行に付与された前記値を変更する変更部と、を有する。
 バグの原因箇所の絞り込みを支援することができる。
複数のソースファイルに同じ値の疑惑値が付与された行が多数存在する例を示す図である。 本発明の実施の形態におけるバグ同定支援装置10のハードウェア構成例を示す図である。 本発明の実施の形態におけるバグ同定支援装置10の機能構成例を示す図である。 疑惑値補正部12が実行する処理手順の一例を説明するためのフローチャートである。 本発明の実施の形態の効果を説明するための図である。
 以下、図面に基づいて本発明の実施の形態を説明する。図2は、本発明の実施の形態におけるバグ同定支援装置10のハードウェア構成例を示す図である。図2のバグ同定支援装置10は、それぞれバスBで相互に接続されているドライブ装置100、補助記憶装置102、メモリ装置103、CPU104、インタフェース装置105、表示装置106、及び入力装置107等を有する。
 バグ同定支援装置10での処理を実現するプログラムは、CD-ROM等の記録媒体101によって提供される。プログラムを記憶した記録媒体101がドライブ装置100にセットされると、プログラムが記録媒体101からドライブ装置100を介して補助記憶装置102にインストールされる。但し、プログラムのインストールは必ずしも記録媒体101より行う必要はなく、ネットワークを介して他のコンピュータよりダウンロードするようにしてもよい。補助記憶装置102は、インストールされたプログラムを格納すると共に、必要なファイルやデータ等を格納する。
 メモリ装置103は、プログラムの起動指示があった場合に、補助記憶装置102からプログラムを読み出して格納する。CPU104は、メモリ装置103に格納されたプログラムに従ってバグ同定支援装置10に係る機能を実現する。インタフェース装置105は、ネットワークに接続するためのインタフェースとして用いられる。表示装置106はプログラムによるGUI(Graphical User Interface)等を表示する。入力装置107はキーボード及びマウス等で構成され、様々な操作指示を入力させるために用いられる。
 図3は、本発明の実施の形態におけるバグ同定支援装置10の機能構成例を示す図である。図3において、バグ同定支援装置10は、バグ同定部11及び疑惑値補正部12を有する。これら各部は、バグ同定支援装置10にインストールされた1以上のプログラムが、CPU104に実行させる処理により実現される。バグ同定支援装置10は、また、コード規約記憶部13を利用する。コード規約記憶部13は、例えば、補助記憶装置102、又はバグ同定支援装置10にネットワークを介して接続可能な記憶装置等を用いて実現可能である。
 バグ同定部11は、例えば、非特許文献1に開示されたSBFL(Spectrum-Based Fault Localization)を用いて、デバッグ対象のプログラムの各ソースファイルの各行に対して、当該行がバグの原因箇所である可能性の高さを示す値(以下、「疑惑値」という。)を付与する。すなわち、疑惑値は、各行が失敗テストケース、及び成功テストケースで何回実行されたかという情報を用いて各行に付与される。
 疑惑値補正部12は、バグ同定部11によって各行に疑惑値が付与された各ソースファイルについて、当該ソースファイル内でコード規約に違反している回数を計数し(カウントし)、当該回数に基づいて、当該ソースファイルの各行の疑惑値を変更(補正)する。すなわち、疑惑値補正部12は、コード規約に違反している回数が多いソースファイルほどバグの原因箇所である可能性が高いであろうという考えに基づき、当該回数が多いソースファイルの各行の疑惑値が相対的に高くなるようにするための処理を実行する。コード規約記憶部13には、コード規約が記憶されている。コード規約としては、例えば、「未使用ローカル変数は宣言しない」、「変数や関数等の命名規則」等が挙げられる。
 以下、疑惑値補正部12が実行する処理手順について説明する。図4は、疑惑値補正部12が実行する処理手順の一例を説明するためのフローチャートである。なお、図4の処理手順の開始時において、例えば、補助記憶装置102には、デバッグ対象のプログラムについて、バグ同定部11によって各行に疑惑値が付与されたソースファイル群が記憶されている。
 ステップS101において、疑惑値補正部12は、当該ソースファイル群のうち、図4の処理手順の実行対象とされていない一つのソースファイルをメモリ装置103に読み込む。以下、読み込まれたソースファイルを「対象ファイル」という。
 続いて、疑惑値補正部12は、対象ファイルについて、コード規約記憶部13に記憶されている各コード規約に違反している箇所の数(すなわち、対象ファイル内においてコード規約に違反している回数)をカウントし、カウント結果をコード規約違反数Cに代入する(S102)。
 続いて、疑惑値補正部12は、コード規約違反数Cに基づいて、対象ファイルの各行の疑惑値を変更(補正)する(S103)。例えば、補正前の疑惑値をVとし、補正後(変更後)の疑惑値をV'として場合、疑惑値補正部12は、以下の演算によって、各行の疑惑値を補正してもよい。
V'=V×(1+C×0.1)
 更に、疑惑値補正部12は、当該演算結果が1.0より大きくなる場合には、当該疑惑値を1.0としてもよい。すなわち、疑惑値補正部12は、以下の定義に基づいて、疑惑値の補正を行ってもよい。
V'=Min(V×(1+C×0.1),1.0)
但し、Min(x,y)はx、yのうち最小値をとる関数
 いずれの場合であっても、コード規約違反数Cが大きいほど、補正後の疑惑値が相対的に大きくなるように、疑惑値の補正が行われる。
 続いて、疑惑値補正部12は、疑惑値が補正された対象ファイルを、例えば、補助記憶装置102へ出力(保存)する(S104)。
 ステップS101~S104は、対象のソースファイル群を構成する全てのソースファイルに対して実行される(S105)。
 図4の処理手順によれば、図1に示した状況は、例えば、図5に示されるように変更される。図5は、本発明の実施の形態の効果を説明するための図である。図5では、ソースファイルAについてはコード規約違反数C=0であり、ソースファイルBについてはコード規約違反数C=1である例が示されている。この場合、ソースファイルBの各行(各ステートメント)の疑惑値が、ステップS103において説明した演算により補正されて大きくされる。その結果、ユーザは、ソースファイルAとソースファイルBとで同じ疑惑値だった箇所について、ソースファイルBの方がバグの原因である可能性が高いと推定することができる。
 上述したように、本実施の形態によれば、SBFL等の既存のバグ同定手法では疑惑値に差がなかった箇所についても、コード規約に違反をしている回数が多いソースファイルの各行にはより高い疑惑値が付与されるようにすることができる。その結果、バグの原因箇所の絞り込みを支援することができる。
 なお、上記において、コード規約違反数Cは、ソースファイル中においてコード規約に違反している箇所を示す値である例を説明したが、例えば、ソースファイル中において違反しているコード規約の種類の数がコード規約違反数Cとされてもよい。
 なお、本実施の形態において、疑惑値補正部12は、計数部及び変更部の一例である。
 以上、本発明の実施の形態について詳述したが、本発明は斯かる特定の実施形態に限定されるものではなく、特許請求の範囲に記載された本発明の要旨の範囲内において、種々の変形・変更が可能である。
10     バグ同定支援装置
11     バグ同定部
12     疑惑値補正部
13     コード規約記憶部
100    ドライブ装置
101    記録媒体
102    補助記憶装置
103    メモリ装置
104    CPU
105    インタフェース装置
106    表示装置
107    入力装置
B      バス

Claims (6)

  1.  各行に対してバグの原因である可能性の高さを示す値が付与されたソースファイルについて、予め定義された規約に対して違反している数を計数する計数部と、
     前記数に基づいて、前記ソースファイルの各行に付与された前記値を変更する変更部と、
    を有することを特徴とするバグ同定支援装置。
  2.  前記変更部は、前記数が多いほど、変更後の値が大きくなるように前記ソースファイルの各行に付与された前記値を変更する、
    ことを特徴とする請求項1記載のバグ同定支援装置。
  3.  各行に対してバグの原因である可能性の高さを示す値が付与されたソースファイルについて、予め定義された規約に対して違反している数を計数する計数手順と、
     前記数に基づいて、前記ソースファイルの各行に付与された前記値を変更する変更手順と、
    をコンピュータが実行することを特徴とするバグ同定支援方法。
  4.  前記変更手順は、前記数が多いほど、変更後の値が大きくなるように前記ソースファイルの各行に付与された前記値を変更する、
    ことを特徴とする請求項3記載のバグ同定支援方法。
  5.  各行に対してバグの原因である可能性の高さを示す値が付与されたソースファイルについて、予め定義された規約に対して違反している数を計数する計数手順と、
     前記数に基づいて、前記ソースファイルの各行に付与された前記値を変更する変更手順と、
    をコンピュータに実行させることを特徴とするプログラム。
  6.  前記変更手順は、前記数が多いほど、変更後の値が大きくなるように前記ソースファイルの各行に付与された前記値を変更する、
    ことを特徴とする請求項5記載のプログラム。
PCT/JP2020/024227 2019-06-25 2020-06-19 バグ同定支援装置、バグ同定支援方法及びプログラム WO2020262257A1 (ja)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2019117779A JP2021005171A (ja) 2019-06-25 2019-06-25 バグ同定支援装置、バグ同定支援方法及びプログラム
JP2019-117779 2019-06-25

Publications (1)

Publication Number Publication Date
WO2020262257A1 true WO2020262257A1 (ja) 2020-12-30

Family

ID=74060960

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2020/024227 WO2020262257A1 (ja) 2019-06-25 2020-06-19 バグ同定支援装置、バグ同定支援方法及びプログラム

Country Status (2)

Country Link
JP (1) JP2021005171A (ja)
WO (1) WO2020262257A1 (ja)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116348510A (zh) 2020-10-23 2023-06-27 三菱化学株式会社 树脂组合物及其成型品

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016038612A (ja) * 2014-08-05 2016-03-22 富士通株式会社 情報処理プログラム、方法及び装置

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016038612A (ja) * 2014-08-05 2016-03-22 富士通株式会社 情報処理プログラム、方法及び装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
TAKAI, YASUNARI ET AL.: "Towards detection of automatically undetectable violations focused on the locality of coding standards violations", IEICE TECHNICAL REPORT, vol. 112, no. 458, 27 February 2013 (2013-02-27), pages 51 - 56, ISSN: 0913-5685 *

Also Published As

Publication number Publication date
JP2021005171A (ja) 2021-01-14

Similar Documents

Publication Publication Date Title
US9311223B2 (en) Prioritizing test cases using multiple variables
US8621441B2 (en) System and method for software immunization based on static and dynamic analysis
US9658907B2 (en) Development tools for refactoring computer code
US8336032B2 (en) Implementing enhanced template debug
US7530056B1 (en) Method and system for detecting runtime defects in a program by comparing correct and incorrect runs
US20150269060A1 (en) Development tools for logging and analyzing software bugs
EP2960799A1 (en) Defect localization in software integration tests
US9239773B1 (en) Method and system for debugging a program that includes declarative code and procedural code
US9292652B2 (en) Generic design rule checking (DRC) test case extraction
US10176077B2 (en) Generating breakpoints for cross-layer debugging
US9262305B1 (en) Simulation observability and control of all hardware and software components of a virtual platform model of an electronics system
WO2019055378A1 (en) METHOD AND APPARATUS FOR FINDING LONG PROCESSES IN A CODE
US9792402B1 (en) Method and system for debugging a system on chip under test
US20110154127A1 (en) Test support system, method and computer program product, which optimize test scenarios to minimize total test time
US11042466B2 (en) Exception prediction before an actual exception during debugging
US20140149800A1 (en) Test method and test control apparatus
US9396097B2 (en) Methods, circuits, devices, systems and associated computer executable code for testing software code
Gong et al. State dependency probabilistic model for fault localization
WO2020113526A1 (zh) 一种芯片验证方法和装置
WO2020262257A1 (ja) バグ同定支援装置、バグ同定支援方法及びプログラム
US10394699B1 (en) Method and system for reusing a refinement file in coverage grading
US8918763B2 (en) Marked test script creation
JP6512032B2 (ja) スタブ化対象判定装置、方法、及びプログラム
JP2018018197A (ja) ソースコード評価プログラム
JP2013541189A (ja) 半導体プロセスレシピを自動検証するための方法及び装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20831088

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20831088

Country of ref document: EP

Kind code of ref document: A1