ReAssert: Deep Learning for Assert Generation
Robert White, Jens Krinke

TL;DR
ReAssert leverages deep learning, specifically Reformer, to generate accurate and diverse JUnit asserts for software testing, outperforming previous methods like ATLAS in precision and uniqueness.
Contribution
This work introduces ReAssert, a novel deep learning approach that directly generates JUnit asserts from methods-under-test using code traceability and advanced models.
Findings
ReAssert achieves up to 44% exact match with ground truth asserts.
Reformer produces 71% unique asserts, the highest among tested models.
ReAssert outperforms ATLAS in accuracy and assert diversity.
Abstract
The automated generation of test code can reduce the time and effort required to build software while increasing its correctness and robustness. In this paper, we present RE-ASSERT, an approach for the automated generation of JUnit test asserts which produces more accurate asserts than previous work with fewer constraints. This is achieved by targeting projects individually, using precise code-to-test traceability for learning and by generating assert statements from the method-under-test directly without the need to write an assert-less test first. We also utilise Reformer, a state-of-the-art deep learning model, along with two models from previous work to evaluate ReAssert and an existing approach, known as ATLAS, using lexical accuracy,uniqueness, and dynamic analysis. Our evaluation of ReAssert shows up to 44% of generated asserts for a single project match exactly with the ground…
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.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Software Testing and Debugging Techniques · Software Reliability and Analysis Research
MethodsAttention Is All You Need · Linear Layer · Convolution · 1x1 Convolution · Byte Pair Encoding · Adafactor · Softmax · Dropout · Reversible Residual Block · Dense Connections
