› Automated Testing
Some think that the only type of testing that is performed in TDD is the unit testing. While unit testing is the main type of testing in TDD, there are other types of testing that should be developed and automated as well. The three main types of automated testing in TDD are the following:
-
Unit Testing
Unit testing tests individual functions or methods within a larger module or class. Unit testing ensures that every single unit in the code works according to its specification. A function may have multiple unit tests each testing a particular part of that function. All unit tests should be automated. Whenever a change is made in a particular module, all unit tests should run again. In order for unit tests to be effective they need to have the following characteristics:
-
Unit tests should run fast.
-
Unit tests should be self-explanatory. In other words, they should be clear and readable.
-
Unit tests should be platform independent. Unite tests that can be run in different platforms are more reliable than platform-dependent tests.
-
Unit tests should isolate dependency on other parts of the software such as databases. Theses isolation can be done using interfaces or mocks.
-
Integration Testing
Integration testing is an extremely important type of testing in TDD. It insures that all units are still working as they should be when integrated. A lot of problems arise when two or more modules are brought together. Therefore, in TDD it is important to continuously integrate units and to develop automated tests that insure all units are still working right.
-
Performance Testing
Although performance testing is not always used in TDD, it is still an important type of testing that should also be automated. Performance testing aims on testing the overall performance of the system when used by a large amount of users. There are many testing frameworks that can help simulating a large number of users accessing the system. The system should be tested using different scenarios and different levels of load.