CIE IGCSE | 7.6.1 Normal and Abnormal Test Data

Lesson objective

Select and justify normal and abnormal test data, state expected results and compare actual behaviour with the requirements.

Learn

7.6.1 | NORMAL AND ABNORMAL TEST DATA

01 | RUNNING ONCE IS NOT ENOUGH

You build a program that receives a mark from zero to fifty. You enter 34 and see “Mark accepted”. Does that prove the program works?

It shows evidence for one accepted input. It does not show whether 500 is rejected, whether an empty entry is handled or whether letters cause the program to crash.

Test data is data deliberately chosen to check a system’s behaviour. Good testing includes both inputs that should be accepted and inputs that should not.

The syllabus distinguishes normal, abnormal, extreme and boundary data. This lesson focuses on normal and abnormal. The next lesson examines the accepted endpoints and nearby rejected values in detail.

The important habit is to predict the required behaviour first, then compare the program’s result with that prediction.

02 | READ THE REQUIREMENTS BEFORE CHOOSING VALUES

A value is not normal or abnormal in isolation. Its category depends on the requirements of the field or task being tested.

For this worked form, the mark must be supplied, must be a whole number and must lie from zero to fifty inclusive. A whole-number mark of 34 is acceptable; 500 is outside the permitted range.

For a temperature system, a negative number may be entirely acceptable. For an order quantity that must be from one to twenty, a negative quantity is unacceptable. Do not assume that negative always means abnormal.

Write down the rule, data type and expected response to failure. If the required behaviour is rejection with another input request, your test should check both the message and the retry, not only that the value was not stored.

When an example’s assumptions are limited to numeric input, non-numeric text is outside that small algorithm’s stated scope. Do not silently treat it as a fully implemented form.

03 | NORMAL DATA: ORDINARY ACCEPTABLE INPUT

Normal test data is valid data within the accepted requirements, used to check ordinary operation. For the mark form, 34 is a useful normal value.

The expected result is that it is accepted and used correctly. If the system stores the mark, it should store 34 against the intended student, not another value or record.

Normal does not mean “whatever people enter most often” or “the average value”. It means a suitable valid input for the task. Several different ordinary valid values may be useful tests.

For an exact six-character code requiring two uppercase letters and four digits, AB1234 is normal data. For an order quantity from one to twenty, 8 is normal data.

Accepted endpoints also meet the rules, but they are more specifically useful as extreme or boundary tests. Use a clearly ordinary interior value when a question asks for a normal example.

04 | ABNORMAL DATA: INPUT THAT SHOULD NOT BE ACCEPTED

Abnormal test data is data that does not meet the specified requirements. It is used to check the system’s handling of unacceptable input.

For the whole-number mark form, 500 violates the range. A value of 12.5 violates the whole-number rule. Text “hello” is not a numeric mark, and an empty required field violates presence.

These are different reasons for rejection. Testing only 500 does not exercise the type or presence handling.

A complete form must define safe handling for each case
Data for full mark formCategoryReason
34NormalSupplied whole number inside the range
500AbnormalOutside the accepted range
12.5AbnormalNot a whole number
helloAbnormalNon-numeric text
Empty entryAbnormalRequired value missing

The expected behaviour is a controlled response under the requirements, such as an explanatory message and a request to re-enter. A crash is not a successful rejection.

Choose clearly out-of-range values for introductory abnormal examples. The next lesson specifically examines values just outside the limits as boundary cases.

05 | A TEST CASE NEEDS MORE THAN AN INPUT

A test case describes the situation being checked. It includes the data, any required starting state and the expected result.

For a simple mark form, input 34 with the expected result “accept and store mark 34” may be enough to state the essential case. For a booking system, input alone is insufficient: whether a booking should be accepted depends on existing bookings and capacity.

A test record adds the actual result observed when the program runs and a conclusion such as pass or fail.

Planned cases for the full form; actual results recorded later
CaseInputExpected result
Normal mark34Accept and store 34 against the intended student
Abnormal range500Reject; no invalid storage; request replacement
Abnormal type12.5Reject under the whole-number rule; request replacement
Abnormal presenceEmptyShow required-field message; do not proceed

Expected results come from the requirements before running the test. Actual results are observations from the test run. They must not be invented or copied from the expectation column.

The table above is a proposed plan. It does not claim the tests have already been performed.

06 | WHY REJECTION CAN MEAN THE TEST PASSED

A test passes when the actual behaviour matches the expected behaviour. That includes correct rejection of abnormal input.

If the form is required to reject 500 and ask again, and it does exactly that, the test passes. “Input rejected” does not mean “test failed”.

If the form accepts 500, the abnormal test fails. If it crashes without the required handling, it also fails.

