What is Mock (Testing)? — UK Software Development Guide

4 min readJune 2025ClickMasters Technical TeamReviewed by James Whitmore, CTO
what is a mock in software testing

Direct Answer

A mock (or mock object) is a simulated object in software testing that mimics the behaviour of a real dependency — allowing code to be tested in isolation. Mocks are typically used in unit tests to replace real dependencies (databases, APIs, external services) with controlled substitutes that return predetermined responses.

Mock-testing in the UK

Mocking has direct implications for UK compliance testing. UK government APIs (HMRC MTD, NHS Spine, GOV.UK Pay) provide sandbox environments that serve as "real mocks" — enabling integration testing without using production systems. For UK GDPR: unit tests should use mock personal data (synthetic data), not real personal data — using real customer records in test environments is a UK GDPR violation. DTAC Domain 3 expects evidence of comprehensive testing — mock-based unit tests are a key component of that evidence.

Related Glossary Terms

Get Expert Advice on Mock-testing

Speak with our UK software development experts about Mock-testing. Free consultation, transparent pricing, no obligation.