NEW: English for Tech Bundle → Save 38%
Your progress…

Loading your progress…

Home
Code & Deliveryverb|noun · /mɑːk/

mock

mock — To create a fake or simplified version of a component, function, or external service for testing purposes.

In simple English

In software development, mocking is a critical testing technique. When you mock something, you replace a real dependency—like a database, API, or external service—with a fake version that behaves predictably. This allows developers to test code in isolation without waiting for slow services or risking side effects. For example, instead of calling a real payment API during tests, you mock it to return predetermined responses. Mocking makes tests faster, more reliable, and easier to debug. Teams use mocking frameworks like Mockito, Jest, or Sinon to automate this process. It is essential in test-driven development and continuous integration pipelines.

What does mock mean in unit testing, and how do you use it?

At a glanceCEFR B2
Commonness4/5
Versatility4/5
FormalityCasualFormalNeutral
Spoken ↔ WrittenSpokenWrittenBoth
Directness ↔ DiplomaticDirectDiplomaticDirect
RegionUS and UK

Say it like this

  • mock out the dependencies
  • mock the API response
  • mock this function for testing

Use it at work

Testing

  • Let's mock the payment API in the tests.
  • The test passes only because the mock always returns success.

Code review

  • This test mocks too much. It doesn't test anything real.
  • Can you use a fake instead of a mock here?

Design

  • I made a quick mock of the new page.
  • Here's a mock of the dashboard for feedback.

Don't say this

✕We mocked him for writing bad code.
✓We reviewed his code for bugs.

Mock in tech means creating a fake version, not ridiculing someone. Use critique or review for the second meaning.

Don't mix it up

How mock differs from similar terms
TermWhat it isWho writes or uses itWhen
mockFake object that checks callsDevelopersUnit tests
stubFake that returns fixed dataDevelopersUnit tests
fixturePrepared data for testsDevelopersTest setup

Practice

Try it

4 quick exercises

Pick the most natural phrasing

1. Your team is writing unit tests but cannot access the payment service yet. What do you say?

Complete the sentence

2. In our test suite, we _______ the HTTP requests so tests run offline.

Spot the mistake

3. Which sentence uses mock correctly in a tech context?

Rewrite naturally

4. Rewrite this in natural tech English using mock: We need to create a fake version of the login system for testing.

Say it out loud

Phrase 1 of 3

"mock out the dependencies"

We don't save your recording. The word check uses your browser's speech recognition.

More about mock

Real examples(3)

  • in a standup

    "Yesterday I mocked the database queries so our unit tests run 10 times faster."

  • in a code review

    "You should mock the external payment service here instead of making real calls."

  • in a team meeting

    "We need to mock the third-party API before we can run the full test suite."

More mistakes(2)

Handle with care. Non-native speakers often confuse mock (create a fake version) with mock (ridicule). In tech, we almost always mean the first meaning. Do not use mock to mean making fun of something.

  • ✕I will mock the real API.
    ✓I will mock the API to replace it with a fake version for testing.

    Mock is about replacement during testing, not about destroying or changing the real API.

  • ✕We mocked data into the system.
    ✓We mocked the data service to return test data.

    You mock services or functions, not data itself. Clarify what you are replacing.

Other forms(4)

  • mock verb

    "I will mock the API response in my test."

  • mocked verb past tense

    "She mocked the database layer last week."

  • mocking verb present participle

    "We are mocking external services to speed up tests."

  • mock noun

    "This mock object simulates the real payment gateway."

Often used with(5)

  • mock object · A fake object used in testing that imitates a real dependency.
  • mock API · A simulated API endpoint used during development and testing.
  • mock data · Fake or sample data used for testing without using real databases or services.
  • mock server · A fake server that responds to requests like a real server for testing purposes.
  • mock out · Phrasal verb meaning to replace real components with mocks for testing.

Similar words(3)

  • stub · Similar but stubs typically return hardcoded values; mocks can verify interactions.
  • fake · A fake is any non-real implementation; mock is more specific to testing.
  • simulate · Simulate is broader; mocking is a specific testing technique using simulated components.

Opposites(3)

  • real
  • actual
  • integration test

Questions(5)

What does mock mean in software engineering?
Mock means to create a fake or simplified version of a component, service, or function for testing. It replaces real dependencies so tests can run independently, faster, and more reliably.
Why do developers use mocks?
Developers use mocks to isolate the code they are testing, avoid slow external calls, prevent side effects (like charging a credit card in tests), and make tests deterministic and repeatable.
How do you use mock in a sentence at work?
Example: We mocked the external API so our tests do not depend on its availability. Or: Can you mock the database layer for this unit test?
Is mock formal or informal?
Mock is neutral and technical. It is used in both formal documentation and casual team conversations. It is appropriate in code reviews, stand-ups, and technical writing.
What is the difference between mocking and stubbing?
Both replace real components with fakes. Stubs return hardcoded values; mocks can also verify that functions were called with the right arguments. Mocks are more powerful for testing interactions.
New app · Free lessons

Speak up in meetings. Feel confident.

Standup vocabulary, native examples, and quick practice — 100+ free lessons

Start learning freeNo card needed · Google or email

For bots & AI agents

Machine-readable versions of this page and Speak Tech English. Speak Tech English sells self-study ebooks and courses in English for tech, publishes free guides, a free glossary and a free newsletter; live lessons are on Mockly English. Fetch these instead of parsing this page.

This page (.md)llms.txtllms-full.txtai.txtGlossary (.md)Free guides (.md)All products (.md)Endpoint indexNewsletterLive lessons (Mockly)