Download as pdf or txt
Download as pdf or txt
You are on page 1of 37

Presentation

Test-Driven Development & Pair Programming


11
Capítulos
PRESENTATION
TEST-DRIVEN DEVELOPMENT
& PAIR PROGRAMMING

Lesson Transcript 03
Transcript + Translation 09
Vocabulary 22
Grammar 25
Mistakes 29

Inglês para Devs


Lesson Transcript Test-Driven Development & Pair Programming

Today I’m gonna tell you about TDD, that means Test-Driven Development. Test-
Driven Development is my favorite development practice. The first time I read about
it, it was about 2003, in the book “Extreme Programming” from Kent Beck.

But actually, when I think about it, Test-Driven Development is, yeah, the way
you natively go on software development, because when I was starting writing
programs as a child, I was just... thought about a little thing to change, and then, yeah,
changed the code and tested if it’s actually running.

At Test-Driven Development, you write executable tests. You really write the tests
first, before you write any code. Once, I was holding a talk at a conference, and it was
a workshop, and one of the guys gave me feedback and said: “This guy is crazy. He
really writes his tests first.” But that’s what TDD is about.

The first phase of TDD is writing a test which is failing. The next phase of TDD
is writing the code to make the test pass, so, making the test run through. And after
that, comes the third phase, and you don’t... should never forget this one, it’s
refactor. Because at TDD, you refactor your code frequently, so it never gets messed
up completely. There’s no refactoring at the end of the month, end of the year or
whatever. You do it directly in the TDD cycles every few minutes.

Yeah, there are three phases of TDD. It’s first: write a test which is failing; we call it
also “red”, so ‘make it red’. The next one is ‘make it green’: write the code which makes
the test pass; it means only the code making the test pass, nothing more, just enough
to make the test pass.
3
Lesson Transcript Test-Driven Development & Pair Programming

And then, refactor. That are the three phases of TDD, and there are many
advantages, yeah, if you go through.

If you create code this way, you will never write code which is not tested. You even
never have the problem you miss to write the test at the end of coding phase
or before release, when you say, “There is no time for tests. I’m gonna make them later”.

If you learn the TDD practices, you will be very good in your hand skills. Some people
call it “software craftsmanship”. You’ll be able to write tests really fast, so you don’t
lose time writing tests. There are many things how you can practice it, and you will
only create testable code.

There are a lot of ways to practice TDD. One of the best things is pair programming.
It’s even a good method… yeah, if you want to introduce TDD to your company, or it’s a
good method for real work. Pair programming, you need a partner. For me, it’s a... for
example, it’s a PHP elephant.

But in real life or real projects, it will take a real partner, in most cases, my
coworker. If I’m at the same location, we both sit on the same mouse and same keyboard.
They’re shared. One guy becomes the driver – he has mouse and keyboard – and
the other one becomes the navigator. Actually, the driver is not thinking, he just does
what the navigator says, and the navigator is… yeah, telling him what to do.

4
Lesson Transcript Test-Driven Development & Pair Programming

You change positions frequently. For example, you can change them by a certain
time. I used to have a timer within my lessons, so you can have a 10-minutes timer.
Or you can switch it with any phase. So, one is writing the test, the next one
is writing the code, and the next one is doing the refactoring. So you have to
switch between them.

If you are not in the same place, many of the… yeah, actual development environments,
like Visual Studio Code, or IntelliJ, or PhpStorm, they have included live collaboration
tools, which make it possible to work with your coworker over the internet
from somewhere over the world – for example, from Brazil and Germany, or
Singapore and Spain.

You can work together by collaboration, and it feels like if you’re on the same
machine. Of course, you need also audio communication, but it makes it really
feel as if you sit on the same PC.

There are several exercises to learn Test-Driven Development, and one of my


favorite exercises is “coding katas”. “Coding katas” are little tasks which you can perform
to learn the way of Test-Driven Development, so you can build up to your skills
and get faster.

One famous coding kata is the Roman numbers kata, where you write a translator for
your Roman number. There are several other katas on the internet. Just go to GitHub
and search for coding katas. They’re available for any language.

5
Lesson Transcript Test-Driven Development & Pair Programming

TDD is possible with any programming language today. For JavaScript, there are
several ones, like Jest. There’s PHPUnit for PHP, there’s JUnit for Java, there is...
I think it’s called NUnit for .NET, and for the most other ones, there’s also… yeah, a
unit testing framework to practice TDD.

A little problem is if you want to introduce TDD to existing projects. As I told you, if you
write your code with TDD, your design emerges from the test and from the code and
from the phases, and you will write perfectly testable code.

But if you already created code which was not created the TDD way, it might highly
be that your code is not as testable as real TDD code. So, you have to make
workarounds and you have to make it testable. That does not occur if you start with
a new project and begin with TDD from the first day. So, using TDD makes your code
better testable by automizable test.

Another thing you can use with TDD... is not even using your tests while development,
but have a system executing your tests frequently, and this system is called
a “continuous integration system”. There are many different “continuous integration
systems” on the market.

My favorite one is GitLab CI, but there is also Jenkins. You can execute it in Bitbucket.
You can use GitHub Actions. You can use TeamCity and I think Bamboo. We will find
some more… GoCD, for example. This system executes a test automatically
when you check the code into the version control system, to Git, and yeah, it
will give you a feedback if the test is not run.
6
Lesson Transcript Test-Driven Development & Pair Programming

So, with continuous integration, you can make sure your tests are automatically executed
any time you submit code to the version control system – and not only you, but also
your coworkers, which is sometimes really… yeah, really useful.

