Title | Call Me Maybe: Using NLP to automatically generate unit test cases respecting temporal constraints |
Publication Type | Conference Paper |
Year of Publication | 2022 |
Authors | Blasi A, Gorla A, Ernst MD, Pezzè M |
Conference Name | ASE 2022: Proceedings of the 37th Annual International Conference on Automated Software Engineering |
Pagination | 1-11 |
Date or Month Published | October |
Conference Location | Oakland Center, MI, USA |
Abstract | A class may need to obey temporal constraints in order to function correctly. For example, the correct usage protocol for an iterator is to always check whether there is a next element before asking for it; iterating over a collection when there are no items left leads to a \emphNoSuchElementException. Automatic test case generation tools such as Randoop and EvoSuite do not have any notion of these temporal constraints. Generating test cases by randomly invoking methods on a new instance of the class under test may raise run time exceptions that do not necessarily expose software faults, but are rather a consequence of violations of temporal properties. \par This paper presents \emphCallMeMaybe, a novel technique that uses natural language processing to analyze Javadoc comments to identify temporal constraints. This information can guide a test case generator towards executing sequences of method calls that respect the temporal constraints. Our evaluation on 73 subjects from seven popular Java expressions. For the two biggest subjects, the integration with Randoop flags 11,818 false alarms and enriches 12,024 correctly failing test cases due to violations of temporal constraints with clear explanation that can help software developers. |
Downloads | https://github.com/ariannab/callmemaybe implementation & replication package
|
Citation Key | BlasiGEP2022 |