My Obsession with Testing

Over the past few days I dived into testing. Those Air Crash Investigations were one of the most useful source of inspiration. The conclusion was to test everything as thoroughly as possible to avoid surprises. OK, this does make sense, but there are two questions really that need answering:

  1. When to stop testing? i.e. at what point can we be certain that this piece of software is reliable.
  2. Should we test every bit of code? i.e. are there any bits of code that we SHOUDn't test?

When to stop testing?

This is an interesting question. The amount of stuff that can possibly go wrong with a simple add(int a, int b) { return a + b; } is quite big:

  • Standard random tests
  • Boundary Tests Overflow exceptions
  • Negative Values
  • etc. etc.

Well... The only way you can be certain what happens is only when you test them all.

Should we test every bit of code?

Now this is an interesting question. Clearly the more tests we do the more certain we can be that the system does what it's suppose to. However, over time there is another factor that plays part: code moderation. Clearly, if we modify a bit of code, we need to rewrite tests, which is not good. Hence, we should only test the API public methods/attributes, which should largely remain the same throughout the Software Development Life Cycle

Leave Comment

Your email address will not be published.

Please type the characters of this captcha image in the input box

Please type the characters of this captcha image in the input box