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.