Contracts in Practice

Contracts in Practice
复制标题

实践中的合同

DOI:
--
复制
发表时间:
2012
期刊:
World Congress on Formal Methods
影响因子:
--
通讯作者:
B. Meyer
B. Meyer
中科院分区:
--
文献类型:
--
作者:
H.;Carlo A. Furia;M. Nordio;M. Piccioni;B. Meyer

文献摘要

参考文献

被引文献

相似文献

契约是一种嵌入在程序文本中的轻量级形式规范。作为代码的可执行部分,它们鼓励程序员对规范投入适当的注意力,并随着程序的发展帮助维护规范和实现之间的一致性。本研究探讨如何在软件开发的实践中使用合同。基于对21个配备契约的Eiffel、C#和Java项目的7700次修订,总计超过2.6亿行代码的广泛实证分析,本文探讨了以下问题:1哪种契约元素的前置条件、后置条件、类不变式使用得更频繁; 2契约如何随着时间的推移而演变; 3实现变化与契约变化之间的关系;四是继承在这一过程中的作用。它发现,在其他结果中,包括合同的程序元素的百分比在大多数项目中超过33%,并且随着时间的推移趋于稳定;对某种类型的合同元素没有强烈的偏好;与实现相比,合同相当稳定;继承不会显着影响合同使用的定性趋势。
Contracts are a form of lightweight formal specification embedded in the program text. Being executable parts of the code, they encourage programmers to devote proper attention to specifications, and help maintain consistency between specification and implementation as the program evolves. The present study investigates how contracts are used in the practice of software development. Based on an extensive empirical analysis of 21 contract-equipped Eiffel, C#, and Java projects totaling more than 260 million lines of code over 7700 revisions, it explores, among other questions: 1 which kinds of contract elements preconditions, postconditions, class invariants are used more often; 2 how contracts evolve over time; 3 the relationship between implementation changes and contract changes; and 4 the role of inheritance in the process. It has found, among other results, that: the percentage of program elements that include contracts is above 33% for most projects and tends to be stable over time; there is no strong preference for a certain type of contract element; contracts are quite stable compared to implementations; and inheritance does not significantly affect qualitative trends of contract usage.
DOI: 10.1109/icstw.2010.31
发表时间: 2010-04
期刊: 2010 Third International Conference on Software Testing, Verification, and Validation Workshops
影响因子: --
作者:
M. Harman;Sung Gon Kim;Kiran Lakhotia;Phil McMinn;S. Yoo
通讯作者: M. Harman;Sung Gon Kim;Kiran Lakhotia;Phil McMinn;S. Yoo