SlideShare a Scribd company logo
1 of 26
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

Classic Testing Mistakes 0226
Classic Testing Mistakes 0226Classic Testing Mistakes 0226
Classic Testing Mistakes 0226
MBA_Community
 
Jun 08 - PMWT Featured Paper -Tarabykin - XP PAPER - FINAL
Jun 08 - PMWT Featured Paper -Tarabykin - XP PAPER - FINALJun 08 - PMWT Featured Paper -Tarabykin - XP PAPER - FINAL
Jun 08 - PMWT Featured Paper -Tarabykin - XP PAPER - FINAL
Alex Tarra
 
Software testing agile_environment_wp
Software testing agile_environment_wpSoftware testing agile_environment_wp
Software testing agile_environment_wp
Cristiano Caetano
 
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
ijceronline
 
Bill of-rights-white-paper-final-012312
Bill of-rights-white-paper-final-012312Bill of-rights-white-paper-final-012312
Bill of-rights-white-paper-final-012312
Cristiano Caetano
 

What's hot (19)

Dtl 2012 kl-app_ctl1.2
Dtl 2012 kl-app_ctl1.2Dtl 2012 kl-app_ctl1.2
Dtl 2012 kl-app_ctl1.2
 
Protecting Enterprise - An examination of bugs, major vulnerabilities and exp...
Protecting Enterprise - An examination of bugs, major vulnerabilities and exp...Protecting Enterprise - An examination of bugs, major vulnerabilities and exp...
Protecting Enterprise - An examination of bugs, major vulnerabilities and exp...
 
Classic Testing Mistakes 0226
Classic Testing Mistakes 0226Classic Testing Mistakes 0226
Classic Testing Mistakes 0226
 
50120140502011
5012014050201150120140502011
50120140502011
 
SW Engineering Management
SW Engineering ManagementSW Engineering Management
SW Engineering Management
 
Predict Software Reliability Before the Code is Written
Predict Software Reliability Before the Code is WrittenPredict Software Reliability Before the Code is Written
Predict Software Reliability Before the Code is Written
 
Jun 08 - PMWT Featured Paper -Tarabykin - XP PAPER - FINAL
Jun 08 - PMWT Featured Paper -Tarabykin - XP PAPER - FINALJun 08 - PMWT Featured Paper -Tarabykin - XP PAPER - FINAL
Jun 08 - PMWT Featured Paper -Tarabykin - XP PAPER - FINAL
 
Software testing agile_environment_wp
Software testing agile_environment_wpSoftware testing agile_environment_wp
Software testing agile_environment_wp
 
Outpost24 webinar - Differentiating vulnerabilities from risks to reduce time...
Outpost24 webinar - Differentiating vulnerabilities from risks to reduce time...Outpost24 webinar - Differentiating vulnerabilities from risks to reduce time...
Outpost24 webinar - Differentiating vulnerabilities from risks to reduce time...
 
Online exa-syste
Online exa-systeOnline exa-syste
Online exa-syste
 
xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012xUnit and TDD: Why and How in Enterprise Software, August 2012
xUnit and TDD: Why and How in Enterprise Software, August 2012
 
Introduction to Software Failure Modes Effects Analysis
Introduction to Software Failure Modes Effects AnalysisIntroduction to Software Failure Modes Effects Analysis
Introduction to Software Failure Modes Effects Analysis
 
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
 
AV-Comparatives Performance Test
AV-Comparatives Performance TestAV-Comparatives Performance Test
AV-Comparatives Performance Test
 
Butler
ButlerButler
Butler
 
Overview of software reliability engineering
Overview of software reliability engineeringOverview of software reliability engineering
Overview of software reliability engineering
 
RSA 2015 Blending the Automated and the Manual: Making Application Vulnerabil...
RSA 2015 Blending the Automated and the Manual: Making Application Vulnerabil...RSA 2015 Blending the Automated and the Manual: Making Application Vulnerabil...
RSA 2015 Blending the Automated and the Manual: Making Application Vulnerabil...
 
Bill of-rights-white-paper-final-012312
Bill of-rights-white-paper-final-012312Bill of-rights-white-paper-final-012312
Bill of-rights-white-paper-final-012312
 
The productivity of testing in software development life cycle
The productivity of testing in software development life cycleThe productivity of testing in software development life cycle
The productivity of testing in software development life cycle
 

Viewers also liked

Investigating Code Review Practices in Defective Files
Investigating Code Review Practices in Defective FilesInvestigating Code Review Practices in Defective Files
Investigating Code Review Practices in Defective Files
The University of Adelaide
 
Revisiting Code Ownership and Its Relationship with Software Quality in the S...
Revisiting Code Ownership and Its Relationship with Software Quality in the S...Revisiting Code Ownership and Its Relationship with Software Quality in the S...
Revisiting Code Ownership and Its Relationship with Software Quality in the S...
The University of Adelaide
 
