SlideShare une entreprise Scribd logo
1  sur  18
Télécharger pour lire hors ligne
Hidden Truths in Dead
Software Paths
Michael Eichberg, Ben Hermann, Mira Mezini, and
Leonid Glanz
ESEC/FSE 2015, Bergamo, Italy
When is a path dead?
if	
  (maxBits	
  >	
  4	
  ||	
  maxBits	
  <	
  8)	
  {	
  
	
  	
  	
  maxBits	
  =	
  8;	
  
}	
  
if	
  (maxBits	
  >	
  8)	
  {	
  
	
  	
  	
  maxBits	
  =	
  16;	
  
}
OpenJDK 8 update 25, com.sun.imageio.plugins.png.PNGMetadata, line 1842ff
Hidden inside a 278 LOC method
Hypothesis
In well-written code every path
between an instruction and all its
successors is eventually taken
A path that will never be taken
indicates an issue
Identifying Infeasible Paths
public	
  static	
  X	
  doX(SomeType[]	
  array)	
  {	
  
if	
  (array	
  !=	
  null	
  ||	
  array.length	
  >	
  0)	
  {	
  (a)	
  }	
  
//	
  …	
  (b)	
  
}//	
  (ex)
1: public static X doX(SomeType[] array){
2: if (array != null || array.length > 0) {(a) }
5: // … (b)
6: }// (ex)
ifnonnull array arraylength array ifgt (>0)
(a)
(b) (ex)
(B) Corresponding CFG
true true false
false
(A) Java Source Code.
ifnonnull array arraylength array ifgt (>0)
(C) Computed AIFG
false
Java Bytecode
Java Bytecode
:- array is null
CFG
Identifying Infeasible Paths
1: public static X doX(SomeType[] array){
2: if (array != null || array.length > 0) {(a) }
5: // … (b)
6: }// (ex)
ifnonnull array arraylength array ifgt (>0)
(a)
(b) (ex)
(B) Corresponding CFG
true true false
false
ifnonnull array arraylength array ifgt (>0)
(a)
(b) (ex)
(C) Computed AIFG
true true false
false
relevant missing edge
a missing edge
Java Bytecode
Java Bytecode
:- array is null
:- array not null
1: public static X doX(SomeType[] array){
2: if (array != null || array.length > 0) {(a) }
5: // … (b)
6: }// (ex)
ifnonnull array arraylength array ifgt (>0)
(a)
(b) (ex)
(B) Corresponding CFG
true true false
false
ifnonnull array arraylength array ifgt (>0)
(a)
(b) (ex)
(C) Computed AIFG
true true false
false
relevant missing edge
a missing edge
Java Bytecode
Java Bytecode
:- array is null
:- array not null
CFG
AIFG
Abstract Interpretation
Not targeted at a specific goal
Not a whole program analysis,
but instead everything may be an entry point
Inter-procedural, path-, flow-, object- and context-sensitive

with configurable call chain length (typically low)
Abstract Interpretation
Integers
support all arithmetic operations (of the JVM)
maximum size for intervals before we consider
them as AnyInt
float, long, double
at type level
reference values
objects distinguished by their allocation site
alias- and path-sensitive
Post-Processing
Compiler Generated Dead Code
The Intricacies of Java
Established Idioms
Assertions
Reflection and Reflection-like Mechanisms
Post-Processing
Compiler Generated Dead Code
void	
  conditionInFinally(java.io.File	
  f)	
  {	
  
boolean	
  completed	
  =	
  false;	
  
try	
  {	
  
f.canExecute();	
  
completed	
  =	
  true;	
  
}	
  finally	
  {	
  	
  
if	
  (completed)	
  doSomething();	
  }	
  
}
Finally blocks are included twice by Java compilers
Post-Processing
The Intricacies of Java
Throwable	
  doFail()	
  {	
  throw	
  new	
  Exception();	
  }	
  
Object	
  compute(Object	
  o)	
  {	
  
if	
  (o	
  ==	
  null)	
  {	
  return	
  doFail();	
  }	
  
else	
  return	
  o;	
  
}
Post-Processing
Established Idioms
switch	
  (i)	
  {	
  
case	
  1:	
  break;	
  
//	
  complete	
  enumerable	
  of	
  all	
  cases	
  
default:	
  throw	
  new	
  UnknownError();	
  
}
Post-Processing
Assertions
Reflection and Reflection-like Mechanisms
Study: JDK 8 Update 25
Category Percentage
Null Confusion 54 %
Range Double Checks 11 %
Dead Extensibility 9 %
Unsupported Operation
Usage
7 %
Unexpected Return
Value
5 %
Forgotten Constant 4 %
Confused Language
Semantics
3 %
Type Confusion 3 %
Confused Conjunctions 2 %
Obviously Useless
Code
1 %
False Positives 1 %
• Found 556 issues
• For 19 we found no
source code
• 279 of 537 were
considered irrelevant
• The remaining 258
issues were manually
inspected
Null Confusion
Infeasible path because of too much checks for null
Infeasible path because of too less checks for null
if	
  (o	
  ==	
  null)	
  return	
  doSomething();	
  
