The Prompt Alchemist: Automated LLM-Tailored Prompt Optimization for Test Case Generation
Gao, Wang, Gao et al.
Test cases are essential for validating the reliability and quality of software applications. Recent studies have demonstrated the capability of Large Language Models (LLMs) to generate useful test cases for given source code. However, the existing work primarily relies on human-written plain prompts, which often leads to suboptimal results since the performance of LLMs can be highly influenced by the prompts. Moreover, these approaches use the same prompt for all LLMs, overlooking the fact that different LLMs might be best suited to different prompts. Given the wide variety of possible prompt formulations, automatically discovering the optimal prompt for each LLM presents a significant challenge. Although there are methods on automated prompt optimization in the natural language processing field, they are hard to produce effective prompts for the test case generation task. First, the methods iteratively optimize prompts by simply combining and mutating existing ones without proper guidance, resulting in prompts that lack diversity and tend to repeat the same errors in the generated test cases. Second, the prompts are generally lack of domain contextual knowledge, limiting LLMs' performance in the task.
테스트 케이스는 소프트웨어 애플리케이션의 신뢰성과 품질을 검증하는 데 필수적입니다. 최근 연구에 따르면 대규모 언어 모델(LLM)은 주어진 소스 코드에 대해 유용한 테스트 케이스를 생성할 수 있는 능력을 갖추고 있습니다. 그러나 기존 연구는 주로 수동으로 작성된 단순한 프롬프트에 의존하고 있으며, 이는 LLM의 성능이 프롬프트 품질에 크게 의존하기 때문에 차선의 결과를 초래합니다. 더욱이, 이러한 방법들은 모든 LLM에 동일한 프롬프트를 사용하여 서로 다른 LLM이 다른 프롬프트에 최적으로 반응할 수 있다는 사실을 간과합니다. 본 논문은 다양성 유도 프롬프트 생성, 실패 기반 규칙 귀납, 도메인 컨텍스트 지식 추출이라는 세 가지 핵심 모듈을 통해 서로 다른 LLM에 대한 자동화된 프롬프트 최적화를 실현하는 MAPS 방법을 제안합니다.
논문은 소프트웨어 테스트, 프롬프트 공학, 대규모 언어 모델 등 여러 분야의 중요한 연구를 포함하는 48개의 관련 문헌을 인용하여 연구에 견고한 이론적 기초를 제공합니다.
전체 평가: 이는 LLM 테스트 케이스 생성 분야에서 중요한 이론적 및 실용적 가치를 가진 고품질의 소프트웨어 공학 연구 논문입니다. 방법 설계가 합리적이고 실험 평가가 충분하며 결과가 설득력 있습니다. 일부 한계가 있지만 전체적으로 기여도가 현저하며 해당 분야의 발전에 중요한 추진력을 제공합니다.