યુનિટ ટેસ્ટિંગ કોડના વ્યક્તિગત યુનિટ્સ (ફંક્શન્સ, મેથોડ્સ, ક્લાસેસ)ને અલગતામાં ચકાસે છે — દરેક નાના ભાગ પોતાના પર સાચીરીતે કામ કરે છે તેની તપાસ કરે છે. યુનિટ ટેસ્ટ્સ ઝડપી, કેન્દ્રિત હોય છે, અને સારી ટેસ્ટિંગ સ્ટ્રેટેજીનો આધાર બનાવે છે.
યુનિટ ટેસ્ટ શું છે
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
