THINK FIRST·CODE LATER

← All labs

Design the tests for "hide after 3 reports"

Problem

Requirement MOD-2 (from Chapter 4), with details agreed with the TAs:

When a post receives reports from 3 different students enrolled in the course, the system shall hide the post from students within 1 minute and add it to the moderation queue. A student cannot report their own post, and reports from TAs/instructors are not counted (they can hide posts directly). A student can report the same post only once; a second report by the same student is ignored. A post that a moderator restored can be hidden again only by 3 new reports (earlier reporters do not count again).

Design a test suite:

  1. Equivalence partitions and boundaries for the number of valid reports.
  2. A decision table for whether a single report counts.
  3. State-based tests covering hide → restore → hide again.
  4. At least 12 test cases in total, each with preconditions, input and expected result.
  5. Mark which tests are unit, integration or system tests, and say which double (stub/fake/mock/spy) you would use for the notification and the clock.

Work it out on paper, in a document or here, then compare with the model answer. Your answer stays in your browser — it is never sent to or stored on the server.