Skillpedia
الاختبار81k · #1701

tdd-workflow

ما الذي تفعله

توجّه هذه المهارة دورة التطوير المدفوع بالاختبار بأسلوب مدرسة لندن، حيث تُحاكى الاعتماديات أولًا. وهي موجهة إلى المطورين الذين يريدون بناء الميزات خطوة بخطوة والاختبارات تقودها.

متى تستخدمها

  • ✓عندما تريد بناء ميزة بالاختبار أولًا، من الخارج إلى الداخل.
  • ✓عندما تريد روتينًا واضحًا للأحمر والأخضر وإعادة الهيكلة لسلوك جديد.
  • ✓عندما تريد التحقق من نتائج الاختبارات النهائية قبل اعتبار المهمة منتهية.

رابط المهارة

https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-testgen/skills/tdd-workflow/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-testgen/skills/tdd-workflow/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“ابنِ حساب الخصم بالاختبار أولًا، وابدأ باختبار فاشل لخدمة التسعير الوهمية.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

تكتب المهارة اختبارًا فاشلًا باعتماديات وهمية، وتشغّله لترى فشله للسبب الصحيح، ثم تكتب أبسط كود ينجح، ثم تعيد الهيكلة. وقبل الإبلاغ عن النجاح، تشغّل الاختبارات المستهدفة واختبارات الانحدار وتسجل النتائج الفعلية.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

Follow the TDD London School (mock-first) approach:

  1. Write the failing test first -- define expected behavior with mocked dependencies
  2. Run the test -- confirm it fails for the right reason
  3. Implement minimal code -- make the test pass with the simplest solution
  4. Refactor -- clean up while keeping tests green
  5. Repeat -- add the next behavior

Before starting: mcp__plugin_ruflo-core_ruflo__hooks_pre-task({ description: "TDD: FEATURE_NAME" }) Before reporting the outcome, run the final target tests and the regression suite after the last edit. Record the actual commands, exit codes, whether tests ran, and failing test names. The initial red test is expected during TDD; only the final validation determines success.

Call mcp__plugin_ruflo-core_ruflo__hooks_post-task with the observed result, including when the task is abandoned or validation is interrupted. Set completed, targetTestsRan, and regressionTestsRan to true only when observed; use null for missing exit codes. Skipped or unrun validation is not success. Never substitute an expected result for an observed one.

The following example maps those observations to the hook input (tool-call notation):

const success = completed && targetTestsRan && regressionTestsRan
  && targetExitCode === 0 && regressionExitCode === 0;
mcp__plugin_ruflo-core_ruflo__hooks_post-task({
  taskId: "tdd-FEATURE",
  success,
  storeResults: true,
  task: JSON.stringify({
    feature: "FEATURE",
    targetCommand, targetExitCode, targetTestsRan,
    regressionCommand, regressionExitCode, regressionTestsRan,
    failingTestNames,
    failureReason: success ? null : failureReason
  })
});

On failure, report success: false and the failing test names in task. If the runner failed before identifying tests, or the task was abandoned, state that reason instead of inventing test names.

Principles:

  • Mock external dependencies at boundaries
  • Test behavior, not implementation
  • One assertion per test when possible
  • Descriptive names: should [behavior] when [condition]
الأسئلة الشائعة

هل الاختبار الفاشل الأول مشكلة؟

لا. يقول المصدر إن الاختبار الأحمر الأول متوقع في هذه المنهجية، ولا يقرر النجاح إلا التحقق النهائي.

ماذا يُعد نجاحًا؟

يجب أن تعمل اختبارات الهدف ومجموعة الانحدار وتنجح كلها. والاختبارات المتخطاة ليست نجاحًا.

هل تسجل النتائج؟

نعم. تبلغ المهارة نتيجة المهمة إلى خطافات الذاكرة مع النتائج المرصودة.

التفاصيل

الوصف الأصلي من المؤلف

TDD London School workflow -- mock-first, outside-in test development

repo: ruvnet/ruflo

الشعبية

نجوم GitHub
81k
الترتيب
#1701
الترخيص
MIT
آخر تحديث
2‏/11‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة