首页 | 本学科首页   官方微博 | 高级检索  
     检索      

基于测试代码变化的重构意图推测方法
引用本文:高原,刘辉,樊孝忠,牛振东.基于测试代码变化的重构意图推测方法[J].北京理工大学学报,2017,37(5):537-543.
作者姓名:高原  刘辉  樊孝忠  牛振东
作者单位:北京理工大学计算机学院,北京100081;96512部队,陕西,汉中723000;北京理工大学计算机学院,北京,100081
基金项目:国家重点研发计划(2016YFB1000801);国家教育部新世纪优秀人才支持计划(NCET-13-0041);国家自然科学基金面上资助项目(61472034,61272169)
摘    要:已有的重构工具主要在传统开发模式下,针对源代码的变化来推测重构.对于目前流行的测试驱动开发方法,缺乏有效的工具指导实施测试驱动重构.为此,本文提出了一种基于测试代码变化的重构意图推测方法,在测试驱动开发过程中,通过实时监控捕获测试代码的变化,并依据启发式规则推测可能的重构操作.该方法在两个实际的测试驱动开发项目上进行了验证.结果表明该方法比现有方法更为高效准确,其准确率提高约15%,查全率提高了33.3%~42.8%. 

关 键 词:重构意图  代码坏味  测试驱动  测试用例
收稿时间:2014/6/19 0:00:00

Inferring Refactoring Intention from Test Case Modification
GAO Yuan,LIU Hui,FAN Xiao-zhong and NIU Zhen-dong.Inferring Refactoring Intention from Test Case Modification[J].Journal of Beijing Institute of Technology(Natural Science Edition),2017,37(5):537-543.
Authors:GAO Yuan  LIU Hui  FAN Xiao-zhong and NIU Zhen-dong
Institution:1. School of Computer Science and Technology, Beijing Institute of Technology, Beijing 100081, China;2. PLA Units 96512, Hanzhong, Shanxi 723000, China
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%.
Keywords:refactoring intention  code smell  test-driven  test case
本文献已被 CNKI 万方数据 等数据库收录!
点击此处可从《北京理工大学学报》浏览原始摘要信息
点击此处可从《北京理工大学学报》下载免费的PDF全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号