Subscribe by Email


Tuesday, April 24, 2012

What is a Test Harness?


Test harness is a rarely heard concept in the field of software testing. 

What is a Test Harness?
- A test harness is known by other name “automated test framework”. 
- A test harness can be defined simply as a collection of test data and softwares that have been configured in order to test a unit of a software program.
- The program is run under various conditions. 
- Under each condition the behavior as well as working of the program is observed and the outcomes are reported. 

Phases of Test Harness Process

The whole process of test harness is completed in two individual phases:
1.        Test execution engine and
2.        Test script repository

How is Test Harness carried out?
- Test harness process cannot be carried out without the automation of the tests. 
- The automated tests than can themselves call the concerned functions with the required parameters and execute them.
- The actual results are then compared to the expected results. 
- The process of test harness acts as a hook for the already developed code which is highly testable and can be checked out using an automation framework or test harness.  

What should a Test Harness do?
The below mentioned are the things that a test harness must do:
1. Run specific tests in order to allow optimization.
2. Orchestrate an environment during the run time.
3. Analyze the results

Certain objectives have been defined for a test harness:
1. Automation of the whole testing process.
2. Execution of the specified test cases.
3. Report the outcomes.

Advantages of a Test Harness
Test harness is quite an advantageous process and some of its advantages have been stated below:
1.  It increases productivity by automating the whole test process.
2.  It increases the probability of the occurrence of the regression testing.
3.  It increases the quality of the components of the software system and application.
4.  It helps ensure the similarity of the subsequent as well as the previous test cases.
5.  It helps in running the tests at any time whenever the testing staff is not available.
6. It effectively executes the test scripts including the conditions that are otherwise unexecutable since they are difficult to be simulated.

How Test Harness facilitate testing at Integration level?

- Test harness has also been developed to facilitate the testing at the integration level i.e., the integration testing. 
- The test stubs tested by a test harness are components of an application that is currently under development and during testing they are replaced by the working components of the developed application in the top down design. 
- Test harness serves as an external aid to the software system or application under testing by simulating functionalities and features which are not present in the immediate test environment.
- In other words, the test harness helps in providing substitutes in case any functionality is found to be missing during the test. 
- The same test harness when kept outside from the source code of the software system or application, it can be used for multiple projects again and again. 
- It forms a deliverable part of the project. 
- The test harness is not provided with any knowledge of test cases, test suites and test reports since it has the capability of simulating the functionality.
- The information on these aspects is fed to the test harness via associated automated testing tools and a testing framework. 
- A test harness can also have a graphical user interface for the ease of operation, logging and scripting of the test cases.
- A new test harness is written for each run time and language since it becomes very much difficult to write a test harness which will work across all the languages and run times.  
- Test harness generates the application which is required to run the tests by providing the required code, files, and test cases and so on.


No comments:

Facebook activity