[論文レビュー] A deep tree-based model for software defect prediction
この論文は、抽象構文木を直接操作してコード表現を学習し、欠陥予測のための木構造LSTMを導入する。SamsungとPROMISEデータセットで、同一プロジェクト内および跨プロジェクトで高い性能を示す。
Defects are common in software systems and can potentially cause various problems to software users. Different methods have been developed to quickly predict the most likely locations of defects in large code bases. Most of them focus on designing features (e.g. complexity metrics) that correlate with potentially defective code. Those approaches however do not sufficiently capture the syntax and different levels of semantics of source code, an important capability for building accurate prediction models. In this paper, we develop a novel prediction model which is capable of automatically learning features for representing source code and using them for defect prediction. Our prediction system is built upon the powerful deep learning, tree-structured Long Short Term Memory network which directly matches with the Abstract Syntax Tree representation of source code. An evaluation on two datasets, one from open source projects contributed by Samsung and the other from the public PROMISE repository, demonstrates the effectiveness of our approach for both within-project and cross-project predictions.
研究の動機と目的
- 大規模なコードベースにおけるテストとメンテナンスの優先順位付けに欠かせない欠陥予測を動機づける。
- ソースコードのASTに合わせて構文と意味を保持する深い木構造LSTMを提案する。
- ASTから直接表現を学習することで手動特徴量設計を排除する。
- 実際のオープンソースプロジェクト Samsung と PROMISE リポジトリで同一プロジェクト内および跨プロジェクトの予測を評価する。
提案手法
- ソースファイルを抽象構文木(AST)に解析する。
- ASTノードのラベルを埋め込み行列(ast2vec)を用いて固定次元のベクトルに埋め込む。
- 子の表現を統合して根のコード表現を生成する木構造LSTM(Tree-LSTM)を適用する。
- 子から親ノードのラベルを予測することで教師なしにTree-LSTMを訓練する(親ラベルのソフトマックス)。
- 学習済みの根表現を、欠陥予測のための従来の分類器(ロジスティック回帰またはランダムフォレスト)への入力として用いる。
実験結果
リサーチクエスチョン
- RQ1AST上の木構造LSTMは欠陥予測のために構文的・意味的情報を効果的に捉えられるか?
- RQ2ASTベースの表現学習は従来の特徴量ベースのアプローチと比較して同一プロジェクト内および跨プロジェクトの欠陥予測を改善するか?
- RQ3分類器の選択(Logistic Regression vs Random Forest)がデータセット間の予測性能にどのような影響を与えるか?
主な発見
- Samsungデータセット内では、Tree-LSTMの特徴量を用いたRandom ForestはF-measure、Precision、Recall、AUCがすべて0.9を大きく上回り、AUCは約0.98。
- PROMISEデータセット内では、本アプローチは平均AUCが0.60、リコールが高く0.86だが、精度とF-measureは一部のベースラインより低い。
- 跨プロジェクト予測は22プロジェクト対の平均リコールが高く(約0.8)、AUCは常に0.5を上回り、全体的な有効性を示している。
- 本研究はモデルが生のASTから学習する能力を示し、手動特徴量設計なしで欠陥予測を実現し、注意機構による局所化の可能性を提供する。
より良い研究を、今すぐ始めましょう
論文設計から論文執筆まで、研究時間を劇的に削減しましょう。
クレジットカード登録不要
このレビューはAIが作成し、人間の編集者が確認しました。