Pages

Saturday, December 27, 2014

Testing (Part 1)

Generally, developers hate testing. They hate to see their code breaking.

But we don't. We test every bits and pieces in our code. Why? Because we know that this is one place where we can see Butterfly effect in action! One simple mistake can cause large (and very bad, of course) effects in the future.

Test Early, Test Often, Test Automatically

Many teams develop elaborate test plans for their project. But automated tests, which run with every build is far better and successful than test plans that sit on a shelf. The earlier we find the bug, the easier the fix. In fact, a good project may have more test code than production code.

Just writing tests is not enough. We have to make sure that we run that often. We cannot say that coding is done unless all the tests are passing. These are some major types of test we need to perform:
  • Unit Testing - Tests a module. Because if the module can't work alone, it cannot work with others as well.
  • Integration Testing - Tests how the subsystems play and interact with each other.
  • Validation and Verification - Ensures that what is build is what the user needs. Checks the functional requirements.
  • Resource Exhaustion, Errors and Recovery - Tests how the system behaves in real world conditions under varying factors like memory, CPU bandwidth etc.
  • Performance Testing - Stress testing, in which we tests our system and how it behaves when there is heavy load.
  • Usability Testing - Different from all the above tests. Here we test the system with real users. It helps us to know how easy it is for them to use it.

- summary of Ruthless Testing, from The Pragmatic Programmer: from Journeyman to Master

No comments:

Post a Comment