GRADE 8 · COMPUTING · UNIT 1 · LESSON 1.44

Computational thinking and programming

Choose representative and boundary tests

Read a little. Try the workbook. Check your answers. Choose one section below to get started.

Topic 1.44 · Choose representative and boundary tests8 fillable worksheet pagesRead at your own pace

LET’S TRACE, REASON AND TEST

Choose representative and boundary tests

Representative tests cover ordinary behaviour; boundary tests examine edges; invalid tests check rejected input. Categories can overlap. A wrong quiz answer may still be valid input if its format is allowed.

Today’s two goals
  • Expose a missing equality case and distinguish data categories against a specification.
  • Explain my method and support it with a labelled trace, example or test record.
Original PaxaKids illustration for Choose representative and boundary tests. Use the supplied program and data models for precise workbook facts.
An original PaxaKids workbook scene. Use the supplied programs and data for precise workbook facts.

Work through an example

For an allowed integer range 1 to 6 inclusive, 3 is an ordinary valid value; 1 and 6 are valid boundaries; 0 and 7 are invalid values just outside the boundaries.

Try before your workbook

Is the upper boundary 6 valid or invalid under that stated range, and why?

Explore the clues

Tap one card to find out more.

Understand the idea

Representative tests cover ordinary behaviour; boundary tests examine edges; invalid tests check rejected input. Categories can overlap. A wrong quiz answer may still be valid input if its format is allowed.

Concept to practise: Choose representative and boundary tests.

Work through an example

For an allowed integer range 1 to 6 inclusive, 3 is an ordinary valid value; 1 and 6 are valid boundaries; 0 and 7 are invalid values just outside the boundaries.

Try before your workbook

Is the upper boundary 6 valid or invalid under that stated range, and why?

Check my readiness thinking

It is valid because the range includes 6. Describe both the boundary position and its expected acceptance rather than treating all boundary values as invalid.

Your original programs and learning models

These original PaxaKids program and data models support your workbook. Some examples deliberately contain faults to investigate. Follow their headings and preserve exact code case, punctuation and order. Traces and supplied records are not claims of physical testing.

Choose tests that can reveal different mistakes

A program may work for one input and fail for another. Repeating an ordinary example is not enough to investigate a change at a limit. Choose representative accepted cases, rejected cases and values at or near the boundaries.

Expected behaviour comes from the specification. Do not copy a program’s output into the expected column and assume it is correct. A justified test can reveal that a condition excludes a value that should be included.

Find a missing equality in a fictional rule

Specification: for valid positive whole-number ages, a fictional club accepts age 14 or younger and declines older ages. The deliberately flawed program below uses less than 14. Write the expected final message from the rule and the message produced by tracing this code.
Find a missing equality in a fictional rule — original model
Age inputExpected from ruleProduced by flawed code
8{'clue': 'Exact message', 'prompt': 'Expected eligibility 8', 'answers': ['May join']}{'clue': 'Exact message', 'prompt': 'Flawed result 8', 'answers': ['May join']}
20{'clue': 'Exact message', 'prompt': 'Expected eligibility 20', 'answers': ['Cannot join']}{'clue': 'Exact message', 'prompt': 'Flawed result 20', 'answers': ['Cannot join']}
14{'clue': 'Exact message', 'prompt': 'Expected eligibility 14', 'answers': ['May join']}{'clue': 'Exact message', 'prompt': 'Flawed result 14', 'answers': ['Cannot join']}
Original Paxa deliberately flawed example
age = int(input("Fictional age: "))
if age < 14:
    print("May join")
else:
    print("Cannot join")

Correct the condition and retest around it

Use <= to include equality. The corrected code still assumes a positive integer age; it is not a general age-validation program. Check the neighbouring values 13, 14 and 15, then recheck the earlier representative cases.
Flawed condition
age = int(input("Fictional age: "))
if age < 14:
    print("May join")
else:
    print("Cannot join")
Corrected condition
age = int(input("Fictional age: "))
if age <= 14:
    print("May join")
else:
    print("Cannot join")

State both boundaries of an integer range

