Skillpedia
الاختبار95k · #1315

test-driven-development

ما الذي تفعله

توجّه هذه المهارة الذكاء الاصطناعي في التطوير المدفوع بالاختبار: كتابة اختبار يُظهر المشكلة أولا، ثم إجراء إصلاح صغير. وهي موجهة للمطورين الذين يريدون دليلا على أن التغيير يعمل.

متى تستخدمها

  • ✓عندما تريد بناء ميزة جديدة مع كتابة اختبار أولا.
  • ✓عندما تحتاج إلى إصلاح عطل وإثباته باختبار يفشل أولا.
  • ✓عندما تغيّر سلوكا وتريد تجنب كسر الاختبارات الموجودة.

رابط المهارة

https://github.com/odysseus-dev/odysseus/blob/dev/resources/skills/general/test-driven-development/SKILL.md

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

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

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

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

استخدم هذه المهارة لمساعدتي: https://github.com/odysseus-dev/odysseus/blob/dev/resources/skills/general/test-driven-development/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

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

“أصلح العطل الذي يتسبب فيه نتائج البحث الفارغة في تعطل الصفحة. اكتب اختبارا يفشل أولا، ثم أصلح.”

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

كيف تعمل

يقرأ الذكاء الاصطناعي الشيفرة والاختبارات الموجودة، ويكتب أصغر اختبار يُظهر السلوك المتوقع ويتأكد من فشله. ثم يجري أصغر تغيير ينجح الاختبار، ويراجع الفروقات.

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

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

When to Use

Use when implementing a feature, fixing a bug, or changing behavior where a regression test can define the expected result. Prefer this workflow for parser, routing, agent-loop, and UI behavior changes.

Procedure

  1. Inspect the relevant code, existing tests, and local conventions before editing.
  2. Write the smallest regression test that demonstrates the requested behavior or reproduces the bug.
  3. Run that test and confirm it fails for the expected reason, not because the test setup is broken.
  4. Make the smallest production change that makes the test pass.
  5. Run the focused test again, then run the surrounding module suite.
  6. Review the diff for unrelated changes, brittle assertions, hidden state, and missing error paths.
  7. Report the tests run and any remaining coverage or environment limits.

Pitfalls

  • Do not write a test that only mirrors the implementation; assert the user-visible contract.
  • Do not weaken an assertion just to make a failing test pass.
  • Do not skip the focused failing-test step when the behavior is observable in a local test.
  • Keep network, filesystem, and model calls deterministic with fakes or fixtures unless the integration itself is under test.

Verification

  • The new regression test fails before the fix and passes after it.
  • The relevant focused suite passes.
  • The broader suite passes or its failure is explained with evidence.
  • The final diff contains the test and the production change needed for the same behavior.
الأسئلة الشائعة

لماذا يجب أن يفشل الاختبار أولا؟

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

هل يستطيع إضعاف الاختبار ليمر؟

لا. تقول المهارة إنه لا يجوز إضعاف تأكيد لمجرد جعل اختبار فاشل ينجح.

كيف تُعالج طلبات الشبكة في الاختبارات؟

تُبقيها المهارة متوقعة بمحاكيات أو تجهيزات، إلا إذا كان الاتصال نفسه هو ما يُختبر.

التفاصيل

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

Build or fix software with a focused red-green-refactor loop

repo: odysseus-dev/odysseus

الشعبية

نجوم GitHub
95k
الترتيب
#1315
الترخيص
AGPL-3.0
آخر تحديث
2‏/11‏/2026

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

0

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

التعليقات

  • …

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

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