انتقل إلى المحتوى
أمين أبوزيد
JNR-054

استكشاف الأخطاء وإصلاحها

  • 6 درس
  • 3 ساعة تدريب (تقدير)
في هذه الصفحة 8 موضوعات

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

نظرة عامة

الموضوعات

  • قراءة السجلات
  • إعادة إنتاج الأخطاء
  • تتبّع المكدس (Stack traces)
  • اختلافات البيئات

تعلّم أولًا

3 ساعة تدريب (تقدير)

مخرجات التعلم

  1. Reproduce a reported bug reliably, locally or in a test.
  2. Read logs and stack traces from a deployed service to localize a failure.
  3. Identify environment differences (config, data, versions) that explain "works on my machine".
  4. Write a short bug report with root cause, fix, and a regression test.

الدروس

  1. 01منهجية لاستكشاف الأخطاء
  2. 02السجلات وتتبّع المكدس (Stack traces) في الإنتاج
  3. 03اختلافات البيئات
  4. 04من الخطأ إلى اختبار الانحدار (Regression test)
  5. 05طلب المساعدة بشكل جيد
  6. 06عرض عملي: تشخيص عطل في الإنتاج من السجلات

المختبر والتمارين

Lab

JNR-054-LAB1 · Break the Shop

Outcomes: 1–4 · Time: ~3 h The instructor injects three faults into a deployed Shop (bad config, data-dependent bug, dependency change). Diagnose each with only logs and the codebase. Acceptance: root cause, fix, and regression test for each.

Exercises (assessment: live troubleshooting session)

IDOutcomeTask
JNR-054-EX011From the report "checkout sometimes fails", write the steps and data needed to reproduce it reliably.
JNR-054-EX021Reproduce a given bug locally in a failing test before looking for the fix.
JNR-054-EX032Given a 30-line stack trace with three "Caused by" sections, name the root cause and the first line in your own code.
JNR-054-EX042Using logs, find the first error for request id abc123 and explain the sequence.
JNR-054-EX053Build a comparison table of local versus production for config, data, and versions and mark the likely culprit for a given symptom.
JNR-054-EX064Write a bug report with symptom, root cause, fix, and regression test for a bug of your choice.
JNR-054-EX074Rewrite a poor help request ("it doesn't work, please help") into a good one.
أظهر الحلول
  • EX01 List the user, data (for example an order without coupon), sequence of calls, and environment; confirm it fails every time.
  • EX02 The test builds the data from the report, asserts the expected behavior, and fails for the same reason as the report.
  • EX03 The last "Caused by" is the root cause; the first frame with your package (for example com.shop...) shows where.
  • EX04 Filter logs by the request id; read the lines in time order up to the first ERROR.
  • EX05 For example a missing environment variable in production explains a startup failure; a null column in production data explains a data-dependent failure.
  • EX06 Use the template: Symptom, Steps, Root cause, Fix, Regression test, Prevention.
  • EX07 "Order API returns 500 for orders without a coupon on staging; works locally. Error and logs attached. I checked Java and env vars. Next I will compare data."
  • Common mistakes (fixing without reproducing, changing several things at once) are assessed in the live session.

الاختبار

Outcomes: O1 reproduce · O2 logs and stack traces · O3 environment differences · O4 bug report and regression test.

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

  1. 1What comes first when troubleshooting?O1
  2. 2Why change one thing at a time?O1
  3. 3In a stack trace, the root cause is usually:O2
  4. 4A correlation (request) id helps to:O2
  5. 5Which should never be logged?O2
  6. 6"Works on my machine" is often caused by differences in:O3
  7. 7To check what is really running in production, verify:O3
  8. 8The regression test should be written:O4
  9. 9A good bug report includes:O4
  10. 10A good help request includes:O4

الجزء العملي

Seven exercises JNR-054-EX01 to EX07 plus the lab; assessed in a live troubleshooting session. Pass: quiz 8/10, at least five exercises correct, and root cause, fix, and regression test for each of the three lab faults.

أخطاء شائعة

Fixing without reproducing; changing several things at once.

التقييم

Live troubleshooting session.

الصلة بالمسار الوظيفي

Incident handling (MID-050) and advanced troubleshooting (SRC-015).

اكتب للبحث في المستويات والمراحل والوحدات والدروس.