Component testing, which is also sometimes referred to as unit testing, involves testing individual modules of code to ensure that they function as expected. The purpose of component testing is to ensure that the smallest testable elements of the program function correctly.
Component testing can take place during the development process and does not need every part of the project to have been completed before the testing takes place. It makes sense to test individual components of a project while they are being written rather than waiting until they are combined together making errors difficult to spot, especially if there are several which may interact with each other to give unpredictable results.
As with all testing, component testing should be documented with test data and results, so that effort is not duplicated if any module has to be revisited in the light of problems encountered at a later stage.
The component testing test process consists of:
Once modules have been through component testing, and meet the requirements, it is time to move on to testing how the components all function together.
Once component testing is complete, the next stage is to make sure that the components all work together. The flow of data between modules needs to be checked for data integrity, and it needs to be checked that the modules work together as planned. This is known as integrative testing.
Usually, a test plan will be written, the inputs to the test being the modules which were tested at the component testing stage. There are a number of different approaches to integration testing depending on the complexity of the project.
Small groups of modules which should work together may be tested together, then combined with others. Alternatively, if the project is a relatively small one, all the modules may be combined, and the system tested as a whole.
A test plan for integrative testing will identify: