Difficulty: Easy
Correct Answer: Checking the logic and behavior of an individual module or program in isolation
Explanation:
Introduction / Context:
Unit testing is a core practice in quality assurance. By verifying the smallest testable parts of software—functions, classes, or modules—engineers detect defects early, document intended behavior, and enable safe refactoring. Clear understanding of unit testing distinguishes it from integration, system, and user acceptance testing.
Given Data / Assumptions:
Concept / Approach:
The essence of unit testing is isolation. Inputs are provided and outputs or side effects are asserted. External services (files, networks, databases) are simulated to keep tests deterministic and fast. This differs from system testing (end-to-end), acceptance testing (business validation), and regression testing (guarding against reintroduction of bugs). Strong unit tests reduce defect propagation to later phases where fixes are costlier.
Step-by-Step Solution:
Verification / Alternative check:
Code coverage metrics, mutation testing, and continuous integration results provide evidence that unit tests exercise the module thoroughly and consistently.
Why Other Options Are Wrong:
Common Pitfalls:
Over-mocking (tests mirror implementation not behavior), flaky tests due to hidden dependencies, and insufficient negative test cases.
Final Answer:
Checking the logic and behavior of an individual module or program in isolation
Discussion & Comments