🎁 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

Memoization
An optimization technique that caches function results for given inputs, avoiding redundant computations for repeated calls.
Dependency Injection
A design pattern where objects receive their dependencies from external sources rather than creating them internally.
Observer Pattern
A design pattern where an object (subject) maintains a list of dependents (observers) that are notified automatically of state changes.
SOLID Principles
Five design principles for writing maintainable, flexible object-oriented code: Single Responsibility, Open-Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion.
Queue
A data structure that follows First-In-First-Out (FIFO) ordering, where elements are added at the rear and removed from the front.
Big O Notation
A mathematical notation that describes the worst-case performance of an algorithm as input size grows.
View All Programming Concepts Terms →