Skip to main content
QUICK REVIEW

[논문 리뷰] Traceability Transformed: Generating more Accurate Links with Pre-Trained BERT Models

Jinfeng Lin, Yalin Liu|arXiv (Cornell University)|2021. 02. 08.
Software Engineering Research인용 수 7
한 줄 요약

이 논문은 오픈소스 프로젝트 내 이슈와 커밋과 같은 소프트웨어 아티팩트 간의 더 정확한 추적 링크를 생성하기 위해 사전 훈련된 BERT 모델을 활용하는 새로운 프레임워크인 T-BERT를 제안한다. 관련된 코드 검색 작업으로부터 지식을 전이함으로써 T-BERT는 데이터 희소성 문제를 극복하고 기존의 전통적인 VSM 모델 대비 평균 60.31% 향상된 정확도를 달성한다. Single-BERT 아키텍처가 가장 뛰어난 성능을 보였고, Siamese-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.

연구 동기 및 목표

  • 딥 러닝을 활용한 자동 소프트웨어 추적성에서의 낮은 정확도와 데이터 희소성 문제를 해결하기 위해.
  • 데이터가 풍부한 관련 작업(예: 코드 검색)에서 효과적인 전이 학습을 가능하게 하여 데이터가 적은 상황에서도 추적 링크 생성 성능을 향상시키기 위해.
  • 기존의 정보 검색(IR) 및 RNN 기반 모델보다 뛰어난 성능을 보이며, 산업 규모의 추적성에 적합한 확장성 있고 효율적인 프레임워크를 개발하기 위해.
  • 이슈-커밋 추적성 링크 생성 맥락에서 다양한 BERT 아키텍처(Single, Siamese, Twin)의 성능 및 효율성 간 상호 비교를 수행하기 위해.

제안 방법

  • 대규모 코드 검색 데이터셋에서 사전 훈련된 BERT 모델을 미세조정하여 코드와 자연어 표현을 일반적으로 학습한 후, 추적성 작업으로 전이한다.
  • 3단계 훈련 전략을 적용: 코드 검색에서 사전 훈련 → 추적성 데이터에서 미세조정 → 최소한의 재훈련으로 새로운 프로젝트에 적응.
  • Single-BERT 아키텍처를 사용하여 이슈 기술서와 코드 변경 세트를 별도로 인코딩한 후, 내적 곱 또는 코사인 유사도로 유사도를 계산한다.
  • Siamese-BERT 아키텍처를 구현하여 양쪽 아티팩트에 공통된 가중치를 사용해 인코딩함으로써 빠른 추론을 가능하게 하면서도 높은 정확도를 유지한다.
  • 대체로 큰 계산 부담 없이 모델 수렴과 성능 향상을 향상시키기 위해 음성 샘플링을 활용한 대비 학습(contrastive learning)을 적용한다.
  • 분류 헤드에서 코사인 임베딩 손실(Cosine Embedding Loss)을 사용하여 관련 아티팩트의 의미적 표현을 정렬하고 링크 예측 성능을 향상시킨다.
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관련된 데이터가 풍부한 작업(예: 코드 검색)에서 전이 학습을 수행하면, 데이터가 적은 소프트웨어 추적성 상황에서 링크 정확도가 유의미하게 향상되는가?
  • RQ2이슈-커밋 추적성 링크 생성에서 다양한 BERT 아키텍처(Single, Siamese, Twin)의 정확도와 추론 효율성은 어떻게 비교되는가?
  • RQ3사전 훈련된 언어 모델을 활용한 전이 학습이 RNN 기반 및 전통적인 IR 모델의 성능을 제한하는 데이터 희소성 문제를 극복하는가?
  • RQ4완전한 재훈련 없이도 중간 단계에서 훈련된 T-BERT 모델이 새로운 오픈소스 프로젝트에 효과적으로 적응할 수 있는가?

주요 결과

  • Single-BERT 아키텍처가 가장 높은 정확도를 기록했으며, 세 개의 실제 오픈소스 프로젝트에서 평균적으로 VSM 모델 대비 평균 평균 정확도(MAP)가 60.31% 향상되었다.
  • Siamese-BERT 아키텍처는 Single-BERT와 유사한 정확도를 달성했지만 실행 시간이 크게 단축되어 대규모 배포에 더 실용적이다.
  • 전이 학습을 통해 훈련된 T-BERT 모델은 동일한 데이터셋에서 VSM 및 RNN 기반 모델(TraceNN)보다 뛰어난 성능을 보였으며, 의미적 갭을 메우는 데 사전 훈련된 언어 모델의 효과성을 입증했다.
  • ONS(Negative Sampling) 훈련 전략은 계산 부담을 크게 증가시키지 않으면서도 모델 수렴 속도와 성능을 향상시켰다.
  • 제한된 훈련 데이터 조건에서도 T-BERT는 안정적이고 높은 성능을 기록했으며, 이는 전이 학습이 추적성 작업에서 데이터 희소성 문제를 효과적으로 완화함을 시사한다.
  • 중간 단계에서 훈련된 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가 만들고, 인간 에디터가 검토했습니다.