Everyone is familiar with Edsger W. Dijkstra’s famous observation that “Program testing can be used to show the presence of bugs, but never to show their absence!” It seems to me that mathematics cannot prove the absence of bugs either.
Consider this simple line of code, that appears in some form in *every* business application:
This is a line of software. It’s an assignment of a value to a variable. And there is no mathematical way to prove that this line is correct. This line is correct only IF the given IP address is really the address of the database server that we require.
Not even TDD and unit testing can help to prove that it’s correct. What would a unit test look like?
This test is just repeating the contents of the configuration file. It will pass even if the address 10.1.2.3 is wrong.
So what is the *only* way to prove that this line of code is correct? You guessed it. You must run the application and see if it works. This test can be manual or automated, but still we need a *test* of the live system to make sure that that line of code is correct.