AsserT5: Test Assertion Generation Using a Fine-Tuned Code Language Model
Severin Primbs, Benedikt Fein, Gordon Fraser

TL;DR
AsserT5 leverages a pre-trained code language model to generate test assertions, significantly improving precision over prior models, but still faces challenges in effectively detecting real-world bugs.
Contribution
This paper introduces AsserT5, a novel assertion generation model based on CodeT5, demonstrating improved accuracy and analyzing its effectiveness in real-world bug detection.
Findings
Up to 59.5% exact match with ground truth assertions
More than twice as precise as prior models
Limited success in detecting real-world bugs
Abstract
Writing good software tests can be challenging, therefore approaches that support developers are desirable. While generating complete tests automatically is such an approach commonly proposed in research, developers may already have specific test scenarios in mind and thus just require help in selecting the most suitable test assertions for these scenarios. This can be done using deep learning models to predict assertions for given test code. Prior research on assertion generation trained these models specifically for the task, raising the question how much the use of larger models pre-trained on code that have emerged since then can improve their performance. In particular, while abstracting identifiers has been shown to improve specifically trained models, it remains unclear whether this also generalises to models pre-trained on non-abstracted code. Finally, even though prior work…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Testing and Debugging Techniques · Software Engineering Research · Software Reliability and Analysis Research
