Leveraging Large Language Models for Enhancing the Understandability of Generated Unit Tests

要約

自動化された単体テスト ジェネレーター、特に EvoSuite のような検索ベースのソフトウェア テスト ツールは、高いカバレッジのテストを生成できます。
これらのジェネレーターは単体テストを作成する負担を軽減しますが、生成されたテストを理解するという点でソフトウェア エンジニアにとって課題となることがよくあります。
これに対処するために、検索ベースのソフトウェア テストと大規模な言語モデルを組み合わせて、自動生成されたテスト ケースの理解を強化する UTGen を導入します。
この機能強化は、テスト データのコンテキスト化、識別子の名前付けの改善、説明的なコメントの追加によって実現されています。
私たちは、学界と産業界からの 32 人の参加者による対照実験を通じて、単体テストの理解しやすさがソフトウェア エンジニアのバグ修正タスクの実行能力にどのような影響を与えるかを調査しました。
私たちは、理解可能なテスト ケースの重要性を強調する現実世界のシナリオをシミュレートするためにバグ修正を選択しました。
UTGen テスト ケースを使用して課題に取り組んでいる参加者は、ベースライン テスト ケースと比較して、最大 33% 多くのバグを修正し、最大 20% の時間を短縮していることが観察されています。
テスト後のアンケートから、テスト名、テスト データ、変数名を強化することでバグ修正プロセスが改善されたと参加者が感じていることがわかりました。

要約(オリジナル)

Automated unit test generators, particularly search-based software testing tools like EvoSuite, are capable of generating tests with high coverage. Although these generators alleviate the burden of writing unit tests, they often pose challenges for software engineers in terms of understanding the generated tests. To address this, we introduce UTGen, which combines search-based software testing and large language models to enhance the understandability of automatically generated test cases. We achieve this enhancement through contextualizing test data, improving identifier naming, and adding descriptive comments. Through a controlled experiment with 32 participants from both academia and industry, we investigate how the understandability of unit tests affects a software engineer’s ability to perform bug-fixing tasks. We selected bug-fixing to simulate a real-world scenario that emphasizes the importance of understandable test cases. We observe that participants working on assignments with UTGen test cases fix up to 33% more bugs and use up to 20% less time when compared to baseline test cases. From the post-test questionnaire, we gathered that participants found that enhanced test names, test data, and variable names improved their bug-fixing process.

arxiv情報

著者 Amirhossein Deljouyi,Roham Koohestani,Maliheh Izadi,Andy Zaidman
発行日 2024-08-21 15:35:34+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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