Why do teams run automated tests automatically in a CI pipeline on every change, instead of just having developers run them locally before they push?

technical-conceptual · Junior level · software-engineering

What the interviewer is really asking

Probes understanding of why tests are integrated into CI: consistency, a shared source of truth, and catching regressions early rather than relying on individual discipline.

What to say

What to avoid

Example answers

Strong: Running tests only locally relies on every person remembering to run them, in their own environment, which drifts from production. CI runs the same suite in a clean, known environment automatically on every pull request, so it's a consistent gate nobody can skip. It also catches regressions at the PR stage, where they're cheap to fix, instead of after a change merges and someone else inherits the breakage.

Weak: Because it's more convenient to have a server do it. Developers can run tests locally too, but CI just does it for you so you don't have to.

Want questions matched to your role? Paste a job title, job description, or CV and get a personalized set, or go Pro to unlock the full bank.