If somebody breaks a test you wrote – that means, yeah, put something in the code and
your test is not running anymore – you will get a notification and you will see it directly
and can correct it directly.

Yeah, that’s the TDD. The most important are the three phases, and it’s really important
that you practice TDD. As more you practice, as faster you get, and easier it gets
to use it. And to be honest, sometimes it’s a lot of fun practicing TDD. I was going to a
lot of “software craftsmanship” meetings where people, actually, they are testing TDD,
practicing TDD, and I worked together with a lot of different people.

I also use TDD to learn new programming languages. For example, Python was
something I never did before, but yeah, with a pair-programming partner
who was into Python, it was easy. Then, I teach him PHP, which is my favorite
programming language. So, both could learn from each other.

That’s another advantage of pair programming: that you learn from each other
when you work together, and both have the same knowledge. Sometimes you learn,
really… yeah, high level things, like architecture, and sometimes you learn really
easy things, just getting a new useful shortcut from your colleague you didn’t
know before.

7
Lesson Transcript Test-Driven Development & Pair Programming

And there’s another higher level of TDD, which is called “Acceptance Test-Driven
Development”. That means you start with writing down your requirements as
test. Not only when you are programming. Start to write tests already when you do the
requirement engineering.

For example, if you do it yourself or have a business engineer, you write it down in
a specific language, and it’s a more natural language, not really a programming
language. It’s called Gherkin, it’s a “Given-When-Then” language. And yeah, you
already write your acceptance criteria down and make it testable later
by so-called “glue code”.

Both are practices to learn. It’s… yeah, not a thing you need to read one time and you
can do it. You need to practice it again and again. But if you practice it, it’s really useful.
You will write better code. You will have less bugs in production, you will have to
fix less bugs later, and you can write your tests easily and fast just inside the code.

So, that’s TDD, my favorite development practice, and I hope you like it. I hope
you will try it out, and thank you for listening.

8
Transcript + Translation Test-Driven Development & Pair Programming

English Português

Today I’m gonna tell you about TDD, Hoje eu vou falar para você sobre TDD,
that means Test-Driven Development. que significa Desenvolvimento Orientado
Test-Driven Development is my favorite a Testes. O Desenvolvimento Orientado
development practice. The first time I a Testes é a minha prática de desenvolvi-
read about it, it was about 2003, in the mento favorita. A primeira vez que eu li
book “Extreme Programming” from Kent sobre isso foi por volta de 2003, no livro
Beck. “Extreme Programming” de Kent Beck.

But actually, when I think about it, Test- Mas, na verdade, quando eu penso nisso,
Driven Development is, yeah, the o Desenvolvimento Orientado a Testes
way you natively go on software é, sim, a maneira que você nativamente
development, because when I was aborda o desenvolvimento de software,
starting writing programs as a child, I porque quando eu estava começando a
was just... thought about a little thing to escrever programas quando criança, eu
change, and then, yeah, changed the code só estava... pensava em uma coisinha
and tested if it’s actually running. para mudar, e aí, sim, mudava o código
e testava se ele está realmente rodando.

At Test-Driven Development, you write No Desenvolvimento Orientado a Testes,


executable tests. You really write the você escreve testes executáveis. Você
tests first, before you write any code. realmente escreve os testes primeiro,
antes de você escrever qualquer código.

9
Transcript + Translation Test-Driven Development & Pair Programming

English Português

Once, I was holding a talk at a conference, Uma vez, eu estava dando uma palestra
and it was a workshop, and one of the em uma conferência, e era um workshop,
guys gave me feedback and said: “This e um dos caras me deu um feedback e
guy is crazy. He really writes his tests first.” disse: “Esse cara é louco. Ele realmente
But that’s what TDD is about. escreve os testes dele primeiro.” Mas é
disso que se trata o TDD.

The first phase of TDD is writing a A primeira fase do TDD é escrever um


test which is failing. The next phase of teste que vá falhar. A próxima fase do
TDD is writing the code to make the test TDD é escrever o código para fazer o
pass, so, making the test run through. teste passar, então, fazer o teste rodar.
And after that, comes the third phase, E depois disso, vem a terceira fase, e
and you don’t... should never forget this você não... nunca deve esquecer essa,
one, it’s refactor. Because at TDD, you é a refatoração. Porque no TDD, você
refactor your code frequently, so it never refatora o seu código frequentemente,
gets messed up completely. There’s no então ele nunca fica completamente
refactoring at the end of the month, end bagunçado. Não há refatoração no final
of the year or whatever. You do it directly do mês, final do ano ou seja lá o que for.
in the TDD cycles every few minutes. Você faz isso diretamente nos ciclos TDD
a cada poucos minutos.

Yeah, there are three phases of TDD. Sim, existem três fases do TDD.

10
Transcript + Translation Test-Driven Development & Pair Programming

English Português

It’s first: write a test which is failing; É primeiramente: escreva um teste vá


we call it also “red”, so ‘make it red’. falhar; nós também o chamamos de
The next one is ‘make it green’: write “vermelho”, então, ‘faça-o vermelho’. O
the code which makes the test pass; próximo é ‘faça-o verde’: escreva o código
it means only the code making the que faz o teste passar; significa apenas o
test pass, nothing more, just enough código que faz o teste passar, nada mais,
to make the test pass. And then, refactor. apenas o suficiente para fazer o teste
That are the three phases of TDD, and passar. E aí, refatore. Essas são as três
there are many advantages, yeah, if fases do TDD, e existem muitas vantagens,
you go through. sim, se você passar por elas.

