TitleTranslating Code Comments to Procedure Specifications
Publication TypeMiscellaneous
Year of Publication2017
AuthorsGoffi A, Gorla A, Ernst MD, Pezzè M, Castellanos SDelgado, Blasi A, Keller B
Date or Month PublishedApril
Abstract

Procedure specifications are useful in many software development tasks, such as test case generation, debugging, program comprehension, code synthesis, refactoring, formal verification, run-time monitoring. As one example, specifications are useful in automatic test case generation: they help a tool produce inputs that induce peculiar behaviors, and they act as test oracles able to reveal bugs.

Whereas formal specifications are seldom available in practice, it is standard practice for developers to document their code with semi-structured comments such as Doxygen, Javadoc, RDoc, and Sphinx. These comments express the procedure specification with a mix of predefined tags and natural language.

This paper presents Jdoctor, an approach that combines natural language parsing with pattern matching to translate Javadoc comments into executable procedure specifications written as Java expressions. In an empirical translating Javadoc into procedure specifications. This is substantially better than previous work; the respective f-measure scores are @tComment specifications to an automated test case generation tool, Randoop. The specifications enabled Randoop to generate test cases that reveal more defects, produce fewer false alarms, and achieve higher coverage.

Citation KeyGoffiGEPCBK2017