advertisement

Do Bugs Reside in Complex Code?

43 %
57 %
advertisement
Information about Do Bugs Reside in Complex Code?

Published on October 10, 2007

Author: andreas.zeller

Source: slideshare.net

Description

Myths In Software Engineering: Does complex code mean there will be more bugs? We have analyzed a number of bug databases (including Eclipse, Mozilla, and various Microsoft projects) and come to surprising conclusions.
advertisement

Myths in Software Engineering “Bugs Reside in Complex Code” Andreas Zeller Saarland University

Obtaining Data

Models Specs Code Traces Profiles Tests e-mail Bugs Effort Navigation Changes Chats

Models Specs Code Traces Profiles Tests e-mail Bugs Effort Navigation Changes Chats

Bugs Changes

Bugs Changes

Bugs Changes

Bugs Changes

Bugs Changes

Bugs Changes

Map bugs to code locations Bugs Changes

Eclipse Bugs

What is the cause Eclipse Bugs of these errors?

Code complexity Past defects

Code complexity Past defects #Lines #Vars #Classes Metrics #Params #Reads #Writes #Arcs #Blocks McCabe Fan In Fan Out …

Projects researched • Internet Explorer 6 • IIS Server • Windows Process Messaging • DirectX • NetMeeting >1,000,000 Lines of Code

Projects researched >1,000,000 Lines of Code

Projects researched ABCDE >1,000,000 Lines of Code

Do metrics correlate with defect density?

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

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

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

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

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

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

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

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

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

Can we predict defect-prone modules?

Can we predict defect-prone modules? • Basic idea: Combine metrics

Can we predict defect-prone modules? • Basic idea: Combine metrics • Give most weight to most predictive metrics

Can we predict defect-prone modules? • Basic idea: Combine metrics • Give most weight to most predictive metrics • Successful prediction in all five projects –

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

Assistance

Eclipse Bugs

What is the cause Eclipse Bugs of these errors?

Is it the developers?

Is it the developers? Does experience matter?

Is it the developers? Bug density Does experience correlates with matter? experience!

Is it history?

Is it history? I found lots of bugs here. Will there be more?

Is it history? I found lots of Yes! (But where bugs here. Will did these come there be more? from?)

How about metrics?

How about metrics? Do code metrics correlate with bug density?

How about metrics? Do code metrics Sometimes! correlate with bug density?

Uh. Coverage?

Uh. Coverage? Does test coverage correlate with bug density?

Uh. Coverage? Yes – Does test coverage correlate with bug the more coverage, density? the more bugs!

Ah! Language features?

Ah! Language features? Are gotos harmful?

Ah! Language features? Are gotos No correlation! harmful?

Ok. Problem domain?

Ok. Problem domain? Which tokens do matter?

Ok. Problem domain? Which tokens import • extends • implements do matter?

Eclipse imports Joint work with Adrian Schröter • Tom Zimmermann

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

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

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

Mozilla Vulnerabilities

And what else?

And what else? So all of this requires earlier defects, right?

And what else? So all of this requires earlier Yes! defects, right?

And what else?

And what else? But are there universal properties?

And what else? ? But are there universal properties?

Defect sources

Defect sources Coding

Defect sources Coding Quality Assurance

Defect sources Design Coding Quality Assurance

Defect sources Design Requirements Coding Quality Assurance

Defect sources • Which properties Design Requirements should we look at? • Which properties can we look at? Coding Quality Assurance

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

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

<?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

Defect sources • Which properties Design Requirements should we look at? • Which properties can we look at? Coding Quality Assurance

Defect sources • Which properties Design Requirements should we look at? • Which properties can we look at? Coding Quality Assurance

Defect sources • Which properties Design Requirements should we look at? • Which properties can we look at? Coding Quality Assurance

#lines presentations

Add a comment

Related pages

Where Do Bed Bugs Come From? - ALOT Health

Where Do Bed Bugs Come From? Author ... How Do Bed Bugs ... and apartment complex residents are most at risk for bed bugs. These resilient bugs can reside ...
Read more

Apartment Bed Bugs | RPA Tenant Rights Blog

Does your apartment have bed bugs? ... Enter access code. ... Now we are curious about the others in the complex that had to do the same because we were ...
Read more

Bed Bugs | Entomology

Bed bugs do not fly, ... Bed bugs normally do not reside on people like head ... The fumigation process is technically complex and requires vacating the ...
Read more

Software bug - Wikipedia

A software bug is an ... Elias Levy wrote that "it is easy to hide vulnerabilities in complex, ... of bugs have nothing to do with the code.
Read more

Bed Bugs 11-13 - Community Alliance of Tenants - Oregon

Bed Bugs How do I get rid of bed bugs in the home? ... Other sites where bed bugs often reside include curtains, ... City Code 8.20.130.
Read more

Experiments correlating code metrics to bug density ...

I'm wondering if someone has done some experiments correlating code metrics (SLOC, Cyclomatic Complexity, etc) ...
Read more

The Mathworks | Inside.Mathworks.com | WebCompanyInfo

... simulation, model-based design, and code generation.. Get reviews for inside.mathworks.com AND inside. Is inside.mathworks.com a scam or a fraud?
Read more

Health Code Violations: Is Your Landlord Breaking the Law ...

Health Code Violations: Is Your Landlord ... injured from the perceived health code violations. You do not need to worry ... bugs! What do I do ...
Read more