New specification: accept whole-number integer inputs from 1 through 100 inclusive; reject values outside that range. For integer boundary testing, use 0, 1, 2 and 99, 100, 101 to check immediately outside, at and immediately inside each limit. These are two local number lines, not one continuous scale.
State both boundaries of an integer range — original labelled workbook model. The following text version gives its labels and values.
State both boundaries of an integer range · original PaxaKids model.
Read this model’s labels and values

Classify acceptance and boundary status separately

Use Yes or No in each column. Here Boundary means one of the six specifically chosen cases 0, 1, 2, 99, 100 and 101. Accepted means an integer within 1–100 inclusive. These properties can overlap.
Classify acceptance and boundary status separately — original model
InputAccepted?Boundary case?
0{'clue': 'Yes or No', 'prompt': 'Accepted range 0', 'answers': ['No']}{'clue': 'Yes or No', 'prompt': 'Boundary status 0', 'answers': ['Yes']}
1{'clue': 'Yes or No', 'prompt': 'Accepted range 1', 'answers': ['Yes']}{'clue': 'Yes or No', 'prompt': 'Boundary status 1', 'answers': ['Yes']}
37{'clue': 'Yes or No', 'prompt': 'Accepted range 37', 'answers': ['Yes']}{'clue': 'Yes or No', 'prompt': 'Boundary status 37', 'answers': ['No']}
99{'clue': 'Yes or No', 'prompt': 'Accepted range 99', 'answers': ['Yes']}{'clue': 'Yes or No', 'prompt': 'Boundary status 99', 'answers': ['Yes']}
100{'clue': 'Yes or No', 'prompt': 'Accepted range 100', 'answers': ['Yes']}{'clue': 'Yes or No', 'prompt': 'Boundary status 100', 'answers': ['Yes']}
101{'clue': 'Yes or No', 'prompt': 'Accepted range 101', 'answers': ['No']}{'clue': 'Yes or No', 'prompt': 'Boundary status 101', 'answers': ['Yes']}

Select useful examples and be precise about categories

Normal data usually means representative accepted data. Invalid data does not meet the stated acceptance rules, such as an out-of-range integer or a wrong input form. Boundary data checks transitions and can also be accepted or invalid.

An older age can be well-formed integer input but fail the fictional club’s eligibility rule. Always state which requirement a category describes. Sampling several cases does not prove every possible case.

Files for this activity

Use these original PaxaKids practice files with the matching workbook. Work on a local copy in the appropriate editor. Some examples deliberately contain faults to investigate; a downloaded file is not a completed practical test.

Paxa the Fox

Try one step with Paxa!

Trace code in the stated order and preserve exact spelling and case. Use fictional data. Label a prediction, paper trace, simulator run and physical-device test separately; an unperformed test stays Pending. Save personal responses before leaving.

