Paper title: Using Source Code Metrics to Predict Change-Prone Java Interfaces
Authors: Daniele Romano and Martin Pinzger
Session: Research Track Session 11: Metrics
The Codex of Business Writing Software for Real-World Solutions 2.pptx
Metrics - Using Source Code Metrics to Predict Change-Prone Java Interfaces
1. Using Source Code Metrics to Predict Change-
Prone Java Interfaces
Daniele Romano and Martin Pinzger
Williamsburg, ICSM 2011
29 Sept 2011
Delft
University of
Technology
Challenge the future
2. Contributions
• Correlation source code metrics vs #changes in interfaces:
• C&K metrics
• complexity and usage metrics
• interface usage cohesion metric
• Predictive power of source code metrics for interfaces:
• prediction models
• 10 open source projects
• 8 Eclipse projects
• Hibernate 2 and Hibernate 3
2
3. Motivations
• Changes in interfaces are not desirable
• changes can have stronger impact
• interfaces define contracts
• existing object oriented metrics not sound for interfaces
• Related work about metrics as quality predictors
• no differences among the kind of class
3
4. Hypotheses
• H1
• InterfaceUsageCohesion (IUC) has a stronger
correlation with number of Source Code Changes
(#SCC) of interfaces than the C&K metrics
• H2
• IUC can improve the performance of prediction models
to classify Java interfaces into change- and not-
change-prone
4
10. Weighted Methods per Class (WMC)
• ci cyclomatic complexity of the ith method
• n number of methods in a class
Number of Methods
10
11. Interface Segregation Principle
ISP
defined by Robert C. Martin
cope with fat interfaces
Fat interface
interfaces that serve different clients
each kind of client uses a different set of methods
the interface should be split in more interface, each one
designed to serve a specific client
11
12. Interface Segregation Principle (I)
Different clients do not share any methods
ClusterClients(i): counts the number of clients
that do not share any method of the interface i
12
14. Other metrics for interfaces…
• Number Of Methods (NOM)
• Number Of Arguments (NOA)
• Arguments Per Procedure (APP)
• Number of Clients (Cli)
• Number of Invocations (Inv)
• Number of Implementing Classes (Impl)
14
18. Results
• H1 ACCEPTED
• IUC has a stronger correlation with #SCC of interfaces
than the C&K metrics
• UIC shows the best correlation
• H2 PARTIALLY ACCEPTED
• IUC can improve the performance of prediction models
to classify Java interfaces into change- and not-
change-prone
• Despite the improvements Wilcoxon test showed a
significant difference only for the LibSVM
18
19. Implications
• Researchers
• taking in account the nature of the measured entities
• Quality Engineers
• enlarge metrics suites
• Developers and Architects
• Measure the ISP violation
19
20. Future Work
• Metrics measurement overtime
• Further validation
• Are the shared methods the problem?
• Component Based System and Service Oriented System
20