Avoid Excessive Setup When Testing Components

lesson patterns active patterns/avoid-excessive-setup-when-dir.md View on GitHub

Avoid Excessive Setup When Testing Components

Rule

If you spend >5 chains on prerequisites (finding files, understanding pipelines, setting up dependencies), stop and identify a minimal test case. Creating mock data to test one component directly is usually faster than running full pipelines or complex setups.

Context

This anti-pattern commonly occurs when validating multi-stage pipelines or testing components that depend on outputs from earlier stages. The instinct to "do it properly" by running the full pipeline can lead to excessive setup time that delays actual progress.

Detection

Pattern

When caught in excessive setup:

  1. Stop and count: How many chains have I spent on prerequisites?
  2. Ask: "Can I create mock/minimal data to test just the component I care about?"
  3. Compare: Full pipeline setup vs. creating mock data + direct test
  4. Choose the faster path (usually mocking)
  5. Document what mock data represents for future reference

Example from evidence:

Outcome

Related

Match Keywords

spending too much time on setup 5+ chains on prerequisites need to understand full pipeline before testing excessive setup before testing component use mock data instead of full pipeline