I just wrote a program that didn't do anything when I ran it.
It's because the main loop had:
That 5 should have been a 7.
Now it has me thinking about what programming language designs would enable the programming system to notice that error and issue a warning “Hey, you wrote a test, but it can never return false”.
Maybe instead of some sort of briliant static analysis, what we need instead is an eaasy dynamic analysis: “Hey, here's a list of tests in your program that always had the same result.”
Has someone outfitted Eclipse or some other IDE to annotate your program after each run with pastel shades showing which parts were actually exercised and which were never run? That seems like it could be useful.