If you create code this way, you will never Se você criar código dessa maneira, você
write code which is not tested. You even nunca escreverá código que não esteja
never have the problem you miss to testado. Você até mesmo nunca tem o
write the test at the end of coding problema de você esquecer de escrever
phase or before release, when you say, o teste no final da fase de codificação ou
“There is no time for tests. I’m gonna make antes do lançamento, quando você diz:
them later”. “Não há tempo para testes. Eu vou fazê-los
mais tarde ”.

If you learn the TDD practices, you will be Se você aprender as práticas de TDD, você
very good in your hand skills. vai ser muito bom em suas habilidades
manuais.

11
Transcript + Translation Test-Driven Development & Pair Programming

English Português

Some people call it “software Algumas pessoas chamam isso de


craftsmanship”. You’ll be able to write “artesanato de software”. Você vai ser
tests really fast, so you don’t lose time capaz de escrever testes muito rápido,
writing tests. There are many things então você não perde tempo escrevendo
how you can practice it, and you will testes. Existem muitas coisas que você
only create testable code. pode fazer para praticar isso, e você só
vai criar código testável.

There are a lot of ways to practice TDD. One Existem muitas maneiras de praticar TDD.
of the best things is pair programming. Uma das melhores coisas é a programação
It’s even a good method… yeah, if you em par. É um bom método até mesmo...
want to introduce TDD to your company, sim, se você quiser apresentar o TDD à
or it’s a good method for real work. Pair sua empresa, ou é um bom método para
programming, you need a partner. For trabalho real. Programação em par, você
me, it’s a... for example, it’s a PHP elephant. precisa de um parceiro. Para mim, é um...
por exemplo, é um elefante PHP.

But in real life or real projects, it will Mas na vida real ou projetos reais, vai ser
take a real partner, in most cases, my necessário um parceiro real, na maioria
coworker. If I’m at the same location, we dos casos, meu colega de trabalho. Se
both sit on the same mouse and same eu estiver no mesmo local, nós dois nos
keyboard. They’re shared. sentamos no mesmo mouse e no mesmo
teclado. Eles são compartilhados.

12
Transcript + Translation Test-Driven Development & Pair Programming

English Português

One guy becomes the driver – he has Um cara se torna o piloto - ele tem mouse
mouse and keyboard – and the other e teclado - e o outro se torna o navegador.
one becomes the navigator. Actually, the Na verdade, o piloto não está pensando,
driver is not thinking, he just does what ele apenas faz o que o navegador diz, e o
the navigator says, and the navigator is… navegador está... sim, dizendo a ele o que
yeah, telling him what to do. fazer.

You change positions frequently. For Vocês mudam de posição frequente-


example, you can change them by mente. Por exemplo, você pode mudá-las
a certain time. I used to have a timer em um certo horário. Eu costumava ter
within my lessons, so you can have a um temporizador nas minhas aulas, en-
10-minutes timer. Or you can switch tão você pode ter um temporizador de 10
it with any phase. So, one is writing minutos. Ou você pode alterar isso com
the test, the next one is writing the qualquer fase. Então, um vai escrever o
code, and the next one is doing the teste, o próximo vai escrever o código, e o
refactoring. So you have to switch próximo está vai fazer a refatoração. En-
between them. tão, você tem que alternar entre eles.

If you are not in the same place, many Se vocês não estiverem no mesmo
of the… yeah, actual development lugar, muitos dos... sim, ambientes
environments, like Visual Studio Code, or de desenvolvimento reais, como o
IntelliJ, or PhpStorm, Visual Studio Code, ou o IntelliJ, ou
o PhpStorm,

13
Transcript + Translation Test-Driven Development & Pair Programming

English Português

they have included live collaboration eles incluíram ferramentas de colaboração


tools, which make it possible to work ao vivo, que tornam possível trabalhar
with your coworker over the internet com o seu colega de trabalho através da
from somewhere over the world – for internet a partir de em algum lugar ao
example, from Brazil and Germany, or redor do mundo - por exemplo, do Brasil
Singapore and Spain. e da Alemanha, ou Cingapura e Espanha.

You can work together by collaboration, Vocês podem trabalhar juntos por
and it feels like if you’re on the same colaboração, e dá a sensação de como
machine. Of course, you need also se vocês estivessem na mesma máquina.
audio communication, but it makes it É claro, vocês também precisam de
really feel as if you sit on the same PC. comunicação de áudio, mas isso
realmente dá a sensação de como se
vocês estivessem sentados no mesmo PC.

There are several exercises to learn Existem vários exercícios para aprender
Test-Driven Development, and one of o Desenvolvimento Orientado a Testes, e
my favorite exercises is “coding katas”. um dos meus exercícios favoritos é “katas
de codificação”.

14
Transcript + Translation Test-Driven Development & Pair Programming

English Português

“Coding katas” are little tasks which you “Katas de codificação” são pequenas
can perform to learn the way of Test- tarefas que você pode realizar para
Driven Development, so you can build aprender o caminho do Desenvolvimento
up to your skills and get faster. Orientado a Testes, para que você possa
desenvolver as suas habilidades e ficar
mais rápido.

One famous coding kata is the Roman Um famoso kata de codificação é o kata
numbers kata, where you write a dos números romanos, onde você escreve
translator for your Roman number. There um tradutor para o seu número romano.
are several other katas on the internet. Existem vários outros katas na internet.
Just go to GitHub and search for coding Basta ir ao GitHub e pesquisar katas de
katas. They’re available for any language. codificação. Eles estão disponíveis para
qualquer linguagem.

