من الخطأ إلى اختبار الانحدار (Regression test)
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
lock in the fix with a test.
الموضوعات المخطط لها
- First write a test that reproduces the bug and fails.
- Then fix the code until the test passes.
- Choose the lowest test level that reproduces it: unit if possible, integration if it depends on the database.
- The test name describes the behavior:
acceptsOrderWithoutCoupon. - A short bug report records symptom, root cause, fix, and the test.
تفاصيل المخطط المبدئي
عرض عملي
a bug report template: Symptom, Steps to reproduce, Root cause, Fix, Regression test, Prevention.
اختبر فهمك
When do you write the regression test?
أظهر الإجابة
Before the fix, so you see it fail.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.