Locating the Bug (cont)
At each stage you have eliminated half of the program from suspicion.
In not too many steps, you will have identified a specific buggy statement.
The problems:
- which variables to print? all? what if too many?
- how to work out where the "half-way execution point" is?
Side note: this approach won't necessarily find an existing bug ...
E.g. x:int { y = x+x; } y==x2 , when intially x==2
|