if	
  (o	
  ==	
  null)	
  return	
  doSomeOtherThing();
int	
  num	
  =	
  array.length;	
  
if	
  (array	
  ==	
  null)	
  	
  
throw	
  InvalidArgumentException();
Range Double Checks
if	
  (extendableSpaces	
  <=	
  0)	
  return;	
  
int	
  adjustment	
  =	
  (target	
  -­‐	
  currentSpan);	
  
int	
  spaceAddon	
  =	
  (extendableSpaces	
  >	
  0)	
  ?	
  
adjustment	
  /	
  extendableSpaces	
  :	
  0;
OpenJDK 8 update 25, javax.swing.text.ParagraphView$Row.layoutMajorAxis, line 1095ff
Dead Extensibility
//	
  For	
  now	
  we	
  set	
  owner	
  to	
  null.	
  In	
  the	
  
future,	
  it	
  may	
  be	
  

//	
  passed	
  as	
  an	
  argument.	
  

Window	
  owner	
  =	
  null;	
  

if	
  (owner	
  instanceof	
  Frame)	
  {	
  ...	
  }
OpenJDK 8 update 25, javax.print.ServiceUI.printDialog, line 189ff
Summary
General analysis approach to find various
different and complex issues
Dead Path detection using Abstract Interpretation
We evaluated on the JDK (and on the
Qualitas Corpus)
We filter out irrelevant issues
Thanks and please try it out
http://www.opal-­‐project.de/tools/bugpicker/
And also see my other talk on a Capability Model
for Java on Friday’s 11:30 session R8.c in the
same room

Contenu connexe

Tendances

Java level 1 Quizzes
Java level 1 QuizzesJava level 1 Quizzes
Java level 1 Quizzes
Steven Luo
 
Os Reindersfinal
Os ReindersfinalOs Reindersfinal
Os Reindersfinal
oscon2007
 

Tendances (20)

Quiz test JDBC
Quiz test JDBCQuiz test JDBC
Quiz test JDBC
 
Handling Exceptions In C &amp; C++ [Part B] Ver 2
Handling Exceptions In C &amp; C++ [Part B] Ver 2Handling Exceptions In C &amp; C++ [Part B] Ver 2
Handling Exceptions In C &amp; C++ [Part B] Ver 2
 
College1
College1College1
College1
 
C++11
C++11C++11
C++11
 
Solid C++ by Example
Solid C++ by ExampleSolid C++ by Example
Solid C++ by Example
 
C programming session3
C programming  session3C programming  session3
C programming session3
 
Summary of C++17 features
Summary of C++17 featuresSummary of C++17 features
Summary of C++17 features
 
C++ vs C#
C++ vs C#C++ vs C#
C++ vs C#
 
Cs2251 daa
Cs2251 daaCs2251 daa
Cs2251 daa
 
Isorc18 keynote
Isorc18 keynoteIsorc18 keynote
Isorc18 keynote
 
(chapter 5) A Concise and Practical Introduction to Programming Algorithms in...
(chapter 5) A Concise and Practical Introduction to Programming Algorithms in...(chapter 5) A Concise and Practical Introduction to Programming Algorithms in...
(chapter 5) A Concise and Practical Introduction to Programming Algorithms in...
 
The Goal and The Journey - Turning back on one year of C++14 Migration
The Goal and The Journey - Turning back on one year of C++14 MigrationThe Goal and The Journey - Turning back on one year of C++14 Migration
The Goal and The Journey - Turning back on one year of C++14 Migration
 
Deep C
Deep CDeep C
Deep C
 
Cpp17 and Beyond
Cpp17 and BeyondCpp17 and Beyond
Cpp17 and Beyond
 
What has to be paid attention when reviewing code of the library you develop
What has to be paid attention when reviewing code of the library you developWhat has to be paid attention when reviewing code of the library you develop
What has to be paid attention when reviewing code of the library you develop
 
What is to loop in c++
What is to loop in c++What is to loop in c++
What is to loop in c++
 
Fast, Private and Verifiable: Server-aided Approximate Similarity Computation...
Fast, Private and Verifiable: Server-aided Approximate Similarity Computation...Fast, Private and Verifiable: Server-aided Approximate Similarity Computation...
Fast, Private and Verifiable: Server-aided Approximate Similarity Computation...
 
