Abstract
There are no existing tools for automatic inference of likely design contracts in existing code for the .NET environment. Design contracts are useful for program verification, program testing, and program maintenance. Automatically inferring likely design contracts adds the benefit that possible contracts, which might otherwise be overlooked, are highlighted. Additionally, automatic inference of likely code contracts provides a base set of contracts, which eases the adoption of Design by Contract. The expense in time and effort of annotating existing programs to include design contracts, was the motivation for this project and for creating the tool named IcsRewrite, which was developed to reduce this cost. The inferring of contracts performed by IcsRewrite is based on a set of constraint relaxation algorithms specifically developed for this purpose. This project demonstrates that automatic inference of likeley code contracts via runtime analysis is viable and useful