Skip to main content
QUICK REVIEW

[論文レビュー] Defect Category Prediction Based on Multi-Source Domain Adaptation

Ying Xing, Mengci Zhao|arXiv (Cornell University)|May 16, 2024
Industrial Vision Systems and Defect Detection被引用数 1
ひとこと要約

本稿では、敵対的訓練と重み付き最大平均差分(WMMD)注釈機構を統合することで欠陥カテゴリ予測を向上させる、マルチソースドメイン適応フレームワークCOPILOTを提案する。複数のソースプロジェクトを別々のドメインとしてモデル化し、それらの特徴分布をターゲットプロジェクトと一致させることで、8プロジェクトのオープンソースデータセットにおいて最先端の性能を達成し、多様な欠陥タイプやデータスパarsity状況下でも、F1、MCC、およびKappaスコアにおいて顕著に優れた結果を示した。

ABSTRACT

In recent years, defect prediction techniques based on deep learning have become a prominent research topic in the field of software engineering. These techniques can identify potential defects without executing the code. However, existing approaches mostly concentrate on determining the presence of defects at the method-level code, lacking the ability to precisely classify specific defect categories. Consequently, this undermines the efficiency of developers in locating and rectifying defects. Furthermore, in practical software development, new projects often lack sufficient defect data to train high-accuracy deep learning models. Models trained on historical data from existing projects frequently struggle to achieve satisfactory generalization performance on new projects. Hence, this paper initially reformulates the traditional binary defect prediction task into a multi-label classification problem, employing defect categories described in the Common Weakness Enumeration (CWE) as fine-grained predictive labels. To enhance the model performance in cross-project scenarios, this paper proposes a multi-source domain adaptation framework that integrates adversarial training and attention mechanisms. Specifically, the proposed framework employs adversarial training to mitigate domain (i.e., software projects) discrepancies, and further utilizes domain-invariant features to capture feature correlations between each source domain and the target domain. Simultaneously, the proposed framework employs a weighted maximum mean discrepancy as an attention mechanism to minimize the representation distance between source and target domain features, facilitating model in learning more domain-independent features. The experiments on 8 real-world open-source projects show that the proposed approach achieves significant performance improvements compared to state-of-the-art baselines.

研究の動機と目的

  • 従来の二値欠陥予測の限界を克服するため、CWE欠陥カテゴリを細分化されたラベルとして用いて、それを多ラベル分類タスクに再定式化すること。
  • ターゲットプロジェクトに十分なラベル付き欠陥データが存在しない状況下でも、クロスプロジェクト欠陥カテゴリ予測を改善すること。
  • 異種のソフトウェアプロジェクトから得られる知識を活用することで、ソースプロジェクトとターゲットプロジェクト間のドメインシフトを軽減すること。
  • ドメイン不変特徴学習と適応的注釈重み付けを用いて、モデルの汎化性能を向上させ、負の転送を低減すること。

提案手法

  • CWEカテゴリを細分化されたラベルとして用いて、従来の二値欠陥予測を多ラベル分類問題に再定式化する。
  • 敵対的訓練を用いてソースプロジェクトとターゲットプロジェクト間のドメイン差を低減するマルチソースドメイン適応フレームワークを提案する。
  • ソースドメインとターゲットドメインの特徴表現距離を最小化するために、重み付き最大平均差分(WMMD)機構を注釈モジュールとして導入する。
  • 敵対的訓練から得られるドメイン関連性スコアを用いて、異なるソースドメインの寄与度を重み付けし、適応的特徴一致を可能にする。
  • 共有エンコーダとタスク固有の分類器ヘッドを備えた深層ニューラルネットワークを訓練し、ドメイン一致と欠陥カテゴリ予測を同時に最適化する。
  • 二段階の訓練プロセスを採用:まず敵対的ドメイン適応を行い、次に注釈ベースの特徴精錬を伴うエンドツーエンドのファインチューニングを行う。

実験結果

リサーチクエスチョン

  • RQ1提案されたCOPILOTフレームワークは、クロスプロジェクト設定において最先端のベースラインと比較して、欠陥カテゴリ予測性能を顕著に向上させることができるか?
  • RQ2COPILOTは、入力検証やバッファオーバーフローなど、希少または複雑なカテゴリを含む多様な欠陥タイプに対しても効果的に対応できるか?
  • RQ3データスパarsityがCOPILOTの性能に与える影響は何か?また、低データレジーム下でのベースラインとの比較において、COPILOTはどのように性能を示すか?
  • RQ4敵対的訓練とWMMD注釈の統合は、モデルのロバストネスと汎化性能にどの程度寄与しているか?

主な発見

  • COPILOTは6つのCWE欠陥タイプカテゴリにおいて平均F1スコア0.932を達成し、最良のベースライン(ABMSDA)を36.4%上回った。
  • 深刻な欠陥のw_F1指標において、COPILOTは平均0.877を達成し、ABMSDAに対して44.9%向上、μVulDeePeckerに対して23.2%向上した。
  • RQ2のアブレーションスタディでは、敵対的訓練またはWMMD注釈を削除すると、平均Kappaスコアがそれぞれ0.945から0.935、0.927に低下し、両モジュールの重要性が確認された。
  • COPILOTはすべての欠陥データ量レベルで優れた性能を維持しており、欠陥カテゴリのサンプル数が36例を超えると最も安定した性能を示した。
  • Scott-Knott ESDテストにより、COPILOTはすべての評価指標(Acc、MCC、Kappa、F1、w_F1)で1位にランクされ、大多数の比較で大きな効果量(Cohenのd > 1.0)を示した。
  • モデルは強力な汎化性能を示し、データセットに含まれる8つのすべてのターゲットプロジェクト(Apache JMeter、Elasticsearch、JTreeなど)で最高の性能を達成した。

より良い研究を、今すぐ始めましょう

論文設計から論文執筆まで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。