期刊文献+

基于代码变更块和抽象语法树的两种重构模式识别

Identifying two refactoring patterns based on hunk and abstract syntax tree
下载PDF
导出
摘要 内联函数(Inline method)和替换算法(Substitute algorithm)是2种在代码重构中常用的重构手法,本文提出一种基于代码变更块和抽象语法树的重构模式识别算法,首先筛选出变更前后2个文件的代码变更块,找到可能属于这2种重构模式的代码变更块,再建立抽象语法树对这些变更块中的代码进行准确的语法分析,对其是否属于此2种模式进行判定。该算法在4个开源项目上进行了实验验证,表明了其具有较高的准确率。 Inline method and Substitute algorithm are two kinds of refactoring methods which are used in code refactoring frequently.This paper proposes a refactoring pattern recognition algorithm based on hunk and abstract syntax tree.First filter out all the hunks of the two files,find the specific hunks that may contain these two kinds of refactoring patterns,then establish an abstract syntax tree to analyze the code in this hunks more accurately and verdict whether it matches these two refactoring patterns.The algorithm has been experimentally verified on four open source projects,indicating that it has a high accuracy.
作者 张志浩 杨春花 ZHANG Zhihao;YANG Chunhua(School of Computer Science and Technology,Qilu University of Technology(Shandong Academy of Sciences),Jinan 250353,China)
出处 《智能计算机与应用》 2019年第3期146-150,共5页 Intelligent Computer and Applications
基金 国家自然科学基金(61502259)
关键词 重构模式 抽象语法树 代码变更块 内联函数 替换算法 refactoring pattern abstract syntax tree hunk Inline method Substitute algorithm
  • 相关文献

参考文献5

二级参考文献36

  • 1JavaCC[ EB/OL]. https://javacc, dev. java. net/, Accessed October 2007.
  • 2JDK1.5 [ EB/OL]. http://java, sun. com/javase/downloads/index. jsp, Accessed March 2008.
  • 3Toshihiro 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.
  • 4Ira 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.
  • 5Komondoor R, Horwitz S. Using slicing to identify duplication in source code[ C]. Proceedings of the 8th International Symposium on Static Analysis, 2001, 40 - 56.
  • 6Higo 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.
  • 7Bas 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.
  • 8Simian [ EB/OL]. http://www, redhillconsulting, com. au/products/simian/, Accessed October 2007.
  • 9JTB [ EB/OL]. http ://compilers. cs. ucla. edu/jtb/, Accessed October 2007.
  • 10王映龙,杨炳儒,宋泽锋,陈卓,唐建军.基因序列相似程度的LCS算法研究[J].计算机工程与应用,2007,43(31):45-47. 被引量:14

共引文献26

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

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