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.

The values worth trying on almost anything

ValueWhat it usually exposes
EmptyRequired-field handling, and code that assumed something was there
One characterMinimum-length rules nobody wrote down
Very long — 500 charactersLayout breaking, and database columns that silently truncate
Leading and trailing spacesValues stored untrimmed, so " sara" and "sara" become two users
Arabic text in a Latin fieldEncoding, direction, and fonts that fall back
O'Brien — an apostropheEscaping, in both the database and the page
<b>bold</b> — a tagWhether your input is rendered as markup somewhere later
0, -1, and 999999Numbers 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 &middot; a &middot; 500 characters &middot;
&quot; sara&quot; with a leading space &middot; O&#39;Brien &middot;
&lt;b&gt;bold&lt;/b&gt; &middot; سارة</p>
One field, seven attempts. Watch what the box lets you type, what it does when you submit, and — the part most people skip — what the value looks like when it is shown back to you afterwards.

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 / جرّب بنفسك

Preview / المعاينة

Check yourself / اختبر نفسك

1. Why is a trailing space worth testing in a name or email field?

2. Why must you never test with a real customer's data?

3. A test case says "use today's date". What is the risk?

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 لا تخصّ أيٌّ من البيانات شخصًا حقيقيًا
How do you want to submit? / كيف تريد التسليم؟