SlideShare a Scribd company logo
Predicting Method Crashes
        with Bytecode Operations
        Sunghun Kim
        Hong Kong University of Science and Technology, China


        Thomas Zimmermann
        Microsoft Research, USA


        Rahul Premraj
        VU University Amsterdam, The Netherlands


        Nicolas Bettenburg
        Queen’s University, Canada


        Shivkumar Shivaji
        University of California, Santa Cruz, USA




© Microsoft Corporation
© Microsoft Corporation
capture and replay
+ prediction


© Microsoft Corporation
Capture and Replay




© Microsoft Corporation
ReCrash Technique
      Goal: Convert a crash into a set of unit tests

      1. Monitoring: maintain a shadow stack
         – Contains a copy of each method argument
         – On program crash, write the shadow stack to a file

      2. Test generation: create many unit tests
         For each stack frame, create one unit test:
           – Invoke the method using arguments from the shadow stack
           – If the test does not reproduce the crash, discard the test


Slide from: http://www.slideshare.net/hunkim/recrash-making-
crashes-reproducible-by-preserving-object-states
 © Microsoft Corporation
Cost of Monitoring
     Key cost of ReCrash:
     copying arguments to shadow stack

     Tradeoff: less information in shadow stack
     ⇒ lower chance of reproducing crashes

     Monitor fewer methods: Ignore methods not
     likely to crash


© Microsoft Corporation
ReCrash+ Technique
      Goal: Convert a crash into a set of unit tests

      1. Monitoring: maintain a shadow stack
         – Contains a copy of each method argument
           for methods predicted to crash
         – On program crash, write the shadow stack to a file

      2. Test generation: create many unit tests
         For each stack frame, create one unit test:
           – Invoke the method using arguments from the shadow stack
           – If the test does not reproduce the crash, discard the test

Slide adapted from: http://www.slideshare.net/hunkim/recrash-
making-crashes-reproducible-by-preserving-object-states
 © Microsoft Corporation
© Microsoft Corporation
crash
       defect prediction


© Microsoft Corporation
From Defect to Crash
     1. The programmer creates a
        defect – an error in the code.

     2. When executed the defect
        creates an infection – an
        error in the state.

     3. The infection propagates.


     4. The infection causes a crash.

Slide adapted from companion materials to Why Programs Fail, 2nd Edition.
A Guide to Systematic Debugging, by Andreas Zeller, Morgan Kauffman.

 © Microsoft Corporation
Approach




     Identify crashed methods        Gene

© Microsoft Corporation
Approach




                          Generate features from Bytecode

© Microsoft Corporation
Approach




features from Bytecode            Build model

 © Microsoft Corporation
Step 1: Identify Crashed Methods




                                     infoZilla
                     Bug report
infoZilla image by Nicolas
© Microsoft Corporation Bettenburg
Step 1: Identify Crashed Methods




                                     infoZilla
                     Bug report
infoZilla image by Nicolas
© Microsoft Corporation Bettenburg
Step 2: Generate Features




          Bytecode




                              Control flow graph
                              (basic blocks)
© Microsoft Corporation
Step 2: Generate Features




© Microsoft Corporation
Step 3: Build Classifier




© Microsoft Corporation
Experiments
     1. Evaluating crash prediction
            – Within-project classification
            – Cross-project classification
            – Significant features (see paper)
            – Impact of “throws” statements (see paper)

     2. Reproducing crashes with ReCrash+




© Microsoft Corporation
Evaluating Crash Prediction
     • Within-project classification:
       ten-fold cross validation
     • Cross-project validation:
       train on one project and test on the other
     • Baseline: complexity metrics
         Size of Method (in Bytes), Number of Conditional Statements,
         Number of Scalar Locals, Number of Vector Locals, Length of Local
         Identifiers, McCabe Complexity, Data Structure Complexity, Nesting
         Level Complexity, Halstead complexity measures




© Microsoft Corporation
Within-Project Classification




© Microsoft Corporation
Cross-Project Classification




© Microsoft Corporation
Reproducing Crashes
     • Train classifier using the ECLIPSE corpus
     • Classify methods from a different project
       called SVNKit.
           – 2,347 methods of which 27% were classified
             as crash-prone
     • Apply ReCrash+: monitor only those
       methods predicted to be crash-prone
           – Three crashes from original ReCrash paper


