Measurement and refactoring for package structure based on complex network

  • PDF / 1,166,458 Bytes
  • 20 Pages / 595 x 794 pts Page_size
  • 57 Downloads / 193 Views

DOWNLOAD

REPORT


Applied Network Science

RESEARCH

Open Access

Measurement and refactoring for package structure based on complex network Yangxi Zhou, Yanran Mi, Yan Zhu and Liangyu Chen* *Correspondence: [email protected] School of Software Engineering, East China Normal University, No.3663 North Zhongshan Road, 200062 Shanghai, China

Abstract Software structure is the backbone for software systems. During the long time of software evolution, it is gradually weakened by continuous code modification and expansion driven by new requirements. Therefore, measuring software and refactoring codes are necessary to keep software structure stable and clean. In this paper, we propose two metrics of cohesion and coupling to characterize package structure. We consider not only the dependencies of intra-package and inter-package, but also the backward dependencies of inter-package. The two metrics are proved theoretically that they are satisfied with Briand’s four properties. Based on these metrics, a refactoring algorithm is presented to improve the quality of package structure. Through tests on ten open source software systems, the experiment result shows our metrics can measure software structure correctly and improve codes to fit for the rule of high cohesion and low coupling. Keywords: Software dependency network, Software metric, Software measurement, Software refactoring, High cohesion and low coupling

Introduction It is well known that software lifecycle has two phases: a development phase and a maintenance phase. In the development phase, programmers make codes carefully under the guidelines of software architecture design, such as the rule of high cohesion and low coupling. Comparing to the development phase, the maintenance phase is much longer and can last for several years. During the long time of maintenance, the software is not stationary, but evolves gradually. Driven by the new requirements, software functionalities are continuously updated and refactored. Therefore, the amount of code increases and it also becomes more and more complicated. This may cause the software to deviate from the original design, and result in the degradation of software quality and comprehensibility, and finally generate a “technical debt” 1 . So it is necessary to keep software architecture stable and codes clean during the evolution to prolong software service life (Tom et al. 2013). 1 Technical

debt is the term used to describe the time/money/resources that will need to be spent in order to rebuild a software system that is already been “completed”.

© The Author(s). 2020 Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, u