Course Process

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

  1. To automate the testing process.
  2. To execute a set of test conditions within the framework
  3. To generate test reports
  4. To record the test results for each one of the tests
  5. Helps the developers to measure code coverage at a code level
  6. To organize a run time environment
  7. To enhance the quality of software components and application

 

Features of Test Harness

  1. Executes test suite in the framework
  2. Provide flexibility and support for debugging
  3. Assists in measuring the code coverage at the code level.
  4. Enters test data to an application under test
  5. Captures the output from the software under test
  6. Records test results

 

Benefits of Test Harness

  1. Increased productivity of the system by automating the tests.
  2. Improved quality of software.
  3. Provides Tests that can be scheduled.
  4. Helps to handle complex conditions that are difficult to simulate.
  5. Helps in debugging the code.

 

Use of Test Harness

  1. Automation testing: It refers to the framework that contains the test scripts, parameters necessary to run these scripts, and gather results to analyze it.
  2. 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

  1. Junit: Tool used while using Java
  2. Nunit: Tool used for using the .Net framework