Abstract
In this experience paper, we share our experience on enhancing automatic unit test generation to more effectively find Java null pointer exceptions (NPEs). NPEs are among the most common and critical errors in Java applications. However, as we demonstrate in this paper, existing unit test generation tools such as Randoop and EvoSuite are not sufficiently effective at catching NPEs. Specifically, their primary strategy of achieving high code coverage does not necessarily result in triggering diverse NPEs in practice. In this paper, we detail our observation on the limitations of current state-of-the-art unit testing tools in terms of NPE detection and introduce a new strategy to improve their effectiveness. Our strategy utilizes both static and dynamic analyses to guide the test case generator to focus specifically on scenarios that are likely to trigger NPEs. We implemented this strategy on top of EvoSuite, and evaluated our tool, NpeTest, on 108 NPE benchmarks collected from 96 real-world projects. The results show that our NPE-guidance strategy can increase EvoSuite's reproduction rate of the NPEs from 56.9% to 78.9%, a 38.7% improvement. Furthermore, NpeTest successfully detected 89 previously unknown NPEs from an industry project.
Original language | English |
---|---|
Title of host publication | Proceedings - 2024 39th ACM/IEEE International Conference on Automated Software Engineering, ASE 2024 |
Publisher | Association for Computing Machinery, Inc |
Pages | 1044-1056 |
Number of pages | 13 |
ISBN (Electronic) | 9798400712487 |
DOIs | |
Publication status | Published - 2024 Oct 27 |
Event | 39th ACM/IEEE International Conference on Automated Software Engineering, ASE 2024 - Sacramento, United States Duration: 2024 Oct 28 → 2024 Nov 1 |
Publication series
Name | Proceedings - 2024 39th ACM/IEEE International Conference on Automated Software Engineering, ASE 2024 |
---|
Conference
Conference | 39th ACM/IEEE International Conference on Automated Software Engineering, ASE 2024 |
---|---|
Country/Territory | United States |
City | Sacramento |
Period | 24/10/28 → 24/11/1 |
Bibliographical note
Publisher Copyright:Copyright held by the owner/author(s).
ASJC Scopus subject areas
- Artificial Intelligence
- Software
- Safety, Risk, Reliability and Quality