CoverUp: Coverage-Guided LLM-Based Test Generation

要約

テストはソフトウェア開発の重要な部分です。
テスト生成ツールは、テスト作成の労働集約的なタスクを自動化しようとしますが、高カバーテストの生成は依然として困難です。
このペーパーでは、高カバーのPython回帰テストの生成を促進するための新しいアプローチである隠蔽を提案します。
カバーアップは、カバレッジ分析、コードコンテキスト、およびフィードバックを、LLMを繰り返しガイドして、ラインと分岐のカバレッジを改善するテストを生成するプロンプトのプロンプトの組み合わせです。
オープンソースのPythonプロジェクトから派生した挑戦的なコードのベンチマーク全体で、プロトタイプの隠蔽実装を評価し、カバーアップが最新のものを大幅に改善することを示しています。
ハイブリッド検索/LLMベースのテストジェネレーターであるCodamosaと比較して、カバーアップは、モジュールあたりの中央値ライン+80%(47%)の分岐カバレッジを達成します。
MUTAPとLLMベースのテストジェネレーターであるMutapと比較して、カバーアップは90%の全体的なライン+ブランチカバレッジを達成します(77%)。
また、カバーアップのパフォーマンスは、使用されたLLMだけでなく、コンポーネントの有効性を組み合わせたものに由来することも示しています。

要約(オリジナル)

Testing is an essential part of software development. Test generation tools attempt to automate the otherwise labor-intensive task of test creation, but generating high-coverage tests remains challenging. This paper proposes CoverUp, a novel approach to driving the generation of high-coverage Python regression tests. CoverUp combines coverage analysis, code context, and feedback in prompts that iteratively guide the LLM to generate tests that improve line and branch coverage. We evaluate our prototype CoverUp implementation across a benchmark of challenging code derived from open-source Python projects and show that CoverUp substantially improves on the state of the art. Compared to CodaMosa, a hybrid search/LLM-based test generator, CoverUp achieves a per-module median line+branch coverage of 80% (vs. 47%). Compared to MuTAP, a mutation- and LLM-based test generator, CoverUp achieves an overall line+branch coverage of 90% (vs. 77%). We also demonstrate that CoverUp’s performance stems not only from the LLM used but from the combined effectiveness of its components.

arxiv情報

著者 Juan Altmayer Pizzorno,Emery D. Berger
発行日 2025-02-10 17:15:52+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.AI, cs.LG, cs.PL, cs.SE パーマリンク