ASSERTIFY: Utilizing Large Language Models to Generate Assertions for Production Code
Mohammad Jalili Torkamani, Abhinav Sharma, Nikita Mehrotra, Rahul, Purandare

TL;DR
This paper introduces Assertify, a tool using large language models and prompt engineering to automatically generate production assertions in code, aiming to improve debugging and documentation.
Contribution
It presents a novel end-to-end approach leveraging LLMs and few-shot learning to generate production assertions, filling a gap in existing assertion generation research.
Findings
Achieved an average ROUGE-L score of 0.526 in assertion generation
Demonstrated effectiveness of LLMs in producing developer-like assertions
Compiled a dataset of 2,810 methods from 22 Java repositories
Abstract
Production assertions are statements embedded in the code to help developers validate their assumptions about the code. They assist developers in debugging, provide valuable documentation, and enhance code comprehension. Current research in this area primarily focuses on assertion generation for unit tests using techniques, such as static analysis and deep learning. While these techniques have shown promise, they fall short when it comes to generating production assertions, which serve a different purpose. This preprint addresses the gap by introducing Assertify, an automated end-to-end tool that leverages Large Language Models (LLMs) and prompt engineering with few-shot learning to generate production assertions. By creating context-rich prompts, the tool emulates the approach developers take when creating production assertions for their code. To evaluate our approach, we compiled a…
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 Engineering Research
