TitleTranslating code comments to procedure specifications
Publication TypeConference Paper
Year of Publication2018
AuthorsBlasi A, Goffi A, Kuznetsov K, Gorla A, Ernst MD, Pezzè M, Castellanos SDelgado
Conference NameISSTA 2018, Proceedings of the 2018 International Symposium on Software Testing and Analysis
Pagination242-253
Date or Month PublishedJuly
Conference LocationAmsterdam, Netherlands
AbstractProcedure specifications are useful in many software development tasks. As one example, in automatic test case generation they can guide testing, act as test oracles able to reveal bugs, and identify illegal inputs. Whereas formal specifications are seldom available in practice, it is standard practice for developers to document their code with semi-structured comments. These comments express the procedure specification with a mix of predefined tags and natural language. This paper presents Jdoctor, an approach that combines pattern, lexical, and semantic matching to translate Javadoc comments into executable procedure specifications written as Java expressions. In an empirical evaluation, Jdoctor achieved precision of translating Javadoc into procedure specifications. We also supplied the Jdoctor-derived specifications to an automated test case generation tool, Randoop. The specifications enabled Randoop to generate test cases that produce fewer false alarms and reveal more defects.
Downloadshttps://github.com/albertogoffi/toradocu Jdoctor implementation
Citation KeyBlasiGKGEPC2018