Lesson 13 / الدرس 13
Steps to reproduce / خطوات إعادة الإنتاج
A bug that cannot be reproduced gets closed, however real it was. Reproducing is a skill with a method: find the shortest path back to the failure, from a starting point anyone can reach.
الخطأ الذي لا يمكن إعادة إنتاجه يُغلق، مهما كان حقيقيًا. وإعادة الإنتاج مهارة لها منهج: أن تجد أقصر طريق يعود إلى الإخفاق، من نقطة بداية يبلغها أي أحد.
You saw it. You are certain. But the report you file says "sometimes the total is wrong", the developer cannot make it happen, and three weeks later it is closed as "cannot reproduce" — and the bug is still there, waiting for a customer. The failure was real; the report was not usable. Those are different problems and only one of them is yours to solve.
Start from somewhere anyone can stand
Your session had an account with eleven orders, a coupon applied two hours ago and a tab left open since morning. The developer has none of that. Steps that begin "on my account" or "with the basket I had" cannot be followed. Begin from a state that can be created from nothing — a fresh account, an empty basket, a signed-out browser — and build up from there in steps that are all written down.
Then take steps away
-
Reproduce it once, writing down everything you did — twelve steps, however clumsy. أعد إنتاجه مرة، واكتب كل ما فعلت — اثنتا عشرة خطوة، مهما كانت خرقاء.
-
Remove one step. Try again. Still broken? The step was not needed — leave it out. احذف خطوة. أعد المحاولة. أما زال معطوبًا؟ إذن لم تكن الخطوة لازمة — فاتركها.
-
Repeat until every remaining step is necessary. Twelve becomes four, and those four are a description of the bug rather than of your afternoon. كرّر حتى تصير كل خطوة باقية لازمة. فتصير الاثنتا عشرة أربعًا، وتلك الأربع وصف للخطأ لا لعصر يومك.
-
The steps you removed are worth a sentence too: "does not require a coupon" saves the developer testing that theory. والخطوات التي حذفتها تستحق جملة أيضًا: «لا يتطلب قسيمة» توفّر على المطوّر اختبار تلك الفرضية.
<h4>First attempt — 9 steps</h4>
<ol>
<li>Sign in</li><li>Search "shoes"</li><li>Filter by size</li>
<li>Open a product</li><li>Add to basket</li><li>Go back</li>
<li>Add a second product</li><li>Open the basket</li><li>Change quantity to 2</li>
</ol>
<h4>Reduced — 3 steps</h4>
<ol>
<li>Open /product/44 signed out</li>
<li>Add to basket</li>
<li>In the basket, change quantity to 2</li>
</ol>
<p><strong>Not required:</strong> signing in, searching, a second product.</p>
Some bugs will not reproduce every time, and that is information rather than failure. Say so plainly and precisely: "3 of 10 attempts" is a usable sentence; "sometimes" is not. An intermittent bug reported honestly with a count is far more actionable than a confident report that turns out to be wrong.
Try it live / جرّب بنفسك
Check yourself / اختبر نفسك
1. Why should steps to reproduce start from a state created from nothing?
Every unstated part of your starting state is a step the reader cannot take. Beginning from nothing and building up in written steps is what makes the path walkable by someone who was not there.
2. What is the value of listing the steps you removed while reducing?
"Does not require signing in" eliminates a whole area of the code before anyone opens it. The negative information is often worth more than the positive steps, and it costs you one sentence.
3. You saw a bug once and cannot make it happen again. What should you do?
An honest one-off report warns the team and costs nobody a day. Overstating it buys attention once and spends the credibility you will need every time after that.
Score / النتيجة: 0 / 3
Your task / مهمتك
Take the bug you reported in the last lesson and reduce it. Show the first attempt, the reduced version, and a line naming what turned out not to be required.
خذ الخطأ الذي أبلغت عنه في الدرس السابق واختصره. أظهر المحاولة الأولى، والنسخة المختصرة، وسطرًا يذكر ما تبيّن أنه غير لازم.
- Both versions shown: the first attempt and the reduced one النسختان معروضتان: المحاولة الأولى والمختصرة
- A line naming the steps that turned out not to be required سطر يذكر الخطوات التي تبيّن أنها غير لازمة
- How many times out of how many attempts it reproduced كم مرة من كم محاولة أُعيد إنتاجه