摘要
代码变更的理解一般基于文本差异化工具,其处理输出的基本对象是一个变更块(hunk)。许多重构都掺杂在日常的bug修改、功能特征的增加等代码变更中,将重构与其它工作隔离有利于对代码变更的理解。现有的代码可视化方法仅展示变更文本,未进行代码变更前后重构模式的展示,没有发挥出可视化技术的优越性。本文基于变更块对代码重构模式进行展示,以抽取方法为例,在4个开源项目中进行实验,并取得了理想的展示效果。
The understanding of code changes is generally based on text differentiation tools,whose basic object for processing output is a hunk.Many refactoring are incorporated into code changes such as daily bug fixes and functional features.Separating refactoring from other work facilitates understanding of code changes.The text differentiation tool only displays the changed text,and does not show the refactoring pattern before and after the code change,and does not play the superiority of the visualization technology.In this paper,code refactoring pattern is demonstrated based on hunks.Taking the extract method as an example,the experiment is carried out in four open source projects,and the ideal display effect is achieved.
作者
石伟
杨春花
SHI Wei;YANG Chunhua(School of Computer Science and Technology,Qilu University of Technology (Shandong Academy of Sciences),Jinan 250353,China)
出处
《智能计算机与应用》
2019年第3期85-88,共4页
Intelligent Computer and Applications
关键词
变更块
重构
抽取方法
重构模式展示
hunk
refactoring
extract method
refactoring pattern display