عرض عملي: إعادة هيكلة order saga بمساعدة الذكاء الاصطناعي مع بقاء الاختبارات خضراء
في هذا الدرس 3 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
refactor the Shop order saga orchestrator with AI. Prepares MID-072-LAB1.
تفاصيل المخطط المبدئي
خطوة بخطوة
- Confirm the tests and contract tests are green; add a characterization test for compensation.
- Prompt with goal, the saga class, its tests, and constraints; ask for a plan of small steps.
- Apply step one (extract state transitions); run tests; commit.
- Planned mistake: accept a large AI diff that also "simplifies" retry logic; a test fails because compensation order changed. Fix: reject and redo as small steps.
- Ask AI for edge-case tests; discard one that only restates the code; run mutation tests.
- Write the PR description with the prompt log and accepted and rejected suggestions.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.