Subscribe by Email


Saturday, April 23, 2011

How are programs tested? Explaining Unit Testing and Integration Testing

In testing programs, individual units are tested and this comes under unit testing. Then, their relationship with one another is tested which comes under integration testing.

UNIT TESTING


- It tests the smaller building blocks of a program.
- It confirms that each module performs its assigned task.
- It involves testing the interface, local data structures, boundary conditions, independent paths and error handling paths.
- Two things are used for unit testing : Driver and Stub.
- Driver is a program that accepts test case data, passes data to the component to be tested, and prints relevant results.
- Stub is program that performs support activities such as data manipulation, queries of states of the component being tested and prints verification of entry.

INTEGRATION TESTING


- Integration testing is followed after unit testing.
- All classes are tested for integration.
- Each component performs correctly within collaboration and that each interface is correct.
- Integration testing can be done by thread based testing approach. A thread is a path of communication among classes that needs to process a single input or respond to an event.
- Regression testing is re-execution of some subset of tests to ensure that changes have not produced unintended side effects.


No comments:

Facebook activity