Skip to main content
QUICK REVIEW

[論文レビュー] Traceability Transformed: Generating more Accurate Links with Pre-Trained BERT Models

Jinfeng Lin, Yalin Liu|arXiv (Cornell University)|Feb 8, 2021
Software Engineering Research被引用数 7
ひとこと要約

本論文は、オープンソースプロジェクトにおけるバグ報告とコミットの間のより正確なトレースリンクを生成するために、事前学習済みBERTモデルを活用する新しいフレームワーク、T-BERTを提案する。関連するコード検索タスクからの知識の転送により、データスパarsityを克服し、従来のVSMモデルと比較して顕著に高い精度を達成した。MAPの平均で60.31%の向上を達成した。単一BERTアーキテクチャが最良のパフォーマンスを示し、シamese-BERTは高速かつほぼ同等の代替手段を提供する。

ABSTRACT

Software traceability establishes and leverages associations between diverse development artifacts. Researchers have proposed the use of deep learning trace models to link natural language artifacts, such as requirements and issue descriptions, to source code; however, their effectiveness has been restricted by availability of labeled data and efficiency at runtime. In this study, we propose a novel framework called Trace BERT (T-BERT) to generate trace links between source code and natural language artifacts. To address data sparsity, we leverage a three-step training strategy to enable trace models to transfer knowledge from a closely related Software Engineering challenge, which has a rich dataset, to produce trace links with much higher accuracy than has previously been achieved. We then apply the T-BERT framework to recover links between issues and commits in Open Source Projects. We comparatively evaluated accuracy and efficiency of three BERT architectures. Results show that a Single-BERT architecture generated the most accurate links, while a Siamese-BERT architecture produced comparable results with significantly less execution time. Furthermore, by learning and transferring knowledge, all three models in the framework outperform classical IR trace models. On the three evaluated real-word OSS projects, the best T-BERT stably outperformed the VSM model with average improvements of 60.31% measured using Mean Average Precision (MAP). RNN severely underperformed on these projects due to insufficient training data, while T-BERT overcame this problem by using pretrained language models and transfer learning.

研究の動機と目的

  • 深層学習を用いた自動ソフトウェアトレーサビリティにおける低精度およびデータスパarsity問題を解決すること。
  • データ豊富な関連タスク(コード検索)から効果的な転移学習を可能にし、低データ状況下でのトレースリンク生成を改善すること。
  • 従来のIRおよびRNNベースのモデルを凌駆するスケーラブルで効率的なフレームワークを、産業スケールのトレーサビリティに開発すること。
  • issue-commitトレーサビリティの文脈において、異なるBERTアーキテクチャ(単一、シアンズ、ツイン)のパフォーマンスと効率性のトレードオフを評価すること。

提案手法

  • 大規模なコード検索データセットで事前学習済みBERTモデルを微調整し、コードおよび自然言語表現の一般化を学習した後、トレーサビリティタスクに転送する。
  • 3段階のトレーニング戦略を適用する:コード検索で事前学習 → トレーサビリティデータで微調整 → 最小限の再トレーニングで新規プロジェクトに適応。
  • 単一BERTアーキテクチャを用い、issue記述とコード変更セットを別々に符号化し、ドット積またはコサイン類似度で類似度を計算する。
  • シアンズBERTアーキテクチャを実装し、両方のアーティファクトに共有重みを適用することで、高速な推論を実現しつつ高い精度を維持する。
  • 負例サンプリング(ONS)を用いた対照的学習を導入し、計算コストを著しく増加させることなく、モデルの収束速度と性能を向上させる。
  • 分類ヘッドでコサイン埋め込み損失を適用し、関連するアーティファクトの意味的表現を整列させ、リンク予測の精度を向上させる。
Figure 1 : An example commit message and code change set, where green lines have been added and red ones removed. The commit was tagged by the committer to the depicted issue.
Figure 1 : An example commit message and code change set, where green lines have been added and red ones removed. The commit was tagged by the committer to the depicted issue.

実験結果

リサーチクエスチョン

  • RQ1関連するデータ豊富なタスク(コード検索)からの転移学習が、低データ状況下のソフトウェアトレーサビリティにおけるトレースリンク精度を顕著に向上させることができるか?
  • RQ2issue-commitトレーサビリティにおいて、異なるBERTアーキテクチャ(単一、シアンズ、ツイン)の精度と推論効率はどのように比較されるか?
  • RQ3事前学習済み言語モデルを用いた転移学習が、RNNベースおよび従来のIRモデルの性能を制限するデータスパarsity問題を克服できるか?
  • RQ4中間でトレーニングされたT-BERTモデルは、完全な再トレーニングなしに新しいオープンソースプロジェクトに効果的に適応可能か?

主な発見

  • 単一BERTアーキテクチャが最高の精度を達成し、3つの実世界のオープンソースプロジェクト全体で平均して60.31%のMAP向上を示した。
  • シアンズBERTアーキテクチャは単一BERTとほぼ同等の精度を達成したが、実行時間が顕著に短く、大規模な展開においてより実用的であった。
  • 転移学習でトレーニングされたT-BERTモデルは、同じデータセット上でVSMおよびRNNベースのモデル(TraceNN)を凌駆し、意味的ギャップを埋めるために事前学習済み言語モデルの有効性を示した。
  • ONS(負例サンプリング)トレーニング戦略により、計算コストを著しく増加させることなく、モデルの収束速度と性能が向上した。
  • 限られたトレーニングデータでもT-BERTは安定的かつ高いパフォーマンスを発揮した。これは、転移学習がトレーサビリティタスクにおけるデータスパarsityを効果的に緩和できることを示している。
  • フレームワークは優れた一般化性能を示し、中間でトレーニングされたT-BERTモデルは完全な再トレーニングなしに新しいプロジェクトに効率的に適応可能であり、時間とリソースコストを削減した。
Figure 2 : A three step workflow applies T-BERT to NLA-PLA traceability. 1) Pre-training data are functions collected from Github projects 2) A BERT is trained as a language model for code with these functions and composed with a relation classifier as the T-BERT model 3) Functions are split as spec
Figure 2 : A three step workflow applies T-BERT to NLA-PLA traceability. 1) Pre-training data are functions collected from Github projects 2) A BERT is trained as a language model for code with these functions and composed with a relation classifier as the T-BERT model 3) Functions are split as spec

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

論文の読解から最終レビューまで、研究時間を劇的に削減しましょう。

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

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