SlideShare une entreprise Scribd logo
1  sur  50
Télécharger pour lire hors ligne
Judge: Identifying,
Understanding, and Evaluating
Sources of Unsoundness in Call
Graphs
Michael Reif, Florian Kübler, Michael Eichberg, Dominik Helm, and Mira Mezini

Software Technology Group

TU Darmstadt
@Reifmi
Why We Shouldn’t Take 

Call Graphs for Granted
• Call graphs are a central data-structure for numerous static
analyses

• Call graphs directly impact a client analysis’ result

• The chosen algorithm predetermines an analysis’ precision
and recall

• Programming languages evolve (APIs and features are
added) and frameworks might not
!2
State-of-the-art Call-graph
Generators for Java
• Many different static analysis frameworks are available

• All can compute a different set of call graphs

• All frameworks use different approaches and make unknown
trade-offs or implementation choices

• Are they actually comparable??
!3
OPAL
Judge’s Overview
TC1.jarTC2.jar⟨Test Case⟩
.jar
⟨Advanced
Test Case⟩
.jar
compile test cases
AllTestCases
<Test Fixtures
Category>.md
Test Case 1(TC1)
…
Test Case 3 (TCN)
⟨Test Fixtures⟩.md
Test Case 1
…
Test Case 3
Judge’s Overview
TC1.jarTC2.jar⟨Test Case⟩
.jar
⟨Advanced
Test Case⟩
.jar
compile test cases
AllTestCases
<Test Fixtures
Category>.md
Test Case 1(TC1)
…
Test Case 3 (TCN)
⟨Test Fixtures⟩.md
Test Case 1
…
Test Case 3
⟨CG⟩
.json
compute CG
Done for each CG per supported
static analysis framework.
⟨CG Algorithm Profile⟩
.tsvcompute profile using CG and expected call targets
Judge’s Overview
TC1.jarTC2.jar⟨Test Case⟩
.jar
⟨Advanced
Test Case⟩
.jar
compile test cases
AllTestCases
<Test Fixtures
Category>.md
Test Case 1(TC1)
…
Test Case 3 (TCN)
⟨Test Fixtures⟩.md
Test Case 1
…
Test Case 3
⟨CG⟩
.json
compute CG
Done for each CG per supported
static analysis framework.
⟨CG Algorithm Profile⟩
.tsvcompute profile using CG and expected call targets
⟨Project⟩
.jar
⟨Features &
Locations⟩
.json
⟨CG⟩
.json
compute CG
run Hermes
Infrastructure used for computing the prevalence of features in
real projects.
Judge’s Overview
TC1.jarTC2.jar⟨Test Case⟩
.jar
⟨Advanced
Test Case⟩
.jar
compile test cases
AllTestCases
<Test Fixtures
Category>.md
Test Case 1(TC1)
…
Test Case 3 (TCN)
⟨Test Fixtures⟩.md
Test Case 1
…
Test Case 3
⟨CG⟩
.json
compute CG
Done for each CG per supported
static analysis framework.
⟨CG Algorithm Profile⟩
.tsvcompute profile using CG and expected call targets
⟨Project⟩
.jar
⟨Features &
Locations⟩
.json
⟨CG⟩
.json
compute CG
run Hermes
Infrastructure used for computing the prevalence of features in
real projects.
⟨Potential
Sources of
Unsoundness⟩
.tsv
compute suitability of CG algo.
use the
respective
CG profile
Test Suite
TC1.jarTC2.jar⟨Test Case⟩
.jar
⟨Advanced
Test Case⟩
.jar
compile test cases
AllTestCases
<Test Fixtures
Category>.md
Test Case 1(TC1)
…
Test Case 3 (TCN)
⟨Test Fixtures⟩.md
Test Case 1
…
Test Case 3
⟨CG⟩
.json
compute CG
Done for each CG per supported
static analysis framework.
⟨CG Algorithm Profile⟩
.tsvcompute profile using CG and expected call targets
⟨Project⟩
.jar
⟨Features &
Locations⟩
.json
⟨CG⟩
.json
compute CG
run Hermes
Infrastructure used for computing the prevalence of features in
real projects.
⟨Potential
Sources of
Unsoundness⟩
.tsv
compute suitability of CG algo.
use the
respective
CG profile
Test Suite
TC1.jarTC2.jar⟨Test Case⟩
.jar
⟨Advanced
Test Case⟩
.jar
compile test cases
AllTestCases
<Test Fixtures
Category>.md
Test Case 1(TC1)
…
Test Case 3 (TCN)
⟨Test Fixtures⟩.md
Test Case 1
…
Test Case 3
⟨CG⟩
.json
compute CG
Done for each CG per supported
static analysis framework.
⟨CG Algorithm Profile⟩
.tsvcompute profile using CG and expected call targets
⟨Project⟩
.jar
⟨Features &
Locations⟩
.json
⟨CG⟩
.json
compute CG
run Hermes
Infrastructure used for computing the prevalence of features in
real projects.
⟨Potential
Sources of
Unsoundness⟩
.tsv
compute suitability of CG algo.
use the
respective
CG profile
• Each category has:

• a description

• multiple test cases

• Each test case has:

• a scenario description

• unique id

• the test code

• excepted calls

• Available annotations:

• CallSite

• IndirectCall
Test Suite
Language Features

• Static Initializer

• Polymorphic Calls

