Unit testing code की अलग-अलग units (functions, methods, classes) को isolation में सत्यापित करती है — यह जाँचना कि प्रत्येक छोटा हिस्सा अपने आप सही ढंग से काम करता है। Unit tests तेज़, केंद्रित होते हैं, और एक अच्छी testing strategy की नींव बनाते हैं।
एक unit test क्या है
A UNIT test verifies the smallest testable piece (a function/method) in ISOLATION:
→ test ONE thing; give inputs, check the output/behavior
→ ISOLATED from dependencies (database, network, other units) — mock/stub those
→ FAST (no real I/O), focused, deterministic
