Back to interactive practice

Written practice

Trace, Test And Debug Responses

Write your response first, check it against the checklist, then reveal the model answer.

Task 1: Testing

Boundary Condition Explanation

Scenario

A program should classify a study session as balanced when total minutes are from 30 to 60 inclusive. A student tests 45 minutes only.

Your prompt

Explain why this testing is incomplete and name at least two additional test values.

Self-check

  • Mentions boundary testing
  • Uses 30 and 60
  • Explains why 45 alone is not enough
  • Uses scenario language

Task 2: Debugging

Counter Debugging

Scenario

A program repeats three times and should count balanced sessions. The code inside the IF statement says `balancedCount <- 1`.

Your prompt

Identify the error type and explain the correction.

Self-check

  • Names logical error
  • Explains that the program resets or overwrites the count
  • Gives corrected counter update
  • Links to loop behaviour

Task 3: Validation

Validation Recommendation

Scenario

A program asks for study minutes. The user accidentally enters -10.

Your prompt

Explain how validation could improve the program.

Self-check

  • Identifies negative minutes as invalid
  • Explains a validation rule
  • Explains effect on accuracy
  • Gives a practical response