BDD & TDD / Quiz

Where the Unit Ends

Unit or integration is not about folder names. Draw the boundary by what the test touches, and decide what deserves mocking.

Difficulty
Medium
Format
Quiz
Points
150
Estimate
10 min

// MISSION BRIEF

Your Mission

"Is this a unit test?" starts more team arguments than tabs vs spaces. This quiz pins the definitions to something useful: what the test touches, how fast and deterministic it is, and where mocking helps versus where it lies.

Scoring: timed quiz; accuracy first, speed bonus for fast clean runs.

// FIRST CONTACT

Battle teaser

The most useful working definition of a unit test:

  1. AA test that covers exactly one function
  2. BAny test in the /unit folder
  3. CFast and deterministic, exercising code in isolation from out-of-process dependencies (DB, network, filesystem)
  4. DA test written before the code
Answers, scoring, hints, and the full battle stay sealed.

// SKILL TAGS

unit-testingintegration-testingmockingtest-strategy