Lingua-e
← Glossary

What does "mock" mean in programming?

mock is one of the most common terms in software development. This guide explains what it means, how it is used in practice, and why it matters, with real examples from the developer world.

Definition

A fake object used in tests to replace a real dependency. Mocks let you test a component in isolation, control what the dependency returns, and verify how the component interacts with it.

Example

"Mock the external API so the test passes without making a real network call."

Word forms

FormTypeMeaningExample
mocknounA fake object used in tests to replace a real dependency"Use a mock for the email service so tests do not send real emails."
mockverb (infinitive)To replace a real dependency with a fake one in tests"Mock the payment API to avoid charging real cards during testing."
mockedpast tenseAlready replaced with a fake object for testing"The database calls are mocked so the test runs without a real database."
mockinggerundThe act of replacing real dependencies with fakes in tests"Mocking external services keeps unit tests fast and predictable."

Related terms

Ready to practice your English at work?

Lingua-e has interactive exercises built around real developer conversations: standups, code reviews, retrospectives, and more. Practice until it comes naturally.

Try Lingua-e for free