• Java 8 Polymorphic Calls

• Lambdas/Method References

• Signature Polymorphic Methods

• Non-Java bytecode

• …
!6
APIs

• Reflection

• Unsafe

• Serialization

• Method Handles

• Dynamic Proxies

• Classloading

• …
Computing the Algorithms’
Profile
!7
TC1.jarTC2.jar⟨Test Case⟩
.jar
⟨Advanced
Test Case⟩
.jar
compile test cases
AllTestCases
<Test Fixtures
Category>.md
Test Case 1(TC1)
…
Test Case 3 (TCN)
⟨Test Fixtures⟩.md
Test Case 1
…
Test Case 3
⟨CG⟩
.json
compute CG
Done for each CG per supported
static analysis framework.
⟨CG Algorithm Profile⟩
.tsvcompute profile using CG and expected call targets
⟨Project⟩
.jar
⟨Features &
Locations⟩
.json
⟨CG⟩
.json
compute CG
run Hermes
Infrastructure used for computing the prevalence of features in
real projects.
⟨Potential
Sources of
Unsoundness⟩
.tsv
compute suitability of CG algo.
use the
respective
CG profile
TC1.jarTC2.jar⟨Test Case⟩
.jar
⟨Advanced
Test Case⟩
.jar
compile test cases
AllTestCases
<Test Fixtures
Category>.md
Test Case 1(TC1)
…
Test Case 3 (TCN)
⟨Test Fixtures⟩.md
Test Case 1
…
Test Case 3
⟨CG⟩
.json
compute CG
Done for each CG per supported
static analysis framework.
⟨CG Algorithm Profile⟩
.tsvcompute profile using CG and expected call targets
⟨Project⟩
.jar
⟨Features &
Locations⟩
.json
⟨CG⟩
.json
compute CG
run Hermes
Infrastructure used for computing the prevalence of features in
real projects.
⟨Potential
Sources of
Unsoundness⟩
.tsv
compute suitability of CG algo.
use the
respective
CG profile
Finding Features in
Real Code
!8
TC1.jarTC2.jar⟨Test Case⟩
.jar
⟨Advanced
Test Case⟩
.jar
compile test cases
AllTestCases
<Test Fixtures
Category>.md
Test Case 1(TC1)
…
Test Case 3 (TCN)
⟨Test Fixtures⟩.md
Test Case 1
…
Test Case 3
⟨CG⟩
.json
compute CG
Done for each CG per supported
static analysis framework.
⟨CG Algorithm Profile⟩
.tsvcompute profile using CG and expected call targets
⟨Project⟩
.jar
⟨Features &
Locations⟩
.json
⟨CG⟩
.json
compute CG
run Hermes
Infrastructure used for computing the prevalence of features in
real projects.
⟨Potential
Sources of
Unsoundness⟩
.tsv
compute suitability of CG algo.
use the
respective
CG profile
Finding Features in
Real Code
!8
[1] Reif, Michael et al. Hermes: assessment and creation of effective test corpora. SOAP ’17. ACM, 43–48.
• We used Hermes [1], a static analysis code query
infrastructure

• Each query is an analysis that checks if a specific feature
is found in a given code base

• We developed 15 Hermes queries to derive 107 Hermes
features and map the derived features to the test case ids

• All queries perform a most-conservative intra-procedural
analysis
Potential Sources of
Unsoundness
!9
0✘
Lambda8
(Invokedynamic -
Scala)
Lambda3
(Invokedynamic -
Java ≤ 10)
1✓
… ……
TR1
(Reflection)
2✘
Extensions
Count
3
Supported
by CG(a)
✓
BPC2
(Polymorphic Call)
Features
(Based on
Test Cases)
✘mz
my ✓
mx ✘
✓mu
……
m4 ✓
m3 ✓
m2 ✘
Reached
by CG(a)
✓m1
Name
Methods
Computed Using Feature Queries / Hermes
LibraryCodeApplicationCode
Sourceof
Unsoundness
For Project (p)
ConditionalSource
ofUnsoundness
Extensions
Mapping
TC1.jarTC2.jar⟨Test Case⟩
.jar
⟨Advanced
Test Case⟩
.jar
compile test cases
AllTestCases
<Test Fixtures
Category>.md
Test Case 1(TC1)
…
Test Case 3 (TCN)
⟨Test Fixtures⟩.md
Test Case 1
…
Test Case 3
⟨CG⟩
.json
compute CG
Done for each CG per supported
static analysis framework.
⟨CG Algorithm Profile⟩
.tsvcompute profile using CG and expected call targets
⟨Project⟩
.jar
⟨Features &
Locations⟩
.json
⟨CG⟩
.json
compute CG
run Hermes
Infrastructure used for computing the prevalence of features in
real projects.
⟨Potential
Sources of
Unsoundness⟩
.tsv
compute suitability of CG algo.
use the
respective
CG profile
• Sources of Unsoundness
definitely make the call graph
unsound

• Conditional sources of
Unsoundness might introduce
unsoundness
Research Questions
• RQ1: How prevalent are the language and API features?

• RQ2: How do the frameworks compare to each other?

• RQ3: Which framework is best suited for which kind of
code base?

• RQ4: How much effort is necessary to get a sound call
graph?
!10
Prevalent Language
Features and APIs (RQ1)
• All the API and language features supported by
Java up to version 7 are used widely across all
code bases 

