{"title":"使用加权依赖图的自动方法重构","authors":"Katsuhisa Maruyama, Kenichi Shima","doi":"10.1145/302405.302627","DOIUrl":null,"url":null,"abstract":"While refactoring makes frameworks more reusable, it is complex to do by hand. This paper presents a mechanism that automatically refactors methods in object-oriented frameworks by using weighted dependence graphs, whose edges are weighted based on the modification histories of the methods. To find the appropriate boundary between frozen spots and hot spots in the methods, the value of the weight varies based on whether the dependence in the original methods has been repeatedly preserved or destroyed in the methods of applications created by programmers. The mechanism constructs both template methods that contain the invariant dependence and hook methods that are separated by eliminating the variant dependence. The new template methods and hook methods tailored to each programmer save him/her from writing superfluous code when reusing a framework. Experimental results show a reduction rate of up to 22% in the number of statements a programmer has to write when creating several applications; this percentage is double that achievable by a conventional refactoring technique.","PeriodicalId":359367,"journal":{"name":"Proceedings of the 1999 International Conference on Software Engineering (IEEE Cat. No.99CB37002)","volume":"14 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"1999-05-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"34","resultStr":"{\"title\":\"Automatic method refactoring using weighted dependence graphs\",\"authors\":\"Katsuhisa Maruyama, Kenichi Shima\",\"doi\":\"10.1145/302405.302627\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"While refactoring makes frameworks more reusable, it is complex to do by hand. This paper presents a mechanism that automatically refactors methods in object-oriented frameworks by using weighted dependence graphs, whose edges are weighted based on the modification histories of the methods. To find the appropriate boundary between frozen spots and hot spots in the methods, the value of the weight varies based on whether the dependence in the original methods has been repeatedly preserved or destroyed in the methods of applications created by programmers. The mechanism constructs both template methods that contain the invariant dependence and hook methods that are separated by eliminating the variant dependence. The new template methods and hook methods tailored to each programmer save him/her from writing superfluous code when reusing a framework. Experimental results show a reduction rate of up to 22% in the number of statements a programmer has to write when creating several applications; this percentage is double that achievable by a conventional refactoring technique.\",\"PeriodicalId\":359367,\"journal\":{\"name\":\"Proceedings of the 1999 International Conference on Software Engineering (IEEE Cat. No.99CB37002)\",\"volume\":\"14 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"1999-05-16\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"34\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Proceedings of the 1999 International Conference on Software Engineering (IEEE Cat. No.99CB37002)\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1145/302405.302627\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 1999 International Conference on Software Engineering (IEEE Cat. No.99CB37002)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/302405.302627","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
Automatic method refactoring using weighted dependence graphs
While refactoring makes frameworks more reusable, it is complex to do by hand. This paper presents a mechanism that automatically refactors methods in object-oriented frameworks by using weighted dependence graphs, whose edges are weighted based on the modification histories of the methods. To find the appropriate boundary between frozen spots and hot spots in the methods, the value of the weight varies based on whether the dependence in the original methods has been repeatedly preserved or destroyed in the methods of applications created by programmers. The mechanism constructs both template methods that contain the invariant dependence and hook methods that are separated by eliminating the variant dependence. The new template methods and hook methods tailored to each programmer save him/her from writing superfluous code when reusing a framework. Experimental results show a reduction rate of up to 22% in the number of statements a programmer has to write when creating several applications; this percentage is double that achievable by a conventional refactoring technique.