The document discusses various myths and misconceptions in software engineering. It summarizes research that analyzed large codebases to determine factors correlated with defects. Metrics like lines of code and complexity metrics correlated with defects, but the relationship depended on the project. Defect-prone modules could be predicted by combining metrics. Other factors like developer experience, prior defects, language features, and dependencies also influenced bugs. While some properties were project-specific, others like the role of requirements, design, coding and testing were universal defect sources.
22. Do metrics correlate
with defect density?
Project Metrics correlated w/ defects
A #Classes and 5 derived
B almost all
C all except MaxInheritanceDepth
D only #Lines
E #Functions, #Arcs, Complexity
23. Do metrics correlate
with defect density?
Project Metrics correlated w/ defects
A #Classes and 5 derived
B almost all
C all except MaxInheritanceDepth
D only #Lines
E #Functions, #Arcs, Complexity
24. Do metrics correlate
with defect density?
Project Metrics correlated w/ defects
A #Classes and 5 derived
B almost all
C all except MaxInheritanceDepth
D only #Lines
E #Functions, #Arcs, Complexity
25. Do metrics correlate
with defect density?
Project Metrics correlated w/ defects
A #Classes and 5 derived
B almost all
C all except MaxInheritanceDepth
D only #Lines
E #Functions, #Arcs, Complexity
26. Do metrics correlate
with defect density?
Project Metrics correlated w/ defects
A #Classes and 5 derived
B almost all
C all except MaxInheritanceDepth
D only #Lines
E #Functions, #Arcs, Complexity
27. Do metrics correlate
with defect density?
Project Metrics correlated w/ defects
A #Classes and 5 derived
B almost all
C all except MaxInheritanceDepth
D only #Lines
E #Functions, #Arcs, Complexity
28. Do metrics correlate
with defect density?
YES
Project Metrics correlated w/ defects
A #Classes and 5 derived
B almost all
C all except MaxInheritanceDepth
D only #Lines
E #Functions, #Arcs, Complexity
29. Is there a set of metrics
that fits all projects?
Project Metrics correlated w/ defects
A #Classes and 5 derived
B almost all
C all except MaxInheritanceDepth
D only #Lines
E #Functions, #Arcs, Complexity
30. Is there a set of metrics
that fits all projects?
NO
Project Metrics correlated w/ defects
A #Classes and 5 derived
B almost all
C all except MaxInheritanceDepth
D only #Lines
E #Functions, #Arcs, Complexity
33. Can we predict
defect-prone modules?
• Basic idea: Combine metrics
• Give most weight to most predictive metrics
34. Can we predict
defect-prone modules?
• Basic idea: Combine metrics
• Give most weight to most predictive metrics
• Successful prediction in all five projects –
35. Can we predict
defect-prone modules?
• Basic idea: Combine metrics
• Give most weight to most predictive metrics
• Successful prediction in all five projects –
• – but requires history to calibrate
58. Eclipse imports
import org.eclipse.jdt.internal.compiler.lookup.*;
import org.eclipse.jdt.internal.compiler.*;
import org.eclipse.jdt.internal.compiler.ast.*;
import org.eclipse.jdt.internal.compiler.util.*;
...
import org.eclipse.pde.core.*;
import org.eclipse.jface.wizard.*;
import org.eclipse.ui.*;
Joint work with Adrian Schröter • Tom Zimmermann
59. Eclipse imports
71% of all components importing compiler
show a post-release defect
import org.eclipse.jdt.internal.compiler.lookup.*;
import org.eclipse.jdt.internal.compiler.*;
import org.eclipse.jdt.internal.compiler.ast.*;
import org.eclipse.jdt.internal.compiler.util.*;
...
import org.eclipse.pde.core.*;
import org.eclipse.jface.wizard.*;
import org.eclipse.ui.*;
Joint work with Adrian Schröter • Tom Zimmermann
60. Eclipse imports
71% of all components importing compiler
show a post-release defect
import org.eclipse.jdt.internal.compiler.lookup.*;
import org.eclipse.jdt.internal.compiler.*;
import org.eclipse.jdt.internal.compiler.ast.*;
import org.eclipse.jdt.internal.compiler.util.*;
...
import org.eclipse.pde.core.*;
import org.eclipse.jface.wizard.*;
import org.eclipse.ui.*;
14% of all components importing ui
show a post-release defect
Joint work with Adrian Schröter • Tom Zimmermann
73. Defect
sources
• Which properties Design
Requirements
should we look at?
• Which properties
can we look at?
Coding Quality Assurance
74. bug density
Plugin.java had 5 failures )
before and one failure after
release (``post''). The
package contains 43 files
(``points'') and encountered 16
failures before and one failure
after release; on average each
file in this package had 0.609
failures before and 0.022
failures after release (``avg'')
Bugs • Fixes • Changes
75. bug density
Plugin.java had 5 failures )
before and one failure after
release (``post''). The
package contains 43 files
(``points'') and encountered 16
failures before and one failure
after release; on average each
file in this package had 0.609
failures before and 0.022
failures after release (``avg'')
Bugs • Fixes • Changes
76. <?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>
<defects project=quot;eclipsequot; release=quot;3.0quot;>
<package name=quot;org.eclipse.core.runtimequot;>
<counts>
<count id=quot;prequot; value=quot;16quot; avg=quot;0.609quot; points=quot;43quot; max=quot;5quot;>
<count id=quot;postquot; value=quot;1quot; avg=quot;0.022quot; points=quot;43quot; max=quot;1quot;>
</counts>
<compilationunit name=quot;Plugin.javaquot;>
<counts>
<count id=quot;prequot; value=quot;5quot;> Plugin.java had 5 failures )
before and one failure after
<count id=quot;postquot; value=quot;1quot;> release (``post''). The
package contains 43 files
(``points'') and encountered 16
failures before and one failure
after release; on average each
file in this package had 0.609
failures before and 0.022
failures after release (``avg'')
Bugs • Fixes • Changes
77. Defect
sources
• Which properties Design
Requirements
should we look at?
• Which properties
can we look at?
Coding Quality Assurance
78. Defect
sources
• Which properties Design
Requirements
should we look at?
• Which properties
can we look at?
Coding Quality Assurance
79. Defect
sources
• Which properties Design
Requirements
should we look at?
• Which properties
can we look at?
Coding Quality Assurance