TDD is possible with any programming O TDD é possível com qualquer linguagem
language today. For JavaScript, there are de programação hoje. Para JavaScript,
several ones, like Jest. There’s PHPUnit existem vários, como o Jest. Existe o
for PHP, there’s JUnit for Java, there is... PHPUnit para PHP, existe o JUnit para Java,
I think it’s called NUnit for .NET, and for existe... eu acho que ele se chama NUnit
the most other ones, there’s also… yeah, para .NET, e para a maioria dos outros,
a unit testing framework to practice existe também... sim, um framework de
TDD. testes unitários para praticar TDD.

15
Transcript + Translation Test-Driven Development & Pair Programming

English Português

A little problem is if you want to introduce Um pequeno problema é se você quiser


TDD to existing projects. As I told you, if introduzir o TDD em projetos existentes.
you write your code with TDD, your design Como eu te disse, se você escrever o seu
emerges from the test and from the code código com TDD, o seu design emerge
and from the phases, and you will write do teste e do código e das fases, e você
perfectly testable code. vai escrever um código perfeitamente
testável.

But if you already created code which was Mas se você já criou um código que não foi
not created the TDD way, it might highly criado da maneira TDD, é muito provável
be that your code is not as testable que o seu código não seja tão testável
as real TDD code. So, you have to make quanto um código TDD real. Então, você
workarounds and you have to make tem que fazer soluções alternativas e você
it testable. That does not occur if you tem que torná-lo testável. Isso não ocorre
start with a new project and begin with se você começar com um novo projeto e
TDD from the first day. So, using TDD começar com TDD desde o primeiro dia.
makes your code better testable by Então, usar TDD torna o seu código melhor
automizable test. testável por testes automatizáveis.

Another thing you can use with Uma outra coisa que você pode usar com
TDD... is not even using your TDD... é nem mesmo usar os seus testes
tests while development, but durante o desenvolvimento, mas ter
have a system executing your tests um sistema executando os seus testes

16
Transcript + Translation Test-Driven Development & Pair Programming

English Português

frequently, and this system is called frequentemente, e esse sistema é


a “continuous integration system”. There chamado de “sistema de integração
are many different “continuous integration contínua”. Existem muitos “sistemas
systems” on the market. de integração contínua” diferentes no
mercado.

My favorite one is GitLab CI, but there is also O meu favorito é o GitLab CI, mas também
Jenkins. You can execute it in Bitbucket. existe o Jenkins. Você pode executá-lo
You can use GitHub Actions. You can use no Bitbucket. Você pode usar o GitHub
TeamCity and I think Bamboo. We will find Actions. Você pode usar o TeamCity
some more… GoCD, for example. This e eu acho que o Bamboo. Nós vamos
system executes a test automatically encontrar mais alguns... o GoCD, por
when you check the code into the exemplo. Esse sistema executa um teste
version control system, to Git, and automaticamente quando você submete
yeah, it will give you a feedback if the o código para o sistema de controle de
test is not run. versão, para o Git, e sim, ele vai te dar um
feedback se o teste não for executado.

So, with continuous integration, you can Portanto, com a integração contínua, você
make sure your tests are automatically pode garantir que os seus testes sejam
executed any time you submit code to executados automaticamente sempre
the version control system – and not only que você submeter código para o sistema
you, but also your coworkers, de controle de versão - e não apenas você,
mas também os seus colegas de trabalho, 17
Transcript + Translation Test-Driven Development & Pair Programming

English Português

which is sometimes really… yeah, really o que às vezes é muito... sim, muito útil.
useful. If somebody breaks a test you Se alguém quebrar um teste que você
wrote – that means, yeah, put something escreveu – ou seja, sim, colocar algo no
in the code and your test is not running código e o seu teste não estiver mais
anymore – you will get a notification and rodando - você vai receber uma notificação
you will see it directly and can correct it e você vai ver diretamente e pode corrigi-
directly. lo diretamente.

Yeah, that’s the TDD. The most important Sim, isso é o TDD. O mais importante são
are the three phases, and it’s really as três fases, e é muito importante que
important that you practice TDD. As more você pratique TDD. Quanto mais você
you practice, as faster you get, and pratica, mais rápido você fica, e mais fácil
easier it gets to use it. And to be honest, fica de usar isso. E para ser honesto, às
sometimes it’s a lot of fun practicing vezes é muito divertido praticar TDD. Eu
TDD. I was going to a lot of “software ia a muitas reuniões de “artesanato de
craftsmanship” meetings where people, software” onde as pessoas, na verdade,
actually, they are testing TDD, practicing elas estão testando TDD, praticando TDD,
TDD, and I worked together with a lot of e eu trabalhava junto com muitas pessoas
different people. diferentes.

I also use TDD to learn new programming Eu também uso TDD para aprender novas
languages. For example, Python was linguagens de programação. Por exemplo,
something I never did before, Python era algo que eu nunca tinha feito
antes, 18
Transcript + Translation Test-Driven Development & Pair Programming

English Português

mas sim, com um parceiro de programação


but yeah, with a pair-programming em par que se interessava por Python, era
partner who was into Python, it was fácil. Então, eu ensinei PHP para ele, que
easy. Then, I teach him PHP, which is é a minha linguagem de programação
my favorite programming language. So, favorita. Então, ambos puderam aprender
both could learn from each other. um com o outro.

That’s another advantage of pair Essa é outra vantagem da programação


programming: that you learn em par: que você aprende um com o outro
from each other when you work quando vocês trabalham em conjunto,
together, and both have the same e ambos têm o mesmo conhecimento.
knowledge. Sometimes you learn, Às vezes você aprende, realmente... sim,
really… yeah, high level things, like coisas de alto nível, como arquitetura, e
architecture, and sometimes you learn às vezes você aprende coisas realmente
really easy things, just getting a new useful fáceis, só arranjar um novo atalho útil do
shortcut from your colleague you didn’t seu colega que você não conhecia antes.
know before.

