Test Harness
A test harness is a collection of software, tools, drivers, stubs, and supporting components used to execute and evaluate automated tests.
“A collection of drivers and test doubles needed to execute a test suite.”
(Definition reproduced from the ISTQB Glossary. Copyright belongs to ISTQB.)
View the complete ISTQB GlossaryWhat is Test Harness?
It provides the infrastructure needed to control test execution, simulate dependencies, and verify outcomes.
Execution support: Coordinates test runs and reporting.
Dependency simulation: Includes stubs, drivers, or mocks.
Automation infrastructure: Simplifies repeatable testing.
Real World Example
A team automates tests for a payment microservice that depends on an external bank API, a fraud-detection service, and a message queue.
Calling those real external systems on every automated test run is slow, costly, and in the bank API's case, not even safe to do repeatedly — but without something standing in for them, the suite can't run in CI at all.
The team builds a Test harness: test doubles that return controlled, predictable responses in place of the bank API and fraud service, plus a driver that invokes the microservice the way a real caller would, so the whole suite runs repeatably without touching live external systems.
The team catches a regression in the payment retry logic on every commit, in seconds, because the harness's stubbed fraud service can be told on demand to return a decline response — something that would be slow and risky to trigger against the real, live service.
Practice Questions
Question 1
A team needs to run automated tests for a payment microservice, but calling the real external bank API and fraud-detection service on every test run is slow, costly, and risky. What should the test harness provide to solve this?
Question 2
Which of the following BEST describes the purpose of a test harness?
Test your knowledge with real ISTQB-style questions
You’ve learned Test Harness. Test your understanding with topic-specific questions in our Mock Exams.