February 5, 2007

Why QA testing is still important with unit tests

Filed under: ResearchAndDevelopment — Ryan Wilcox @ 11:00 pm

Here’s a parable for you.

One day a programmer was writing a script (in Python, if it matters). It was a complicated script, so like any good programmer, he factored the program so his calculation stuff could be done without requiring a GUI. Then he wrote unit tests, as he should.

The day came when the unit tests passed, and there was much rejoicing. The actual script was executed to do its job…. but wait, no output.

Great thoughts were thought, and code looked at. The unit tests pass… but it doesn’t work. Why??

The answer soon came – in factoring out calculation stuff (to allow easy testing), the programmer forgot to pass the values from the calculations on to the GUI!! Soon enough, all was fixed and the program worked.

The moral of the story: no matter how many unit tests you have testing your calculations and stuff on the backend, you still need someone (or some thing) going through and making sure the GUI works. Be this with your unit testing framework testing the views, automated testing, or acceptance testing, you need to make sure your information gets to your users.