On the Rationale and Use of Assertion Messages in Test Code: Insights from Software Practitioners
Anthony Peruma, Taryn Takebayashi, Rocky Huang, Joseph Carmelo, Averion, Veronica Hodapp, Christian D. Newman, Mohamed Wiem Mkaouer

TL;DR
This study surveys software practitioners to understand their use, perceptions, and challenges related to assertion messages in unit tests, providing guidelines for best practices and tool improvements.
Contribution
It offers empirical insights into assertion message usage, perceptions, and challenges, and proposes guidelines for improving their quality and integration in testing tools.
Findings
Majority find assertion messages valuable for troubleshooting and documentation
Not all practitioners consistently include assertion messages
Guidelines for crafting high-quality assertion messages
Abstract
Unit testing is an important practice that helps ensure the quality of a software system by validating its behavior through a series of test cases. Core to these test cases are assertion statements, which enable software practitioners to validate the correctness of the system's behavior. To aid with understanding and troubleshooting test case failures, practitioners can include a message (i.e., assertion message) within the assertion statement. While prior studies have examined the frequency and structure of assertion messages by mining software repositories, they do not determine their types or purposes or how practitioners perceive the need for or the usage of various types of assertion messages. In this paper, we survey 138 professional software practitioners to gather insights into their experience and views regarding assertion messages. Our findings reveal that a majority of…
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 Testing and Debugging Techniques · Software Engineering Research · Software System Performance and Reliability