And there’s another higher level of TDD, E tem um outro nível mais alto de TDD,
which is called “Acceptance Test-Driven que é chamado de “Desenvolvimento
Development”. That means you start Orientado a Testes de Aceitação”. Isso
with writing down your requirements significa que você começa anotando os
as test. seus requisitos como um teste.

19
Transcript + Translation Test-Driven Development & Pair Programming

English Português

Not only when you are programming. Não apenas quando você estiver
Start to write tests already when you do programando. Comece a escrever testes
the requirement engineering. já quando você fizer a engenharia de
requisitos.

For example, if you do it yourself or have a Por exemplo, se você faz isso sozinho
business engineer, you write it down in a ou tem um engenheiro de negócios,
specific language, and it’s a more natural você anota isso em uma linguagem
language, not really a programming específica, e é uma linguagem mais
language. It’s called Gherkin, it’s a “Given- natural, não realmente uma linguagem de
When-Then” language. And yeah, programação. Chama-se Gherkin, é uma
you already write your acceptance linguagem “Given-When-Then”. E sim,
criteria down and make it testable você anota os seus critérios de aceitação
later by so-called “glue code”. antecipadamente e os torna testáveis
mais tarde através do chamado “glue
code”.

Both are practices to learn. It’s… yeah, not Ambos são práticas para se aprender. É...
a thing you need to read one time and you sim, não é uma coisa que você precise
can do it. You need to practice it again ler uma vez e você possa fazê-la. Você
and again. But if you practice it, it’s really precisa praticá-la inúmeras vezes. Mas se
useful. You will write better code. você praticá-la, ela é muito útil. Você vai
escrever um código melhor.

20
Transcript + Translation Test-Driven Development & Pair Programming

English Português

You will have less bugs in production, Você vai ter menos bugs em produção,
you will have to fix less bugs later, você vai ter que consertar menos bugs
and you can write your tests easily and posteriormente, e você poderá escrever
fast just inside the code. os seus testes de maneira fácil e rápida
apenas dentro do código.

So, that’s TDD, my favorite development Então, isso é TDD, a minha prática de
practice, and I hope you like it. I hope desenvolvimento favorita, e eu espero
you will try it out, and thank you for que vocês gostem. Eu espero que você a
listening. experimente, e obrigado por escutar.

21
Vocabulary Test-Driven Development & Pair Programming

gonna to hold a talk


Abreviação de “going to”, muito usada na Uma “talk” em inglês pode ser uma
fala. “conversa”, mas também pode ser uma
“palestra” ou “apresentação” em uma
conferência, que é o caso aqui. Assim, “to
Test-Driven Development
hold a talk” significa algo como “dar uma
Desenvolvimento Orientado a palestra”.
Testes. Trata-se de um processo de
desenvolvimento de software que se
feedback
baseia em ter os requisitos de software
convertidos em casos de testes antes que Literalmente, essa palavra vem de “feed”
o software seja totalmente desenvolvido, (alimentar) e “back” (de volta), ou seja,
além de monitorar o desenvolvimento de algo como “retroalimentar”. No contexto
software, testando-o repetidamente. de trabalho e projetos, “feedback” é uma
palavra muito usada na sua forma em
inglês, sem tradução, para se referir à
natively reação ou avaliação de alguém a respeito
Nativamente, de maneira nativa. de um trabalho ou projeto que foi feito e
entregue a essa pessoa.
to go about (something)
Veremos na seção Mistakes que este to be (all) about (something)
phrasal verb deverá ser usado no lugar A expressão “to be about (something)” ou
de “to go on”. Ele significa “abordar (algo)”, “to be all about (something)” é equivalente
“proceder em (fazer algo)”, ocupar-se em em português a “tratar-se de (algo)”.
(fazer algo), dependendo do contexto. Outros exemplos possíveis:
• This case is (all) about politics. (Esse
executable caso se trata de política.)
• Kanban is about visualizing your work…
Executável.
(Kanban se trata de visualizar o seu
trabalho…)
workshop
Palavra muito usada também em to run through
português na sua versão original, sem
tradução, para indicar algo como uma “Examinar” ou “percorrer” algo como uma
“palestra” ou um “curso”. lista ou a execução de um programa.

22
Vocabulary Test-Driven Development & Pair Programming

workshop pair programming


Palavra muito usada também em Programação em par. Trata-se de uma
português na sua versão original, sem técnica de desenvolvimento de software
tradução, para indicar algo como uma ágil em que dois programadores
“palestra” ou um “curso”. trabalham juntos em uma mesma estação
de trabalho.
to refactor
to switch
Refatorar.
Trocar, alternar, mudar.
to go through (something)
Passar por (algo). coworker
Colega de trabalho.
to get messed up
Ficar bagunçado, ficar estragado. shared

refactoring Compartilhado.

Refatoração. Refere-se ao processo de several


modificar um sistema de software para
Vários(as).
melhorar a estrutura interna do código
sem alterar seu comportamento externo. task
(the) release Tarefa.
Como substantivo, significa “lançamento”. unit testing
craftsmanship Testes unitários.
Substantivo que vem da profissão
knowledge
“craftsman”, que seria um “artesão” ou
uma pessoa habilidosa com trabalhos Conhecimento.
manuais. Ou seja, “craftsmanship”
pode ser traduzida como “artesanato”, (a) design
“trabalho artesanal”, “técnica”, “habilidade”,
Palavra muito usada também em
dependendo do contexto.
português na sua versão original, sem
tradução, para indicar algo como uma
testable
“projeto”, “desenho” ou “modelo” de algo a
Testável. ser construído.