© Microsoft Corporation
Reproducing Crashes
     All 3 crashes from SVNKit were successfully
     reproduced by ReCrash+.

     Runtime overhead decreased:




© Microsoft Corporation
Reproducing Crashes
     Only a subset
     of methods had
     to be monitored:




© Microsoft Corporation
Conclusion
     • Monitoring crash-prone methods reduced the
       overhead significantly at almost no cost.
     • Opportunity for capture and replay tools to
       reduce overhead with prediction models.
     • Value of project’s history for the identification
       of crash-prone methods.
     • Potential value of Bytecode features for
       prediction models.


© Microsoft Corporation

More Related Content

What's hot (19)

PDF
Dtl 2012 kl-app_ctl1.2
Комсс Файквэе
 
PDF
Protecting Enterprise - An examination of bugs, major vulnerabilities and exp...
ESET Middle East
 
PDF
Classic Testing Mistakes 0226
MBA_Community
 
PDF
50120140502011
IAEME Publication
 
PPT
SW Engineering Management
Robert Sayegh
 
PPTX
Predict Software Reliability Before the Code is Written
Ann Marie Neufelder
 
DOC
Jun 08 - PMWT Featured Paper -Tarabykin - XP PAPER - FINAL
Alex Tarra
 
PDF
Software testing agile_environment_wp
Cristiano Caetano
 
PDF
Outpost24 webinar - Differentiating vulnerabilities from risks to reduce time...
Outpost24
 
DOCX
Online exa-syste
Anand Bavarava
 
ODP
xUnit and TDD: Why and How in Enterprise Software, August 2012
Justin Gordon
 
PPTX
Introduction to Software Failure Modes Effects Analysis
Ann Marie Neufelder
 
PDF
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
ijceronline
 
PDF
AV-Comparatives Performance Test
Herbert Rodriguez
 
PPTX
Overview of software reliability engineering
Ann Marie Neufelder
 
PDF
RSA 2015 Blending the Automated and the Manual: Making Application Vulnerabil...
Denim Group
 
PDF
Bill of-rights-white-paper-final-012312
Cristiano Caetano
 
PDF
The productivity of testing in software development life cycle
Nora Alriyes
 
Dtl 2012 kl-app_ctl1.2
Комсс Файквэе
 
Protecting Enterprise - An examination of bugs, major vulnerabilities and exp...
ESET Middle East
 
Classic Testing Mistakes 0226
MBA_Community
 
50120140502011
IAEME Publication
 
SW Engineering Management
Robert Sayegh
 
Predict Software Reliability Before the Code is Written
Ann Marie Neufelder
 
Jun 08 - PMWT Featured Paper -Tarabykin - XP PAPER - FINAL
Alex Tarra
 
Software testing agile_environment_wp
Cristiano Caetano
 
Outpost24 webinar - Differentiating vulnerabilities from risks to reduce time...
Outpost24
 
Online exa-syste
Anand Bavarava
 
xUnit and TDD: Why and How in Enterprise Software, August 2012
Justin Gordon
 
Introduction to Software Failure Modes Effects Analysis
Ann Marie Neufelder
 
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
ijceronline
 
AV-Comparatives Performance Test
Herbert Rodriguez
 
Overview of software reliability engineering
Ann Marie Neufelder
 
RSA 2015 Blending the Automated and the Manual: Making Application Vulnerabil...
Denim Group
 
Bill of-rights-white-paper-final-012312
Cristiano Caetano
 
The productivity of testing in software development life cycle
Nora Alriyes
 

Viewers also liked (7)

PDF
Ph.D. Thesis Defense: Studying Reviewer Selection and Involvement in Modern ...
The University of Adelaide
 
PDF
Investigating Code Review Practices in Defective Files
The University of Adelaide
 
PDF
Revisiting Code Ownership and Its Relationship with Software Quality in the S...
The University of Adelaide
 
PDF
Improving Code Review Effectiveness Through Reviewer Recommendations
The University of Adelaide
 
PDF
Who Should Review My Code?
The University of Adelaide
 
PDF
Automated parameter optimization should be included in future 
defect predict...
Chakkrit (Kla) Tantithamthavorn
 
PDF
Towards a Better Understanding of the Impact of Experimental Components on De...
Chakkrit (Kla) Tantithamthavorn
 
Ph.D. Thesis Defense: Studying Reviewer Selection and Involvement in Modern ...
The University of Adelaide
 