Automated parameter optimization should be included in future 
defect predict...
Automated parameter optimization should be included in future 
defect predict...Automated parameter optimization should be included in future 
defect predict...
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...
Towards a Better Understanding of the Impact of Experimental Components on De...Towards a Better Understanding of the Impact of Experimental Components on De...
Towards a Better Understanding of the Impact of Experimental Components on De...
Chakkrit (Kla) Tantithamthavorn
 

Viewers also liked (7)

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

Similar to Predicting Method Crashes with Bytecode Operations

Windows Store Apps: Tips & Tricks
Windows Store Apps: Tips & TricksWindows Store Apps: Tips & Tricks
Windows Store Apps: Tips & Tricks
Robert MacLean
 
Презентация
ПрезентацияПрезентация
Презентация
guest22d71d
 

Similar to Predicting Method Crashes with Bytecode Operations (20)

Cross-project defect prediction
Cross-project defect predictionCross-project defect prediction
Cross-project defect prediction
 
Finding Bugs, Fixing Bugs, Preventing Bugs — Exploiting Automated Tests to In...
Finding Bugs, Fixing Bugs, Preventing Bugs — Exploiting Automated Tests to In...Finding Bugs, Fixing Bugs, Preventing Bugs — Exploiting Automated Tests to In...
Finding Bugs, Fixing Bugs, Preventing Bugs — Exploiting Automated Tests to In...
 
Presentation on vulnerability analysis
Presentation on vulnerability analysisPresentation on vulnerability analysis
Presentation on vulnerability analysis
 
Model-Driven Software Verification
Model-Driven Software VerificationModel-Driven Software Verification
Model-Driven Software Verification
 
Technical meeting automated testing with vs2010
Technical meeting automated testing with vs2010Technical meeting automated testing with vs2010
Technical meeting automated testing with vs2010
 
Agile Engineering Sparker GLASScon 2015
Agile Engineering Sparker GLASScon 2015Agile Engineering Sparker GLASScon 2015
Agile Engineering Sparker GLASScon 2015
 
SourceWarp AST 2023.pdf
SourceWarp AST 2023.pdfSourceWarp AST 2023.pdf
SourceWarp AST 2023.pdf
 
Windows Store Apps: Tips & Tricks
Windows Store Apps: Tips & TricksWindows Store Apps: Tips & Tricks
Windows Store Apps: Tips & Tricks
 
Vulnerability Detection Based on Git History
Vulnerability Detection Based on Git HistoryVulnerability Detection Based on Git History
Vulnerability Detection Based on Git History
 
SE2018_Lec 19_ Software Testing
SE2018_Lec 19_ Software TestingSE2018_Lec 19_ Software Testing
SE2018_Lec 19_ Software Testing
 
Alm 4 Azure
Alm 4 AzureAlm 4 Azure
Alm 4 Azure
 
Continuous Delivery Applied
Continuous Delivery AppliedContinuous Delivery Applied
Continuous Delivery Applied
 
Continuous Delivery Applied (Agile Richmond)
Continuous Delivery Applied (Agile Richmond)Continuous Delivery Applied (Agile Richmond)
Continuous Delivery Applied (Agile Richmond)
 
Continuous Delivery Applied
Continuous Delivery AppliedContinuous Delivery Applied
Continuous Delivery Applied
 
Continuous Delivery Applied (AgileDC)
Continuous Delivery Applied (AgileDC)Continuous Delivery Applied (AgileDC)
Continuous Delivery Applied (AgileDC)
 
IRJET- Development of Uncrackable Software
IRJET- Development of Uncrackable SoftwareIRJET- Development of Uncrackable Software
IRJET- Development of Uncrackable Software
 
Visual Studio 2010 Testing Overview
Visual Studio 2010 Testing OverviewVisual Studio 2010 Testing Overview
Visual Studio 2010 Testing Overview
 
Презентация
ПрезентацияПрезентация
Презентация
 
Security and DevOps: Agility and Teamwork - SID315 - re:Invent 2017
Security and DevOps: Agility and Teamwork - SID315 - re:Invent 2017Security and DevOps: Agility and Teamwork - SID315 - re:Invent 2017
Security and DevOps: Agility and Teamwork - SID315 - re:Invent 2017
 
Cloud Native Security: New Approach for a New Reality
Cloud Native Security: New Approach for a New RealityCloud Native Security: New Approach for a New Reality
Cloud Native Security: New Approach for a New Reality
 

More from Thomas Zimmermann

Analytics for software development
Analytics for software developmentAnalytics for software development
Analytics for software development
Thomas Zimmermann
 

More from Thomas Zimmermann (20)

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

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 

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