计算机科学与探索 ›› 2017, Vol. 11 ›› Issue (9): 1418-1428.DOI: 10.3778/j.issn.1673-9418.1609025

• 系统软件与软件工程 • 上一篇    下一篇

面向设计的开源软件项目重构经验研究

阮  航1,2,陈  恒1,2,彭  鑫1,2+,赵文耘1,2   

  1. 1. 复旦大学 软件学院,上海 201203
    2. 复旦大学 上海数据科学重点实验室,上海 201203
  • 出版日期:2017-09-01 发布日期:2017-09-06

Empirical Study of Design-Oriented Refactorings in Open Source Projects

RUAN Hang1,2, CHEN Heng1,2, PENG Xin1,2+, ZHAO Wenyun1,2   

  1. 1. Software School, Fudan University, Shanghai 201203, China
    2. Shanghai Key Laboratory of Data Science, Fudan University, Shanghai 201203, China
  • Online:2017-09-01 Published:2017-09-06

摘要: 软件在演化过程中经常被修改,软件结构往往会偏离原有的设计方向,软件质量也会逐渐变差。不良设计造成的技术债务在后续开发过程中会带来许多困难和阻碍,需要及时重构,改善原有代码的不良设计。对常见的重构操作进行了简单介绍和分类。在两个开源项目上进行了经验研究,关注两个问题:(1)重构在开源项目中是否被广泛应用,其中是否存在面向设计的重构;(2)是否存在没有及时重构改善原有代码的不良设计,导致后续开发遇到不必要的困难的情况, 并且后续是否进行了重构。初步证明了重构在开源项目中的广泛应用和重要性,以及面向设计的重构的重要作用。

关键词: 技术债, 软件设计, 重构, 开源项目

Abstract:  Software is constantly changing and evolving, driven by the increment of requirements. Software often degrades from the original design, the quality of codes also becomes poor. Developers will meet more barriers and difficulties in the future development when there are some technical debts in the original design. It is necessary to improve the quality of codes by refactorings. This paper introduces some common types of refactorings under the review of related literature, and introduces a simple case to verify the importance of the design-oriented refactorings. This paper aims to answer two questions: (1) whether there are applied refactorings in the open source project and whether there are design-oriented refactorings among them; (2) whether there exists some situation that the structure with a bad design causes difficulties in the fellow-up development and whether the developers apply some refactorings to it later. This paper proves the wide use and importance of refactorings in open source projects, particularly the importance of the design-oriented refactorings.

Key words: technical debt, software design, refactoring, open source project