23
Vocabulary Test-Driven Development & Pair Programming

framework (a) “Given-When-Then” language


No contexto de tecnologia, “framework” Linguagem “Given-When-Then”. Podemos
é uma palavra muito usada na sua forma traduzir literalmente como “Dado-
em inglês, sem tradução, para se referir Quando-Então”. Trata-se de um modelo
a um conjunto de conceitos usado para destinado a orientar a escrita de testes
resolver um problema de um domínio de aceitação: (Dado) algum contexto,
específico. Um framework de software, (Quando) alguma ação for realizada,
por exemplo, consiste em um conjunto (Então) um determinado conjunto de
de classes implementadas em uma consequências deverá ocorrer.
linguagem específica, usadas para auxiliar
o desenvolvimento de software. criteria
Critérios. É uma palavra que está na forma
workaround do plural pois vem diretamente do latim. O
Solução alternativa. singular correto é “criterion” e é bastante
usado, mas muitos nativos também usam a
automatable palavra “criteria” como se ela representasse
Automatizável. Veremos na seção algo no singular (como na frase “one
Mistakes que esta palavra deveria ter criteria”), o que é considerado errado por
sido usada, e não “automizable”, que não muitos gramáticos, mas é algo que você
existe. pode encontrar.

to submit so-called

Submeter. Chamado, assim chamado, denominado.

glue code
to be into (something)
Código cola. Expressão que se refere
Interessar-se por (algo). a um código que não contribui para
nenhuma funcionalidade do programa,
shortcut e serve somente para unir (to glue)
Atalho. diferentes partes de um código que de
outra forma não seriam compatíveis.
to try out (something)
again and again
Experimentar (algo), provar (algo), a fim
de testar se essa coisa funciona bem ou Inúmeras vezes, repetidamente, repetidas
como esperado. vezes.

24
Grammar Test-Driven Development & Pair Programming

in real life or real projects, it will take a real partner

O verbo “to take” tem diferentes significados em inglês, como


“pegar”, “tomar”, “levar”, etc. Na frase acima, o vemos no sentido de
“ser necessário”.

you can have a 10-minutes timer

Veremos na seção Mistakes que a frase correta seria “you can have
a 10-minute timer”.

A expressão “10-minute timer” é composta de um numeral (“10”) e


um substantivo (“minute”) juntos por um hífen, formando a locução
adjetiva “10-minute”, que qualifica o substantivo “timer” - um
“temporizador de 10 minutos”.
Geralmente, esse hífen é obrigatório para locuções adjetivas onde
as duas palavras estiverem funcionando juntas como um adjetivo
(10-minute) antes do substantivo (timer) que estão descrevendo.
Além disso, em locuções adjetivas, substantivos contáveis como
“minute” estarão sempre na forma do singular.

25
Grammar Test-Driven Development & Pair Programming

one is writing the test, the next one is writing the code, and
the next one is doing the refactoring

Na frase acima, vemos o tempo verbal Present Continuous, que


equivale ao nosso Gerúndio do português, mas sendo usado para
falar sobre o futuro, não sobre o que está acontecendo agora
mesmo. É um uso comum que veremos bastante em inglês.

live collaboration tools, which make it possible to work with


your coworker over the internet

Quando usamos o verbo “to make” com um adjetivo ou um adjetivo


comparativo, ele tem o sentido de “tornar”, “fazer com que”. Nessa
frase, temos o adjetivo “possible”.

Note também o “it” sendo usado entre as palavras “make” e


“possible”. Como em inglês o verbo “to make” precisa de um
objeto direto, precisamos desse “it” ali no meio para servir como
esse objeto, mesmo que não tenha tradução em português. Seria
errado dizer “...to make possible to...”

26
Grammar Test-Driven Development & Pair Programming

with a pair-programming partner

Vemos novamente uma locução adjetiva. A expressão “pair-


programming partner” é composta de dois substantivos (“pair” e
“programming”) juntos por um hífen, formando a locução adjetiva
“pair-programming”, que qualifica o substantivo “partner” - um
“parceiro de programação em par”.
Geralmente, esse hífen é obrigatório para locuções adjetivas onde
as duas palavras estiverem funcionando juntas como um adjetivo
(pair-programming) antes do substantivo (partner) que estão
descrevendo. Se o substantivo vier antes, o hífen não é usado.

Outros exemplos:

• That well-known artist will be here. (Aquele artista bem


conhecido vai estar aqui.)
• como as duas palavras que formam a locução (well-known) vêm
logo antes do substantivo (artist), o hífen é necessário
• That artist who will be here is well known. (Aquele artista que
vai estar aqui é bem conhecido.)
• como as duas palavras que formam a locução não vêm logo antes
do artigo, o hífen não é usado

27
Grammar Test-Driven Development & Pair Programming

both could learn from each other

A expressão “each other” é sinônima de “one another”, e podemos


traduzi-las geralmente como “um ao outro” ou “uns aos outros”.
Na frase acima, por causa da preposição “from” (de, a partir de),
o sentido muda um pouco e fica “um do outro”, e faz sentido
com o resto da frase, que diz que uma pessoa pode aprender do
conhecimento da outra.

you already write your acceptance criteria down

Phrasal verbs são formados por um verbo e mais uma (ou mais)
palavras, que geralmente é uma preposição ou um advérbio.
Quando usamos em uma frase, geralmente o verbo e a
preposição/advérbio de um phrasal verb ficam juntos. Porém, em
alguns casos, é possível separá-los, jogando a preposição/advérbio
pro final da frase. Por exemplo, podemos dizer tanto “you (...)
write down your acceptance criteria”, quanto “you (...) write your
acceptance criteria down”. Ambas as formas estão corretas!

