SlideShare a Scribd company logo
1 of 11
Automatic Bug Fixing
Daniel Hansson
Microprocessor and SOC Test and Verification 2015
always_comb
begin : MUX
if (sel == 1'b0) beggin
mux_out = din_0;
end else begin
mux_out = din_1;
end
end
Added new code segment in a commit:
Syntax Error
2 Ways to Fix
always_comb
begin : MUX
if (sel == 1'b0) begin
mux_out = din_0;
end else begin
mux_out = din_1;
end
end
always_comb
begin : MUX
if (sel == 1'b0) beggin
mux_out = din_0;
end else begin
mux_out = din_1;
end
end
Fix Root CauseUnroll Entire Commit
Bug Fixes
Regression Test Setups
3
Continuous Integration
- Gate keeper
- Short directed tests
Post-Integration Testing
- Large Test Suites
- Random/Directed Tests
Automatic Debug
Inhouse Solution (e.g using
GIT Bisect)
or
PinDown Automated Debug Process
Automated, Validated Identification of Faulty Code
Pass
Regression
Test Failures
Validate
Assign
Bug Report
 Smart Test Grouping
 Run Debug Tests
 Smart Pin-Pointing
Pin-Point
Fail
Revision Control
System
PinDown Patented
Algo to find Bugs:
Fixing the
Bugs
 Random Tests
 Directed Tests
 Single Cause
 Multiple Cause
 Build Failures
 Test Failures
 Intermittent
Committing Fix (optional)
5
PinDown Debug Algorithm
Test
Results
3. Unroll Changes
- 10 selections in parallel
4. Verify
The Rest
1-4 times
Bug Group 1:
”Error: RX value wrong”
12 test failures
Bug Group 2:
”Address is XXXXXXX”
14 test failures
Fastest Test
Fastest Test
1. Grouping
2. Smart
Selection
Identify
possible bad
commits
Revision Control System
Test passes
No pass
Bug No: 1 (new bug)
Test: test34_vm_seed_0x45679832
Build: dtlb_thdr
Error: Error: RX value wrong
Committer: johndoe
Commit Message:
979301: RX performance improvement
Committed Files:
//depot/bigproject/dv/dtlb/dtlb_rqe/common/interface/dtlb_rqe_tb_if.sv
Log:
/projects/pindown/bigproject/dv/dtlb/tb/ftlb_thdr/sv_sep_dut_comp.log
Next Bug
*
6
The Principle is Simple
...but the
reality is
difficult
PinDown supports
all scenarios
Human – Tool Race Condition
Solution: Before committing a fix, check if a fix has already been
committed. Both humans and tools need to do this.
Time
Run Test Suite Debug
Check
Fix
Head
Now
Tested
Revision
Commit
Fix
Commit
Fix
Fault Oscillation
Test A Failing
Commit Fix
Solution: The tool must not unroll its own fixes. In those cases just send
a bug report.
Unroll Fix
Test B Failing
Test A Failing
Partial Introduction of a New Feature
Solution: Don’t allow partial introduction of a feature which makes a test
fail. This rule applies to a continuous integration gate keeper as well.
Constrained random tests may find issues weeks after inserting
Test A Failing
Remove itIntroduce Feature
PinDown Automated Debug Process
Automated, Validated Identification of Faulty Code
Pass
Regression
Test Failures
Validate
Assign
Bug Report
 Smart Test Grouping
 Run Debug Tests
 Smart Pin-Pointing
Pin-Point
Fail
Revision Control
System
PinDown Patented
Algo to find Bugs:
Fixing the
Bugs
 Random Tests
 Directed Tests
 Single Cause
 Multiple Cause
 Build Failures
 Test Failures
 Intermittent
Committing Fix (optional)
Automatically
fixing bugs locally
is advanced and
has no side-effects
Automatically committing the fix is easy to implement but
has serious side-effects (human-tool race, fault oscillation,
implications for partial introduction of new failures)
Summary
Short Test Suites Any Test Suite Size Any Test Suite Size
Directed Tests Only Random, Directed Tests Random, Directed Tests
- No partial checkins that
causes tests to fail
- Check tool/RCS before
commit
Automatic Bug Fix
with Commit
Revision Control
System
Pass
Fixing the
Bugs
Test Suites
Policy Implications
Continuous Integration
Gate Keeper
Automatic Bug Fix
Local
Pass
Fixing the
Bugs
Bug Report
None
Test Suites Test Suites
Policy Implications Policy Implications
No partial checkins that
causes tests to fail

More Related Content

What's hot

Understand regression testing
Understand regression testingUnderstand regression testing
Understand regression testing
gaoliang641
 
Coderetreat @AgileWorks Bucharest 2012 07 06
Coderetreat @AgileWorks Bucharest 2012 07 06 Coderetreat @AgileWorks Bucharest 2012 07 06
Coderetreat @AgileWorks Bucharest 2012 07 06
Adi Bolboaca
 
Random testing
Random testingRandom testing
Random testing
Can KAYA
 
Istqb question-paper-dump-4
Istqb question-paper-dump-4Istqb question-paper-dump-4
Istqb question-paper-dump-4
TestingGeeks
 

What's hot (20)

Testing a GPS application | Testbytes
Testing a GPS application | TestbytesTesting a GPS application | Testbytes
Testing a GPS application | Testbytes
 
Understand regression testing
Understand regression testingUnderstand regression testing
Understand regression testing
 
Testing: ¿what, how, why?
Testing: ¿what, how, why?Testing: ¿what, how, why?
Testing: ¿what, how, why?
 
Principles in software debugging
Principles in software debuggingPrinciples in software debugging
Principles in software debugging
 
Coderetreat @AgileWorks Bucharest 2012 07 06
Coderetreat @AgileWorks Bucharest 2012 07 06 Coderetreat @AgileWorks Bucharest 2012 07 06
Coderetreat @AgileWorks Bucharest 2012 07 06
 
Typical DevOps activities by role
Typical DevOps activities by roleTypical DevOps activities by role
Typical DevOps activities by role
 
Tdd
TddTdd
Tdd
 
Static analysis is most efficient when being used regularly. We'll tell you w...
Static analysis is most efficient when being used regularly. We'll tell you w...Static analysis is most efficient when being used regularly. We'll tell you w...
Static analysis is most efficient when being used regularly. We'll tell you w...
 
testing
testingtesting
testing
 
Embedded System Test Automation
Embedded System Test AutomationEmbedded System Test Automation
Embedded System Test Automation
 
Basics of Functional Verification - Arrow Devices
Basics of Functional Verification - Arrow DevicesBasics of Functional Verification - Arrow Devices
Basics of Functional Verification - Arrow Devices
 
Random testing
Random testingRandom testing
Random testing
 
Vlsi testing
Vlsi testingVlsi testing
Vlsi testing
 
Automated Testing for Embedded Software in C or C++
Automated Testing for Embedded Software in C or C++Automated Testing for Embedded Software in C or C++
Automated Testing for Embedded Software in C or C++
 
Bug life cycle
Bug life cycleBug life cycle
Bug life cycle
 
Bert Zuurke - A Lean And Mean Approach To Model-Based Testing - EuroSTAR 2010
Bert Zuurke - A Lean And Mean Approach To Model-Based Testing - EuroSTAR 2010Bert Zuurke - A Lean And Mean Approach To Model-Based Testing - EuroSTAR 2010
Bert Zuurke - A Lean And Mean Approach To Model-Based Testing - EuroSTAR 2010
 
Unit test
Unit testUnit test
Unit test
 
Istqb question-paper-dump-4
Istqb question-paper-dump-4Istqb question-paper-dump-4
Istqb question-paper-dump-4
 
Unit testing
Unit testingUnit testing
Unit testing
 
Put the Tests Before the Code
Put the Tests Before the CodePut the Tests Before the Code
Put the Tests Before the Code
 

Similar to Automatic Bug Fixing

Testing & continuous delivery
Testing & continuous deliveryTesting & continuous delivery
Testing & continuous delivery
Nelson Melina
 

Similar to Automatic Bug Fixing (20)

Creating testing tools to support development
Creating testing tools to support developmentCreating testing tools to support development
Creating testing tools to support development
 
Workshop unit test
Workshop   unit testWorkshop   unit test
Workshop unit test
 
Testing As A Bottleneck - How Testing Slows Down Modern Development Processes...
Testing As A Bottleneck - How Testing Slows Down Modern Development Processes...Testing As A Bottleneck - How Testing Slows Down Modern Development Processes...
Testing As A Bottleneck - How Testing Slows Down Modern Development Processes...
 
SE2_Lec 20_Software Testing
SE2_Lec 20_Software TestingSE2_Lec 20_Software Testing
SE2_Lec 20_Software Testing
 
Google test training
Google test trainingGoogle test training
Google test training
 
Agile Engineering Sparker GLASScon 2015
Agile Engineering Sparker GLASScon 2015Agile Engineering Sparker GLASScon 2015
Agile Engineering Sparker GLASScon 2015
 
Testing & continuous delivery
Testing & continuous deliveryTesting & continuous delivery
Testing & continuous delivery
 
S.t.
S.t.S.t.
S.t.
 
(Agile) engineering best practices - What every project manager should know
(Agile) engineering best practices - What every project manager should know(Agile) engineering best practices - What every project manager should know
(Agile) engineering best practices - What every project manager should know
 
Week1 programming challenges
Week1 programming challengesWeek1 programming challenges
Week1 programming challenges
 
Synchronization in os.pptx
Synchronization in os.pptxSynchronization in os.pptx
Synchronization in os.pptx
 
SE2018_Lec 19_ Software Testing
SE2018_Lec 19_ Software TestingSE2018_Lec 19_ Software Testing
SE2018_Lec 19_ Software Testing
 
Testing 3: Types Of Tests That May Be Required
Testing 3: Types Of Tests That May Be RequiredTesting 3: Types Of Tests That May Be Required
Testing 3: Types Of Tests That May Be Required
 
Test Automation Improvement by Machine Learning Jasst'21 Tokyo
Test Automation Improvement by Machine Learning Jasst'21 TokyoTest Automation Improvement by Machine Learning Jasst'21 Tokyo
Test Automation Improvement by Machine Learning Jasst'21 Tokyo
 
ALM Summit 3 - Setting up a Continuous Delivery Deployment Pipeline with TFS
ALM Summit 3 - Setting up a Continuous Delivery Deployment Pipeline with TFSALM Summit 3 - Setting up a Continuous Delivery Deployment Pipeline with TFS
ALM Summit 3 - Setting up a Continuous Delivery Deployment Pipeline with TFS
 
SE2_Lec 21_ TDD and Junit
SE2_Lec 21_ TDD and JunitSE2_Lec 21_ TDD and Junit
SE2_Lec 21_ TDD and Junit
 
Unit testing - A&BP CC
Unit testing - A&BP CCUnit testing - A&BP CC
Unit testing - A&BP CC
 
Model Driven Testing: requirements, models & test
Model Driven Testing: requirements, models & test Model Driven Testing: requirements, models & test
Model Driven Testing: requirements, models & test
 
6months industrial training in software testing, jalandhar
6months industrial training in software testing, jalandhar6months industrial training in software testing, jalandhar
6months industrial training in software testing, jalandhar
 
6 weeks summer training in software testing,ludhiana
6 weeks summer training in software testing,ludhiana6 weeks summer training in software testing,ludhiana
6 weeks summer training in software testing,ludhiana
 

Recently uploaded

TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
panagenda
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
FIDO Alliance
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
FIDO Alliance
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
FIDO Alliance
 

Recently uploaded (20)

Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 

Automatic Bug Fixing

  • 1. Automatic Bug Fixing Daniel Hansson Microprocessor and SOC Test and Verification 2015
  • 2. always_comb begin : MUX if (sel == 1'b0) beggin mux_out = din_0; end else begin mux_out = din_1; end end Added new code segment in a commit: Syntax Error 2 Ways to Fix always_comb begin : MUX if (sel == 1'b0) begin mux_out = din_0; end else begin mux_out = din_1; end end always_comb begin : MUX if (sel == 1'b0) beggin mux_out = din_0; end else begin mux_out = din_1; end end Fix Root CauseUnroll Entire Commit Bug Fixes
  • 3. Regression Test Setups 3 Continuous Integration - Gate keeper - Short directed tests Post-Integration Testing - Large Test Suites - Random/Directed Tests Automatic Debug Inhouse Solution (e.g using GIT Bisect) or
  • 4. PinDown Automated Debug Process Automated, Validated Identification of Faulty Code Pass Regression Test Failures Validate Assign Bug Report  Smart Test Grouping  Run Debug Tests  Smart Pin-Pointing Pin-Point Fail Revision Control System PinDown Patented Algo to find Bugs: Fixing the Bugs  Random Tests  Directed Tests  Single Cause  Multiple Cause  Build Failures  Test Failures  Intermittent Committing Fix (optional)
  • 5. 5 PinDown Debug Algorithm Test Results 3. Unroll Changes - 10 selections in parallel 4. Verify The Rest 1-4 times Bug Group 1: ”Error: RX value wrong” 12 test failures Bug Group 2: ”Address is XXXXXXX” 14 test failures Fastest Test Fastest Test 1. Grouping 2. Smart Selection Identify possible bad commits Revision Control System Test passes No pass Bug No: 1 (new bug) Test: test34_vm_seed_0x45679832 Build: dtlb_thdr Error: Error: RX value wrong Committer: johndoe Commit Message: 979301: RX performance improvement Committed Files: //depot/bigproject/dv/dtlb/dtlb_rqe/common/interface/dtlb_rqe_tb_if.sv Log: /projects/pindown/bigproject/dv/dtlb/tb/ftlb_thdr/sv_sep_dut_comp.log Next Bug *
  • 6. 6 The Principle is Simple ...but the reality is difficult PinDown supports all scenarios
  • 7. Human – Tool Race Condition Solution: Before committing a fix, check if a fix has already been committed. Both humans and tools need to do this. Time Run Test Suite Debug Check Fix Head Now Tested Revision Commit Fix Commit Fix
  • 8. Fault Oscillation Test A Failing Commit Fix Solution: The tool must not unroll its own fixes. In those cases just send a bug report. Unroll Fix Test B Failing Test A Failing
  • 9. Partial Introduction of a New Feature Solution: Don’t allow partial introduction of a feature which makes a test fail. This rule applies to a continuous integration gate keeper as well. Constrained random tests may find issues weeks after inserting Test A Failing Remove itIntroduce Feature
  • 10. PinDown Automated Debug Process Automated, Validated Identification of Faulty Code Pass Regression Test Failures Validate Assign Bug Report  Smart Test Grouping  Run Debug Tests  Smart Pin-Pointing Pin-Point Fail Revision Control System PinDown Patented Algo to find Bugs: Fixing the Bugs  Random Tests  Directed Tests  Single Cause  Multiple Cause  Build Failures  Test Failures  Intermittent Committing Fix (optional) Automatically fixing bugs locally is advanced and has no side-effects Automatically committing the fix is easy to implement but has serious side-effects (human-tool race, fault oscillation, implications for partial introduction of new failures)
  • 11. Summary Short Test Suites Any Test Suite Size Any Test Suite Size Directed Tests Only Random, Directed Tests Random, Directed Tests - No partial checkins that causes tests to fail - Check tool/RCS before commit Automatic Bug Fix with Commit Revision Control System Pass Fixing the Bugs Test Suites Policy Implications Continuous Integration Gate Keeper Automatic Bug Fix Local Pass Fixing the Bugs Bug Report None Test Suites Test Suites Policy Implications Policy Implications No partial checkins that causes tests to fail