Investigating Code Review Practices in Defective Files
The University of Adelaide
 
Revisiting Code Ownership and Its Relationship with Software Quality in the S...
The University of Adelaide
 
Improving Code Review Effectiveness Through Reviewer Recommendations
The University of Adelaide
 
Who Should Review My Code?
The University of Adelaide
 
Automated parameter optimization should be included in future 
defect predict...
Chakkrit (Kla) Tantithamthavorn
 
Towards a Better Understanding of the Impact of Experimental Components on De...
Chakkrit (Kla) Tantithamthavorn
 
Ad

Similar to Predicting Method Crashes with Bytecode Operations (20)

PDF
Cross-project defect prediction
Thomas Zimmermann
 
PDF
Finding Bugs, Fixing Bugs, Preventing Bugs — Exploiting Automated Tests to In...
University of Antwerp
 
PDF
Presentation on vulnerability analysis
Asif Anik
 
PDF
Model-Driven Software Verification
Juan Antonio Martin Checa
 
PDF
Technical meeting automated testing with vs2010
Clemens Reijnen
 
PPTX
Agile Engineering Sparker GLASScon 2015
Stephen Ritchie
 
PDF
SourceWarp AST 2023.pdf
Julian Thome
 
PPTX
Windows Store Apps: Tips & Tricks
Robert MacLean
 
PDF
Vulnerability Detection Based on Git History
Kenta Yamamoto
 
PDF
SE2018_Lec 19_ Software Testing
Amr E. Mohamed
 
PDF
Alm 4 Azure
Clemens Reijnen
 
PPTX
Continuous Delivery Applied
Excella
 
PPTX
Continuous Delivery Applied (Agile Richmond)
Mike McGarr
 
PPTX
Continuous Delivery Applied
DC Agile Engineering Conference
 
PPTX
Continuous Delivery Applied (AgileDC)
Mike McGarr
 
PDF
IRJET- Development of Uncrackable Software
IRJET Journal
 
PPTX
Visual Studio 2010 Testing Overview
Steve Lange
 
PPT
Презентация
guest22d71d
 
PDF
Cloud-Native Security
VMware Tanzu
 
PDF
Cloud Native Security: New Approach for a New Reality
Carlos Andrés García
 
Cross-project defect prediction
Thomas Zimmermann
 
Finding Bugs, Fixing Bugs, Preventing Bugs — Exploiting Automated Tests to In...
University of Antwerp
 
Presentation on vulnerability analysis
Asif Anik
 
Model-Driven Software Verification
Juan Antonio Martin Checa
 
Technical meeting automated testing with vs2010
Clemens Reijnen
 
Agile Engineering Sparker GLASScon 2015
Stephen Ritchie
 
SourceWarp AST 2023.pdf
Julian Thome
 
Windows Store Apps: Tips & Tricks
Robert MacLean
 
Vulnerability Detection Based on Git History
Kenta Yamamoto
 
SE2018_Lec 19_ Software Testing
Amr E. Mohamed
 
Alm 4 Azure
Clemens Reijnen
 
Continuous Delivery Applied
Excella
 
Continuous Delivery Applied (Agile Richmond)
Mike McGarr
 
Continuous Delivery Applied
DC Agile Engineering Conference
 
Continuous Delivery Applied (AgileDC)
Mike McGarr
 
IRJET- Development of Uncrackable Software
IRJET Journal
 
Visual Studio 2010 Testing Overview
Steve Lange
 
Презентация
guest22d71d
 
Cloud-Native Security
VMware Tanzu
 
Cloud Native Security: New Approach for a New Reality
Carlos Andrés García
 
Ad

More from Thomas Zimmermann (20)

PDF
MSR 2013 Preview
Thomas Zimmermann
 
PPT
Klingon Countdown Timer
Thomas Zimmermann
 
PDF
Data driven games user research
Thomas Zimmermann
 
PDF
Not my bug! Reasons for software bug report reassignments
Thomas Zimmermann
 
PDF
Empirical Software Engineering at Microsoft Research
Thomas Zimmermann
 
PDF
Security trend analysis with CVE topic models
Thomas Zimmermann
 
PDF
Analytics for software development
Thomas Zimmermann
 
PDF
Characterizing and predicting which bugs get fixed
Thomas Zimmermann
 
PDF
Changes and Bugs: Mining and Predicting Development Activities
Thomas Zimmermann
 
