Skip to content

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.

AI chatbot

Still have questions?

Ask the AI chatbot about this term or another AI concept.

Up to 500 characters.

Ask LATHIC about AI. Relevant glossary entries may be included.

Your question, the glossary entries it matches, and a rotating pseudonymous identifier go to Microsoft Azure’s OpenAI service through Vercel AI Gateway to generate an answer. Zero retention and no training are required of the provider, and LATHIC does not save your question or answer. Privacy Notice