Test Harness in Software Testing
Test Harness refers to a collection of stubs, drivers, and other supporting tools that are added in the framework to execute tests. It is used to replicate the missing items which are basically small programs that interact with the software under test. It uses a test library and generates a report.
It is used in two main areas which are automation testing and integration testing. It also contains all the information needed to compile and run a test like test cases, target deployment port(TDP), source file under test, stubs, etc.
Objectives of Test Harness
- To automate the testing process.
- To execute a set of test conditions within the framework
- To generate test reports
- To record the test results for each one of the tests
- Helps the developers to measure code coverage at a code level
- To organize a run time environment
- To enhance the quality of software components and application
Features of Test Harness
- Executes test suite in the framework
- Provide flexibility and support for debugging
- Assists in measuring the code coverage at the code level.
- Enters test data to an application under test
- Captures the output from the software under test
- Records test results
Benefits of Test Harness
- Increased productivity of the system by automating the tests.
- Improved quality of software.
- Provides Tests that can be scheduled.
- Helps to handle complex conditions that are difficult to simulate.
- Helps in debugging the code.
Use of Test Harness
- Automation testing: It refers to the framework that contains the test scripts, parameters necessary to run these scripts, and gather results to analyze it.
- Integration testing: It is used to combine together two units of code that interact with each other to check whether the integrated behavior of two modules works as expected or not.
Test Harness Tools
- Junit: Tool used while using Java
- Nunit: Tool used for using the .Net framework