KatInterview

Testing a Leaf-Counting System

BehavioralModel answer
MediumModel answerBehavioraltestingqatest-strategy

Last updated

Design a comprehensive test strategy for a system that counts leaves on a large tree, addressing ambiguity, test oracles, functional coverage, and scale.

You're designing a test plan for a system that counts leaves on a large tree.

This prompt is intentionally vague. Your task includes determining what the system actually does before creating tests for it.

Consider these angles:

  • What type of system is this? A computer vision application analyzing photos of real trees, or software that traverses a tree data structure?
  • What level of precision is required? Must the count be exact, or is approximation within some margin acceptable?
  • What does "large" mean in this context? Are there constraints on processing time or memory usage?
  • What form do inputs and outputs take? Images, node streams, a single integer, detailed breakdowns?

Provide a structured test strategy that demonstrates how you'd validate this system's correctness and reliability.

Hints

Hint 1

Start by asking questions to narrow down what you're actually testing—the system type determines everything else about your strategy.

Hint 2

Think about how you'll establish correct answers (your test oracle) for different scenarios—this varies significantly between physical and logical trees.

Hint 3

Consider the full spectrum: happy paths, edge cases, error conditions, performance under load, and what quality bar must be met before release.