PDF
Changes and Bugs: Mining and Predicting Development Activities
Thomas Zimmermann
 
PDF
Predicting Defects using Network Analysis on Dependency Graphs
Thomas Zimmermann
 
PDF
Quality of Bug Reports in Open Source
Thomas Zimmermann
 
PDF
Meet Tom and his Fish
Thomas Zimmermann
 
PDF
Predicting Subsystem Defects using Dependency Graph Complexities
Thomas Zimmermann
 
PDF
Got Myth? Myths in Software Engineering
Thomas Zimmermann
 
PDF
Mining Workspace Updates in CVS
Thomas Zimmermann
 
PDF
Mining Software Archives to Support Software Development
Thomas Zimmermann
 
PDF
Unit testing with JUnit
Thomas Zimmermann
 
PPT
esolang: Esoterische Programmiersprachen
Thomas Zimmermann
 
PPT
TA-RE: An Exchange Language for Mining Software Repositories
Thomas Zimmermann
 
MSR 2013 Preview
Thomas Zimmermann
 
Klingon Countdown Timer
Thomas Zimmermann
 
Data driven games user research
Thomas Zimmermann
 
Not my bug! Reasons for software bug report reassignments
Thomas Zimmermann
 
Empirical Software Engineering at Microsoft Research
Thomas Zimmermann
 
Security trend analysis with CVE topic models
Thomas Zimmermann
 
Analytics for software development
Thomas Zimmermann
 
Characterizing and predicting which bugs get fixed
Thomas Zimmermann
 
Changes and Bugs: Mining and Predicting Development Activities
Thomas Zimmermann
 
Changes and Bugs: Mining and Predicting Development Activities
Thomas Zimmermann
 
Predicting Defects using Network Analysis on Dependency Graphs
Thomas Zimmermann
 
Quality of Bug Reports in Open Source
Thomas Zimmermann
 
Meet Tom and his Fish
Thomas Zimmermann
 
Predicting Subsystem Defects using Dependency Graph Complexities
Thomas Zimmermann
 
Got Myth? Myths in Software Engineering
Thomas Zimmermann
 
Mining Workspace Updates in CVS
Thomas Zimmermann
 
Mining Software Archives to Support Software Development
Thomas Zimmermann
 
Unit testing with JUnit
Thomas Zimmermann
 
esolang: Esoterische Programmiersprachen
Thomas Zimmermann
 
TA-RE: An Exchange Language for Mining Software Repositories
Thomas Zimmermann
 

Recently uploaded (20)

DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PPTX
Talbott's brief History of Computers for CollabDays Hamburg 2025
Talbott Crowell
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
NASA A Researcher’s Guide to International Space Station : Earth Observations
Dr. PANKAJ DHUSSA
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PDF
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
PDF
“ONNX and Python to C++: State-of-the-art Graph Compilation,” a Presentation ...
Edge AI and Vision Alliance
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PDF
[GDGoC FPTU] Spring 2025 Summary Slidess
minhtrietgect
 
PDF
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pdf
ghjghvhjgc
 
PPTX
Securing Model Context Protocol with Keycloak: AuthN/AuthZ for MCP Servers
Hitachi, Ltd. OSS Solution Center.
 
PDF
Software Development Company Keene Systems, Inc (1).pdf
Custom Software Development Company | Keene Systems, Inc.
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
Home Cleaning App Development Services.pdf
V3cube
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
Talbott's brief History of Computers for CollabDays Hamburg 2025
Talbott Crowell
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
NASA A Researcher’s Guide to International Space Station : Earth Observations
Dr. PANKAJ DHUSSA
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
“ONNX and Python to C++: State-of-the-art Graph Compilation,” a Presentation ...
Edge AI and Vision Alliance
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
[GDGoC FPTU] Spring 2025 Summary Slidess
minhtrietgect
 
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pdf
ghjghvhjgc
 
Securing Model Context Protocol with Keycloak: AuthN/AuthZ for MCP Servers
Hitachi, Ltd. OSS Solution Center.
 
Software Development Company Keene Systems, Inc (1).pdf
Custom Software Development Company | Keene Systems, Inc.
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Home Cleaning App Development Services.pdf
V3cube
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 

