یونٹ ٹیسٹنگ کوڈ کی انفرادی یونٹس (functions، methods، classes) کو الگ تھلگ انجام دیتے ہوئے تصدیق کرتی ہے — یہ چیک کرتے ہوئے کہ ہر چھوٹا ٹکڑا اپنے آپ میں صحیح طریقے سے کام کرتا ہے۔ یونٹ ٹیسٹس تیز، مرکوز ہوتے ہیں، اور ایک اچھی ٹیسٹنگ حکمت عملی کی بنیاد بناتے ہیں۔
یونٹ ٹیسٹ کیا ہے
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