• Support for Java 8 is a must, unless analyzing
Android or Clojure code

• Supporting classical Reflection and Serialization
is strongly recommended, independent of the
source code’s age

• Support for many features is only required in
specific scenarios
!11
The Call Graphs’ Feature Support (RQ2)
!12
The Call Graphs’ Feature Support (RQ2)
!12
The Call Graphs’ Feature Support (RQ2)
!12
Standard Java
Features are well-
supported
The Call Graphs’ Feature Support (RQ2)
!12
Standard Java
Features are well-
supported
The Call Graphs’ Feature Support (RQ2)
!12
Java 8 Features
are partially
supported
Standard Java
Features are well-
supported
The Call Graphs’ Feature Support (RQ2)
!12
Java 8 Features
are partially
supported
Standard Java
Features are well-
supported
The Call Graphs’ Feature Support (RQ2)
!12
Java 8 Features
are partially
supported
The JVM is not
fully covered
Standard Java
Features are well-
supported
The Call Graphs’ Feature Support (RQ2)
!12
Java 8 Features
are partially
supported
The JVM is not
fully covered
Standard Java
Features are well-
supported
The Call Graphs’ Feature Support (RQ2)
!12
Java 8 Features
are partially
supported
The JVM is not
fully covered
Standard Java
Features are well-
supported
Reflection API
partially
supported
The Call Graphs’ Feature Support (RQ2)
!12
Java 8 Features
are partially
supported
The JVM is not
fully covered
Standard Java
Features are well-
supported
Reflection API
partially
supported
The Call Graphs’ Feature Support (RQ2)
!12
Java 8 Features
are partially
supported
The JVM is not
fully covered
Some APIs and
language features
are unsupported
Standard Java
Features are well-
supported
Reflection API
partially
supported
Performance Results (RQ2)
!13
Performance Results (RQ2)
!13
Performance Results (RQ2)
!13
avg. Runtimes
largely differ
Performance Results (RQ2)
!13
avg. Runtimes
largely differ
Performance Results (RQ2)
!13
avg. Runtimes
largely differ
Reachable Methods vary even for
implementations of the same algorithm
by more than 20x
RTA-Example
!14
void program(boolean condition){
Collection c1 = new LinkedList();
Collection c2;
if(condition){
c2 = new ArrayList();
} else {
c2 = new Vector();
}
c2.add(null);
Collection c3 = new HashSet();
}
• RTA [2] depends on the program’s instantiated
types

• Soot, WALA, and OPAL behave complete
differently
[2] D. Bacon and P. Sweeney. Fast static analysis of C++ virtual function calls. OOPSLA '96. ACM, 324-341.
RTA-Example
!14
void program(boolean condition){
Collection c1 = new LinkedList();
Collection c2;
if(condition){
c2 = new ArrayList();
} else {
c2 = new Vector();
}
c2.add(null);
Collection c3 = new HashSet();
}
• RTA [2] depends on the program’s instantiated
types

• Soot, WALA, and OPAL behave complete
differently
[2] D. Bacon and P. Sweeney. Fast static analysis of C++ virtual function calls. OOPSLA '96. ACM, 324-341.
RTA-Example
!14
void program(boolean condition){
Collection c1 = new LinkedList();
Collection c2;
if(condition){
c2 = new ArrayList();
} else {
c2 = new Vector();
}
c2.add(null);
Collection c3 = new HashSet();
}
• RTA [2] depends on the program’s instantiated
types

• Soot, WALA, and OPAL behave complete
differently
[2] D. Bacon and P. Sweeney. Fast static analysis of C++ virtual function calls. OOPSLA '96. ACM, 324-341.
{ LinkedList, ArrayList, Vector, HashSet }
RTA-Example
!14
void program(boolean condition){
Collection c1 = new LinkedList();
Collection c2;
if(condition){
c2 = new ArrayList();
} else {
c2 = new Vector();
}
c2.add(null);
Collection c3 = new HashSet();
}
• RTA [2] depends on the program’s instantiated
types

• Soot, WALA, and OPAL behave complete
differently
[2] D. Bacon and P. Sweeney. Fast static analysis of C++ virtual function calls. OOPSLA '96. ACM, 324-341.
{ LinkedList, ArrayList, Vector, HashSet }
RTA-Example
!14
void program(boolean condition){
Collection c1 = new LinkedList();
Collection c2;
if(condition){
c2 = new ArrayList();
} else {
c2 = new Vector();
}
c2.add(null);
Collection c3 = new HashSet();
}
• RTA [2] depends on the program’s instantiated
types

• Soot, WALA, and OPAL behave complete
differently
[2] D. Bacon and P. Sweeney. Fast static analysis of C++ virtual function calls. OOPSLA '96. ACM, 324-341.
{ LinkedList, ArrayList, Vector, HashSet }
{ LinkedList, ArrayList, Vector}
RTA-Example
!14
void program(boolean condition){
Collection c1 = new LinkedList();
Collection c2;
if(condition){
c2 = new ArrayList();
} else {
c2 = new Vector();
}
c2.add(null);
Collection c3 = new HashSet();
}
• RTA [2] depends on the program’s instantiated
types

