Applied Network Science (Aug 2020)

Measurement and refactoring for package structure based on complex network

  • Yangxi Zhou,
  • Yanran Mi,
  • Yan Zhu,
  • Liangyu Chen

DOI
https://doi.org/10.1007/s41109-020-00298-8
Journal volume & issue
Vol. 5, no. 1
pp. 1 – 20

Abstract

Read online

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