Lesson 6 / الدرس 6
Choosing the data / اختيار البيانات
Most testers type asdasd and move on. The data you choose is the test — the steps are only how you deliver it — and there are a handful of values that break more software than everything else combined.
معظم المختبِرين يكتبون asdasd ويمضون. والبيانات التي تختارها هي الاختبار — وما الخطوات إلا كيفية تسليمها — وثمّة قيم قليلة تكسر من البرمجيات أكثر مما يكسره كل ما عداها مجتمعًا.
A test case with weak data is a strong-looking case that finds nothing. asdasd in a name field proves the field accepts letters, which nobody doubted. The interesting values are the ones the developer never pictured while writing the code, and there is a short list of them that works on almost any field you will ever meet.
asdasd في خانة اسم تثبت أن الخانة تقبل الحروف، وهذا لم يشك فيه أحد. والقيم المثيرة هي التي لم يتصورها المطوّر وهو يكتب الكود، ولها قائمة قصيرة تصلح لأي خانة تلقاها تقريبًا.The values worth trying on almost anything
| Value | What it usually exposes |
|---|---|
| Empty | Required-field handling, and code that assumed something was there |
| One character | Minimum-length rules nobody wrote down |
| Very long — 500 characters | Layout breaking, and database columns that silently truncate |
| Leading and trailing spaces | Values stored untrimmed, so " sara" and "sara" become two users |
| Arabic text in a Latin field | Encoding, direction, and fonts that fall back |
| O'Brien — an apostrophe | Escaping, in both the database and the page |
| <b>bold</b> — a tag | Whether your input is rendered as markup somewhere later |
| 0, -1, and 999999 | Numbers assumed to be positive, small, and present |
Eight values. Run them against any text field and you will out-test most people who have been doing this for a year.
<form>
<label>Full name <input maxlength="200"></label>
<button>Save</button>
</form>
<p>Try, in order: nothing · a · 500 characters ·
" sara" with a leading space · O'Brien ·
<b>bold</b> · سارة</p>
Data has to be repeatable
The other half of the job is that your data must still work next month. A case that says "use my account" breaks when you leave. A case that uses today's date passes in March and fails in February. Write the values into the case; where a value must be fresh — a new email each run — say how to make one, not just that you need one.
Try it live / جرّب بنفسك
Check yourself / اختبر نفسك
1. Why is a trailing space worth testing in a name or email field?
It is invisible on screen and decisive in a database. A user who signs up with a trailing space and later signs in without one is a real support ticket on a real number of sites.
2. Why must you never test with a real customer's data?
Test environments are less protected than production and more widely accessible. Moving a real name, email or card number into one is the incident itself, regardless of intent.
3. A test case says "use today's date". What is the risk?
A case must give the same answer whenever it runs. "Today" quietly changes the input, so a failure in February and a pass in March tell you nothing about the software.
Score / النتيجة: 0 / 3
Your task / مهمتك
Pick any form on any site and run all eight values from the table against one of its fields. Report what you typed, what happened, and — separately — what the value looked like when the page showed it back to you.
اختر أي نموذج في أي موقع وأجرِ القيم الثماني كلها من الجدول على واحدة من خاناته. وبلّغ بما كتبت، وماذا حدث، و — منفصلًا — كيف بدت القيمة حين أعادت الصفحة عرضها عليك.
- A table with a row for each of the eight values جدول فيه صف لكل واحدة من القيم الثماني
- Each row records what happened on submit and what was shown back afterwards كل صف يسجّل ماذا حدث عند الإرسال وماذا عُرض بعدها
- None of the data belongs to a real person لا تخصّ أيٌّ من البيانات شخصًا حقيقيًا