Anotei essa no caderno depois de errar numa entrevista de verdade. Hoje ela vive no meu baralho de Testing. Abaixo, a resposta como eu daria agora.
A resposta, como você fala na entrevista
Unit: isolate a single function, mock all dependencies — fast, run constantly.
Integration: multiple modules together (e.g., controller hitting a real database).
E2E: simulate real user flows through the whole system.
The testing pyramid: many unit tests at the base, fewer integration, few e2e at the top (slow and brittle).
Ler é fácil. Falar isso em inglês, sob pressão, com alguém avaliando, é outra história. No VagaGringa esse tópico vira flashcard com repetição espaçada, cai em quiz e entra no simulado.
Treinar este tópico no app