• Soot, WALA, and OPAL behave complete
differently
[2] D. Bacon and P. Sweeney. Fast static analysis of C++ virtual function calls. OOPSLA '96. ACM, 324-341.
{ LinkedList, ArrayList, Vector, HashSet }
{ArrayList, Vector}{ LinkedList, ArrayList, Vector}
Project-specific Evaluation
(RQ3)
!15
Project-specific Evaluation
(RQ3)
!15
Project-specific Evaluation
(RQ3)
!15
Soot supports CSR
but its expensive
Project-specific Evaluation
(RQ3)
!15
Soot supports CSR
but its expensive
Project-specific Evaluation
(RQ3)
!15
Soot supports CSR
but its expensive
OPAL supports most
features but has the
smallest call graph
Project-specific Evaluation
(RQ3)
!15
Soot supports CSR
but its expensive
OPAL supports most
features but has the
smallest call graph
OPAL covers only 47
methods from Xalan
(~0.3%)
Project-specific Evaluation
(RQ3)
!15
Soot supports CSR
but its expensive
OPAL supports most
features but has the
smallest call graph
OPAL covers only 47
methods from Xalan
(~0.3%)
Very few call sites
have a huge impact
Is it worth it to do the work
manually? (RQ 4)
• GOAL: Get a reasonably sound call graph

• JVM profiling and TamiFlex [3] as ground truth
!16
[3] Bodden, Eric, et al. Taming Reflection--Static Analysis in the Presence of Reflection and Custom Class Loaders. (2010).
Apply Judge
Inspect Results
Add Entry Points
• Analyzed 10 reflective call sites

• Added 50 entry points

• manual analysis took roughly 90 minutes

• The call graph then covered 91% of all
methods contained in the profile and 121 from
198 reported by TamiFlex
!17
!17
!17
!17

Contenu connexe

Tendances

A Survey on Automatic Software Evolution Techniques
A Survey on Automatic Software Evolution TechniquesA Survey on Automatic Software Evolution Techniques
A Survey on Automatic Software Evolution Techniques
Sung Kim
 
A Survey on Dynamic Symbolic Execution for Automatic Test Generation
A Survey on  Dynamic Symbolic Execution  for Automatic Test GenerationA Survey on  Dynamic Symbolic Execution  for Automatic Test Generation
A Survey on Dynamic Symbolic Execution for Automatic Test Generation
Sung Kim
 
How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...
How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...
How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...
Sung Kim
 

Tendances (20)

ProbeDroid - Crafting Your Own Dynamic Instrument Tool on Android for App Beh...
ProbeDroid - Crafting Your Own Dynamic Instrument Tool on Android for App Beh...ProbeDroid - Crafting Your Own Dynamic Instrument Tool on Android for App Beh...
ProbeDroid - Crafting Your Own Dynamic Instrument Tool on Android for App Beh...
 
A Survey on Automatic Software Evolution Techniques
A Survey on Automatic Software Evolution TechniquesA Survey on Automatic Software Evolution Techniques
A Survey on Automatic Software Evolution Techniques
 
Parasoft fda software compliance part2
Parasoft fda software compliance   part2Parasoft fda software compliance   part2
Parasoft fda software compliance part2
 
CrashLocator: Locating Crashing Faults Based on Crash Stacks (ISSTA 2014)
CrashLocator: Locating Crashing Faults Based on Crash Stacks (ISSTA 2014)CrashLocator: Locating Crashing Faults Based on Crash Stacks (ISSTA 2014)
CrashLocator: Locating Crashing Faults Based on Crash Stacks (ISSTA 2014)
 
A Survey on Dynamic Symbolic Execution for Automatic Test Generation
A Survey on  Dynamic Symbolic Execution  for Automatic Test GenerationA Survey on  Dynamic Symbolic Execution  for Automatic Test Generation
A Survey on Dynamic Symbolic Execution for Automatic Test Generation
 
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
 
JVM++: The Graal VM
JVM++: The Graal VMJVM++: The Graal VM
JVM++: The Graal VM
 
Improving Automated Tests with Fluent Assertions
Improving Automated Tests with Fluent Assertions Improving Automated Tests with Fluent Assertions
Improving Automated Tests with Fluent Assertions
 
Hi-Lite erts2012
Hi-Lite erts2012Hi-Lite erts2012
Hi-Lite erts2012
 
Qtp (basics to advanced)
Qtp (basics to advanced)Qtp (basics to advanced)
Qtp (basics to advanced)
 
Implementation of TypeGraphQL with Apollo Server
Implementation of TypeGraphQL with Apollo ServerImplementation of TypeGraphQL with Apollo Server
Implementation of TypeGraphQL with Apollo Server
 
Automated Program Repair Keynote talk
Automated Program Repair Keynote talkAutomated Program Repair Keynote talk
Automated Program Repair Keynote talk
 
How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...
How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...
How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...
 
Toward dynamic analysis of obfuscated android malware
Toward dynamic analysis of obfuscated android malwareToward dynamic analysis of obfuscated android malware
Toward dynamic analysis of obfuscated android malware
 
Harton-Presentation
Harton-PresentationHarton-Presentation
Harton-Presentation
 
Agile analysis development
Agile analysis developmentAgile analysis development
Agile analysis development
 
Mobilesoft 2017 Keynote
Mobilesoft 2017 KeynoteMobilesoft 2017 Keynote
Mobilesoft 2017 Keynote
 
