Testing Elixir with Test Doubles: Stubs, Mocks, and Fakes
Learn to isolate dependencies and write reliable unit tests in Elixir using Mox and modern concurrent testing patterns.
💬مدرب ذكاء اصطناعي اسأل عن أي درس واحصل على إجابة واضحة فورًا، في أي وقت.
🕐ابدأ في أي وقت بلا جداول أو مواعيد نهائية — تعلّم بوتيرتك، وقتما يناسبك.
🌐بالعربية الدروس والمهام والشهادة — كل ذلك بلغتك بالكامل.
حول هذه الدورة
Testing concurrent Elixir applications often requires isolating external services, databases, and third-party APIs. To write fast, reliable tests without hitting real external networks, you must master the art of test doubles. This text-based course guides you through the concepts and practical application of stubs, mocks, and fakes specifically tailored for the Elixir ecosystem.
You will transition from writing slow, fragile tests that rely on external state to crafting isolated, lightning-fast test suites that run concurrently without interference.
What you'll learn:
- Understand the core differences between stubs, mocks, fakes, dummies, and spies
- Configure and use the Mox library to define mock behaviors for Elixir modules
- Design clean Elixir behaviors and explicit contracts to decouple your application logic
- Implement lightweight fakes for local development and unit testing
- Manage concurrent tests safely using Mox's multi-process ownership model
- Apply modern testing patterns that align with Elixir's asynchronous nature
We begin with essential testing terminology and foundational concepts of dependency inversion. Next, you will explore step-by-step written tutorials that demonstrate how to define behaviors, swap implementations for testing, and assert on calls using Mox. Each concept is reinforced with practical code examples and conceptual walkthroughs.
This course is designed for beginner to intermediate Elixir developers who want to improve their testing practices. No advanced testing experience is required, though a basic familiarity with Elixir syntax and the Mix build tool is recommended.
Start writing robust, isolated Elixir tests today.
محتوى الدورة
ما الذي ستحصل عليه
📜شهادة إتمام أضفها إلى ملفك على LinkedIn
💬مدرّس AI شخصي عالق في دورة؟ اسأل مدرّسك المدمج أي شيء، في أي وقت.
🎧النسخة الصوتية مضمَّنة تعلَّم أثناء تنقُّلك — دون شاشة
♾️وصول مدى الحياة عُد متى شئت، بلا انتهاء
📱الهاتف أو الكمبيوتر يعمل في أي مكان وعلى أي جهاز
💸استرداد خلال 14 يومًا دون أسئلة
⚡قصير ومركَّز 2 ساعة 54 دقيقة من المحتوى التطبيقي
شهادة إتمام
كل دورة تكملها على PickAClass تُصدر شهادة كهذه — أصلية، بكودها الخاص، قابلة للتحقّق عبر الرابط، ومفصّلة عمّا أُثبت فعلًا.
P
PickAClass
ملف المهارات · قابل للتحقّق
وثيقة
شهادة إتقان
تشهد هذه الوثيقة بأن
الاسم واللقب
أثبت بنجاح إتقان
Testing Elixir with Test Doubles: Stubs, Mocks, and Fakes
المهارات المُثبَتة
✓
تحليل أنماط السلوك
تأسيسي
1.2 ساعة
✓
أطر معمارية لاتخاذ القرارات
متمكّن
1.4 ساعة
✓
تصميم اختبار A/B
متمكّن
1.7 ساعة
✓
كتابة نصوص سلوكية
متقدّم
1.9 ساعة
P
PickAClass — الاسم واللقب
Testing Elixir with Test Doubles: Stubs, Mocks, and Fakes