Procedure 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 92% and recall of 83% in 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.

Blasi, A., Goffi, A., Kuznetsov, K., Gorla, A., Ernst, M., Pezze, M., et al. (2018). Translating code comments to procedure specifications. In ISSTA 2018: Proceedings of the 27th ACM SIGSOFT International Symposium on Software Testing and Analysis (pp.242-253). Association for Computing Machinery, Inc [10.1145/3213846.3213872].

Translating code comments to procedure specifications

Pezze M.;
2018

Abstract

Procedure 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 92% and recall of 83% in 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.
paper
Automatic test case generation; Natural language processing; Software testing; Specification inference; Test oracle generation;
English
27th ACM SIGSOFT International Symposium on Software Testing and Analysis, ISSTA 2018 - July 16 - 21, 2018
2018
ISSTA 2018: Proceedings of the 27th ACM SIGSOFT International Symposium on Software Testing and Analysis
978-1-4503-5699-2
2018
242
253
none
Blasi, A., Goffi, A., Kuznetsov, K., Gorla, A., Ernst, M., Pezze, M., et al. (2018). Translating code comments to procedure specifications. In ISSTA 2018: Proceedings of the 27th ACM SIGSOFT International Symposium on Software Testing and Analysis (pp.242-253). Association for Computing Machinery, Inc [10.1145/3213846.3213872].
File in questo prodotto:
Non ci sono file associati a questo prodotto.

I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/10281/631758
Citazioni
  • Scopus 113
  • ???jsp.display-item.citation.isi??? 100
Social impact