28
Mistakes Test-Driven Development & Pair Programming

Neste curso, você talvez já tenha notado que nem todos os professores são
falantes nativos de inglês. Isso foi proposital, para te mostrar que é possível ser
extremamente fluente em inglês, a nível de trabalhar e fazer apresentações no
idioma, e mesmo assim cometer pequenos errinhos.

Nesta seção, vamos explicar quais foram esses errinhos cometidos durante a
aula e como corrigi-los.

practice
Explicação: Um pequeno erro de pronúncia. A pronúncia correta é “practice”.

Test-Driven Development is, yeah, the way you natively go on


software development

Frase correta: Test-Driven Development is, yeah, the way you natively go about
software development

Explicação: O phrasal verb correto a ser usado aqui é “to go about”, que já vimos na
seção Vocabulary e tem o sentido de “abordar (algo)”, “proceder em (fazer algo)”, ocupar-
se em (fazer algo), dependendo do contexto.

At Test-Driven Development
Frase correta: In Test-Driven Development

Explicação: A preposição correta a ser usada com uma matéria de estudo é “in”, e não
“at”.

29
Mistakes Test-Driven Development & Pair Programming

The first phase of TDD is writing a test which is failing


Frase correta: The first phase of TDD is writing a test which will fail

Explicação: É mais correto gramaticalmente usar o Futuro aqui, em vez do Present


Continuous.

you don’t... should never forget this one, it’s refactor


Frase correta: you don’t... should never forget this one, it’s refactoring

Explicação: Como ele está falando sobre uma fase, temos que usar um substantivo ou
um verbal noun aqui, dessa forma, o correto é usar “refactoring”.

at TDD
Frase correta: in TDD

Explicação: Novamente, a preposição correta a ser usada com uma matéria de estudo
é “in”, e não “at”.

cycles
Explicação: Um pequeno erro de pronúncia. A pronúncia correta no singular é “cycle”.

write a test which is failing


Frase correta: write a test which will fail

Explicação: Novamente, é mais correto gramaticalmente usar o Futuro aqui, em vez do


Present Continuous.

30
Mistakes Test-Driven Development & Pair Programming

That are the three phases of TDD


Frase correta: These/Those are the three phases of TDD

Explicação: Como estamos falando de fases no plural, o demonstrativo também tem


que estar no plural. Assim, podemos usar tanto “these” quanto “those”.

Além disso, temos um pequeno erro de pronúncia. A pronúncia correta é “phases”.

...there are many advantages, yeah, if you go through.


Frase correta: ...there are many advantages, yeah, if you go through them.

Explicação: O phrasal verb “to go through” pede um objeto direto como complemento.
Soa estranho e incompleto usá-lo sem algum objeto. Assim, como o instrutor estava
falando sobre as três fases de TDD, podemos usar o object pronoun “them”.

You even never have the problem you miss to write the test at the
end of coding phase
Frase correta: You never (even) have the problem (that) you forget to write the test
at the end of the coding phase

Explicação: A frase original havia ficado um pouco estranha. O instrutor provavelmente


se embananou um pouco na hora de falar.

Primeiramente, “even never” soa muito estranho”. Você pode dizer “never even”, ou
então apenas “never”.

O verbo “to miss” não soa bem nesse contexto. O instrutor quis passar a ideia de “não
fazer (algo)”, então podemos trocar por “to forget” (esquecer).

Por fim, como trata-se de uma fase específica, faltou o artigo definido “the”.

31
Mistakes Test-Driven Development & Pair Programming

practices
Explicação: Um pequeno erro de pronúncia. A pronúncia correta é “practices”.

There are many things how you can practice it


Frases corretas:
• There are many things you can do to practice it.
• There are many ways (for you) to practice (it).

Explicação: A palavra “how” não se encaixa bem nessa frase. Temos que alterá-la para
“There are many things you can do to practice it.” (Existem muitas coisas que você pode
fazer para praticar isso), ou então para “There are many ways (for you) to practice (it).”
(Existem muitas maneiras (para você) de praticar isso).

he has mouse and keyboard


Frase correta: he has the mouse and keyboard

Explicação: Faltou o artigo definido “the”.

you can change them by a certain time


Frase correta: you can change them at a certain time

Explicação: A preposição “at” soa melhor nesse contexto.

you can have a 10-minutes timer


Frase correta: you can have a 10-minute timer

Explicação: Como vimos na seção Grammar, quando usamos palavras contáveis como
adjetivo ou como parte de uma locução adjetiva (aqui “10-minute”), além de precisarmos
do hífen, essa palavra estará sempre no singular.

32
Mistakes Test-Driven Development & Pair Programming

switch
Explicação: Um pequeno erro de pronúncia. Parece que o instrutor sem querer
pronuncia algo como “search”, mas o verbo correto a ser usado é “switch”. A pronúncia
correta é “switch”.

from somewhere over the world


Frase correta: from somewhere around the world

Explicação: A palavra “around” soa mais natural nesta frase.

it feels like if you’re on the same machine


Frase correta: it feels as if you’re on the same machine

Explicação: A estrutura correta é “to feel as if…”, e não “like if”. Esse é um erro muito
comum, pois “as” e “like” são sinônimas em alguns casos.

you need also audio communication


Frase correta: you also need audio communication

Explicação: O advérbio “also” costuma vir entre o sujeito e o verbo principal.

you can build up to your skills


Frase correta: you can build up your skills

Explicação: O phrasal verb é “to build up (something)”. O “to” não faz sentido aqui.

it makes it really feel as if you sit on the same PC


