Pyramid or portfolio? Pyramid guides cost distribution; portfolio maps specific product risks to cheapest sufficient fidelity, including hardware/performance/security/production.
Unit versus integration? Isolated functional unit versus multiple real collaborators/boundary behavior; define team terminology explicitly.
Why not E2E everything? Slow, brittle, difficult diagnosis/data/environment; move decisions to narrow tests and keep critical wiring journeys.
When fake versus mock? Stateful reusable behavior versus verifying an interaction contract; prefer observable outcomes unless call itself matters.
Why can fake be dangerous? It may omit SQL/server/scheduler semantics; run shared contracts and real adapter tests.
What makes concurrency testable? injected scheduler/dispatcher/clock, structured scopes, explicit state/events, no sleeps/global work.
runTest benefit? structured test scope, shared scheduler, virtual delays, child exception/leak handling.
Why can StateFlow test hang? Infinite collection is a child of runTest; use finite operators or cancellable backgroundScope collector.
Why subscribe to stateIn(WhileSubscribed) in test? Upstream may remain inactive without collector even when reading current value.
How test Room migration? Export schemas, create each supported old version with representative data, migrate/validate schema and semantic data/indexes.
MockWebServer value? Verifies actual HTTP request/serialization/error/timeout behavior without an external environment.
Espresso versus UI Automator? In-app synchronized View interaction versus cross-app/system UI automation.
Robolectric trade-off? Fast host framework simulation; not full device/OEM/render/Binder/hardware fidelity.
Why semantics-based Compose tests? Stable user meaning and accessibility contract rather than layout implementation.
Screenshot limitation? Pixel fidelity depends on environment and cannot prove behavior/accessibility.
How fix flakes? Preserve evidence, classify nondeterminism, control time/state/environment, semantic waits, cleanup; retries/quarantine are managed temporary tools.
Coverage limitation? Execution does not prove assertions or requirements; use for gaps, combined with risk/quality evidence.
Mutation testing? Deliberately changes code to see whether tests detect behavioral faults; useful selectively for high-risk pure logic.