Decide When Automated Tests Are Necessary
CoinbaseSoftware Engineer · OnsiteLast updated
Assesses an engineer's testing philosophy, balancing risk and velocity to determine when automated tests are mandatory versus when lighter verification suffices, while looking beyond naive code coverage metrics.
Interview Prompt
"Engineers often debate the right balance between moving quickly and maintaining strict test coverage. Walk me through your philosophy on automated testing:
- When is comprehensive automated testing non-negotiable, and when is lighter testing (or even manual verification) justified?
- How do you assess whether a test suite actually protects user-facing behavior, rather than simply satisfying a code coverage percentage target?"
Context & Expectations
High-reliability software environments—especially in fintech and crypto—handle irreversible actions such as balance updates, order matching, and blockchain transactions. In these domains, a bug can mean immediate financial loss or security breach. At the same time, dogmatic pursuit of 100% line coverage on low-risk, fast-changing prototypes can paralyze engineering velocity.
A strong answer should avoid generic platitudes ("tests are always good") and instead articulate a risk-weighted, pragmatic engineering framework.
What a Strong Answer Demonstrates
- Risk-Based Prioritization: Distinguishes between critical paths (financial calculations, authorization, data persistence, state transitions) where exhaustive automated tests (unit, integration, property-based) are mandatory, versus ephemeral code (one-off scripts, throwaway UI spikes, early discovery prototypes) where manual validation or minimal smoke tests are sufficient.
- Quality Beyond Metrics: Explains why vanity metrics like line or branch coverage can create a false sense of security (e.g., executing code without meaningful assertions). Advocates for behavioral testing, boundary-value analysis, fault injection, or mutation testing to measure actual resilience.
- Production-Minded Pragmatism: Demonstrates an understanding of the total cost of ownership of tests, including flakiness, maintenance overhead, and CI runtimes. Shows an ability to balance engineering velocity with system stability.
Hints
Hint 1
Anchor your framework around the blast radius and irreversibility of potential failures, such as financial ledger mutations versus cosmetic UI updates.
Hint 2
Explain why high line coverage can still miss critical regressions, and mention techniques like mutation testing, contract testing, or property-based tests.
Hint 3
Share a concrete past experience where you pushed for rigorous automation or, conversely, consciously accepted lighter testing to meet a strategic objective.
Follow-up questions
- How do you handle a teammate who either writes tests with no meaningful assertions just to pass CI gates, or one who insists on 100% coverage on throwaway spikes?
- In a system where transactions are irreversible (e.g., blockchain transfers), what testing layers would you enforce before any code reaches production?
- How do you tackle flaky automated tests in a shared CI/CD pipeline when delivery deadlines are tight?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.