Property-based testing an open-source compiler, pflua (FOSDEM 2015)
Property-based testing an open-source compiler, pflua (FOSDEM 2015)Property-based testing an open-source compiler, pflua (FOSDEM 2015)
Property-based testing an open-source compiler, pflua (FOSDEM 2015)
 
Cppcheck and PVS-Studio compared
Cppcheck and PVS-Studio comparedCppcheck and PVS-Studio compared
Cppcheck and PVS-Studio compared
 
Clean Code V2
Clean Code V2Clean Code V2
Clean Code V2
 

Similaire à Judge: Identifying, Understanding, and Evaluating Sources of Unsoundness in Call Graphs

CodeChecker Overview Nov 2019
CodeChecker Overview Nov 2019CodeChecker Overview Nov 2019
CodeChecker Overview Nov 2019
Olivera Milenkovic
 
Code Analysis-run time error prediction
Code Analysis-run time error predictionCode Analysis-run time error prediction
Code Analysis-run time error prediction
NIKHIL NAWATHE
 
Qtp interview questions
Qtp interview questionsQtp interview questions
Qtp interview questions
Ramu Palanki
 
Qtp interview questions
Qtp interview questionsQtp interview questions
Qtp interview questions
Ramu Palanki
 
Reducing Redundancies in Multi-Revision Code Analysis
Reducing Redundancies in Multi-Revision Code AnalysisReducing Redundancies in Multi-Revision Code Analysis
Reducing Redundancies in Multi-Revision Code Analysis
Sebastiano Panichella
 
Tech talk specflow_bddx_hassa_nagy
Tech talk specflow_bddx_hassa_nagyTech talk specflow_bddx_hassa_nagy
Tech talk specflow_bddx_hassa_nagy
Skills Matter
 

Similaire à Judge: Identifying, Understanding, and Evaluating Sources of Unsoundness in Call Graphs (20)

Code Review with Sonar
Code Review with SonarCode Review with Sonar
Code Review with Sonar
 
News In The Net40
News In The Net40News In The Net40
News In The Net40
 
CodeChecker Overview Nov 2019
CodeChecker Overview Nov 2019CodeChecker Overview Nov 2019
CodeChecker Overview Nov 2019
 
Code Analysis-run time error prediction
Code Analysis-run time error predictionCode Analysis-run time error prediction
Code Analysis-run time error prediction
 
Optimising code using Span<T>
Optimising code using Span<T>Optimising code using Span<T>
Optimising code using Span<T>
 
Sista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performanceSista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performance
 
Værktøjer udviklet på AAU til analyse af SCJ programmer
Værktøjer udviklet på AAU til analyse af SCJ programmerVærktøjer udviklet på AAU til analyse af SCJ programmer
Værktøjer udviklet på AAU til analyse af SCJ programmer
 
Qtp interview questions
Qtp interview questionsQtp interview questions
Qtp interview questions
 
Qtp interview questions
Qtp interview questionsQtp interview questions
Qtp interview questions
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
The Pill for Your Migration Hell
The Pill for Your Migration HellThe Pill for Your Migration Hell
The Pill for Your Migration Hell
 
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Update
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech UpdateAdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Update
AdaCore Paris Tech Day 2016: Jose Ruiz - QGen Tech Update
 
Boost your App with Gatling
Boost your App with GatlingBoost your App with Gatling
Boost your App with Gatling
 
Real-time Programming in Java
Real-time Programming in JavaReal-time Programming in Java
Real-time Programming in Java
 
Reducing Redundancies in Multi-Revision Code Analysis
Reducing Redundancies in Multi-Revision Code AnalysisReducing Redundancies in Multi-Revision Code Analysis
Reducing Redundancies in Multi-Revision Code Analysis
 
Search-Based Robustness Testing of Data Processing Systems
Search-Based Robustness Testing of Data Processing SystemsSearch-Based Robustness Testing of Data Processing Systems
Search-Based Robustness Testing of Data Processing Systems
 
Systematic Evaluation of the Unsoundness of Call Graph Algorithms for Java
Systematic Evaluation of the Unsoundness of Call Graph Algorithms for JavaSystematic Evaluation of the Unsoundness of Call Graph Algorithms for Java
Systematic Evaluation of the Unsoundness of Call Graph Algorithms for Java
 
Tech talk specflow_bddx_hassa_nagy
Tech talk specflow_bddx_hassa_nagyTech talk specflow_bddx_hassa_nagy
Tech talk specflow_bddx_hassa_nagy
 
Unit testing of spark applications
Unit testing of spark applicationsUnit testing of spark applications
Unit testing of spark applications
 
Ensuring Performance in a Fast-Paced Environment (CMG 2014)
Ensuring Performance in a Fast-Paced Environment (CMG 2014)Ensuring Performance in a Fast-Paced Environment (CMG 2014)
Ensuring Performance in a Fast-Paced Environment (CMG 2014)
 

Dernier

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
ssuserdda66b
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Dernier (20)

Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 

