| Literature DB >> 33267058 |
Yiming Xiang1, Weifeng Pan2, Haibo Jiang2, Yunfang Zhu2, Hao Li3.
Abstract
Modularity has been regarded as one of the most important properties of a successful software design. It has significant impact on many external quality attributes such as reusability, maintainability, and understandability. Thus, proposing metrics to measure the software modularity can be very useful. Although several metrics have been proposed to characterize some modularity-related attributes, they fail to characterize software modularity as a whole. A complex network uses network models to abstract the internal structure of complex systems, providing a general way to analyze complex systems as a whole. In this paper, we introduce the complex network theory into software engineering and employ modularity, a metric widely used in the field of community detection in complex network research, to measure software modularity as a whole. First, a specific piece of software is represented by a software network, feature coupling network (FCN), where methods and attributes are nodes, couplings between methods and attributes are edges, and the weight on the edges denotes the coupling strength. Then, modularity is applied to the FCN to measure software modularity. We apply the Weyuker's criteria which is widely used in the field of software metrics, to validate the modularity as a software metric theoretically, and also perform an empirical evaluation using open-source Java software systems to show its effectiveness as a software metric to measure software modularity.Entities:
Keywords: Java software; complex networks; modularity; software maintenance; software metrics
Year: 2019 PMID: 33267058 PMCID: PMC7514828 DOI: 10.3390/e21040344
Source DB: PubMed Journal: Entropy (Basel) ISSN: 1099-4300 Impact factor: 2.524
Figure 1An overview of the proposed approach.
Figure 2A simple code segment (top) and its corresponding FCN (Feature Coupling Network) (bottom).
Subject software systems.
| Systems | Domain | Directory | KLOC | URLs |
|---|---|---|---|---|
| jmeter-3.0 | testing | src/core | 37.951 |
|
| jfreechart-1.0.19 | tool | source | 97.880 |
|
| ant-1.6.1 | parsers | src/main | 81.515 |
|
| struts-2.5.2 | middleware | src/core | 48.347 |
|
| freemind-1.0.1 | data visualization | src | 45.049 |
|
| bcel-6.0 | programming language | src | 29.206 |
|
| mybatis-3 | middleware | src | 20.385 |
|
| colt-1.2.0 | sdk | src | 34.709 |
|
| jbullet-2.72.2.4 | middleware | com | 22.297 |
|
| junit4-r4.12 | testing | src | 9.296 |
|
| jxtaim-0.1i | communications | src | 12.423 |
|
| commons-email-1.4 | communications | src | 2.705 |
|
Figure 3FCNs for jemter and jfreechart.
Q values of the subject software systems.
| Systems |
|
|
|
|---|---|---|---|
| jmeter-3.0 | 3339 | 2342 | 0.4292 |
| jfreechart-1.0.19 | 11,946 | 9967 | 0.2429 |
| ant-1.6.1 | 11,858 | 14,437 | 0.3589 |
| struts-2.5.2 | 5089 | 3301 | 0.5099 |
| freemind-1.0.1 | 6620 | 8742 | 0.4062 |
| bcel-6.0 | 3984 | 3667 | 0.3113 |
| mybatis-3 | 3193 | 3131 | 0.3131 |
| colt-1.2.0 | 4735 | 6497 | 0.4650 |
| jbullet-2.72.2.4 | 3288 | 4065 | 0.3603 |
| junit4-r4.12 | 1576 | 1406 | 0.3277 |
| jxtaim-0.1i | 1531 | 1429 | 0.3039 |
| commons-email-1.4 | 375 | 256 | 0.3422 |
Descriptions of the subject software systems and their Q values.
| Design Pattern | Version | LOC |
|
|
|
|---|---|---|---|---|---|
| Builder | before | 130 | 11 | 8 | 0.2656 |
| after | 161 | 29 | 19 | 0.2041 | |
| Composite | before | 59 | 10 | 9 | −0.0787 |
| after | 60 | 11 | 8 | −0.1194 | |
| Decorator | before | 34 | 13 | 6 | −0.1667 |
| after | 39 | 15 | 5 | −0.1800 | |
| Iterator | before | 112 | 4 | 1 | 0 |
| after | 174 | 12 | 7 | −0.0078 | |
| State | before | 61 | 5 | 4 | 0.1550 |
| after | 83 | 11 | 5 | 0.1200 |
Figure 4FCNs for the software Builder before and after applying the “Builder” design pattern.
CPU time required for each step.
|
|
|
|
|
|
|
|
|
| i | 6 s | 35 s | 30 s | 8 s | 15 s | 11 s | 5 s |
| ii | 0 s | 0 s | 0 s | 0 s | 0 s | 0 s | 0 s |
| iii | 0 s | 0 s | 0 s | 0 s | 0 s | 0 s | 0 s |
|
|
|
|
|
|
| ||
| i | 13 s | 7 s | 2 s | 2 s | 0 s | ||
| ii | 0 s | 0 s | 0 s | 0 s | 0 s | ||
| iii | 0 s | 0 s | 0 s | 0 s | 0 s |