Wednesday, February 3, 2010

The Power of Testing

Testing is an often dreaded but very necessary part of the development process. It can be a tedious task but it can really pay off in the long run. I think this (de)Motivational poster sums it up nicely.

Testing1

I realize that there isn't time to test everything. Like all programming tasks they need to be added into the schedule. Therefore, you need to choose the tests that best suit your situation. Here are a few examples.

  • Unit Testing
  • Regression Testing
  • Integration Testing
  • Usability Testing

Unit testing was brought to the forefront with the concept of Test-driven Development (TTD). TTD encourages developers to write a unit test first then create the method. This ensures that every method has a test written for it. If you are trying to apply this to an existing project it can be a very large task. For new projects there are many tools available which which help automate the process.

Creating unit tests for every function can be a time consuming process and needs to be balanced with generating the code that actually does the work. This can be further complicated since you need a positive and negative test in many cases. You need to ensure your function returns the correct results for valid input as well as proper handling of invalid input. Achieving the right amount of unit tests can be a somewhat daunting task.

Two types of tests which are almost always used are regression and integration tests. Regression testing ensures that changes to the code don't break any existing functionality. This is a step up from unit level tests in that it demonstrates that all of the units work together properly. Testing of new features is generally referred to as Integration Testing since it tests the addition of new features with the old.

When you are developing a program that will be used by people frequently Usability Testing is a valuable tool. Many people think that this can be a very time consuming and expensive type of testing to do. However, it doesn't have to be. You can conduct informal usability tests by simply grabbing someone in the hall and asking them to look at a form or web page that you just completed. If they can use the form then your on the right track.

Other simple usability tests can be conducted in a few hours using screen sharing software and a little help from your customers. This allows your developers to watch a user work with the program and identify good and bad aspects of the interface. I believe this kind of feedback is invaluable, it will lead to improvements and is well worth the time investment.

There are many other categories of tests that can be run and ultimately the level of tests you perform is going to depend on many factors. Although testing is very important delivering a product to market is just as important. Do enough testing to ensure that your product will work correctly and effectively then get it out to your best testers; your customers.

1 comment:

Gary W. Deason said...

The peculiar approach. I like. I would also add here the service http://www.nixsolutions.com/services/quality-assurance-services/. It will help you learn something new. I think that a lot of people visit it decides to use the services of this website.