What I've Learned This Week

Consider the following situation:

  1. A client code C calls a BI-method B via a very-simple-technical-wrapper-method W.
  2. C (sometimes) gets an unreasonable result.
  3. The whole deal is production-grade code.

Who is most likely at fault?

The intuitive answer would be B - lots of work, lots of chance of bugs.
But this is production level code - everything has been tested through and through. Especially the BI stuff.

Technical-wrapper W, however is so simple, that (As far as whoever coded it is concerned) it requires no testing at all. It wasn't tested, it "just works."

So, while it is true that "more code --> more chance of bugs," it doesn't stop there:

  • more code --> more chance of bugs --> better testing --> decrease probability of bug
  • practically no code --> hardly any chance of bugs --> hardly any testing --> probability of bugs remains

This makes even more sense if your system is so small that W might only be used once or twice.