Lesson 2 / الدرس 2
Why software breaks / لماذا تنكسر البرمجيات
Bugs are not random misfortune. They cluster in a small number of predictable places, and knowing where those places are is most of what separates a fast tester from a thorough one.
الأخطاء ليست سوء حظ عشوائيًا. بل تتجمّع في مواضع قليلة يمكن توقّعها، ومعرفة تلك المواضع هي معظم ما يفصل المختبِر السريع عن المختبِر الدقيق.
A developer writing a feature holds one story in their head: the thing the feature is for. The code they write handles that story well, because they were looking straight at it. Everything that breaks is something they were not looking at — and people are not looking at the same few things, over and over, in every project ever built.
The places bugs live
-
Edges. Zero items, one item, the maximum, one past the maximum. The code was written for "some items" and never asked how many. الحواف. صفر عنصر، وعنصر واحد، والحد الأقصى، وواحد بعد الحد الأقصى. فالكود كُتب لـ«بعض العناصر» ولم يسأل قط: كم؟
-
Emptiness. A blank field, a user with no orders, a search that matches nothing. Empty is a real state and it is almost never the one that was drawn. الفراغ. خانة فارغة، ومستخدم بلا طلبات، وبحث لا يطابق شيئًا. فالفراغ حالة حقيقية، وهو نادرًا ما يكون الحالة التي رُسمت.
-
Repetition. Pressing the button twice. Submitting while the first submit is still in flight. Refreshing halfway through. التكرار. ضغط الزر مرتين. والإرسال بينما الإرسال الأول لم ينتهِ. والتحديث في منتصف الطريق.
-
Other people. Two users editing the same thing, or an admin deleting what someone else has open. الآخرون. مستخدمان يعدّلان الشيء نفسه، أو مسؤول يحذف ما يفتحه سواه.
-
The unhappy path. The network drops, the file is too big, the password is wrong. Failure handling is written last and tested least. المسار غير السعيد. تنقطع الشبكة، والملف أكبر من اللازم، وكلمة المرور خاطئة. فمعالجة الفشل تُكتب آخرًا وتُختبر أقل شيء.
-
Anything recently changed. A fix is new code, and new code is where new bugs are. The area around a change is the highest-yield ground on the whole product. كل ما تغيّر حديثًا. فالإصلاح كود جديد، والكود الجديد هو موطن الأخطاء الجديدة. والمنطقة المحيطة بالتغيير أخصب أرض في المنتج كله.
A bug is a disagreement, not a crash
Nothing here needs to crash to be a bug. If the page says "1 results", if a date reads 03/04 with no way to know which is the month, if an Arabic name comes out reversed — the software ran perfectly and still did the wrong thing. A bug is a gap between what was promised and what happened, and the promise is often unwritten.
<p>Showing 1 results for "test"</p>
<p>Delivery on 03/04</p>
<ul></ul>
<p>You have 0 new messages.</p>
Try it live / جرّب بنفسك
Check yourself / اختبر نفسك
1. Which area of a product is usually the highest-yield place to test?
A change is new code, and new code carries new bugs — including in the area around it that the change disturbed. Old stable code has already survived every user who met it.
2. A page displays "Showing 1 results". Nothing crashes. Is this a bug?
Running successfully and behaving correctly are different things. The product promises readable English; it delivered something a reader stumbles on. That gap is the bug, whether or not anything crashed.
3. Why is "no real user would do that" a risky reason to skip a test?
It is a guess about human behaviour dressed as a fact. Real people paste from Word, have apostrophes in their names and press back mid-payment. The cost of being wrong is a bug found by a customer instead of by you.
Score / النتيجة: 0 / 3
Your task / مهمتك
Take any page on this site and hunt one of the six places above. Build a short page reporting what you looked at, which of the six it was, and what you found — including "nothing", if that is the truth.
خذ أي صفحة في هذا الموقع وفتّش في واحد من المواضع الستة أعلاه. وابنِ صفحة قصيرة تبلّغ فيها بما نظرت فيه، وأيّ المواضع الستة كان، وماذا وجدت — بما في ذلك «لا شيء» إن كان ذلك هو الصدق.
- Names the page you looked at and which of the six places you hunted تذكر الصفحة التي نظرت فيها وأيّ المواضع الستة فتّشت
- Says what you actually did, step by step, not just what you concluded تذكر ما فعلته فعلًا، خطوة خطوة، لا ما استنتجته فقط
- States the result plainly, even when the result is that you found nothing تذكر النتيجة بوضوح، حتى لو كانت أنك لم تجد شيئًا