{"title":"在Java中使用标记库和字节码检测来支持契约式设计","authors":"Yu Chin Cheng, Chien-Tsun Chen, Chin-Yun Hsieh","doi":"10.1109/APSEC.2007.55","DOIUrl":null,"url":null,"abstract":"Several approaches have been proposed to support Design by Contract in Java. In this paper, through the use of markers which are predefined dummy methods and attributes, a new approach to annotate contracts is presented. The annotated programs can be directly compiled by standard Java compilers. A bytecode instrumentor is developed to manipulate the bytecode to inject contract evaluation instructions and make the contracts executable at runtime. The marker approach avoids two primary problems found in the existing practices: source compatibility that depends on language extension and symbolic barrier that leaves contracts and their targets unrelated. It also facilitates streamlined integration with IDEs and improves readability as well as writability of the contract- annotated programs.","PeriodicalId":273688,"journal":{"name":"14th Asia-Pacific Software Engineering Conference (APSEC'07)","volume":"3 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2007-12-04","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"4","resultStr":"{\"title\":\"ezContract: Using Marker Library and Bytecode Instrumentation to Support Design by Contract in Java\",\"authors\":\"Yu Chin Cheng, Chien-Tsun Chen, Chin-Yun Hsieh\",\"doi\":\"10.1109/APSEC.2007.55\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Several approaches have been proposed to support Design by Contract in Java. In this paper, through the use of markers which are predefined dummy methods and attributes, a new approach to annotate contracts is presented. The annotated programs can be directly compiled by standard Java compilers. A bytecode instrumentor is developed to manipulate the bytecode to inject contract evaluation instructions and make the contracts executable at runtime. The marker approach avoids two primary problems found in the existing practices: source compatibility that depends on language extension and symbolic barrier that leaves contracts and their targets unrelated. It also facilitates streamlined integration with IDEs and improves readability as well as writability of the contract- annotated programs.\",\"PeriodicalId\":273688,\"journal\":{\"name\":\"14th Asia-Pacific Software Engineering Conference (APSEC'07)\",\"volume\":\"3 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2007-12-04\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"4\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"14th Asia-Pacific Software Engineering Conference (APSEC'07)\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1109/APSEC.2007.55\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"14th Asia-Pacific Software Engineering Conference (APSEC'07)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/APSEC.2007.55","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
ezContract: Using Marker Library and Bytecode Instrumentation to Support Design by Contract in Java
Several approaches have been proposed to support Design by Contract in Java. In this paper, through the use of markers which are predefined dummy methods and attributes, a new approach to annotate contracts is presented. The annotated programs can be directly compiled by standard Java compilers. A bytecode instrumentor is developed to manipulate the bytecode to inject contract evaluation instructions and make the contracts executable at runtime. The marker approach avoids two primary problems found in the existing practices: source compatibility that depends on language extension and symbolic barrier that leaves contracts and their targets unrelated. It also facilitates streamlined integration with IDEs and improves readability as well as writability of the contract- annotated programs.