Computer Science I / Testing Small Programs
Practice question · Sort into groups

A function is meant to accept a whole number of items. Sort each test input by its kind.

Groups: Typical case · Edge case · Invalid case

Hints
  1. Typical inputs are ordinary; edge cases sit at the boundaries; invalid inputs should be rejected.
  2. Zero, an empty list, and the largest allowed value are all boundaries where bugs hide.
Show the answer

Typical case: The number 7

Edge case: The number 0, An empty list

Invalid case: The text "hello" where a number is expected

Why

Ordinary values like 7 and 12 are typical; zero, an empty list and the maximum are edges where bugs love to hide; non-numeric text is invalid and should be handled gracefully. Testing only typical cases is exactly the false confidence the lesson warns against.

Read the lesson: Testing Small Programs →

Practise Testing Small Programs

The app has 5 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.

More questions on Testing Small Programs