Coding & Software AI
Unit test
A small automated test that checks one function or component in isolation.
Example
A unit test checks that one pricing function returns the expected result for a discount.
Why it matters
It gives quick feedback when a small part of the software changes.
You'll hear it
“This check should catch the incorrect calculation on its own.”
Can you control it?
Sometimes
Sometimes. Some products or workflows let you influence a unit test, while others keep it fixed or manage it automatically. Check the settings and documentation for the tool you are using.
Common questions
- Does passing unit tests prove the complete application works?
- No. Parts can work separately and still interact incorrectly.
- Can a test make the same mistaken assumption as the code?
- Yes. A poorly chosen expected answer can approve incorrect behavior.
- Should every test depend on outside services?
- No. Isolated checks often replace outside dependencies so they remain focused and repeatable.