Computer Science I / Testing Small Programs
Practice question · Select all that apply

A function takes a list of numbers. Select every input that is an edge case worth testing.

Hints
  1. Edge cases sit at boundaries: empty, single-element, first, last, or maximum.
  2. Two of the options are ordinary typical inputs, not boundaries.
Show the answer
  • C. An empty list
  • D. A list with exactly one element
  • E. A list containing the largest allowed value
Why

An empty list, a single-element list and the largest value are all boundaries where bugs cluster. The two ordinary five- and three-number lists are typical cases, useful, but not the boundaries where most real bugs surface.

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