130419 aminata sabane - a study of the impact of antipatterns on class testability
-
Upload
ptidej-team -
Category
Technology
-
view
70 -
download
2
description
Transcript of 130419 aminata sabane - a study of the impact of antipatterns on class testability
MotivationsGoal
Empirical StudyResults
Other Findings: Refactoring for Reducing Testing CostConclusion
Outline
Motivations
Goal
Empirical Study
Results
Other Findings
Conclusion
A. Sabane, M. Di Penta, G. Antoniol, Y-G. Gueheneuc March 07th, 2013 1 / 26
MotivationsGoal
Empirical StudyResults
Other Findings: Refactoring for Reducing Testing CostConclusion
Motivations
What are Antipatterns?
Identify poor solutions to recurring design problems[Brown et al.]
Some causes
Time-market pressure
Insufficient knowledge and or experience
Misapplication of some design patterns
A. Sabane, M. Di Penta, G. Antoniol, Y-G. Gueheneuc March 07th, 2013 2 / 26
MotivationsGoal
Empirical StudyResults
Other Findings: Refactoring for Reducing Testing CostConclusion
Motivations
Impact of Antipatterns...
A. Sabane, M. Di Penta, G. Antoniol, Y-G. Gueheneuc March 07th, 2013 3 / 26
MotivationsGoal
Empirical StudyResults
Other Findings: Refactoring for Reducing Testing CostConclusion
Motivations
What about Testability and Testing?
A. Sabane, M. Di Penta, G. Antoniol, Y-G. Gueheneuc March 07th, 2013 4 / 26
MotivationsGoal
Empirical StudyResults
Other Findings: Refactoring for Reducing Testing CostConclusion
Goal
Study the impact of antipatterns on class testability
A. Sabane, M. Di Penta, G. Antoniol, Y-G. Gueheneuc March 07th, 2013 5 / 26
MotivationsGoal
Empirical StudyResults
Other Findings: Refactoring for Reducing Testing CostConclusion
Class Testability MeasureMaDUMObjectsSubjectsRQ1: Assess AP class impact on testing effort?RQ2: Which APs are the most expensiveRQ3: Cost-effectiveness of APs testing
Class Testability Measure
What is Testability?
Degree to which a system or component facilitates theestablishment of test criteria and performance of tests todetermine whether those criteria have been met [IEEEGlossary]
Testing effort [Bache et al.]
How to Measure Testability?
Metric-Based approaches [Bruntink et al.]
number of test cases required to satisfy a given coveragecriterion [Bache et al.]
A. Sabane, M. Di Penta, G. Antoniol, Y-G. Gueheneuc March 07th, 2013 6 / 26
MotivationsGoal
Empirical StudyResults
Other Findings: Refactoring for Reducing Testing CostConclusion
Class Testability MeasureMaDUMObjectsSubjectsRQ1: Assess AP class impact on testing effort?RQ2: Which APs are the most expensiveRQ3: Cost-effectiveness of APs testing
MaDUM
What is it?
Unit testing technique for object oriented programs [Bashir etal.]
Based on data slices
Core idea: The correctness of a class is equivalent to thecorrectness of all its slices
Focus on the test of methods interactions
A. Sabane, M. Di Penta, G. Antoniol, Y-G. Gueheneuc March 07th, 2013 7 / 26
MotivationsGoal
Empirical StudyResults
Other Findings: Refactoring for Reducing Testing CostConclusion
Class Testability MeasureMaDUMObjectsSubjectsRQ1: Assess AP class impact on testing effort?RQ2: Which APs are the most expensiveRQ3: Cost-effectiveness of APs testing
MaDUM
A. Sabane, M. Di Penta, G. Antoniol, Y-G. Gueheneuc March 07th, 2013 8 / 26
MotivationsGoal
Empirical StudyResults
Other Findings: Refactoring for Reducing Testing CostConclusion
Class Testability MeasureMaDUMObjectsSubjectsRQ1: Assess AP class impact on testing effort?RQ2: Which APs are the most expensiveRQ3: Cost-effectiveness of APs testing
MaDUM
A. Sabane, M. Di Penta, G. Antoniol, Y-G. Gueheneuc March 07th, 2013 9 / 26
MotivationsGoal
Empirical StudyResults
Other Findings: Refactoring for Reducing Testing CostConclusion
Class Testability MeasureMaDUMObjectsSubjectsRQ1: Assess AP class impact on testing effort?RQ2: Which APs are the most expensiveRQ3: Cost-effectiveness of APs testing
Why MaDUM?
Why MaDUM?
Specific to OO programs
Not require specific design documentation
Possibility to compute the number of required test cases
Upper-bound for testing cost
A. Sabane, M. Di Penta, G. Antoniol, Y-G. Gueheneuc March 07th, 2013 10 / 26
MotivationsGoal
Empirical StudyResults
Other Findings: Refactoring for Reducing Testing CostConclusion
Class Testability MeasureMaDUMObjectsSubjectsRQ1: Assess AP class impact on testing effort?RQ2: Which APs are the most expensiveRQ3: Cost-effectiveness of APs testing
Objects
4 systems: Ant, ArgoUML, Checkstyle & JFreechart
Systems belong to different application domains, havebug-fixing data available and have been used in previousstudies [Abbes et al.], [Bruntink et al.]
A. Sabane, M. Di Penta, G. Antoniol, Y-G. Gueheneuc March 07th, 2013 11 / 26
MotivationsGoal
Empirical StudyResults
Other Findings: Refactoring for Reducing Testing CostConclusion
Class Testability MeasureMaDUMObjectsSubjectsRQ1: Assess AP class impact on testing effort?RQ2: Which APs are the most expensiveRQ3: Cost-effectiveness of APs testing
Subjects
13 antipatterns
Studied in previous studies [Khomh et al.], [Abbes et al.],
Detection tool: Decor [Moha et al.]
Name (Abbr) Ant ArgoUML CheckStyle JFreeChartAntipattern classes 452 901 161 245No Antipattern (None) 297 376 99 233
A. Sabane, M. Di Penta, G. Antoniol, Y-G. Gueheneuc March 07th, 2013 12 / 26
MotivationsGoal
Empirical StudyResults
Other Findings: Refactoring for Reducing Testing CostConclusion
Class Testability MeasureMaDUMObjectsSubjectsRQ1: Assess AP class impact on testing effort?RQ2: Which APs are the most expensiveRQ3: Cost-effectiveness of APs testing
RQ1: Assess AP class impact on testing effort?
How large is the MaDUM test suite for classes participating in APscompared to that of other classes?
A. Sabane, M. Di Penta, G. Antoniol, Y-G. Gueheneuc March 07th, 2013 13 / 26
MotivationsGoal
Empirical StudyResults
Other Findings: Refactoring for Reducing Testing CostConclusion
Class Testability MeasureMaDUMObjectsSubjectsRQ1: Assess AP class impact on testing effort?RQ2: Which APs are the most expensiveRQ3: Cost-effectiveness of APs testing
RQ2: Which APs are the most expensive
How does the size of the MaDUM test suite vary among classesparticipating in different kinds of APs?
A. Sabane, M. Di Penta, G. Antoniol, Y-G. Gueheneuc March 07th, 2013 14 / 26
MotivationsGoal
Empirical StudyResults
Other Findings: Refactoring for Reducing Testing CostConclusion
Class Testability MeasureMaDUMObjectsSubjectsRQ1: Assess AP class impact on testing effort?RQ2: Which APs are the most expensiveRQ3: Cost-effectiveness of APs testing
RQ3: Cost-effectiveness of APs testing
What is the potential cost-benefit achieved when focusing testingon APs, as opposed to other classes?
A. Sabane, M. Di Penta, G. Antoniol, Y-G. Gueheneuc March 07th, 2013 15 / 26
MotivationsGoal
Empirical StudyResults
Other Findings: Refactoring for Reducing Testing CostConclusion
RQ1RQ2RQ3
Results
Results...
A. Sabane, M. Di Penta, G. Antoniol, Y-G. Gueheneuc March 07th, 2013 16 / 26
MotivationsGoal
Empirical StudyResults
Other Findings: Refactoring for Reducing Testing CostConclusion
RQ1RQ2RQ3
RQ1: How large is the MaDUM test suite for classesparticipating in APs compared to that of other classes?
●
●
●●
●
●●
●
●
●●
●
●
●●
●●
●
●
●
●
●
●
●
●
●
●●
●●
●●●●●●
●
●●●●●
●●
●
●
●
●
●
●●
●
●
●
●●
●
●
●
●
●
●
●
●●
●
●
●
●
●●
●
●
●
●
●
●●●
●●
●
●●
●
●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●
●
●
●
●●
●
●●
●
●
●
●
●
●
●
●
●
●
●
●●
●
●
●●
●
●
●
●
●
●
●
●●
●
●
●
●●
●
●●●
●
●
●
●
●
●
●●●●●●●●●●●●
●
●
●
●
●●●
●
●
●
●
●
●
●●
●●
●
●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●
●
●
●
●
●●
●
●
●
●●●●●
●
●●●●●●●
●
AP NAP AP NAP AP NAP AP NAP
020
4060
80
Ant ArgoUML Checkstyle JFreeChartSystemClasses
# of
Tes
t Cas
es (<
=100
)
Figure: Number of test cases in the MaDUM test suite for classesparticipating (AP) and not (NAP) in antipatterns.
A. Sabane, M. Di Penta, G. Antoniol, Y-G. Gueheneuc March 07th, 2013 17 / 26
MotivationsGoal
Empirical StudyResults
Other Findings: Refactoring for Reducing Testing CostConclusion
RQ1RQ2RQ3
RQ1: How large is the MaDUM test suite for classesparticipating in APs compared to that of other classes?
System Mean TCs AP Mean TCs NAP p-Value Cliff’s dAnt 18 9 < 0.01 0.23 (Small)
ArgoUML 10 3 < 0.01 0.35 (Medium)CheckStyle 9 6 = 0.01 NAJFreeChart 26 13 < 0.01 0.22 (Small)
A. Sabane, M. Di Penta, G. Antoniol, Y-G. Gueheneuc March 07th, 2013 18 / 26
MotivationsGoal
Empirical StudyResults
Other Findings: Refactoring for Reducing Testing CostConclusion
RQ1RQ2RQ3
RQ2: How does the size of the MaDUM test suite varyamong classes participating in different kinds of APs?
●●●●●
●●●
●
●
● ●●●
●●●●
●
●●
●●
●●●
●
●
●●●●●
●●
●
●
●
●
●
●●●●●●●●●●●●●●●●●●●●●
●
AS BCSBA B CDSBP CC LzC LM LPL MC RPB SC SG SAK NONE
02
04
06
08
01
00
Kind of Antipattern
# o
f Te
st
Ca
se
s (
<=
10
0)
A. Sabane, M. Di Penta, G. Antoniol, Y-G. Gueheneuc March 07th, 2013 19 / 26
MotivationsGoal
Empirical StudyResults
Other Findings: Refactoring for Reducing Testing CostConclusion
RQ1RQ2RQ3
RQ2: How does the size of the MaDUM test suite varyamong classes participating in different kinds of APs?
●
●
●
●
●
●
●
●
●
●●●●●●●●
●●●●●
●●●
●
AS BCSBA B CDSBP CC LzC LM LPL MC RPB SC SG SAK NONE
02
04
06
08
01
00
Kind of Antipattern
# o
f Te
st
Ca
se
s (
<=
10
0)
Classes participating in APs related to “excess of responsibility” aremore expensive
A. Sabane, M. Di Penta, G. Antoniol, Y-G. Gueheneuc March 07th, 2013 20 / 26
MotivationsGoal
Empirical StudyResults
Other Findings: Refactoring for Reducing Testing CostConclusion
RQ1RQ2RQ3
RQ3: What is the potential cost-benefit achieved whenfocusing testing on APs, as opposed to other classes?
0 1000 2000 3000 4000 5000 6000 7000
020
4060
80100
# of Test Case (cum.)
Defec
ts in te
sted c
lasses
(cum.)
It is cost-effective to analyze/test APs classes with a higher prioritythan other classes
A. Sabane, M. Di Penta, G. Antoniol, Y-G. Gueheneuc March 07th, 2013 21 / 26
MotivationsGoal
Empirical StudyResults
Other Findings: Refactoring for Reducing Testing CostConclusion
Other Findings: Refactoring for Reducing Testing Cost
Effect of traditional refactoring on testing cost?
A. Sabane, M. Di Penta, G. Antoniol, Y-G. Gueheneuc March 07th, 2013 22 / 26
MotivationsGoal
Empirical StudyResults
Other Findings: Refactoring for Reducing Testing CostConclusion
Other Findings: Refactoring for Reducing Testing Cost
Before Afterrefactoring refactoring
Class (system) Type TRS TCs TRS TCsTokenFilter (Ant) CDSBP 5 263 2 27PropPanel (ArgoUML) Blob 5 271 3 43BooleanExpressionComplexityCheck
(Checkstyle)LPL 6 732 5 132
AxisState (JFreeChart) NAP 5 248 1 11DynamicTimeSeriesCollection(JFreeChart)
Blob 4 208 2 122
A. Sabane, M. Di Penta, G. Antoniol, Y-G. Gueheneuc March 07th, 2013 23 / 26
MotivationsGoal
Empirical StudyResults
Other Findings: Refactoring for Reducing Testing CostConclusion
Conclusion
Findings
Most of APs classes are expensive for unit testing
APs classes with excess of responsibilities require more testingeffort than other
Prioritize the testing of APs classes can be more cost-effective
Specific refactoring can help to reduce testing cost
A. Sabane, M. Di Penta, G. Antoniol, Y-G. Gueheneuc March 07th, 2013 24 / 26
MotivationsGoal
Empirical StudyResults
Other Findings: Refactoring for Reducing Testing CostConclusion
Conclusion
Future Work
Study more systems
Investigate the symptoms that make APs classes moreexpensive
Study the impact of APs on testing effort from other aspects
Investigate specific refactoring for testability
A. Sabane, M. Di Penta, G. Antoniol, Y-G. Gueheneuc March 07th, 2013 25 / 26
MotivationsGoal
Empirical StudyResults
Other Findings: Refactoring for Reducing Testing CostConclusion
Thank you very much for your attention!
A. Sabane, M. Di Penta, G. Antoniol, Y-G. Gueheneuc March 07th, 2013 26 / 26