Predicting Method Crashes with Bytecode Operations

  • 1. Predicting Method Crashes with Bytecode Operations Sunghun Kim Hong Kong University of Science and Technology, China Thomas Zimmermann Microsoft Research, USA Rahul Premraj VU University Amsterdam, The Netherlands Nicolas Bettenburg Queen’s University, Canada Shivkumar Shivaji University of California, Santa Cruz, USA © Microsoft Corporation
  • 3. capture and replay + prediction © Microsoft Corporation
  • 4. Capture and Replay © Microsoft Corporation
  • 5. ReCrash Technique Goal: Convert a crash into a set of unit tests 1. Monitoring: maintain a shadow stack – Contains a copy of each method argument – On program crash, write the shadow stack to a file 2. Test generation: create many unit tests For each stack frame, create one unit test: – Invoke the method using arguments from the shadow stack – If the test does not reproduce the crash, discard the test Slide from: http://www.slideshare.net/hunkim/recrash-making- crashes-reproducible-by-preserving-object-states © Microsoft Corporation
  • 6. Cost of Monitoring Key cost of ReCrash: copying arguments to shadow stack Tradeoff: less information in shadow stack ⇒ lower chance of reproducing crashes Monitor fewer methods: Ignore methods not likely to crash © Microsoft Corporation
  • 7. ReCrash+ Technique Goal: Convert a crash into a set of unit tests 1. Monitoring: maintain a shadow stack – Contains a copy of each method argument for methods predicted to crash – On program crash, write the shadow stack to a file 2. Test generation: create many unit tests For each stack frame, create one unit test: – Invoke the method using arguments from the shadow stack – If the test does not reproduce the crash, discard the test Slide adapted from: http://www.slideshare.net/hunkim/recrash- making-crashes-reproducible-by-preserving-object-states © Microsoft Corporation
  • 9. crash defect prediction © Microsoft Corporation
  • 10. From Defect to Crash 1. The programmer creates a defect – an error in the code. 2. When executed the defect creates an infection – an error in the state. 3. The infection propagates. 4. The infection causes a crash. Slide adapted from companion materials to Why Programs Fail, 2nd Edition. A Guide to Systematic Debugging, by Andreas Zeller, Morgan Kauffman. © Microsoft Corporation
  • 11. Approach Identify crashed methods Gene © Microsoft Corporation
  • 12. Approach Generate features from Bytecode © Microsoft Corporation
  • 13. Approach features from Bytecode Build model © Microsoft Corporation
  • 14. Step 1: Identify Crashed Methods infoZilla Bug report infoZilla image by Nicolas © Microsoft Corporation Bettenburg
  • 15. Step 1: Identify Crashed Methods infoZilla Bug report infoZilla image by Nicolas © Microsoft Corporation Bettenburg
  • 16. Step 2: Generate Features Bytecode Control flow graph (basic blocks) © Microsoft Corporation
  • 17. Step 2: Generate Features © Microsoft Corporation
  • 18. Step 3: Build Classifier © Microsoft Corporation
  • 19. Experiments 1. Evaluating crash prediction – Within-project classification – Cross-project classification – Significant features (see paper) – Impact of “throws” statements (see paper) 2. Reproducing crashes with ReCrash+ © Microsoft Corporation
  • 20. Evaluating Crash Prediction • Within-project classification: ten-fold cross validation • Cross-project validation: train on one project and test on the other • Baseline: complexity metrics Size of Method (in Bytes), Number of Conditional Statements, Number of Scalar Locals, Number of Vector Locals, Length of Local Identifiers, McCabe Complexity, Data Structure Complexity, Nesting Level Complexity, Halstead complexity measures © Microsoft Corporation
  • 23. Reproducing Crashes • Train classifier using the ECLIPSE corpus • Classify methods from a different project called SVNKit. – 2,347 methods of which 27% were classified as crash-prone • Apply ReCrash+: monitor only those methods predicted to be crash-prone – Three crashes from original ReCrash paper © Microsoft Corporation
  • 24. Reproducing Crashes All 3 crashes from SVNKit were successfully reproduced by ReCrash+. Runtime overhead decreased: © Microsoft Corporation
  • 25. Reproducing Crashes Only a subset of methods had to be monitored: © Microsoft Corporation
  • 26. Conclusion • Monitoring crash-prone methods reduced the overhead significantly at almost no cost. • Opportunity for capture and replay tools to reduce overhead with prediction models. • Value of project’s history for the identification of crash-prone methods. • Potential value of Bytecode features for prediction models. © Microsoft Corporation