JP2016024784A - Bug prediction device, method, and program - Google Patents
Bug prediction device, method, and program Download PDFInfo
- Publication number
- JP2016024784A JP2016024784A JP2014151117A JP2014151117A JP2016024784A JP 2016024784 A JP2016024784 A JP 2016024784A JP 2014151117 A JP2014151117 A JP 2014151117A JP 2014151117 A JP2014151117 A JP 2014151117A JP 2016024784 A JP2016024784 A JP 2016024784A
- Authority
- JP
- Japan
- Prior art keywords
- revision
- bug
- matrix
- change
- storage means
- 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
Images
Landscapes
- Stored Programmes (AREA)
- Debugging And Monitoring (AREA)
Abstract
Description
本発明は、バグ予測装置及び方法及びプログラムに係り、特に、ソースコード上のバグを予測するためのバグ予測装置及び方法及びプログラムに関する。 The present invention relates to a bug prediction apparatus, method, and program, and more particularly, to a bug prediction apparatus, method, and program for predicting a bug in a source code.
ソースコード上でバグのありそうな箇所を連続するバージョンのソースコードから予測する技術や(例えば、非特許文献1参照)、ソースコード上で修正の多い箇所が、近い将来も修正される傾向にある、という経験則に基づいたバグ予測技術がある(例えば、非特許文献2参照)。 A technique for predicting likely bugs in the source code from successive versions of the source code (see, for example, Non-Patent Document 1), and many corrections on the source code tend to be corrected in the near future. There is a bug prediction technique based on the empirical rule that there is (see, for example, Non-Patent Document 2).
また、ソースコードの中で同時に変更される傾向にある箇所は機能的な関連性が高い、という経験則による、ソースコードから機能への多対多マッピング技術がある(例えば、非特許文献3参照)。 In addition, there is a many-to-many mapping technique from source code to function based on an empirical rule that parts that tend to be changed at the same time in the source code are highly functionally related (for example, see Non-Patent Document 3). ).
しかしながら、上記の非特許文献1の技術では、バグ予測の結果が「モジュール」であり、バグの多い「機能」を求められない、という問題がある。
However, the technique of Non-Patent
また、非特許文献2の技術は、バグが含まれそうなソースコード上の位置を予測可能ではあるが、バグの多い「機能」は求められない。
The technique of Non-Patent
非特許文献3の技術は、上記の非特許文献1,2の技術によってバグの多いソースコード箇所を求めた上で、当該非特許文献3の技術を適用することで、バグの多い機能の候補を求めることはできるが、その候補のうちどの機能が実際にバグを含んでいるのか特定できないという問題がある。
The technique of Non-Patent
本発明は、上記の点に鑑みなされたもので、作成したソフトウェアについて、製造工程開始後かつテスト工程開始前の期間に、テスト工程において見つけるべきバグが多く含まれる機能を予測することが可能なバグ予測装置及び方法及びプログラムを提供することを目的とする。 The present invention has been made in view of the above points, and it is possible to predict a function including many bugs to be found in the test process in the period after the start of the manufacturing process and before the start of the test process for the created software. It is an object to provide a bug prediction apparatus, method, and program.
一態様によれば、ソースコード上のバグが多く含まれる機能を検出するためのバグ予測装置であって、
近い過去に修正された箇所ほど近い将来にも修正されやすいという前提の下、ソースコードの変更履歴を取得し、該変更履歴からバグの修正が行われたと判断できるリビジョンのみに限定して、機能的な関連の強いソースコードの変更箇所を導出するための行列を作成し、該行列をクラスタリングすることによりバグが多く含まれる機能のソフトウェアの機能を推定するバグ推定手段を有するバグ予測装置が提供される。
According to one aspect, a bug prediction apparatus for detecting a function including many bugs in a source code,
Functionality is limited to only revisions that can be determined that bugs have been corrected based on the assumption that changes made in the near past are likely to be corrected in the near future. A bug prediction apparatus having a bug estimation means for estimating a function of software having a function including many bugs by creating a matrix for deriving a change point of a source code having a strong relation and clustering the matrix is provided. The
一態様によれば、作成したソフトウェアについて、製造工程開始後かつテスト工程開始前の期間に、テスト工程において見つけるべきバグが多く含まれるソフトウェアの機能を特定することが可能となる。 According to one aspect, it is possible to specify the function of software that includes many bugs to be found in the test process after the manufacturing process starts and before the test process starts.
以下、図面と共に本発明の実施の形態を説明する。 Hereinafter, embodiments of the present invention will be described with reference to the drawings.
本発明では、ソースコードの変更履歴からは、「近い過去に修正された箇所ほど将来にも修正されやすい」ことが知られており、バグの予測が可能であること、及び、ソースコードの変更履歴において、共有のリビジョンで共起的に変更される傾向にある一連のソースコード箇所は、機能的な関連の強いクラスタを構成するとき、ソースコードコメントやコミットメッセージを用いた特徴語抽出を併用することで、関連する機能の候補を導出可能であることを前提とする。 In the present invention, it is known from the change history of the source code that “the portion corrected in the near past is easier to be corrected in the future”, and that the bug can be predicted, and the change in the source code In a history, a series of source code parts that tend to change co-occurringly with shared revisions, together with feature word extraction using source code comments and commit messages, when forming a cluster with strong functional relationships Thus, it is assumed that related function candidates can be derived.
図1は、本発明の一実施の形態におけるバグ予測装置の構成例を示す。 FIG. 1 shows a configuration example of a bug prediction apparatus according to an embodiment of the present invention.
同図に示すバグ予測装置1は、ユーザ端末2に接続され、ユーザ端末2から問い合わせに対して、バグの多い機能を出力する。
A
バグ予測装置1は、変更箇所登録部10、バグ修正リビジョン登録部20、修正箇所行列登録部30、クラスタリング部40、特徴語抽出部50、VCS(Version Control System)リポジトリ11、変更箇所記憶部12、バグ修正リビジョン記憶部13、修正箇所行列記憶部14、クラスタ記憶部15を有する。
The
VCSリポジトリ11は、一般的には、図2に示すような機能を有する。リビジョン記憶部111は、リビジョン毎に管理下のファイル名、ファイル内容、コミットメッセージを記憶する。ファイル差分抽出機能112は、ユーザ端末2からコミット操作があると、追加、変更、削除のあったファイル名とコミットメッセージ及び、新しいリビジョンを取得し、ユーザ手元のファイルと、リビジョン記憶部111にある最新のリビジョンのファイルを比較して、差分を抽出する。リビジョン記録機能113は、差分、コミットログ、リビジョン番号をリビジョン記憶部111に追加し、当該処理が完了したことをユーザ端末2に通知する。リビジョン間差分計算機能114は、ユーザの比較操作により、リビジョン番号を2つ取得し、2つのリビジョン間にある差分(ファイルの存在、ファイルの内容)を求める。関数名導出機能115は、差分の箇所の前後コンテキストをもとに、その箇所の関数名を導出する。コミットメッセージ抽出機能116は、2つのリビジョン間にある全てのコミットメッセージを抽出し、差分の内容、差分箇所の関数名、コミットメッセージを返却する。なお、図1では、VCSリポジトリ11をバグ予測装置1内に設けているが、この例に限定されることなく、バグ予測装置1の外部に設けられていてもよい。
The
次に、上記の構成における各部の処理について説明する。 Next, the process of each part in said structure is demonstrated.
図3は、本発明の一実施の形態におけるバグ予測装置の概要動作のフローチャートである。 FIG. 3 is a flowchart of an outline operation of the bug prediction apparatus according to the embodiment of the present invention.
ステップ210) 変更箇所登録部10は、ユーザ端末2から問い合わせがあると、VCSリポジトリ11からリビジョンを読み出し、各リビジョンの変更箇所を収集して、変更箇所記憶部12に登録する。ユーザ端末2から問い合わせとして、VCSリポジトリ11の場所の指定が入力される。また、収集される変更箇所は、ファイル名と関数名からなる。変更箇所記憶部12は、収集された変更箇所のリビジョンの一覧である変更リビジョン一覧を持つ。詳細な処理については図5で説明する。
Step 210) Upon receiving an inquiry from the
ステップ220) バグ修正リビジョン登録部20は、VCSリポジトリ11から読み出したコミットメッセージに基づいて、バグを修正したと判断可能なリビジョンを、バグ修正リビジョン記憶部13に登録する。
Step 220) Based on the commit message read from the
ステップ230) 修正箇所行列登録部30は、ステップ210で変更箇所記憶部12に登録された変更箇所の集合について、ステップ220でバグ修正リビジョン記憶部13に登録されたバグ修正のリビジョンの1つ1つに、2つの変更箇所が共に変更されているかを表す行列を作成する。具体的には、図4に示すように、バグ修正リビジョン毎に1つの行列を作成する。行列の大きさは、行、列ともに、変更箇所の数である。行列は特定のリビジョンにおいて2つの変更箇所が共に変更されていることを表す。変更箇所iと変更箇所jがあるとき、着目するリビジョンにおいてiとjが共に変更されているならば、行列の要素(i,j)を"1"とし、そうでなければ"0"とする。図4の例は、変更箇所1と2のみがあるリビジョンにおいて変更されていることを示す。
Step 230) The correction part
得られた行列は修正箇所行列記憶部14に登録される。
The obtained matrix is registered in the corrected part
ステップ240) クラスタリング部40は、修正箇所行列記憶部14に登録された修正箇所行列の集合にクラスタリングアルゴリズムを適用することで、関連性の強い変更箇所同士をクラスタとする。具体的には、修正箇所行列記憶部14から修正箇所行列を読み出し、当該修正箇所行列に対して、与えられた複数のグラフから関連の高い部分グラフを求める技術(例えば、非特許文献4)を適用することで、分類結果であるクラスタが得られる。クラスタは変更箇所の集合で構成され、クラスタ記憶部15に格納される。
Step 240) The
ステップ250) 特徴語抽出部50は、クラスタ記憶部15のバグが含まれると考えられるソフトウェア機能の名前を、コミットメッセージに対する特徴語抽出により求める。具体的には、クラスタ記憶部15からクラスタリング結果を読み出し、個々のクラスタについて、ソフトウェア機能の名前を取得する。その処理内容は、クラスタを構成するすべての修正箇所を、変更箇所記憶部12を参照することにより、全ての変更箇所から変更リビジョン一覧を取得した後、各リビジョンにおけるコミットメッセージをバグ修正リビジョン記憶部13から取得し、コミットメッセージ群に対して、特徴的な単語を抽出する自然言語処理手法(例えば、非特許文献5参照)のような特徴語抽出アルゴリズムを適用する。得られた特徴語を、バグが含まれると考えられるソフトウェア機能名としてユーザ端末2に出力する。
Step 250) The feature
次に、上記のステップ210の変更箇所登録処理の詳細を説明する。 Next, the details of the change location registration process in step 210 will be described.
図5は、本発明の一実施の形態における変更箇所登録処理の詳細フローチャートである。 FIG. 5 is a detailed flowchart of the change location registration process according to the embodiment of the present invention.
以下のステップ310〜330の処理を、VCSリポジトリ11内のすべてのリビジョンについて繰り返す。
The following steps 310 to 330 are repeated for all revisions in the
ステップ310) 変更箇所登録部10は、VCSリポジトリ11中の着目しているi番目のリビジョンと、その1つ前のリビジョンを比較し、差分を抽出する。差分を抽出する際に、VCSのdiffコマンドを想定し、"+"、"−"、"*"、"!"などの記号で示された差分を、差分箇所毎に分類して保持する。
Step 310) The change
ステップ320) ステップ310で得られたそれぞれの差分に対して、差分箇所の位置する関数名を取得する。取得できない場合は近傍のシンボル名を用いる。 Step 320) For each difference obtained in Step 310, the function name where the difference portion is located is acquired. If it cannot be obtained, a nearby symbol name is used.
ステップ330) 差分箇所を変更箇所記憶部12に登録する。
Step 330) The difference part is registered in the changed
次に、上記のステップ220のバグ修正リビジョン登録処理の詳細を説明する。 Next, details of the bug correction revision registration process in step 220 will be described.
図6は、本発明の一実施の形態におけるバグ修正リビジョン登録処理の詳細フローチャートである。 FIG. 6 is a detailed flowchart of the bug correction revision registration process according to the embodiment of the present invention.
バグ修正リビジョン登録部20は、読み出したVCSリポジトリ11内のすべてのリビジョンに対して、以下のステップ410〜440までの処理を繰り返す。
The bug correction
ステップ410) VCSリポジトリ11から読み出されたリビジョンのコミットメッセージを取得する。
Step 410) A commit message of the revision read from the
ステップ420) コミットメッセージに基づいて、パッチがバグフィックスを含むかどうかを判断する手法(例えば、非特許文献6)を適用してバグの修正を表す表現が含まれているかを判断する。 Step 420) Based on the commit message, a method (for example, Non-Patent Document 6) for determining whether or not the patch includes a bug fix is applied to determine whether or not an expression representing a bug correction is included.
ステップ430) バグの修正を表す表現が含まれている場合には、ステップ440に移行し、含まれていない場合には、ステップ410の処理に戻る。 Step 430) If an expression representing a bug correction is included, the process proceeds to step 440. If not included, the process returns to step 410.
ステップ440) コミットメッセージにバグの修正を表す表現が含まれている場合には、当該リビジョンの番号とコミットメッセージをバグ修正リビジョン記憶部13に登録する。
Step 440) If the commit message includes an expression representing bug correction, the revision number and the commit message are registered in the bug correction
次に、ステップ230の修正箇所行列作成処理の詳細を説明する。 Next, details of the correction location matrix creation processing in step 230 will be described.
図7は、本発明の一実施の形態における修正箇所行列作成処理の詳細フローチャートである。 FIG. 7 is a detailed flowchart of the correction location matrix creation process according to the embodiment of the present invention.
ステップ510) 修正箇所行列登録部30は、バグ修正リビジョン記憶部13からリビジョンを読み出す。
Step 510) The correction location
ステップ520) 読み出したリビジョンの数をRvとする。 Step 520) Let Rv be the number of read revisions.
ステップ530) 変更箇所記憶部12から変更箇所を読み出す。
Step 530) The changed part is read from the changed
ステップ540) 読み出した変更箇所の数をPとする。 Step 540) Let P be the number of read changes.
ステップ550) 処理したリビジョンの数revを0に初期化する。 Step 550) The number of processed revisions rev is initialized to zero.
ステップ560) 修正箇所行列の初期化処理を行う。詳細な処理は図8で説明する。 Step 560) The correction location matrix is initialized. Detailed processing will be described with reference to FIG.
ステップ570) rev=rev+1とする。 Step 570) Set rev = rev + 1.
ステップ580) rev<Rvであればステップ560に戻り、rev≧Rvであれば当該修正箇所行列登録部30の処理を終了する。
Step 580) If rev <Rv, the process returns to Step 560, and if rev ≧ Rv, the process of the modified part
次に、上記のステップ560の処理を詳細に説明する。
Next, the process of
図8は、本発明の一実施の形態における修正箇所行列初期化処理の詳細フローチャートである。 FIG. 8 is a detailed flowchart of the correction location matrix initialization process according to the embodiment of the present invention.
ステップ6010) 修正箇所行列登録部30は、変更箇所記憶部12からrev番目の変更箇所を読み出し、Rとする。
Step 6010) The correction part
ステップ6020) T=P×Pのゼロ行列とする(ただし、Pは変更箇所記憶部12から読み出された変更箇所の数)。 Step 6020) A T = P × P zero matrix (where P is the number of changed locations read from the changed location storage unit 12).
ステップ6030) 変更箇所iをi=0とする。 Step 6030) The changed part i is set to i = 0.
ステップ6040) 変更箇所jをj=i+1とする。 Step 6040) The changed portion j is set to j = i + 1.
ステップ6050) i番目とj番目のユニークな変更箇所が、ともに、Rに含まれているかを判断する。 Step 6050) It is determined whether both the i-th and j-th unique changed portions are included in R.
ステップ6060) 含まれている場合にはステップ6070に移行し、含まれていない場合にはステップ6080に移行する。
Step 6060) If yes, go to
ステップ6070) T(i,j)=T(j,i)=1とする。 Step 6070) T (i, j) = T (j, i) = 1.
ステップ6080) j=j+1とする。
Step 6080) j =
ステップ6090) j<Pであればステップ6040に移行し、j≧Pであればステップ6100に移行する。
Step 6090) If j <P, go to
ステップ6100) 変更箇所iをi=i+1とする。 Step 6100) The changed part i is set to i = i + 1.
ステップ6110) i<Pであればステップ6040に戻り、i≧Pであればステップ6120に移行する。
Step 6110) If i <P, return to
ステップ6120) 行列Tとリビジョンrevを修正箇所行列記憶部14に登録する。
Step 6120) The matrix T and the revision rev are registered in the corrected part
次に、図3のステップ240のクラスタリング処理の詳細について説明する。
Next, details of the clustering process in
図9は、本発明の一実施の形態におけるクラスタリング処理の詳細フローチャートである。 FIG. 9 is a detailed flowchart of the clustering process according to the embodiment of the present invention.
ステップ710) クラスタリング部40は、修正箇所行列記憶部14からリビジョン毎の修正箇所行列を取り出す。
Step 710) The
ステップ720) 取り出した修正行列群に、与えられた複数のグラフから関連の高い部分を求める既存手法(例えば、非特許文献4)を適用してクラスタリングを行う。 Step 720) Clustering is performed by applying an existing method (for example, Non-Patent Document 4) for obtaining a highly relevant part from a plurality of given graphs to the extracted correction matrix group.
ステップ730) ステップ720でクラスタリングされた各クラスタをクラスタ記憶部15に登録する。
Step 730) The clusters clustered in Step 720 are registered in the
次に、図3のステップ250の特徴語抽出処理の詳細について説明する。
Next, the details of the feature word extraction process in
図10は、本発明の一実施の形態における特徴語抽出処理の詳細フローチャートである。 FIG. 10 is a detailed flowchart of the feature word extraction process according to the embodiment of the present invention.
ステップ810) 特徴語抽出部50は、クラスタ記憶部15からすべてのクラスタを読み出す。
Step 810) The feature
ステップ820) 変更箇所記憶部12からすべての変更箇所を読み出す。
Step 820) All changed portions are read from the changed
ステップ830)ステップ810で読み出されたすべてのクラスタに対して、クラスタ特徴語抽出処理を行う。詳細については図11で詳述する。 Step 830) Cluster feature word extraction processing is performed for all the clusters read in step 810. Details will be described in detail with reference to FIG.
ステップ840) ステップ830で得られた特徴語を、クラスタが表すバグの多い機能として出力する。 Step 840) The feature word obtained in step 830 is output as a buggy function represented by the cluster.
上記のステップ830のクラスタ特徴語抽出処理について説明する。 The cluster feature word extraction process in step 830 will be described.
図11は、本発明の一実施の形態におけるクラスタ特徴語抽出処理の詳細フローチャートである。 FIG. 11 is a detailed flowchart of cluster feature word extraction processing according to an embodiment of the present invention.
ステップ910)特徴語抽出部50は、クラスタ記憶部15から読み出されたクラスタを構成する変更箇所を取得する。
Step 910) The feature
ステップ920) 変更箇所を変更しているリビジョンの集合を取得する。 Step 920) Acquire a set of revisions whose changed portions are changed.
ステップ930) メモリ(図示せず)上の文書DをD=φとする。 Step 930) Document D on the memory (not shown) is set to D = φ.
ステップ940) バグ修正リビジョン記憶部13から、ステップ920で取得したリビジョンの集合の各リビジョンのコミットメッセージを読み出す。
Step 940) The commit message of each revision in the set of revisions acquired in Step 920 is read from the bug correction
ステップ950) リビジョンのコミットメッセージを文書Dに追加する。 Step 950) Add a revision commit message to document D.
ステップ960) 上記のステップ940,950の処理を、リビジョン集合のすべてのリビジョンに対して繰り返した後、文書Dに対する特徴語抽出を実行する。特徴語抽出処理は、特徴的な単語を抽出する自然言語処理手法(例えば、非特許文献5)をはじめとする既存の特徴語抽出技術を適用することにより実現できる。
Step 960) After the processes of
本実施の形態に係るバグ予測装置1は、例えば、1つ又は複数のコンピュータに、本実施の形態で説明する処理内容を記述したプログラムを実行させることにより実現可能である。すなわち、バグ予測装置1が有する機能は、当該コンピュータに内蔵されるCPUやメモリ、ハードディスクなどのハードウェア資源を用いて、バグ予測装置1で実施される処理に対応するプログラムを実行することによって実現することが可能である。また、上記プログラムは、コンピュータが読み取り可能な記録媒体(可搬メモリ等)に記録して、保存したり、配布したりすることが可能である。また、上記プログラムをインターネットや電子メールなど、ネットワークを通して提供することも可能である。
The
本発明は、上記の実施の形態に限定されることなく、特許請求の範囲内において、種々変更・応用が可能である。 The present invention is not limited to the above-described embodiments, and various modifications and applications are possible within the scope of the claims.
1 バグ予測装置
2 ユーザ端末
10 変更箇所登録部
11 VCS(Version Control System)リポジトリ
12 変更箇所記憶部
13 バグ修正リビジョン記憶部
14 修正箇所行列記憶部
15 クラスタ記憶部
20 バグ修正リビジョン登録部
30 修正箇所行列登録部
40 クラスタリング部
50 特徴語抽出部
111 リビジョン記憶部
112 ファイル差分抽出機能
113 リビジョン記録機能
114 リビジョン間差分計算機能
115 関数名導出機能
116 コミットメッセージ抽出機能
DESCRIPTION OF
Claims (7)
近い過去に修正された箇所ほど近い将来にも修正されやすいという前提の下、ソースコードの変更履歴を取得し、該変更履歴からバグの修正が行われたと判断できるリビジョンのみに限定して、機能的な関連の強いソースコードの変更箇所を導出するための行列を作成し、該行列をクラスタリングすることによりバグが多く含まれる機能のソフトウェアの機能を推定するバグ推定手段
を有することを特徴とするバグ予測装置。 A bug prediction device for detecting a function including many bugs in source code,
Functionality is limited to only revisions that can be determined that bugs have been corrected based on the assumption that changes made in the near past are likely to be corrected in the near future. A bug characterized by having a bug estimation means for estimating a function of software having a function that includes many bugs by creating a matrix for deriving a source code change part having a strong relation and clustering the matrix Prediction device.
少なくとも、ソースコードのリビジョン毎の変更履歴、コミットメッセージを格納した変更履歴記憶手段と、
前記変更履歴記憶手段からリビジョン毎の変更箇所を抽出して変更リビジョン一覧を変更箇所記憶手段に登録する変更箇所登録手段と、
前記変更履歴記憶手段からバグを修正したと判断可能なリビジョンを前記コミットメッセージに基づいて抽出し、バグ修正リビジョン記憶手段に登録するバグ修正リビジョン登録手段と、
前記変更箇所記憶手段から取得した前記変更リビジョン一覧について、前記バグ修正リビジョン記憶手段から取得した修正したリビジョン毎に2つの変更箇所が共に変更されているかを示す行列を生成し、修正箇所行列記憶手段に登録する修正箇所行列登録手段と、
前記修正箇所行列記憶手段の行列についてクラスタリングを行い、関連性の強い変更箇所同士をクラスタとし、クラスタ記憶手段に格納するクラスタリング手段と、
前記クラスタ記憶手段から取得した各クラスタを構成するすべての変更箇所に基づいて、前記変更箇所記憶手段から変更箇所のリビジョンを取得し、該リビジョンに基づいて、前記バグ修正リビジョン記憶手段から各リビジョンのコミットメッセージを取得し、該コミットメッセージの特徴語を抽出することにより、バグが含まれると推定されるソフトウェアの機能の名前を抽出する特徴語抽出手段と、
を有する請求項1記載のバグ予測装置。 The bug estimation means is:
At least a change history for each revision of the source code, a change history storage means storing a commit message,
Change location registration means for extracting a change location for each revision from the change history storage means and registering a change revision list in the change location storage means;
A revision that can be determined that a bug has been corrected from the change history storage means, based on the commit message, and that is registered in the bug correction revision storage means;
For the change revision list acquired from the change location storage means, a matrix indicating whether two change locations are changed for each corrected revision acquired from the bug correction revision storage means is generated, and the correction location matrix storage means Correction location matrix registration means to be registered in
Clustering for the matrix of the correction location matrix storage means, clustering the highly relevant change locations between each other, clustering means for storing in the cluster storage means,
Based on all the changed portions constituting each cluster acquired from the cluster storage unit, the revision of the changed portion is acquired from the changed portion storage unit, and based on the revision, the revision of each revision is acquired from the bug correction revision storage unit. A feature word extraction means for extracting the name of the function of the software presumed to include a bug by acquiring a commit message and extracting a feature word of the commit message;
The bug prediction apparatus according to claim 1, comprising:
前記行列の行及び列の数を変更箇所の数とし、前記修正したリビジョン毎に、変更箇所iと変更箇所jが共に変更されている場合は、該行列の要素(i,j)を1とし、そうでなければ0とする手段を含み、
前記クラスタリング手段は、
前記行列の要素(i,j)が1の変更箇所行列に対してクラスタリングを行う手段を含む
請求項2記載のバグ予測装置。 The corrected location matrix registration means includes:
The number of rows and columns of the matrix is the number of changed parts. If the changed part i and the changed part j are both changed for each revised revision, the matrix element (i, j) is set to 1. , Otherwise includes a means of 0,
The clustering means includes
3. The bug prediction apparatus according to claim 2, further comprising means for clustering the changed part matrix having an element (i, j) of 1 in the matrix.
近い過去に修正された箇所ほど近い将来にも修正されやすいという前提の下、ソースコードの変更履歴を取得し、該変更履歴からバグの修正が行われたと判断できるリビジョンのみに限定して、機能的な関連の強いソースコードの変更箇所を導出するための行列を作成し、該行列をクラスタリングすることによりバグが多く含まれる機能のソフトウェアの機能を推定するバグ推定ステップ
を行うことを特徴とするバグ予測方法。 A bug prediction method in a device for detecting a function containing many bugs in source code,
Functionality is limited to only revisions that can be determined that bugs have been corrected based on the assumption that changes made in the near past are likely to be corrected in the near future. A bug is characterized in that a bug estimation step for estimating a function of software of a function including many bugs is created by creating a matrix for deriving a source code change part having a strong relation and clustering the matrix. Prediction method.
少なくとも、ソースコードのリビジョン毎の変更履歴、コミットメッセージを格納した変更履歴記憶手段からリビジョン毎の変更箇所を抽出して変更リビジョン一覧を変更箇所記憶手段に登録する変更箇所登録ステップと、
前記変更履歴記憶手段からバグを修正したと判断可能なリビジョンを前記コミットメッセージに基づいて抽出し、バグ修正リビジョン記憶手段に登録するバグ修正リビジョン登録ステップと、
前記変更箇所記憶手段から取得した前記変更リビジョン一覧について、前記バグ修正リビジョン記憶手段から取得した修正したリビジョン毎に2つの変更箇所が共に変更されているかを示す行列を生成し、修正箇所行列記憶手段に登録する修正箇所行列登録ステップと、
前記修正箇所行列記憶手段の行列についてクラスタリングを行い、関連性の強い変更箇所同士をクラスタとし、クラスタ記憶手段に格納するクラスタリングステップと、
前記クラスタ記憶手段から取得した各クラスタを構成するすべての変更箇所に基づいて、前記変更箇所記憶手段から変更箇所のリビジョンを取得し、該リビジョンに基づいて、前記バグ修正リビジョン記憶手段から各リビジョンのコミットメッセージを取得し、該コミットメッセージの特徴語を抽出することにより、バグが含まれると推定されるソフトウェアの機能の名前を抽出する特徴語抽出ステップと、
を有する請求項4記載のバグ予測方法。 In the bug estimation step,
At least a change history for each revision of the source code, a change location registration step for extracting a change location for each revision from the change history storage means storing the commit message and registering a change revision list in the change location storage means;
A bug correction revision registration step of extracting a revision that can be determined to have corrected a bug from the change history storage means based on the commit message, and registering the revision in the bug correction revision storage means;
For the change revision list acquired from the change location storage means, a matrix indicating whether two change locations are changed for each corrected revision acquired from the bug correction revision storage means is generated, and the correction location matrix storage means A correction location matrix registration step to be registered in
Clustering with respect to the matrix of the corrected location matrix storage means, clustering the highly relevant change locations together, and storing in the cluster storage means,
Based on all the changed portions constituting each cluster acquired from the cluster storage unit, the revision of the changed portion is acquired from the changed portion storage unit, and based on the revision, the revision of each revision is acquired from the bug correction revision storage unit. A feature word extraction step of extracting a name of a software function that is estimated to include a bug by obtaining a commit message and extracting a feature word of the commit message;
The bug prediction method of Claim 4 which has these.
前記行列の行及び列の数を変更箇所の数とし、前記修正したリビジョン毎に、変更箇所iと変更箇所jが共に変更されている場合は、該行列の要素(i,j)を1とし、そうでなければ0とし、
前記クラスタリングステップにおいて、
前記行列の要素(i,j)が1の変更箇所行列に対してクラスタリングを行う
請求項5記載のバグ予測方法。 In the modified location matrix registration step,
The number of rows and columns of the matrix is the number of changed parts. If the changed part i and the changed part j are both changed for each revised revision, the matrix element (i, j) is set to 1. , Otherwise 0,
In the clustering step,
The bug prediction method according to claim 5, wherein clustering is performed on the changed portion matrix having an element (i, j) of 1 in the matrix.
請求項1乃至3のいずれか1項に記載のバグ予測装置の各手段として機能させるためのバグ予測プログラム。 Computer
A bug prediction program for functioning as each means of the bug prediction apparatus according to claim 1.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2014151117A JP2016024784A (en) | 2014-07-24 | 2014-07-24 | Bug prediction device, method, and program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2014151117A JP2016024784A (en) | 2014-07-24 | 2014-07-24 | Bug prediction device, method, and program |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2016024784A true JP2016024784A (en) | 2016-02-08 |
Family
ID=55271449
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2014151117A Pending JP2016024784A (en) | 2014-07-24 | 2014-07-24 | Bug prediction device, method, and program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2016024784A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2019079312A (en) * | 2017-10-25 | 2019-05-23 | クラリオン株式会社 | Source code analysis device, source code analysis method, and source code analysis program |
| US12361142B1 (en) * | 2024-02-13 | 2025-07-15 | Endor Labs Inc | Identifying and addressing potential vulnerabilities in third-party code |
-
2014
- 2014-07-24 JP JP2014151117A patent/JP2016024784A/en active Pending
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2019079312A (en) * | 2017-10-25 | 2019-05-23 | クラリオン株式会社 | Source code analysis device, source code analysis method, and source code analysis program |
| US12361142B1 (en) * | 2024-02-13 | 2025-07-15 | Endor Labs Inc | Identifying and addressing potential vulnerabilities in third-party code |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111026568B (en) | Data and task relation construction method and device, computer equipment and storage medium | |
| CN107729227B (en) | Application test scoping method, system, server and storage medium | |
| JP2021500658A (en) | Computer implementation methods, systems, and computer program products that perform interactive workflows, as well as computer programs. | |
| US20140298321A1 (en) | Installation control method and installation control apparatus | |
| CN110221933B (en) | Code defect auxiliary repair method and system | |
| US20160098390A1 (en) | Command history analysis apparatus and command history analysis method | |
| CN104915426B (en) | Information sorting method, the method and device for generating information sorting model | |
| JP6409577B2 (en) | Test selection program, test selection method, and test selection device | |
| JP2015026222A (en) | Test program, test method and test device | |
| US20130339787A1 (en) | Systematic failure remediation | |
| CN105893075A (en) | Update method and device of application | |
| CN118537666B (en) | Image detection method, device, electronic equipment and storage medium | |
| CN110750433A (en) | Interface testing method and device | |
| CN108255735B (en) | Associated environment testing method, electronic device and computer readable storage medium | |
| JP6437892B2 (en) | Software analysis system, software analysis method, and software analysis program | |
| US9116808B2 (en) | Method and system for determining device configuration settings | |
| CN108536467A (en) | Location processing method, device, terminal device and the storage medium of code | |
| US20210208996A1 (en) | Verification automation apparatus, verification automation method, and computer-readable recording medium | |
| JP2016024784A (en) | Bug prediction device, method, and program | |
| CN113254248B (en) | Fault diagnosis method, system and computing device | |
| CN103761247B (en) | A kind of processing method and processing device of error file | |
| CN115129596A (en) | Automatic interface testing method, system, device and storage medium | |
| JP2019101889A (en) | Test execution device and program | |
| US9465687B2 (en) | Information processing apparatus and information processing method | |
| CN107071553A (en) | Method, device and computer readable storage medium for modifying video and voice |