Correctly rejecting abnormal input can be a passing test
InputExpectedIllustrative actualTest outcome
34AcceptAccepted correctlyPass
500Reject and retryRejected and retriedPass
500Reject and retryAccepted and storedFail
helloControlled type rejectionUnhandled crashFail

The actual results in this table are illustrative observations, not a report of a real deployed form.

Be precise about the level you are discussing: an input can fail validation while the system passes its rejection test.

07 | TRACE A RANGE RETRY BEFORE TESTING IT

This small pseudocode component expects every input to be a whole number and checks only the permitted range.

DECLARE Mark : INTEGER
// Assume each entry is a whole number
REPEAT
    INPUT Mark
    IF Mark < 0 OR Mark > 50
      THEN
        OUTPUT "Enter a mark from 0 to 50"
    ENDIF
UNTIL Mark >= 0 AND Mark <= 50
OUTPUT "Accepted: ", Mark

With input 34, the UNTIL condition is true immediately and the algorithm outputs “Accepted: 34”. With 500 followed by 34, the first input produces the retry message; the second meets the condition and is accepted.

For this component, 500 is abnormal because it violates the range assumption being checked. Letters and fractional text require additional input handling in a complete form, which this snippet does not implement.

A trace predicts what the instructions do. A test run checks the implemented behaviour. Comparing both with the requirements can help reveal whether the code or the intended rule needs attention.

08 | USE DIFFERENT ABNORMAL CASES FOR DIFFERENT RULES

A student code must be supplied and contain exactly two uppercase letters followed by four digits. AB1234 is a normal example.

AB123 has too few characters. AB12C4 puts a letter in a digit position. ab1234 violates the specified uppercase rule. Empty text violates the required-field rule.

Two uppercase letters followed by four digits
CodeCategory under the pattern rulesExpected
AB1234NormalAccept pattern
AB123Abnormal lengthReject
AB12C4Abnormal formatReject
ab1234Abnormal case ruleReject
EmptyAbnormal presenceReject

These tests exercise different failure conditions. State which rule each case violates rather than simply calling all of them “wrong”.

AB9999 may pass the pattern. Whether it is registered is a separate requirement. It becomes an unacceptable test input for a record-existence check only when you know that it is not a registered code and the system requires a registered code.

09 | STATE MATTERS IN A BOOKING TEST

The club has capacity three and allows each student one booking. Before each independent test, specify its accepted-booking collection.

With S104 and S205 booked, a request from S306 should be accepted. With the same starting records, a request from S104 should be rejected as a duplicate.

With S104, S205 and S306 booked, a request from S407 should be rejected because the session is full.

Independent states; rejection need not mean malformed identifier data
Starting accepted IDs (capacity 3)RequestExpected
S104, S205S306Accept; add S306; zero places remain
S104, S205S104Reject duplicate; records unchanged
S104, S205, S306S407Reject full session; records unchanged

A rejected request does not necessarily contain abnormal field data. S407 can be a perfectly valid identifier but a booking cannot be accepted in that starting state. Describe this as a rejection-path scenario rather than assuming every rejection is caused by malformed input.

This distinction keeps data categories separate from business decisions. A format check tests the code; booking rules also depend on stored state.

10 | KEEP TESTS INDEPENDENT OR RECORD THEIR SEQUENCE

If accepting S306 fills the club, a later booking test no longer starts from the original two-booking state. That change can alter its expected result.

For independent cases, reset the system to the stated starting records before each run. Alternatively, intentionally test a sequence and record how each step changes the state for the next.

Do not mix these approaches without explanation. A result may look wrong because the starting state differs from the test plan, not because the program’s logic is wrong.

For the mark retry, a test of 500 followed by 34 is deliberately a sequence: the rejection leads to replacement input. The test checks that both actions occur in the right order.

A repeatable test includes enough information for another person to recreate the situation and compare the same required behaviour.

11 | CHOOSE DATA THAT REVEALS MISTAKES

Suppose a total-and-count program receives three inputs of one. The total and count both equal three, so that data can hide an update that adds one instead of the input amount.

Inputs 4, 7 and 2 are more revealing: their total is 13 while their count is 3. These are normal data if they meet the input rules, but they distinguish two possible behaviours.

Likewise, one normal mark tests acceptance but not rejection. Several abnormal marks violating the same upper limit may add less evidence than cases covering range, type, presence and retry separately.

Test data should be selected for a reason. The goal is meaningful coverage of requirements and likely errors, not the largest possible table of repetitive inputs.

12 | CHECK OUTPUTS AND CHANGES TO STORED DATA

An error message is only part of the result. If the form rejects 500 but still saves it, the system has not met the rejection requirement.

