Inferring Contracts Sample Clauses
Inferring Contracts. If an existing JWIG service is to be refactored into using contracts, then substantial automatic support is also available. It is possible to infer a contract that is satisfied by the given code and XHTML. The template directory structure is copied to form the contract directory. Each template is described in the contract with respect to the existing gaps, forms, and fields. The rest of the contract is inferred from the summary graphs computed by the analyzer. Each show statement is represented by a page in the contract. The edges in all summary graphs are distributed into either the templates or the pages in the contract. If an edge is present in all the summary graphs corresponding to show statements, then it is represented directly in that template, otherwise it is represented in only the pages corresponding to the relevant show statements. For the shop.inventory code, the inferred contract is identical to the given one, which Fig. 8. X-ray view of MainPage. indicates that the accuracy of this inference algorithm is high.
