Skillpedia
الاختبار75k · #2945

mutation-testing

ما الذي تفعله

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

متى تستخدمها

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

رابط المهارة

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/mutation-testing/SKILL.md

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

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

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

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

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

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

“الكود عندي له تغطية اختبارات عالية، لكنني لست متأكدًا من أن الاختبارات تلتقط الأخطاء الحقيقية. هل تستطيع إعداد اختبار الطفرات؟”

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

كيف تعمل

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

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

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

Use mutation testing to measure how well tests detect bugs

A codebase can have 90% line coverage and still ship critical bugs if tests only execute code without asserting meaningful outcomes. Mutation testing reveals these gaps by proving that your tests can distinguish correct code from subtly broken code — the standard that actually matters in production.

Quick Reference

  • Code coverage tells you which lines were executed; mutation score tells you which bugs were caught
  • Stryker injects small code changes (mutations) and checks whether tests fail — if they don't, the tests are weak
  • Aim for 80%+ mutation score on critical business logic paths
  • Run Stryker on a focused scope (one module) rather than the whole codebase to keep CI times manageable

Check

Assess whether this module has mutation testing configured and whether the mutation score on critical paths meets the project's quality threshold.

Fix

Set up Stryker for this module, run an initial mutation report, and improve tests to kill surviving mutants in the critical business logic paths.

Explain

Explain what mutation testing is, how Stryker works, and why mutation score is a more meaningful quality signal than code coverage alone.

Code Review

Review the Stryker configuration and mutation report to identify surviving mutants in critical code paths, and suggest test improvements to kill them.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/testing/mutation-testing

الأسئلة الشائعة

ما الفرق بين درجة الطفرات والتغطية؟

التغطية تُظهر الأسطر التي تم تشغيلها، أما درجة الطفرات فتُظهر الأخطاء التي التقطتها الاختبارات فعلًا.

لماذا وحدة واحدة في كل مرة؟

توصي المهارة بنطاق مركّز حتى تبقى أوقات تشغيل CI قابلة للإدارة.

ما الدرجة التي يجب أن أستهدفها؟

تقترح المهارة 80 بالمئة أو أكثر لمسارات منطق العمل الحرجة.

التفاصيل

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

Use when evaluating test quality on modules containing business logic, calculation utilities, or state machines to determine whether the tests provide genuine defect detection.

repo: thedaviddias/Front-End-Checklist

الشعبية

نجوم GitHub
75k
الترتيب
#2945
الترخيص
MIT
آخر تحديث
31‏/10‏/2026

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

0

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

التعليقات

  • …

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

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