For a normal mark, check the accepted value and record association. For an abnormal mark, check that unacceptable data is not used or stored and that the user can supply a replacement as required.

For a booking rejection, confirm that the accepted-booking count and identifiers remain unchanged. A duplicate should not create another accepted record.

A good expected result can therefore include output, data changes and control flow: “Display the range message, leave the stored mark unchanged and request replacement input.”

Use the level of detail appropriate to the system and the question. Do not claim that displaying the right message alone proves all required behaviour.

13 | EXPLAIN AND JUSTIFY YOUR CHOICE

If asked to give normal data, supply a concrete value such as 34 for a whole-number mark from zero to fifty. If asked to explain why it is suitable, state that it meets the type and range and exercises ordinary acceptance.

For abnormal data, give 500 and explain that it exceeds the upper limit, so the system should reject it and request a permitted replacement.

A useful test statement is: “Use 12.5 because the field requires an integer. The expected result is controlled rejection of the fractional entry rather than accepting it as a whole mark.”

Avoid vague examples such as “a normal number” or “incorrect data”. State the rule, the specific input and the expected response.

14 | WHAT NORMAL AND ABNORMAL TESTS DO NOT PROVE

Passing these tests gives evidence for the cases exercised. It does not prove that every possible input and every combination of state will behave correctly.

You still need accepted endpoints, values next to the limits and other relevant paths. Those extreme and boundary cases are the focus of the next lesson.

Testing also differs from validation and verification. Validation checks an input rule during operation; verification checks copying or entry. Testing deliberately supplies cases to check whether the system performs its required behaviour.

You should now be able to choose normal and abnormal data, justify each case and distinguish the validity of the input from the success of the test.

MATCH THE TESTING TERM

Terminology

Terminology

Test data

Data deliberately chosen to check a system’s behaviour.

Normal test data

Ordinary valid data meeting the specified requirements.

Abnormal test data

Data that does not meet the specified requirements.

Requirement

Something the system must do or a condition it must satisfy.

Test case

A stated situation, data and expected behaviour used to check a requirement.

Starting state

The records or conditions present before a test begins.

Expected result

What should happen according to the requirements.

Actual result

What is observed during a test run.

Pass

The actual behaviour matches the required expected behaviour.

Fail

The actual behaviour does not match the required expected behaviour.

Controlled rejection

Handling unacceptable input with the required response rather than an unhandled crash.

Retry

Requesting replacement input after rejection.

Independent case

A test run from its own specified starting state.

Sequential test

A series of actions whose earlier changes affect later starting states.

Coverage

The requirements, conditions and paths exercised by the chosen tests.

Boundary data

Values at and just outside acceptance limits, studied in the next lesson.

Validation

Checking input against specified acceptability rules.

Verification

Checking copying or entry as intended.

Questions

Questions

CHECK YOUR UNDERSTANDING

Select all correct choices. Each exact set earns one point.

1. Which is ordinary normal data for a required whole mark from zero to fifty?
2. Which are abnormal for that full form?
3. A test is expected to reject 500 and retry. It does so. What is the test result?
4. Which distinguish expected and actual results?
5. Why include several types of abnormal input?
6. Which statements about booking tests are correct?
7. Which should be checked after rejected input?
8. Which statements about data categories are correct?

EXPLAIN AND COMPARE

Write your answers before revealing each sample.

1. Define normal and abnormal test data.

2. Give and justify one normal and two different abnormal inputs for the mark form.

3. Explain why correctly rejecting abnormal input is a passing test.

4. Compare expected and actual results.

5. Explain why a single successful normal test is insufficient.

6. Explain why starting state must be recorded for a booking test.

7. Suggest a test for type handling and state the expected result.

8. Explain why a rejected valid identifier is not necessarily abnormal field data.

DESIGN IT | TEST AN ORDER QUANTITY

A required order quantity must be a whole number from one to twenty. The form should reject unacceptable input, explain the rule and allow re-entry without storing the rejected value. Propose one ordinary normal value and abnormal cases for range, type and presence. State expected results; leave actual results for a real test run.

Reveal a possible plan

Normal: eight, accepted and stored as eight. Abnormal range: fifty, rejected as outside one to twenty. Abnormal type: two point five or text three, rejected under the integer rule. Abnormal presence: empty field, required-field message. Each rejection should leave valid stored data unchanged and allow replacement input. A later actual observation determines whether each test passed.

Flashcards

Flashcards

Click to flip. Select the ideas you need to revisit.

0 cards selected for revision.

    Selections are kept while this page is open.

    Workbook

    Workbook

    COMING SOON

    The workbook for 7.6.1 Normal and Abnormal Test Data is coming soon. Complete the matching task and written questions in your exercise book.