You should add tests.
Você deveria adicionar testes.Aula
Should/shouldn't para recomendações
Nível: A2
Objetivo
Usar should e shouldn't para dar conselhos simples de engenharia em code review e planejamento, mantendo um tom educado e direto.
Explicação
Use `should + verbo na forma base` para recomendar uma ação: `You should add tests.`, `We should refactor this first.`, `I think you should restart the service.`
Use `shouldn't + verbo na forma base` para recomendar que algo não seja feito: `We shouldn't deploy now.`, `You shouldn't change that file.`, `The team shouldn't merge without a review.`
`Should` é um modal, por isso não recebe `-s` no presente (`He should check the logs.`, nunca `He shoulds`) e é seguido sempre pelo verbo na forma base (`should run`, `should fix`; nunca `should runs` ou `should fixed`).
Em code review, suavize o conselho com expressões educadas no início da frase: `Maybe we should…`, `I think we should…`, `Perhaps you should…`, `I would suggest we…` (sem should). Em geral, `should` e `shouldn't` já soam como recomendação e não como ordem, mas o `maybe` / `I think` deixa o tom mais colaborativo.
Compare o tom:
- Direto: `You should add tests.`
- Educado: `Maybe we should add tests?`
- Negativo direto: `We shouldn't deploy now.`
- Negativo educado: `I think we shouldn't deploy yet.`
`Should` também aparece em perguntas de planejamento, pedindo concordância da equipe: `Should we deploy now?`, `Should I open a pull request?`, `Should we wait for the team?`
Exemplos
| Inglês | Tradução | Observação |
|---|---|---|
| You should add tests before merging. | Você deveria adicionar testes antes de fazer merge. | Should + verbo na forma base: add, não adds. |
| We shouldn't deploy now. | Não deveríamos fazer deploy agora. | Shouldn't = should + not; verbo na forma base. |
| Maybe we should refactor this first. | Talvez a gente devesse refatorar isso primeiro. | Maybe suaviza a recomendação. |
| I think you shouldn't change that file. | Acho que você não deveria alterar aquele arquivo. | I think + shouldn't mantém o tom educado. |
| Should we deploy the fix today? | Deveríamos fazer o deploy da correção hoje? | Pergunta de planejamento com should. |
Erros comuns
- Colocar -s em should: `He shoulds check` deve ser `He should check`.
- Usar o verbo no passado depois de should: `You should added` deve ser `You should add`.
- Esquecer o verbo principal: `You should tests` deve ser `You should add tests`.
- Colocar to depois de should: `You should to add tests` está errado; use sempre a forma base.
- Confundir should com must: `You must add tests` é uma ordem; `You should add tests` é uma recomendação.
Prática guiada
Reescreva cada situação como um conselho educado em inglês:
- Situação: faltam testes na PR.
Conselho: `You should add tests before merging.`
- Situação: o build falhou e a equipe quer fazer deploy.
Conselho: `We shouldn't deploy now. We should fix the build first.`
- Situação: a função está difícil de ler.
Conselho: `Maybe we should refactor this function.`
Resumo
Should recomenda uma ação e shouldn't recomenda que ela não seja feita; em ambos os casos, o verbo principal fica na forma base. Em code review, suavize com `maybe`, `I think` ou `perhaps` para manter um tom educado.
Vocabulário
Palavras principais
We shouldn't deploy now.
Não deveríamos fazer deploy agora.You should add tests for this endpoint.
Você deveria adicionar testes para este endpoint.We should deploy the fix in the morning.
Deveríamos fazer o deploy da correção de manhã.Maybe we should refactor this function.
Talvez devêssemos refatorar esta função.The code review pointed out two issues.
A revisão de código apontou dois problemas.You should open a pull request for this change.
Você deveria abrir um pull request para essa alteração.We shouldn't merge without tests.
Não deveríamos fazer merge sem testes.You should fix the bug before deploying.
Você deveria corrigir o bug antes do deploy.This code has a small bug.
Este código tem um pequeno bug.You should create a new branch for this change.
Você deveria criar uma nova branch para esta alteração.Maybe we should run the tests again.
Talvez devêssemos executar os testes de novo.I think you should add a comment here.
Acho que você deveria adicionar um comentário aqui.Perhaps we should wait for the team.
Talvez devêssemos esperar a equipe.História
História: Should/shouldn't para recomendações
Nível: A2
História em inglês
Before the review
On Friday afternoon, Sofia opened a pull request for the new payment flow. The pull request was small, but it didn't have any tests. Bruno saw the pull request and started the code review. He noticed that the new code changed an important file. He also noticed that the build ran, but no integration tests ran with it. Sofia felt a little worried, because the team usually deploys on Friday.
Polite suggestions
Bruno left a comment: "Maybe we should add a few tests before merging." He also wrote: "I think we shouldn't deploy this on Friday afternoon." Sofia read the comments and agreed with both of them. She added three tests and asked the team to review the pull request again. The team decided to deploy the change on Monday morning instead. Bruno sent a short message: "Thanks for the quick fix. We can ship this safely now."
Tradução linha por linha
| Inglês | Tradução |
|---|---|
| On Friday afternoon, Sofia opened a pull request for the new payment flow. | Na sexta à tarde, Sofia abriu um pull request para o novo fluxo de pagamento. |
| The pull request was small, but it didn't have any tests. | O pull request era pequeno, mas não tinha nenhum teste. |
| Bruno saw the pull request and started the code review. | Bruno viu o pull request e começou a revisão de código. |
| He noticed that the new code changed an important file. | Ele percebeu que o novo código alterava um arquivo importante. |
| He also noticed that the build ran, but no integration tests ran with it. | Ele também percebeu que o build rodou, mas nenhum teste de integração rodou junto. |
| Sofia felt a little worried, because the team usually deploys on Friday. | Sofia ficou um pouco preocupada, porque a equipe geralmente faz deploy na sexta. |
| Bruno left a comment: "Maybe we should add a few tests before merging." | Bruno deixou um comentário: “Talvez devêssemos adicionar alguns testes antes de fazer merge.” |
| He also wrote: "I think we shouldn't deploy this on Friday afternoon." | Ele também escreveu: “Acho que não deveríamos fazer deploy desta na sexta à tarde.” |
| Sofia read the comments and agreed with both of them. | Sofia leu os comentários e concordou com os dois. |
| She added three tests and asked the team to review the pull request again. | Ela adicionou três testes e pediu para a equipe revisar o pull request de novo. |
| The team decided to deploy the change on Monday morning instead. | A equipe decidiu fazer o deploy da alteração na segunda de manhã, em vez disso. |
| Bruno sent a short message: "Thanks for the quick fix. We can ship this safely now." | Bruno enviou uma mensagem curta: “Obrigado pela correção rápida. Agora podemos enviar isso com segurança.” |
Notas de vocabulário
- Maybe we should add a few tests before merging. = recomendação educada com should + verbo na forma base
- I think we shouldn't deploy this on Friday afternoon. = recomendação negativa educada com I think + shouldn't
- We should add tests. = should é seguido pela forma base do verbo
- We shouldn't deploy now. = shouldn't = should + not; verbo na forma base
- the code review = a revisão feita por outro engenheiro antes do merge
Perguntas de compreensão
- What did Sofia open on Friday afternoon?
- What was missing from the pull request?
- What did Bruno suggest the team should add before merging?
- Should the team deploy the change on Friday afternoon?
- What did Sofia do after reading the comments?
- When did the team decide to deploy the change?
Prática com a história
- Transforme em recomendação educada: "Add tests for this function."
- Transforme em recomendação negativa educada: "Don't deploy on Friday."
- Faça uma pergunta de planejamento: "Should we deploy now?"
- Reescreva educadamente: "Don't change that file!"
Prática
Exercícios e teste
A próxima melhoria é transformar esses arquivos em perguntas com resposta no navegador. Por enquanto, esta página já organiza o estudo e permite seguir a aula inteira sem abrir os arquivos manualmente.