Java level 1 Quizzes
Java level 1 QuizzesJava level 1 Quizzes
Java level 1 Quizzes
 
C language
C languageC language
C language
 
Os Reindersfinal
Os ReindersfinalOs Reindersfinal
Os Reindersfinal
 

Similaire à Hidden Truths in Dead Software Paths

Orthogonal Functional Architecture
Orthogonal Functional ArchitectureOrthogonal Functional Architecture
Orthogonal Functional Architecture
John De Goes
 
Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
Java 5 6 Generics, Concurrency, Garbage Collection, TuningJava 5 6 Generics, Concurrency, Garbage Collection, Tuning
Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
Carol McDonald
 
Os Reindersfinal
Os ReindersfinalOs Reindersfinal
Os Reindersfinal
oscon2007
 
Consider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docxConsider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docx
maxinesmith73660
 

Similaire à Hidden Truths in Dead Software Paths (20)

Price of an Error
Price of an ErrorPrice of an Error
Price of an Error
 
Java Performance MythBusters
Java Performance MythBustersJava Performance MythBusters
Java Performance MythBusters
 
Forgive me for i have allocated
Forgive me for i have allocatedForgive me for i have allocated
Forgive me for i have allocated
 
Mathematicians: Trust, but Verify
Mathematicians: Trust, but VerifyMathematicians: Trust, but Verify
Mathematicians: Trust, but Verify
 
100 bugs in Open Source C/C++ projects
100 bugs in Open Source C/C++ projects 100 bugs in Open Source C/C++ projects
100 bugs in Open Source C/C++ projects
 
Orthogonal Functional Architecture
Orthogonal Functional ArchitectureOrthogonal Functional Architecture
Orthogonal Functional Architecture
 
"Why is there no artificial intelligence yet?" Or, analysis of CNTK tool kit ...
"Why is there no artificial intelligence yet?" Or, analysis of CNTK tool kit ..."Why is there no artificial intelligence yet?" Or, analysis of CNTK tool kit ...
"Why is there no artificial intelligence yet?" Or, analysis of CNTK tool kit ...
 
Klee and angr
Klee and angrKlee and angr
Klee and angr
 
100 bugs in Open Source C/C++ projects
100 bugs in Open Source C/C++ projects100 bugs in Open Source C/C++ projects
100 bugs in Open Source C/C++ projects
 
Haskell for data science
Haskell for data scienceHaskell for data science
Haskell for data science
 
Java coding pitfalls
Java coding pitfallsJava coding pitfalls
Java coding pitfalls
 
What You Need to Know about Lambdas
What You Need to Know about LambdasWhat You Need to Know about Lambdas
What You Need to Know about Lambdas
 
Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
Java 5 6 Generics, Concurrency, Garbage Collection, TuningJava 5 6 Generics, Concurrency, Garbage Collection, Tuning
Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
 
core java
 core java core java
core java
 
Symbolic Execution And KLEE
Symbolic Execution And KLEESymbolic Execution And KLEE
Symbolic Execution And KLEE
 
20160520 what youneedtoknowaboutlambdas
20160520 what youneedtoknowaboutlambdas20160520 what youneedtoknowaboutlambdas
20160520 what youneedtoknowaboutlambdas
 
Os Reindersfinal
Os ReindersfinalOs Reindersfinal
Os Reindersfinal
 
200 Open Source Projects Later: Source Code Static Analysis Experience
200 Open Source Projects Later: Source Code Static Analysis Experience200 Open Source Projects Later: Source Code Static Analysis Experience
200 Open Source Projects Later: Source Code Static Analysis Experience
 
Consider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docxConsider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docx
 
Unit I Advanced Java Programming Course
Unit I   Advanced Java Programming CourseUnit I   Advanced Java Programming Course
Unit I Advanced Java Programming Course
 

Dernier

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Dernier (20)

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 

