Search This Blog

05 February 2010

Test driven development

During software development one must take actions to ensure that the software contains as few errors as possible, no software will be completely error free. There are several paths to consider and they all have their advantages and disadvantages.

There are people that argue for not using testing at all since it costs to much and gives to few advantages, I for one think this is as stupid as standing on the freeway and hiding your head in the ground just hoping that there won't be any cars comming your way. At the minimum there should at least be some basic testing done before releasing a software. Either some of the users should perform test or some sort of automatic test should be written.

Unit testing is a very good method for minimising the errors within a single unit. The hard part with unit testing is to make sure that the test really are UNIT test and not integrations test. Only direct calls to an object should be tested in a single test and no dependencies of other objects implementation should be required. If one begin to couple objects and the test depends on other objects you aren't anymore using Unit testing. The reason for makeing sure that the objects only depends on themself in a test is that by doing this one can make it much easier to maintain a good test suite.

Integrations testing on the other side is a good method for making sure that all components in the project works as designed even if changes are made in the underlying code. These test should match the business cases detected to make sure that no errors are introduced into the code. It often here you need to remake the tests when a bug is detected to make sure that the test catches the bug and also can give a clear information that the bug has been removed and fixed.

User tests are a good way to detect errors in communication since the users will be the most capable persons to make sure that the application behaves and functions as it should. It can be hard to make sure that these tests really are performed.

Automatic GUI testing is good but often time consuming and hard to write so they cover all possible events and possibilities in the application. Needless its a good idé to creates such tests, especilly if there isn't any real users test in the system.

No comments:

Post a Comment