Rise of the Heisenbug
-
Upload
gil-zilberfeld -
Category
Technology
-
view
1.486 -
download
4
description
Transcript of Rise of the Heisenbug
![Page 1: Rise of the Heisenbug](https://reader035.fdocuments.us/reader035/viewer/2022070315/554fb7b9b4c90542018b459d/html5/thumbnails/1.jpg)
Veranstalter:
Speziell zu Software-Testing14.-15. Februar 2011, München
Rise of the HeisenbugGil Zilberfeld
![Page 2: Rise of the Heisenbug](https://reader035.fdocuments.us/reader035/viewer/2022070315/554fb7b9b4c90542018b459d/html5/thumbnails/2.jpg)
Who Am I?
• Software developer for 15 years
• Product Manager at Typemock
• @gil_zilberfeld
• www.gilzilberfeld.com
![Page 3: Rise of the Heisenbug](https://reader035.fdocuments.us/reader035/viewer/2022070315/554fb7b9b4c90542018b459d/html5/thumbnails/3.jpg)
What’s the plan?
• A humble beginning• Heisenbugs• Tools and solutions
![Page 4: Rise of the Heisenbug](https://reader035.fdocuments.us/reader035/viewer/2022070315/554fb7b9b4c90542018b459d/html5/thumbnails/4.jpg)
My First TDD Project
![Page 5: Rise of the Heisenbug](https://reader035.fdocuments.us/reader035/viewer/2022070315/554fb7b9b4c90542018b459d/html5/thumbnails/5.jpg)
Progress has beaten us
• The Multicore• Mainstream
Languages don’t help• Tools are complex
![Page 6: Rise of the Heisenbug](https://reader035.fdocuments.us/reader035/viewer/2022070315/554fb7b9b4c90542018b459d/html5/thumbnails/6.jpg)
We can do so much more
![Page 7: Rise of the Heisenbug](https://reader035.fdocuments.us/reader035/viewer/2022070315/554fb7b9b4c90542018b459d/html5/thumbnails/7.jpg)
Concurrency problems
• State problems• Race conditions• Deadlocks
![Page 8: Rise of the Heisenbug](https://reader035.fdocuments.us/reader035/viewer/2022070315/554fb7b9b4c90542018b459d/html5/thumbnails/8.jpg)
Heisenberg’s Uncertainty Principle
It is impossible to know both the exact position and the exact velocity of an object at the same time
![Page 9: Rise of the Heisenbug](https://reader035.fdocuments.us/reader035/viewer/2022070315/554fb7b9b4c90542018b459d/html5/thumbnails/9.jpg)
Heisenbug
The process of hunting the bug impacts our ability to catch it
![Page 10: Rise of the Heisenbug](https://reader035.fdocuments.us/reader035/viewer/2022070315/554fb7b9b4c90542018b459d/html5/thumbnails/10.jpg)
Heisenbugs
• Identification is hard• Reproduction is
hard• Fixing is easy• Checking the fix is
hard
![Page 11: Rise of the Heisenbug](https://reader035.fdocuments.us/reader035/viewer/2022070315/554fb7b9b4c90542018b459d/html5/thumbnails/11.jpg)
A Methodological Solution
• Reproduce• Write a failing test• Fix it• Keep the test
![Page 12: Rise of the Heisenbug](https://reader035.fdocuments.us/reader035/viewer/2022070315/554fb7b9b4c90542018b459d/html5/thumbnails/12.jpg)
It should work!
• Works for logic• Shouldn’t it work for
concurrency?
![Page 13: Rise of the Heisenbug](https://reader035.fdocuments.us/reader035/viewer/2022070315/554fb7b9b4c90542018b459d/html5/thumbnails/13.jpg)
Repeatability is the issue
• Produce the same result– Any computer– Any configuration
![Page 14: Rise of the Heisenbug](https://reader035.fdocuments.us/reader035/viewer/2022070315/554fb7b9b4c90542018b459d/html5/thumbnails/14.jpg)
What’s the Solution?
• Proper tools
![Page 15: Rise of the Heisenbug](https://reader035.fdocuments.us/reader035/viewer/2022070315/554fb7b9b4c90542018b459d/html5/thumbnails/15.jpg)
Catching Race Conditions
• Example using CThru
![Page 16: Rise of the Heisenbug](https://reader035.fdocuments.us/reader035/viewer/2022070315/554fb7b9b4c90542018b459d/html5/thumbnails/16.jpg)
Catching deadlocks
• Using Racer
![Page 17: Rise of the Heisenbug](https://reader035.fdocuments.us/reader035/viewer/2022070315/554fb7b9b4c90542018b459d/html5/thumbnails/17.jpg)
Other Tools
• Static Analysis– http://en.wikipedia.org/wiki/List_of_tools_for_sta
tic_code_analysis• AOP
– http://www.bodden.de/tools/aop-dot-net/• Microsoft CHESS
– http://research.microsoft.com/en-us/projects/chess/
![Page 18: Rise of the Heisenbug](https://reader035.fdocuments.us/reader035/viewer/2022070315/554fb7b9b4c90542018b459d/html5/thumbnails/18.jpg)
Back to Basics
• Code reviews• Awareness
– Architecture• Safe guards• Tools