• Save
Do Bugs Reside in Complex Code?
Upcoming SlideShare
Loading in...5
×
 

Do Bugs Reside in Complex Code?

on

  • 4,366 views

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

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.

Statistics

Views

Total Views
4,366
Views on SlideShare
4,351
Embed Views
15

Actions

Likes
3
Downloads
0
Comments
0

4 Embeds 15

http://www.slideshare.net 6
http://inside.mathworks.com 4
http://www.linkedin.com 4
https://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Do Bugs Reside in Complex Code? Do Bugs Reside in Complex Code? Presentation Transcript

  • 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