MR-Coupler: 함수적 결합 분석을 통한 자동 변환 테스트 케이스 생성
MR-Coupler: Automated Metamorphic Test Generation via Functional Coupling Analysis
변환 테스트(MT)는 소프트웨어 테스트에서 오라클 문제를 완화하는 널리 인정되는 기술입니다. 그러나 효과적인 변환 관계(MR)를 구성하는 어려움으로 인해 MT의 활용이 제한됩니다. 이러한 MR 구성에는 종종 도메인별 지식이나 얻기 어려운 정보가 필요합니다. 본 연구에서는 소스 코드에서 쉽게 얻을 수 있는 메서드 간의 함수적 결합을 활용하여 MR을 자동으로 구성하고 변환 테스트 케이스(MTC)를 생성하는 새로운 접근 방식을 제안합니다. 저희의 기술인 MR-Coupler는 함수적으로 결합된 메서드 쌍을 식별하고, 대규모 언어 모델을 사용하여 후보 MTC를 생성하며, 테스트 증폭 및 돌연변이 분석을 통해 이를 검증합니다. 특히, 저희는 가능한 메서드 쌍의 비용이 많이 드는 열거를 피하기 위해 세 가지 함수적 결합 특징을 활용하고, 오탐을 줄이기 위한 새로운 검증 메커니즘을 사용합니다. MR-Coupler를 100개의 사람이 작성한 MTC와 50개의 실제 버그에 대해 평가한 결과, 90% 이상의 작업에서 유효한 MTC를 생성하고, 유효한 MTC 생성량을 64.90% 향상시키며, 기준 모델과 비교하여 오탐을 36.56% 감소시켰습니다. 또한, MR-Coupler가 생성한 MTC는 실제 버그의 44%를 탐지했습니다. 이러한 결과는 함수적 결합을 활용하여 자동 MR을 구성하는 효과를 강조하며, MR-Coupler가 실제 환경에서 MT의 활용을 촉진할 수 있는 잠재력을 보여줍니다. 또한, 향후 연구를 지원하기 위해 도구 및 실험 데이터를 공개했습니다.
Metamorphic testing (MT) is a widely recognized technique for alleviating the oracle problem in software testing. However, its adoption is hindered by the difficulty of constructing effective metamorphic relations (MRs), which often require domain-specific or hard-to-obtain knowledge. In this work, we propose a novel approach that leverages the functional coupling between methods, which is readily available in source code, to automatically construct MRs and generate metamorphic test cases (MTCs). Our technique, MR-Coupler, identifies functionally coupled method pairs, employs large language models to generate candidate MTCs, and validates them through test amplification and mutation analysis. In particular, we leverage three functional coupling features to avoid expensive enumeration of possible method pairs, and a novel validation mechanism to reduce false alarms. Our evaluation of MR-Coupler on 100 human-written MTCs and 50 real-world bugs shows that it generates valid MTCs for over 90% of tasks, improves valid MTC generation by 64.90%, and reduces false alarms by 36.56% compared to baselines. Furthermore, the MTCs generated by MR-Coupler detect 44% of the real bugs. Our results highlight the effectiveness of leveraging functional coupling for automated MR construction and the potential of MR-Coupler to facilitate the adoption of MT in practice. We also released the tool and experimental data to support future research.
No Analysis Report Yet
This paper hasn't been analyzed by Gemini yet.
Log in to request an AI analysis.