【24h】

Refactoring with Contracts

机译:重构合同

获取原文
获取外文期刊封面目录资料

摘要

Design by contract is a practical methodology for developing code together with its specification. The contract consists of class invariants and method preand postconditions. As the code is refactored, specifications of internal units change with the code. There are mutual influences between the code and the contract. The assertions that constitute the contract are Java expressions; refactorings such as Rename Method must change these assertions as well as the code. The contract has methodological implications, which serve as preconditions on some refactorings; these must be checked before performing those refactorings. In addition, some contract modifications follow from certain refactorings, and can be done automatically. Development environments that support design by contract must take these influences into account. We report on the implementation in Eclipse of several refactorings that involve both code and contract. These show how contracts are modified in response to code changes, how contracts prevent certain changes, and how new contracts are computed for newly-generated methods and classes.
机译:合同设计是一种实用的方法,用于与其规范一起开发代码。合同由类不变性和方法组成。由于代码重构,内部单元的规范随代码而更改。代码与合同之间存在相互影响。构成合同的断言是Java表达式; RENAME方法等重构必须更改这些断言以及代码。该合同具有方法论影响,可作为一些重构的先决条件;必须在执行这些重构之前检查这些。此外,某些合同修改遵循某些重构,可以自动完成。通过合同支持设计的开发环境必须考虑这些影响。我们报告了涉及代码和合同的几个重构的日食。这些展示合同是如何响应代码而改变的合同,合同如何防止某些更改,以及用于新生成的方法和类的新合同如何。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号