
CS553 Lecture Finding Bugs 2
Finding Bugs
Last time
โ Run-time reordering transformations
Today
โ Program Analysis for finding bugs, especially security bugs
โ problem specification
โ motivation
โ approaches
โ remaining issues
CS553 Lecture Finding Bugs 3
Problem
What is a bug?
โ a path in the code that causes a run-time exception
โ a path through the code that causes incorrect results
Issues
โ exponential many paths
โ cannot statically determine the path a program will take
โ โProgram testing can be used to find the presence of bugs, but never to show their
absence.โ [Dijkstra 1972]
Undecidability
โ soundness and completeness together is undecidable
โ confusion in literature: which is which?
โ every reported error is genuine (no false positives)
โ if the program has any errors then the checker will report some error (no false
negatives)
CS553 Lecture Finding Bugs 4
Motivation for the Automatic Detection of Bugs
Time spent in program maintenance
โ most software engineers spend the majority of their time doing
maintenance
โ most time spent doing maintenance is time spent debugging
Costs due to bugs that allow security exploits (approximations published
at CNET News.com, Jan 31 2003)
โ Slammer (950 million)
โ Code Red (2.6 billion productivity loss)
โ LoveLetter (8.8 billion)
โ Klez virus (9.0 billion)
CS553 Lecture Finding Bugs 5
Approaches to Finding Bugs
Approaches
โ strengthening the type system
โ static analysis to detect bug patterns
โ automated theorem proving
โ dynamic analysis
โ catch errors before they occur
โ find the cause for failures after the fact
Evaluating the different approaches
โ how many false positives?
โ how many false negatives?
โ extent of user intervention or ease of use
โ efficiency of approach