摘要
抽取方法是一种常用的代码重构手段,被广泛应用到软件开发和维护中。提出一个基于克隆检测的抽取方法重构模式的识别算法。以代码变更块hunk为单位,用代码克隆检测工具simian对候选的hunk进行筛选,用语法分析对该模式进行判定。在4个开源项目上进行实验,结果表明该算法具有较高的准确率。
Extract method is a common way to refactor code, which is widely used in software development and maintenance. This paper proposed a recognition algorithm of pattern refactoring based on clone detection. In the unit of code change block hunk, the candidate hunk was screened by code clone detection tool simian, and the pattern was determined by grammar analysis. Experiments on four open source projects show that the algorithm has high accuracy.
作者
张志浩
杨春花
Zhang Zhihao;Yang Chunhua(School of Computer Science and Technology, Qilu University of Technology(Shandong Academy of Science), Jinan 250000, Shandong, China)
出处
《计算机应用与软件》
北大核心
2019年第9期12-15,20,共5页
Computer Applications and Software
基金
国家自然科学基金项目(61502259)
关键词
重构模式
重构模式识别
代码克隆检测
代码变更
抽取方法
Refactoring pattern
Refactoring pattern identification
Code clone detection
Code changes
Extract method