ACM Home Page
Please provide us with feedback. Feedback
A comparative study of programmer-written and automatically inferred contracts
Full text PdfPdf (507 KB)
Source
International Symposium on Software Testing and Analysis archive
Proceedings of the eighteenth international symposium on Software testing and analysis table of contents
Chicago, IL, USA
SESSION: Empirical studies table of contents
Pages 93-104  
Year of Publication: 2009
ISBN:978-1-60558-338-9
Authors
Nadia Polikarpova  ETH Zurich, Zurich, Switzerland
Ilinca Ciupa  ETH Zurich, Zurich, Switzerland
Bertrand Meyer  ETH Zurich, Zurich, Switzerland
Sponsors
SIGSOFT: ACM Special Interest Group on Software Engineering
SIGPLAN: ACM Special Interest Group on Programming Languages
ACM: Association for Computing Machinery
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 34,   Downloads (12 Months): 74,   Citation Count: 0
Additional Information:

abstract   references   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/1572272.1572284
What is a DOI?

ABSTRACT

Where do contracts - specification elements embedded in executable code - come from? To produce them, should we rely on the programmers, on automatic tools, or some combination?

Recent work, in particular the Daikon system, has shown that it is possible to infer some contracts automatically from program executions. The main incentive has been an assumption that most programmers are reluctant to invent the contracts themselves. The experience of contract-supporting languages, notably Eiffel, disproves that assumption: programmers will include contracts if given the right tools. That experience also shows, however, that the resulting contracts are generally partial and occasionally incorrect.

Contract inference tools provide the opportunity for studying objectively the quality of programmer-written contracts, and for assessing the respective roles of humans and tools. Working on 25 classes taken from different sources such as widely-used standard libraries and code written by students, we applied Daikon to infer contracts and compared the results (totaling more than 19500 inferred assertion clauses) with the already present contracts.

We found that a contract inference tool can be used to strengthen programmer-written contracts, but cannot infer all contracts that humans write. The tool generates around five times as many relevant assertion clauses as written by programmers; but it only finds around 60% of those originally written by programmers. Around a third of the generated assertions clauses are either incorrect or irrelevant. The study also uncovered interesting correlations between the quality of inferred contracts and some code metrics.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

 
1
CITADEL webpage. http://se.inf.ethz.ch/people/polikarpova/citadel.html.
 
2
EiffelStudio. Eiffel Software. http://www.eiffel.com/.
 
3
Traffic. http://traffic.origo.ethz.ch/.
 
4
M. Barnett, K. R. M. Leino, and W. Schulte. The Spec# programming system: An overview. In CASSIS 2004, volume 3362 of LNCS. Springer, 2004.
5
 
6
P. Chalin. Are practitioners writing contracts? In Springer LNCS 4157, pages 100--113, 2006.
 
7
8
9
 
10
 
11
N. Gupta and Z. V. Heidepriem. A new structural coverage criterion for dynamic detection of program invariants. In ASE 2003: Proceedings of the 18th Annual International Conference on Automated Software Engineering, pages 49--58, Montreal, Canada, October 8-10, 2003.
12
 
13
 
14
J. Henkel and A. Diwan. Discovering algebraic specifications from Java classes. In L. Cardelli, editor, ECOOP 2003 - Object-Oriented Programming, 17th European Conference, Darmstadt, July 2003. Springer.
 
15
16
 
17
 
18
19
20
 
21
C. Pacheco and M. D. Ernst. Eclat: Automatic generation and classification of test inputs. In ECOOP 2005 - Object-Oriented Programming, 19th European Conference, Glasgow, Scotland, July 25--29, 2005.
22
 
23
B. Pytlik, M. Renieris, S. Krishnamurthi, and S. P. Reiss. Automated fault localization using potential invariants. In Proceedings of the Workshop on Automated and Algorithmic Debugging 2003, 2003.
 
24
N. Tillmann, F. Chen, and W. Schulte. Discovering likely method specifications. In ICFEM, pages 717--736, 2006.
 
25
J. W. Tukey. Exploratory Data Analysis. Addison-Wesley, Reading, MA, 1977.
 
26
T. Xie and D. Notkin. Tool-assisted unit test selection based on operational violations. Automated Software Engineering, 2003. Proceedings. 18th IEEE International Conference on, pages 40--48, Oct. 2003.
27

Collaborative Colleagues:
Nadia Polikarpova: colleagues
Ilinca Ciupa: colleagues
Bertrand Meyer: colleagues