AI engineering glossary · Python advanced

What is unit test?

Unit test: A small automated check that runs one piece of code, such as a function, in isolation and verifies its result against an expected value. Suites of them catch regressions when code changes.

Level: beginnerTopic: Python advanced

Unit test: an example

assert add(2, 3) == 5 is a unit test checking that add returns 5.

Related terms

More Python advanced terms

Where you learn it

Unit test is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.