🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

Programming Concepts Beginner

What is Unit Testing?

Testing individual components or functions of a program in isolation to verify they work correctly.

Unit tests verify that individual functions, methods, or classes produce correct output for given inputs. They run fast, test in isolation (using mocks/stubs for dependencies), and provide immediate feedback when code breaks.

Popular frameworks include pytest (Python), JUnit (Java), Jest (JavaScript), and PHPUnit (PHP). Test-Driven Development (TDD) writes tests before implementation. Good tests are independent, repeatable, and cover edge cases.

Related Terms

SOLID Principles
Five design principles for writing maintainable, flexible object-oriented code: Single Responsibility, Open-Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion.
Concurrency
The ability of a program to manage multiple tasks that can make progress during overlapping time periods.
Stack vs Heap
Two memory regions: the stack stores function call data with automatic cleanup, while the heap stores dynamically allocated objects.
Garbage Collection
An automatic memory management process that identifies and reclaims memory no longer in use by a program.
Memoization
An optimization technique that caches function results for given inputs, avoiding redundant computations for repeated calls.
Clean Code
Code that is easy to read, understand, and maintain — following consistent conventions, meaningful naming, and single-responsibility functions.
View All Programming Concepts Terms →