Our Unit 1 learning path
  1. Lesson 1.1: Recall algorithms and representations
  2. Lesson 1.2: Purpose and conventions of pseudocode
  3. Lesson 1.3: Input, output and strings
  4. Lesson 1.4: Identifiers and assignment
  5. Lesson 1.5: Arithmetic and translation
  6. Lesson 1.6: Trace and review a sequence
  7. Lesson 1.7: Conditions and two-way flow
  8. Lesson 1.8: IF THEN and indentation
  9. Lesson 1.9: IF THEN ELSE and decision diagrams
  10. Lesson 1.10: Ordered ELSEIF and fallback ELSE
  11. Lesson 1.11: Match flowchart and pseudocode branches
  12. Lesson 1.12: AND, OR and NOT
  13. Lesson 1.13: Grouping, precedence and review
  14. Lesson 1.14: Why software searches
  15. Lesson 1.15: A successful linear search
  16. Lesson 1.16: An unsuccessful search and termination
  17. Lesson 1.17: Practise and communicate the search
  18. Lesson 1.18: Translate conditions into Python
  19. Lesson 1.19: One-branch IF programs
  20. Lesson 1.20: Two-way IF ELSE programs
  21. Lesson 1.21: Ordered ELIF choices
  22. Lesson 1.22: Ranges and independent decisions
  23. Lesson 1.23: Boolean operators in Python
  24. Lesson 1.24: Design and test recommendations
  25. Lesson 1.25: Trace, debug and reflect
  26. Lesson 1.26: Choose data types and recognise Boolean literals
  27. Lesson 1.27: Set and use Boolean flags
  28. Lesson 1.28: Explain and identify constants
  29. Lesson 1.29: Express constants in three algorithm forms
  30. Lesson 1.30: Use a fixed factor in a calculation
  31. Lesson 1.31: Cast to Boolean and validate an empty response
  32. Lesson 1.32: Recall calls and trace return values
  33. Lesson 1.33: Supply parameters and reuse library code
  34. Lesson 1.34: Choose and import libraries responsibly
  35. Lesson 1.35: Round with floor and ceiling
  36. Lesson 1.36: Use pi and investigate another mathematical feature
  37. Lesson 1.37: Generate random choices within bounds
  38. Lesson 1.38: Investigate random real values and review library use
  39. Lesson 1.39: Retrieve test tables and predict selection outcomes
  40. Lesson 1.40: Decompose everyday problems
  41. Lesson 1.41: Decompose programs and organise shared work
  42. Lesson 1.42: Develop through repeated build/test cycles
  43. Lesson 1.43: Predict and verify algorithm outcomes
  44. Lesson 1.44: Choose representative and boundary tests
  45. Lesson 1.45: Build, execute and review a test plan
  46. Lesson 1.46: Recall physical inputs and compare transmission media
  47. Lesson 1.47: Configure a radio group and agree a message scheme
  48. Lesson 1.48: Send and receive numbers and strings
  49. Lesson 1.49: Trace numeric message sequences
  50. Lesson 1.50: Transmit text and use received data in conditions
  51. Lesson 1.51: Diagnose and extend a message protocol
  52. Lesson 1.52: Review communication and evidence of testing
  53. Lesson 1.53: Project 1: Adventure story
  54. Lesson 1.54: Project 2: Fire, Water, Earth
  55. Lesson 1.55: Check your progress 1
For grown-ups: using this lesson

Your answers are checked in your browser. Open responses need grown-up review and are shown separately from the automatic score. Check your work, then use “Retry answers to practise” to revisit mistakes while keeping correct responses.

Read one explanation, discuss the model and try the readiness check before the workbook. Choose “Mark lesson finished” when ready. Optional account progress saves lesson position and completion across devices; save personal responses before leaving.

2. Fill in your workbook

Read the teaching and complete workbook instructions. Choose, write or draw; Answer list offers larger controls. Trace code precisely and distinguish predictions from actual tests. Review designs, explanations and drawings with a grown-up.

Choose representative and boundary tests8 student pages · original artwork

Opening your PDF…

Swipe sideways across the worksheet on a small screen, or use “Answer list” for larger controls.

TAKE YOUR PRACTICE OFFLINE

3. Download the student worksheet

All 8 original A4 student pages, ready for pencil-and-paper practice. Choose Review Answers to check your work on this webpage.

Student worksheet only · PDF · 8.2 MiB · No answer key included

Download worksheet PDF ↓

TRY FIRST, THEN CHECK TOGETHER

Download the student worksheet →

4. Answers & guidance

Finished your try? Open the guide and compare one worksheet at a time. Your own words may be different and still explain the right idea.

Shown on this webpage only. There is no answer-key download, and this guide is left out when printing the page.

Show answers for all 8 worksheets

Worksheet 1

  1. Question 1: What defines the expected result of a test? the stated requirement or specification
  2. Question 2: Why include a value exactly at a limit? it may expose a missing equality case

Worksheet 2

  1. Question 3: Expected eligibility 8 May join
  2. Question 4: Flawed result 8 May join
  3. Question 5: Expected eligibility 20 Cannot join
  4. Question 6: Flawed result 20 Cannot join
  5. Question 7: Expected eligibility 14 May join
  6. Question 8: Flawed result 14 Cannot join

Worksheet 3

  1. Question 9: Which comparison operator includes less than and equal to? <=
  2. Question 10: For age 14, write the corrected final message. May join
  3. Question 11: For age 15, write the corrected final message. Cannot join
  4. Question 12: Why retest age 13 after the repair? to check that a previously accepted nearby case still works

Worksheet 4

  1. Question 13: Which pair is just outside the accepted integer range? 0 and 101
  2. Question 14: Is 100 accepted by this specification? yes, the upper endpoint is included