Judge: Identifying, Understanding, and Evaluating Sources of Unsoundness in Call Graphs

  • 1. Judge: Identifying, Understanding, and Evaluating Sources of Unsoundness in Call Graphs Michael Reif, Florian Kübler, Michael Eichberg, Dominik Helm, and Mira Mezini Software Technology Group TU Darmstadt @Reifmi
  • 2. Why We Shouldn’t Take 
 Call Graphs for Granted • Call graphs are a central data-structure for numerous static analyses • Call graphs directly impact a client analysis’ result • The chosen algorithm predetermines an analysis’ precision and recall • Programming languages evolve (APIs and features are added) and frameworks might not !2
  • 3. State-of-the-art Call-graph Generators for Java • Many different static analysis frameworks are available • All can compute a different set of call graphs • All frameworks use different approaches and make unknown trade-offs or implementation choices • Are they actually comparable?? !3 OPAL
  • 4. Judge’s Overview TC1.jarTC2.jar⟨Test Case⟩ .jar ⟨Advanced Test Case⟩ .jar compile test cases AllTestCases <Test Fixtures Category>.md Test Case 1(TC1) … Test Case 3 (TCN) ⟨Test Fixtures⟩.md Test Case 1 … Test Case 3
  • 5. Judge’s Overview TC1.jarTC2.jar⟨Test Case⟩ .jar ⟨Advanced Test Case⟩ .jar compile test cases AllTestCases <Test Fixtures Category>.md Test Case 1(TC1) … Test Case 3 (TCN) ⟨Test Fixtures⟩.md Test Case 1 … Test Case 3 ⟨CG⟩ .json compute CG Done for each CG per supported static analysis framework. ⟨CG Algorithm Profile⟩ .tsvcompute profile using CG and expected call targets
  • 6. Judge’s Overview TC1.jarTC2.jar⟨Test Case⟩ .jar ⟨Advanced Test Case⟩ .jar compile test cases AllTestCases <Test Fixtures Category>.md Test Case 1(TC1) … Test Case 3 (TCN) ⟨Test Fixtures⟩.md Test Case 1 … Test Case 3 ⟨CG⟩ .json compute CG Done for each CG per supported static analysis framework. ⟨CG Algorithm Profile⟩ .tsvcompute profile using CG and expected call targets ⟨Project⟩ .jar ⟨Features & Locations⟩ .json ⟨CG⟩ .json compute CG run Hermes Infrastructure used for computing the prevalence of features in real projects.
  • 7. Judge’s Overview TC1.jarTC2.jar⟨Test Case⟩ .jar ⟨Advanced Test Case⟩ .jar compile test cases AllTestCases <Test Fixtures Category>.md Test Case 1(TC1) … Test Case 3 (TCN) ⟨Test Fixtures⟩.md Test Case 1 … Test Case 3 ⟨CG⟩ .json compute CG Done for each CG per supported static analysis framework. ⟨CG Algorithm Profile⟩ .tsvcompute profile using CG and expected call targets ⟨Project⟩ .jar ⟨Features & Locations⟩ .json ⟨CG⟩ .json compute CG run Hermes Infrastructure used for computing the prevalence of features in real projects. ⟨Potential Sources of Unsoundness⟩ .tsv compute suitability of CG algo. use the respective CG profile
  • 8. Test Suite TC1.jarTC2.jar⟨Test Case⟩ .jar ⟨Advanced Test Case⟩ .jar compile test cases AllTestCases <Test Fixtures Category>.md Test Case 1(TC1) … Test Case 3 (TCN) ⟨Test Fixtures⟩.md Test Case 1 … Test Case 3 ⟨CG⟩ .json compute CG Done for each CG per supported static analysis framework. ⟨CG Algorithm Profile⟩ .tsvcompute profile using CG and expected call targets ⟨Project⟩ .jar ⟨Features & Locations⟩ .json ⟨CG⟩ .json compute CG run Hermes Infrastructure used for computing the prevalence of features in real projects. ⟨Potential Sources of Unsoundness⟩ .tsv compute suitability of CG algo. use the respective CG profile
  • 9. Test Suite TC1.jarTC2.jar⟨Test Case⟩ .jar ⟨Advanced Test Case⟩ .jar compile test cases AllTestCases <Test Fixtures Category>.md Test Case 1(TC1) … Test Case 3 (TCN) ⟨Test Fixtures⟩.md Test Case 1 … Test Case 3 ⟨CG⟩ .json compute CG Done for each CG per supported static analysis framework. ⟨CG Algorithm Profile⟩ .tsvcompute profile using CG and expected call targets ⟨Project⟩ .jar ⟨Features & Locations⟩ .json ⟨CG⟩ .json compute CG run Hermes Infrastructure used for computing the prevalence of features in real projects. ⟨Potential Sources of Unsoundness⟩ .tsv compute suitability of CG algo. use the respective CG profile • Each category has: • a description • multiple test cases • Each test case has: • a scenario description • unique id • the test code • excepted calls • Available annotations: • CallSite • IndirectCall
  • 10. Test Suite Language Features • Static Initializer • Polymorphic Calls • Java 8 Polymorphic Calls • Lambdas/Method References • Signature Polymorphic Methods • Non-Java bytecode • … !6 APIs • Reflection • Unsafe • Serialization • Method Handles • Dynamic Proxies • Classloading • …
  • 11. Computing the Algorithms’ Profile !7 TC1.jarTC2.jar⟨Test Case⟩ .jar ⟨Advanced Test Case⟩ .jar compile test cases AllTestCases <Test Fixtures Category>.md Test Case 1(TC1) … Test Case 3 (TCN) ⟨Test Fixtures⟩.md Test Case 1 … Test Case 3 ⟨CG⟩ .json compute CG Done for each CG per supported static analysis framework. ⟨CG Algorithm Profile⟩ .tsvcompute profile using CG and expected call targets ⟨Project⟩ .jar ⟨Features & Locations⟩ .json ⟨CG⟩ .json compute CG run Hermes Infrastructure used for computing the prevalence of features in real projects. ⟨Potential Sources of Unsoundness⟩ .tsv compute suitability of CG algo. use the respective CG profile
  • 12. TC1.jarTC2.jar⟨Test Case⟩ .jar ⟨Advanced Test Case⟩ .jar compile test cases AllTestCases <Test Fixtures Category>.md Test Case 1(TC1) … Test Case 3 (TCN) ⟨Test Fixtures⟩.md Test Case 1 … Test Case 3 ⟨CG⟩ .json compute CG Done for each CG per supported static analysis framework. ⟨CG Algorithm Profile⟩ .tsvcompute profile using CG and expected call targets ⟨Project⟩ .jar ⟨Features & Locations⟩ .json ⟨CG⟩ .json compute CG run Hermes Infrastructure used for computing the prevalence of features in real projects. ⟨Potential Sources of Unsoundness⟩ .tsv compute suitability of CG algo. use the respective CG profile Finding Features in Real Code !8
  • 13. TC1.jarTC2.jar⟨Test Case⟩ .jar ⟨Advanced Test Case⟩ .jar compile test cases AllTestCases <Test Fixtures Category>.md Test Case 1(TC1) … Test Case 3 (TCN) ⟨Test Fixtures⟩.md Test Case 1 … Test Case 3 ⟨CG⟩ .json compute CG Done for each CG per supported static analysis framework. ⟨CG Algorithm Profile⟩ .tsvcompute profile using CG and expected call targets ⟨Project⟩ .jar ⟨Features & Locations⟩ .json ⟨CG⟩ .json compute CG run Hermes Infrastructure used for computing the prevalence of features in real projects. ⟨Potential Sources of Unsoundness⟩ .tsv compute suitability of CG algo. use the respective CG profile Finding Features in Real Code !8 [1] Reif, Michael et al. Hermes: assessment and creation of effective test corpora. SOAP ’17. ACM, 43–48. • We used Hermes [1], a static analysis code query infrastructure • Each query is an analysis that checks if a specific feature is found in a given code base • We developed 15 Hermes queries to derive 107 Hermes features and map the derived features to the test case ids • All queries perform a most-conservative intra-procedural analysis
  • 14. Potential Sources of Unsoundness !9 0✘ Lambda8 (Invokedynamic - Scala) Lambda3 (Invokedynamic - Java ≤ 10) 1✓ … …… TR1 (Reflection) 2✘ Extensions Count 3 Supported by CG(a) ✓ BPC2 (Polymorphic Call) Features (Based on Test Cases) ✘mz my ✓ mx ✘ ✓mu …… m4 ✓ m3 ✓ m2 ✘ Reached by CG(a) ✓m1 Name Methods Computed Using Feature Queries / Hermes LibraryCodeApplicationCode Sourceof Unsoundness For Project (p) ConditionalSource ofUnsoundness Extensions Mapping TC1.jarTC2.jar⟨Test Case⟩ .jar ⟨Advanced Test Case⟩ .jar compile test cases AllTestCases <Test Fixtures Category>.md Test Case 1(TC1) … Test Case 3 (TCN) ⟨Test Fixtures⟩.md Test Case 1 … Test Case 3 ⟨CG⟩ .json compute CG Done for each CG per supported static analysis framework. ⟨CG Algorithm Profile⟩ .tsvcompute profile using CG and expected call targets ⟨Project⟩ .jar ⟨Features & Locations⟩ .json ⟨CG⟩ .json compute CG run Hermes Infrastructure used for computing the prevalence of features in real projects. ⟨Potential Sources of Unsoundness⟩ .tsv compute suitability of CG algo. use the respective CG profile • Sources of Unsoundness definitely make the call graph unsound • Conditional sources of Unsoundness might introduce unsoundness
  • 15. Research Questions • RQ1: How prevalent are the language and API features? • RQ2: How do the frameworks compare to each other? • RQ3: Which framework is best suited for which kind of code base? • RQ4: How much effort is necessary to get a sound call graph? !10
  • 16. Prevalent Language Features and APIs (RQ1) • All the API and language features supported by Java up to version 7 are used widely across all code bases • Support for Java 8 is a must, unless analyzing Android or Clojure code • Supporting classical Reflection and Serialization is strongly recommended, independent of the source code’s age • Support for many features is only required in specific scenarios !11
  • 17. The Call Graphs’ Feature Support (RQ2) !12
  • 18. The Call Graphs’ Feature Support (RQ2) !12
  • 19. The Call Graphs’ Feature Support (RQ2) !12 Standard Java Features are well- supported
  • 20. The Call Graphs’ Feature Support (RQ2) !12 Standard Java Features are well- supported
  • 21. The Call Graphs’ Feature Support (RQ2) !12 Java 8 Features are partially supported Standard Java Features are well- supported
  • 22. The Call Graphs’ Feature Support (RQ2) !12 Java 8 Features are partially supported Standard Java Features are well- supported
  • 23. The Call Graphs’ Feature Support (RQ2) !12 Java 8 Features are partially supported The JVM is not fully covered Standard Java Features are well- supported
  • 24. The Call Graphs’ Feature Support (RQ2) !12 Java 8 Features are partially supported The JVM is not fully covered Standard Java Features are well- supported
  • 25. The Call Graphs’ Feature Support (RQ2) !12 Java 8 Features are partially supported The JVM is not fully covered Standard Java Features are well- supported Reflection API partially supported
  • 26. The Call Graphs’ Feature Support (RQ2) !12 Java 8 Features are partially supported The JVM is not fully covered Standard Java Features are well- supported Reflection API partially supported
  • 27. The Call Graphs’ Feature Support (RQ2) !12 Java 8 Features are partially supported The JVM is not fully covered Some APIs and language features are unsupported Standard Java Features are well- supported Reflection API partially supported
  • 30. Performance Results (RQ2) !13 avg. Runtimes largely differ
  • 31. Performance Results (RQ2) !13 avg. Runtimes largely differ
  • 32. Performance Results (RQ2) !13 avg. Runtimes largely differ Reachable Methods vary even for implementations of the same algorithm by more than 20x
  • 33. RTA-Example !14 void program(boolean condition){ Collection c1 = new LinkedList(); Collection c2; if(condition){ c2 = new ArrayList(); } else { c2 = new Vector(); } c2.add(null); Collection c3 = new HashSet(); } • RTA [2] depends on the program’s instantiated types • Soot, WALA, and OPAL behave complete differently [2] D. Bacon and P. Sweeney. Fast static analysis of C++ virtual function calls. OOPSLA '96. ACM, 324-341.
  • 34. RTA-Example !14 void program(boolean condition){ Collection c1 = new LinkedList(); Collection c2; if(condition){ c2 = new ArrayList(); } else { c2 = new Vector(); } c2.add(null); Collection c3 = new HashSet(); } • RTA [2] depends on the program’s instantiated types • Soot, WALA, and OPAL behave complete differently [2] D. Bacon and P. Sweeney. Fast static analysis of C++ virtual function calls. OOPSLA '96. ACM, 324-341.
  • 35. RTA-Example !14 void program(boolean condition){ Collection c1 = new LinkedList(); Collection c2; if(condition){ c2 = new ArrayList(); } else { c2 = new Vector(); } c2.add(null); Collection c3 = new HashSet(); } • RTA [2] depends on the program’s instantiated types • Soot, WALA, and OPAL behave complete differently [2] D. Bacon and P. Sweeney. Fast static analysis of C++ virtual function calls. OOPSLA '96. ACM, 324-341. { LinkedList, ArrayList, Vector, HashSet }
  • 36. RTA-Example !14 void program(boolean condition){ Collection c1 = new LinkedList(); Collection c2; if(condition){ c2 = new ArrayList(); } else { c2 = new Vector(); } c2.add(null); Collection c3 = new HashSet(); } • RTA [2] depends on the program’s instantiated types • Soot, WALA, and OPAL behave complete differently [2] D. Bacon and P. Sweeney. Fast static analysis of C++ virtual function calls. OOPSLA '96. ACM, 324-341. { LinkedList, ArrayList, Vector, HashSet }
  • 37. RTA-Example !14 void program(boolean condition){ Collection c1 = new LinkedList(); Collection c2; if(condition){ c2 = new ArrayList(); } else { c2 = new Vector(); } c2.add(null); Collection c3 = new HashSet(); } • RTA [2] depends on the program’s instantiated types • Soot, WALA, and OPAL behave complete differently [2] D. Bacon and P. Sweeney. Fast static analysis of C++ virtual function calls. OOPSLA '96. ACM, 324-341. { LinkedList, ArrayList, Vector, HashSet } { LinkedList, ArrayList, Vector}
  • 38. RTA-Example !14 void program(boolean condition){ Collection c1 = new LinkedList(); Collection c2; if(condition){ c2 = new ArrayList(); } else { c2 = new Vector(); } c2.add(null); Collection c3 = new HashSet(); } • RTA [2] depends on the program’s instantiated types • Soot, WALA, and OPAL behave complete differently [2] D. Bacon and P. Sweeney. Fast static analysis of C++ virtual function calls. OOPSLA '96. ACM, 324-341. { LinkedList, ArrayList, Vector, HashSet } {ArrayList, Vector}{ LinkedList, ArrayList, Vector}
  • 43. Project-specific Evaluation (RQ3) !15 Soot supports CSR but its expensive OPAL supports most features but has the smallest call graph
  • 44. Project-specific Evaluation (RQ3) !15 Soot supports CSR but its expensive OPAL supports most features but has the smallest call graph OPAL covers only 47 methods from Xalan (~0.3%)
  • 45. Project-specific Evaluation (RQ3) !15 Soot supports CSR but its expensive OPAL supports most features but has the smallest call graph OPAL covers only 47 methods from Xalan (~0.3%) Very few call sites have a huge impact
  • 46. Is it worth it to do the work manually? (RQ 4) • GOAL: Get a reasonably sound call graph • JVM profiling and TamiFlex [3] as ground truth !16 [3] Bodden, Eric, et al. Taming Reflection--Static Analysis in the Presence of Reflection and Custom Class Loaders. (2010). Apply Judge Inspect Results Add Entry Points • Analyzed 10 reflective call sites • Added 50 entry points • manual analysis took roughly 90 minutes • The call graph then covered 91% of all methods contained in the profile and 121 from 198 reported by TamiFlex
  • 47. !17
  • 48. !17
  • 49. !17
  • 50. !17