Frase correta: it makes it really feel as if you’re sitting on the same PC

Explicação: Como a sensação é algo momentâneo, o correto aqui é usar o Present


Continuous, que equivale ao nosso Gerúndio.

33
Mistakes Test-Driven Development & Pair Programming

for the most other ones


Frase correta: for most of the other ones

Explicação: A estrutura correta é para dizer “a maioria de (algo)” é: “most of


(something)”.

it might highly be that


Frase correta: it’s highly likely that

Explicação: O instrutor construiu a frase de uma maneira estranha. A estrutura correta


para dizer que algo é muito provável é dizer que essa coisa é “highly likely”.

occur
Explicação: Um pequeno erro de pronúncia. A pronúncia correta é “occur”.

using TDD makes your code better testable by automizable test


Frase correta: using TDD makes your code better testable by automatable tests

Explicação: Como vimos na seção Vocabulary, a palavra “automizable” não existe. A


palavra correta é “automatable”, que vem do verbo “to automate” (automatizar).

Além disso, como se trata de testes em geral, o correto seria usar o plural “tests”.

frequently
Explicação: Um pequeno erro de pronúncia. A pronúncia correta é “frequently”.

requirement
Explicação: Um pequeno erro de pronúncia. A pronúncia correta é “requirement”.

34
Mistakes Test-Driven Development & Pair Programming

using your tests while development


Frases corretas:
• using your tests during development
• using your tests while developing

Explicação: Temos duas opções para corrigir essa frase. Se quisermos manter o
substantivo “development”, então precisamos da preposição “during”. Já se quisermos
manter a conjunção “while”, então precisamos do verbo “developing”.

This system executes a test automatically when you check the code
into the version control system, to Git
Frases corretas:
• This system executes a test automatically when you submit the code to the version
control system, to Git
• This system executes a test automatically when you check the code in the version
control system, in Git

Explicação: Temos duas possibilidades. A primeira é trocar o verbo “to check” por
“to submit” (submeter), que encaixa melhor nesse contexto de enviar, e aí trocar a
preposição “into” por “to”, que funciona melhor.

Outra opção é manter o verbo “to check” que, nesse contexto de código, pode significar
apenas “verificar”, mas também pode ter o sentido de executá-lo em um ambiente
de testes antes de enviá-lo para produção ou de passar para o próximo estágio de
desenvolvimento. E aí, teríamos que trocar as preposições “into” e “to” por “in”.

it will give you a feedback


Frase correta: it will give you feedback

Explicação: A palavra “feedback” não é contável, então não faz sentido dizer “to give a
feedback”, basta dizer “to give feedback”.

35
Mistakes Test-Driven Development & Pair Programming

As more you practice, as faster you get, and easier it gets


Frase correta: The more you practice, the faster you get, and the easier it gets

Explicação: A estrutura “quanto mais X, mais Y” em inglês é ser expressada com “the
more X, the more Y”. Uma maneira mais abrangente de expressá-la seria:

the + adjetivo comparativo + oração + the + adjetivo comparativo + oração

Ou seja, ela mostra o aumento ou diminuição proporcional de uma coisa em relação a


outra. Exemplos:
• The more I see him, the more I like him. (Quanto mais eu o vejo, mais eu gosto
dele.)
• The more I see him, the less I like him. (Quanto mais eu o vejo, menos eu gosto
dele.)
• The older we are, the wiser we become. (Quanto mais velhos nós somos, mais
sábios nós ficamos.)
• The higher you climb, the colder it gets. (Quanto mais alto você escala, mais frio
fica.

Python was something I never did before


Frase correta: Python was something I had never used before

Explicação: Como se trata no passado do passado (algo indicado pelo advérbio


“before”), o tempo verbal mais correto a ser usado é o Past Perfect, e não o Simple Past,
apesar de o Simple Past ser muito usado em contextos mais informais.

Além disso, não soa muito natural usar o verbo “to do” com uma linguagem de
programação ou um idioma (como “English”, “French”). O melhor aqui seria trocá-lo pelo
verbo “to use”.

Finalmente, em frases que temos um verbo auxiliar ao verbo principal (como é o caso no
Present Perfect, Past Perfect e com verbos modais), advérbios como “never” vem sempre
entre o verbo auxiliar (“had”) e o verbo principal (“used”).

36
Mistakes Test-Driven Development & Pair Programming

Then, I teach him PHP


Frase correta: Then, I taught him PHP

Explicação: A frase está gramaticalmente correta, mas como o instrutor estava


contando uma história e usando o Simple Past até agora, soa melhor continuar a usar o
Simple Past.

colleague
Explicação: Um pequeno erro de pronúncia. A palavra “colleague” deve ser
pronunciada como /ˈkɑliɡ/ (pronúncia em I.P.A.), que soa mais ou menos como “kó-lig”
em português, e não como “kó-lij”.

you start with writing down your requirements as test


Frase correta: you start with writing down your requirements as a test

Explicação: Faltou o artigo indefinido “a”.

you already write your acceptance criteria down and make it


testable later
Frase correta: you write your acceptance criteria down beforehand and make it
testable later

Explicação: O instrutor quis dizer que os critérios devem ser escritos “antes”,
“antecipadamente”, por isso o advérbio “beforehand” funciona melhor aqui do que
“already”.

You will have less bugs in production, you will have to fix less bugs
later
Frase correta: You will have fewer bugs in production, you will have to fix fewer bugs
later

Explicação: Um erro muito comum. Com substantivos contáveis, como “bug”, temos
que usar “fewer” com esse sentido de “menos”. A palavra “less” é usada como adjetivo
apenas com substantivos incontáveis.

37

You might also like