Worksheet 5

  1. Question 15: Accepted range 0 No
  2. Question 16: Boundary status 0 Yes
  3. Question 17: Accepted range 1 Yes
  4. Question 18: Boundary status 1 Yes
  5. Question 19: Accepted range 37 Yes
  6. Question 20: Boundary status 37 No
  7. Question 21: Accepted range 99 Yes
  8. Question 22: Boundary status 99 Yes
  9. Question 23: Accepted range 100 Yes
  10. Question 24: Boundary status 100 Yes
  11. Question 25: Accepted range 101 No
  12. Question 26: Boundary status 101 Yes

Worksheet 6

  1. Question 27: Which supplied integer is an ordinary interior accepted case: 37 or 150? 37
  2. Question 28: Which supplied integer is outside 1–100: 37 or 150? 150
  3. Question 29: Can a boundary test also be invalid under the acceptance rule? yes, such as 0 or 101 here

Worksheet 7

  1. Question 30: Use the fictional club specification and the flawed page 2 program. Predict results for ages 8, 20 and 14 before tracing or running it. Record the expected and produced messages separately and explain the mismatch at 14. Make the page 3 repair and retest 13, 14 and 15 plus the earlier representative cases. Keep both code versions, predictions, paper traces and actual outputs or Pending. Explain why testing only below and above the limit missed the error. Expected ages 8 and 14: May join; age 20: Cannot join. Flawed age < 14 accepts 8, rejects 20 correctly but wrongly rejects 14. Repair age <= 14. Corrected 13 and 14: May join; 15 and 20: Cannot join; 8 remains May join. Valid positive whole-number scope retained, no real age data needed. Distinct specification-based predictions, flawed observations or paper traces, preserved failure, changed source and actual retests or Pending. Explain exact-limit equality coverage; do not claim finite passing cases prove universal correctness. Grown-up review; personal evidence is required.

Worksheet 8

  1. Question 31: For the page 4 integer specification, prepare a test-selection table with an input, reason, acceptance status, category labels and expected message Accept or Reject for each case. Include the six stated boundary inputs plus useful interior and further out-of-range examples. Explain that some labels overlap and why repeated ordinary inputs miss boundary defects. Compare selections with a partner if available or review individually; retain feedback or peer exchange Pending and a justified revision. Plan actual execution for the next lesson. Clear integer 1–100 inclusive specification. Required boundary cases 0 Reject, 1 Accept, 2 Accept, 99 Accept, 100 Accept, 101 Reject; representative interior such as 37 Accept and further outside such as -8 or 150 Reject. Normal/invalid and boundary labels may overlap; each row has a reason and predicted message before execution. Wrong-form entries may be proposed as additional invalid tests only with an explicit validation requirement, not assumed handled by the eligibility example. Actual partner comparison or individual review with peer exchange Pending, useful revision and next-step execution plan. No learner run is claimed in this planning task. Grown-up review; personal evidence is required.
Back to my workbook ↑

Curriculum & workbook reference

Computing for your homeschool day

Explore Choose representative and boundary tests with this free Grade 8 Computing lesson. Read one idea together, try the fillable workbook and return to review at your own pace. Download the same student worksheet PDF for pencil-and-paper practice.

Fit learning around your family’s day. There is no timer and no sign-up is needed to use the lesson. An optional account saves your lesson position and completion across devices. Workbook responses and drawings stay in this tab; save a copy of your responses before leaving.

Understand your results

Closed answers are checked in your browser. Drawings and written explanations need grown-up review and are shown separately from the automatic score. Check your work, then use “Retry answers to practise” to revisit mistakes while keeping correct responses.

Choose Review Answers after trying the activity. The guide stays on the webpage; the worksheet download contains only the student pages.

For programme background, visit the Cambridge Lower Secondary Computing overview. PaxaKids provides independent original companion practice.

Book page references identify the related teaching topic. File-management and responsible-data preparation are original PaxaKids material; orientation or contents pages are not presented as teaching citations for those skills. The explanations, characters, programs and exercises here are original PaxaKids companion practice. Practical tasks require the appropriate editor and, where applicable, suitable equipment. A design or paper trace is not a verified hardware result. Only completed, reviewed lessons are listed.

Explore the Cambridge Lower Secondary Computing curriculum for programme background. PaxaKids is an independent learning resource.