Glossary Updates12 new terms added to the glossaries · October 2, 2026, 22:44 CEST
AI TechDocKnowledge

Glossary · Automation software engineering and architecture

Mock object

Also known as: Mock

German: Mock-Objekt

In software testing, a mock object is a test double that replaces a real dependency and checks that the code under test calls it in the expected way, for example with the right arguments and number of calls.

  • Software engineering

In one sentence

A mock object is a test double that replaces a dependency and verifies that the code under test calls it as expected.

Example

A unit test of the valve control function block uses a mock of the output module to check that the close command is sent exactly once after the timeout.

How it applies

  • Engineering: Mocks let a Unit test run without hardware, fieldbus or database. They work best when dependencies are injected through interfaces, see Dependency injection.
  • Verification: A mock checks interactions, not the real behavior of the dependency. Tests with mocks must therefore be complemented by Hardware-in-the-loop tests or integration tests on real components.
  • Documentation: Test specifications should state which dependencies are mocked, so reviewers and assessors can judge what a passed test actually demonstrates.

Mock vs. stub

Both are kinds of Test double. A stub only returns prepared answers so the test can run; a mock additionally verifies how it was called. Teams often use the word mock for both.

By knowledge.aitechdoc.world · Published September 26, 2026 · Last reviewed

Source: AI TechDoc Knowledge editorial definition, based on common software testing practice

Definitions follow the cited standards and specifications. Where a source is a copyrighted publication, such as an ISO, IEC or EN standard, the definition is a close paraphrase, not a verbatim quotation, so as not to infringe copyright. We recommend reading the original publication. The sections “How it applies” are editorial commentary by AI TechDoc Knowledge and are not part of any standard.

Seen a mistake? Send us a note!