高原, 刘辉, 樊孝忠, 牛振东. 基于测试代码变化的重构意图推测方法[J]. 北京理工大学学报自然版, 2017, 37(5): 537-543. DOI: 10.15918/j.tbit1001-0645.2017.05.019
引用本文: 高原, 刘辉, 樊孝忠, 牛振东. 基于测试代码变化的重构意图推测方法[J]. 北京理工大学学报自然版, 2017, 37(5): 537-543. DOI: 10.15918/j.tbit1001-0645.2017.05.019
GAO Yuan, LIU Hui, FAN Xiao-zhong, NIU Zhen-dong. Inferring Refactoring Intention from Test Case Modification[J]. Transactions of Beijing institute of Technology, 2017, 37(5): 537-543. DOI: 10.15918/j.tbit1001-0645.2017.05.019
Citation: GAO Yuan, LIU Hui, FAN Xiao-zhong, NIU Zhen-dong. Inferring Refactoring Intention from Test Case Modification[J]. Transactions of Beijing institute of Technology, 2017, 37(5): 537-543. DOI: 10.15918/j.tbit1001-0645.2017.05.019

基于测试代码变化的重构意图推测方法

Inferring Refactoring Intention from Test Case Modification

  • 摘要: 已有的重构工具主要在传统开发模式下,针对源代码的变化来推测重构.对于目前流行的测试驱动开发方法,缺乏有效的工具指导实施测试驱动重构.为此,本文提出了一种基于测试代码变化的重构意图推测方法,在测试驱动开发过程中,通过实时监控捕获测试代码的变化,并依据启发式规则推测可能的重构操作.该方法在两个实际的测试驱动开发项目上进行了验证.结果表明该方法比现有方法更为高效准确,其准确率提高约15%,查全率提高了33.3%~42.8%.

     

    Abstract: Existing tools/methods are used to infer refactoring according to production code change in traditional development mode. In the test-driven development (TDD), there are few tools can be used to guide test driven refactoring. In this paper, an approach was proposed to inferring refactoring intension from test case modifications. Firstly, the test code modification was captured with a monitor, and then the potential refactoring was inferred from the captured modification according to predefined heuristics. The proposed approach has been implemented and evaluated with two real applications. Evaluation results show that compared with existing approach the precision increases by 15% and the recall increases by 33.3%~42.8%.

     

/

返回文章
返回