Hidden Truths in Dead Software Paths

  • 1. Hidden Truths in Dead Software Paths Michael Eichberg, Ben Hermann, Mira Mezini, and Leonid Glanz ESEC/FSE 2015, Bergamo, Italy
  • 2. When is a path dead? if  (maxBits  >  4  ||  maxBits  <  8)  {        maxBits  =  8;   }   if  (maxBits  >  8)  {        maxBits  =  16;   } OpenJDK 8 update 25, com.sun.imageio.plugins.png.PNGMetadata, line 1842ff Hidden inside a 278 LOC method
  • 3. Hypothesis In well-written code every path between an instruction and all its successors is eventually taken A path that will never be taken indicates an issue
  • 4. Identifying Infeasible Paths public  static  X  doX(SomeType[]  array)  {   if  (array  !=  null  ||  array.length  >  0)  {  (a)  }   //  …  (b)   }//  (ex) 1: public static X doX(SomeType[] array){ 2: if (array != null || array.length > 0) {(a) } 5: // … (b) 6: }// (ex) ifnonnull array arraylength array ifgt (>0) (a) (b) (ex) (B) Corresponding CFG true true false false (A) Java Source Code. ifnonnull array arraylength array ifgt (>0) (C) Computed AIFG false Java Bytecode Java Bytecode :- array is null CFG
  • 5. Identifying Infeasible Paths 1: public static X doX(SomeType[] array){ 2: if (array != null || array.length > 0) {(a) } 5: // … (b) 6: }// (ex) ifnonnull array arraylength array ifgt (>0) (a) (b) (ex) (B) Corresponding CFG true true false false ifnonnull array arraylength array ifgt (>0) (a) (b) (ex) (C) Computed AIFG true true false false relevant missing edge a missing edge Java Bytecode Java Bytecode :- array is null :- array not null 1: public static X doX(SomeType[] array){ 2: if (array != null || array.length > 0) {(a) } 5: // … (b) 6: }// (ex) ifnonnull array arraylength array ifgt (>0) (a) (b) (ex) (B) Corresponding CFG true true false false ifnonnull array arraylength array ifgt (>0) (a) (b) (ex) (C) Computed AIFG true true false false relevant missing edge a missing edge Java Bytecode Java Bytecode :- array is null :- array not null CFG AIFG
  • 6. Abstract Interpretation Not targeted at a specific goal Not a whole program analysis, but instead everything may be an entry point Inter-procedural, path-, flow-, object- and context-sensitive
 with configurable call chain length (typically low)
  • 7. Abstract Interpretation Integers support all arithmetic operations (of the JVM) maximum size for intervals before we consider them as AnyInt float, long, double at type level reference values objects distinguished by their allocation site alias- and path-sensitive
  • 8. Post-Processing Compiler Generated Dead Code The Intricacies of Java Established Idioms Assertions Reflection and Reflection-like Mechanisms
  • 9. Post-Processing Compiler Generated Dead Code void  conditionInFinally(java.io.File  f)  {   boolean  completed  =  false;   try  {   f.canExecute();   completed  =  true;   }  finally  {     if  (completed)  doSomething();  }   } Finally blocks are included twice by Java compilers
  • 10. Post-Processing The Intricacies of Java Throwable  doFail()  {  throw  new  Exception();  }   Object  compute(Object  o)  {   if  (o  ==  null)  {  return  doFail();  }   else  return  o;   }
  • 11. Post-Processing Established Idioms switch  (i)  {   case  1:  break;   //  complete  enumerable  of  all  cases   default:  throw  new  UnknownError();   }
  • 13. Study: JDK 8 Update 25 Category Percentage Null Confusion 54 % Range Double Checks 11 % Dead Extensibility 9 % Unsupported Operation Usage 7 % Unexpected Return Value 5 % Forgotten Constant 4 % Confused Language Semantics 3 % Type Confusion 3 % Confused Conjunctions 2 % Obviously Useless Code 1 % False Positives 1 % • Found 556 issues • For 19 we found no source code • 279 of 537 were considered irrelevant • The remaining 258 issues were manually inspected
  • 14. Null Confusion Infeasible path because of too much checks for null Infeasible path because of too less checks for null if  (o  ==  null)  return  doSomething();   if  (o  ==  null)  return  doSomeOtherThing(); int  num  =  array.length;   if  (array  ==  null)     throw  InvalidArgumentException();
  • 15. Range Double Checks if  (extendableSpaces  <=  0)  return;   int  adjustment  =  (target  -­‐  currentSpan);   int  spaceAddon  =  (extendableSpaces  >  0)  ?   adjustment  /  extendableSpaces  :  0; OpenJDK 8 update 25, javax.swing.text.ParagraphView$Row.layoutMajorAxis, line 1095ff
  • 16. Dead Extensibility //  For  now  we  set  owner  to  null.  In  the   future,  it  may  be  
 //  passed  as  an  argument.  
 Window  owner  =  null;  
 if  (owner  instanceof  Frame)  {  ...  } OpenJDK 8 update 25, javax.print.ServiceUI.printDialog, line 189ff
  • 17. Summary General analysis approach to find various different and complex issues Dead Path detection using Abstract Interpretation We evaluated on the JDK (and on the Qualitas Corpus) We filter out irrelevant issues
  • 18. Thanks and please try it out http://www.opal-­‐project.de/tools/bugpicker/ And also see my other talk on a Capability Model for Java on Friday’s 11:30 session R8.c in the same room