Skip to content
IGCSE·Tuition
ICT · Lessons

Test a model with boundary inputs

A formula that works for a typical value can still fail on the exact number where a rule changes.

On this page
  1. What should you test?
  2. How to run a test, step by step
  3. Worked example
  4. The mistake to watch for
  5. Check yourself
  6. Where this leads next

Testing a model means choosing input values on purpose, working out the answer by hand, and comparing it with what the sheet shows. The values that matter most are those at the boundary of a rule, where the result switches.

This lesson follows formatting units in the module on spreadsheet modelling and charts, and uses the layout from separating inputs, calculations and outputs.

What should you test?

For every condition in the model, test three kinds of value:

  • Just below the boundary.
  • Exactly at the boundary.
  • Just above the boundary.

Also test an empty or zero input where the model divides, and an invalid input where the rule should reject it.

How to run a test, step by step

  1. List the rules in the model, such as thresholds and divisions.
  2. Write a test table with the input values and the expected result for each, calculated by hand.
  3. Enter each value into the input cell, one at a time.
  4. Compare the sheet’s result with your expected result.
  5. Fix any mismatch, then run the whole table again, because a fix can break another case.

Worked example

An invented online shop charges RM8 delivery unless the order total is RM150 or more. The total is in B2, and B3 holds:

=IF(B2>=150,0,8)

Test value in B2Expected deliverySheet result
149.9988
15000
150.0100
08 (or reject, if the task says so)8

All rows match, so the rule is correct. The point is that 150 itself was tested, because “RM150 or more” includes it.

Division test: profit margin in B6 is =B4/B5 where B5 is revenue. If B5 is 0, the sheet shows an error. The safer form is =IF(B5=0,0,B4/B5). With B4 = 156 and B5 = 300 it gives 0.52, and with B5 = 0 it gives 0.

The mistake to watch for

A common slip is to use the wrong comparison, then test only easy values.

Mistaken formula: =IF(B2>150,0,8)

Tested with 200 and 50, it gives 0 and 8, which look right. But an order of exactly 150 pays RM8, which breaks the rule.

The correction is to use >= and to include the boundary in the test table. Testing only typical values passes the faulty formula. The boundary test is the one that fails it.

Check yourself

1. The formula =IF(A1>=40,“Pass”,“Fail”) is meant to pass scores of 40 and above. What should it show for 39, 40 and 41?

Show answer

Fail, Pass, Pass. The boundary 40 passes because the rule uses >=.

2. A rule gives a student discount to ages under 18. The formula is =IF(B2<18,0.2,0). What discount does an 18-year-old get, and what do ages 17 and 19 get?

Show answer

Age 18 gets 0, age 17 gets 0.2 (20%), and age 19 gets 0. Age 18 is not under 18, so the boundary is outside the discount.

3. A cell holds =B4/B5 and B5 can be 0. Write a safer version and state its result when B4 = 50 and B5 = 0.

Show answer

=IF(B5=0,0,B4/B5). With B5 = 0 it returns 0, so no error appears.

Where this leads next

The last step is to check what the reader actually receives: check print areas and hidden rows. The read-only SQL practice lab applies the same boundary thinking to database conditions.

When tests keep passing but the marker’s values fail, a teacher in online one-to-one ICT tuition can help you build a test table before you start on the formulas.

Questions people ask

What is a boundary value?

It is the value where a rule changes, such as 150 in a rule that gives free delivery at RM150 or more. Test the boundary itself, one step below it and one step above it, because mistakes with greater-than and greater-than-or-equal show up there.

How many test values do I need?

For each rule, three are a good start: just below, at and just above the boundary. Add a zero value and an impossible value, such as a negative quantity, when the model divides or counts. Record the expected result before you read the sheet's answer.

Why should I write the expected result first?

If you look at the sheet's answer first, it is easy to believe it. Working out the expected value by hand beforehand turns the test into a real check. A mismatch then tells you exactly which formula to inspect.

Updated:

Your next step

If your sheet passes your own test but fails on the checker's values, a one-to-one teacher can help you design a test table that covers the edges first.

Paid one-hour trial at your assigned teacher’s confirmed rate, starting from RM80. You agree the teacher’s hourly rate before the trial, and ongoing lessons continue at that same rate. The schedule is arranged with your teacher after the trial.

Tuition is arranged with a parent or guardian. Send them this page on WhatsApp and they can enquire for you.

Parent or guardian? Enquire here

9,000+ students helped through our service