Beware of bugs in the above code; I have only proved it correct, not tried it.
No amount of source-level verification or scrutiny will protect you from using untrusted code.
An individual developer like me cares about writing the new code and making it as interesting and efficient as possible. But very few people want to do the testing.
An effective way to test code is to exercise it at its natural boundaries
I used Agitator on some code I had unit-tested, and it made me a better tester. As an Agitar Fellow, I look forward to the leverage of working with an outstanding organization as together we continue to improve the value of developer testing.
Running the test suite like this allows us to catch problems when they are just introduced.
We have a rule that if you check in code, you have to maintain it. So I mostly code on the side. I don't check in code anymore.
You can't trust code that you did not totally create yourself.
The real value of tests is not that they detect bugs in the code but that they detect inadequacies in the methods, concentration, and skills of those who design and produce the code.
The trick generally is to break programs into pieces and have those pieces be individually testable and so then when you move on to the other pieces you treat it as a black box knowing that it either works or doesn't work.
All real programs contain errors until proved otherwise which is impossible.
It is strange how little harm bad codes do.