Say it like this
- Write unit tests for this function
- The unit tests are failing
- We have good unit test coverage
Use it at work
Code review
- Can you add a unit test for this function?
- The unit tests don't cover the error case.
Debugging
- The unit test fails on CI but passes locally.
- This unit test is flaky.
Process
- All new code needs unit tests.
- Unit tests run in under a minute.
Don't say this
Unit tests are for small, isolated pieces of code, not entire systems. Use integration tests or end-to-end tests for larger scopes.
Don't mix it up
| Term | What it is | Who writes or uses it | When |
|---|---|---|---|
| unit test | Tests one small piece of code | Developers | Every function |
| integration test | Tests parts working together | Developers | Between modules |
| end-to-end test | Tests a full user flow | QA | Key journeys |
Practice
Try it
4 quick exercises
1. What would a developer say when starting work on a new function?
2. Our CI pipeline automatically _______ the unit tests whenever we push code.
3. Which sentence uses unit test incorrectly?
4. Rewrite using unit test: 'Before we send this code, we should check that each small piece works correctly by itself.'
Say it out loud
Phrase 1 of 3
"Write unit tests for this function"
We don't save your recording. The word check uses your browser's speech recognition.
More about unit test
Real examples(3)
- in a standup
"I spent yesterday writing unit tests for the login module and got 95% coverage."
- in a code review
"This is good work, but I don't see unit tests. Can you add tests for the new calculateDiscount function?"
- in a team meeting
"Our unit tests caught a critical bug in the payment processor before it reached production."
More mistakes(2)
Handle with care. Do not confuse unit tests with integration tests or end-to-end tests, which test larger components. Unit tests focus on individual functions or methods in isolation.
- ✕I am running unit test right now.✓I'm running the unit tests right now.
Unit tests are typically run as a set or suite, so use plural form or specify which tests you mean.
- ✕The unit test is not passing because the server is down.✓The unit test is failing because the server is down.
Use fail or failing rather than not passing when discussing test results.
Other forms(5)
- unit test noun
"Write a unit test for the calculateTotal function."
- unit tests noun (plural)
"All unit tests must pass before merging."
- write unit tests verb phrase
"We need to write unit tests for edge cases."
- run unit tests verb phrase
"The CI pipeline runs unit tests automatically."
- unit-test verb phrase
"This function is hard to unit-test because it calls the API directly."
Often used with(5)
- write unit tests · The most common action; developers write tests for their code
- run unit tests · Execute tests; often done automatically in CI/CD pipelines
- unit test coverage · The percentage of code covered by tests; aim for high coverage
- unit test framework · Tools like JUnit, pytest, Jest used to write and run tests
- unit tests fail/pass · Tests produce results indicating success or failure
Similar words(2)
- unit testing · The process or activity of writing and running unit tests
- atomic test · Less common term for a test of a single isolated component
Opposites(3)
- integration test
- end-to-end test
- manual test
Questions(8)
- What is a unit test, with an example?
- If add(a, b) should return a + b, a unit test calls add(2, 3) and checks the result is 5. If someone breaks the function later, the test fails and shows them.
- What is the difference between unit tests and integration tests?
- A unit test checks one piece of code alone. An integration test checks that several pieces work together, for example your code plus a real database. End-to-end tests check the whole app like a user would.
- What does "add unit tests" mean in a code review?
- The reviewer wants automated tests for the code you changed, so future changes cannot break it without anyone noticing. A typical reply is "Good call, I'll add tests for the edge cases."
- What is the difference between a unit test and an integration test?
- A unit test checks one isolated function or method in isolation, often using mocks for dependencies. An integration test checks how multiple components work together. Unit tests are faster and more focused; integration tests verify the system works as a whole.
- How do you use unit test in a sentence at work?
- You can say: Write unit tests for this feature. Run the unit tests before committing. We need better unit test coverage. The unit tests are passing. These unit tests caught a bug. Unit test frameworks like Jest and pytest make writing tests easier.
- Is unit test formal or informal?
- Unit test is neutral and professional. It is used in both casual team conversations and formal documentation. You can say it in any workplace context without sounding too formal or too casual.
- Why are unit tests important in software development?
- Unit tests catch bugs early before code reaches production. They make refactoring safer because developers know if they break something. They also serve as documentation showing how code should behave. Most companies require high unit test coverage.
- What tools do developers use to write unit tests?
- Common unit test frameworks include JUnit for Java, pytest for Python, Jest for JavaScript, NUnit for C#, and PHPUnit for PHP. These frameworks provide tools for writing, running, and reporting on unit tests.



