期刊文献+

基于变更类型和相似性比较的代码重构模式识别 被引量:1

Identifying code refactoring patterns based on code change types and similarity comparison
下载PDF
导出
摘要 在现代软件开发和维护中重构是提高软件可维护性和软件质量的常用手段。而大量重构模式掺杂在日常的bug修复、功能增加等代码变更中,使得变更理解变得非常复杂。因此,提出一种对常见的抽取方法和抽取类重构模式的识别算法。研究基于工具Change Distiller和JDiff分别获取变更类型和抽取代码块,通过判断移动后的代码块与原文件变更代码的关系,识别采取的重构模式。该算法在4个开源项目中进行实验,其平均准确率在80%左右。 Refactoring is a common way of improving software maintainability and software quality in modern software development and maintenance. In daily revision,refactoring patterns are usually mixed with code changes accomplishing other tasks such as bug fixing and feature addition,which makes the change understanding very complicated. The paper proposes an identifying algorithm for refactoring patterns including the extract method and extract class. It is based on ChangeDistiller and JDiff that are used to get code changes types and extract code blocks respectively. Then,the algorithm will identify the refactoring pattern according to the characteristics of the relationship between the changed codes and the original codes. The algorithm has been tested on 4 open source projects,with an average 80% accuracy.
作者 孙美荣 杨春花 SUN Meirong;YANG Chunhua(School of Information, Qilu University of Technology ( Shandong Academy of Sciences), Jinan 250353, Chin)
出处 《智能计算机与应用》 2018年第2期25-29,34,共6页 Intelligent Computer and Applications
关键词 重构模式 抽取方法 抽取类 refactoring patterns extract me^od extract class
  • 相关文献

参考文献4

二级参考文献41

  • 1陈丹,袁捷,缪淮扣.类间结构型代码味道自动检测的研究[J].计算机工程,2007,33(7):59-61. 被引量:6
  • 2JavaCC[ EB/OL]. https://javacc, dev. java. net/, Accessed October 2007.
  • 3JDK1.5 [ EB/OL]. http://java, sun. com/javase/downloads/index. jsp, Accessed March 2008.
  • 4Toshihiro Kamiya, Shinji Kusumoto, Katsuro Inoue. CCFinder: a multilinguistic token-based code clone detection system for large scale source c.ode[ J]. IEEE Transactions on Software Engineering, 2002, 28(7) : 654-670.
  • 5Ira D Baxter, Andrew Yahin, Leonardo Moura, et al. Clone detection using abstract syntax trees[ C]. Proceedings of the Internation- al Conference on Software Maintenance, 1998, 368-377.
  • 6Komondoor R, Horwitz S. Using slicing to identify duplication in source code[ C]. Proceedings of the 8th International Symposium on Static Analysis, 2001, 40 - 56.
  • 7Higo Y, Kamiya T, Kusumoto S, et al. Refactoring support based on code clone analysis[ C]. Proceedings of 5th International Conference on Product Focused Software Process Improvement, April 2004, 220-233.
  • 8Bas Comelissen, Bas Graaf, Leon Moonen. Identification of variation points using dynamic analysis[ C]. Proceedings of First International Workshop on Reengineering Towards Product Lines, November 2005, 9-13.
  • 9Simian [ EB/OL]. http://www, redhillconsulting, com. au/products/simian/, Accessed October 2007.
  • 10JTB [ EB/OL]. http ://compilers. cs. ucla. edu/jtb/, Accessed October 2007.

共引文献19

同被引文献4

引证文献1

二级引证文献1

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部