Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
TDD: Por que e por onde começar
Search
Mateus Guimarães
October 08, 2016
Programming
0
270
TDD: Por que e por onde começar
Por que TDD?
Quando escrever testes?
Quais benefícios tenho escrevendo testes?
Mateus Guimarães
October 08, 2016
Tweet
Share
More Decks by Mateus Guimarães
See All by Mateus Guimarães
Unveiling the Modular Monolith — Laracon EU 2024
mateusjatenee
0
270
Desbravando monolitos modulares
mateusjatenee
0
92
Scaling The Monolith
mateusjatenee
0
430
Escalando um Monolito em Laravel
mateusjatenee
0
350
Other Decks in Programming
See All in Programming
AIのメモリー
watany
11
1.1k
0から始めるモジュラーモノリス-クリーンなモノリスを目指して
sushi0120
0
210
ご注文の差分はこちらですか? 〜 AWS CDK のいろいろな差分検出と安全なデプロイ
konokenj
4
720
JetBrainsのAI機能の紹介 #jjug
yusuke
0
160
副作用と戦う PHP リファクタリング ─ ドメインイベントでビジネスロジックを解きほぐす
kajitack
3
500
Android 16KBページサイズ対応をはじめからていねいに
mine2424
0
810
AI Ramen Fight
yusukebe
0
120
MySQL9でベクトルカラム登場!PHP×AWSでのAI/類似検索はこう変わる
suguruooki
1
260
LLMは麻雀を知らなすぎるから俺が教育してやる
po3rin
2
1.4k
DataformでPythonする / dataform-de-python
snhryt
0
110
リバースエンジニアリング新時代へ! GhidraとClaude DesktopをMCPで繋ぐ/findy202507
tkmru
4
1.6k
Prompt Engineeringの再定義「Context Engineering」とは
htsuruo
0
110
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
58
9.5k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.8k
Documentation Writing (for coders)
carmenintech
72
4.9k
Facilitating Awesome Meetings
lara
54
6.5k
Making the Leap to Tech Lead
cromwellryan
134
9.4k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
530
Writing Fast Ruby
sferik
628
62k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
It's Worth the Effort
3n
185
28k
Building Applications with DynamoDB
mza
95
6.5k
Testing 201, or: Great Expectations
jmmastey
43
7.6k
BBQ
matthewcrist
89
9.8k
Transcript
TDD Por que e por onde começar
O que é Test-Driven Development?
None
• Menos erros • Menos dor de cabeça • Código
menor e conciso • Testar algo manualmente é chato e demorado • Trabalho em equipe mais fácil • Divertido!
TDD não é mágico Bugs irão ocorrer, mesmo escrevendo testes
PHPUnit • O maior framework de testes para PHP •
Configurações ficam no arquivo phpunit.xml
None
Nosso app
Nosso primeiro teste O que fazemos? Criamos dois registros do
model Book, Fazemos uma requisição para api/books Verificamos se o JSON certo é retornado Verificamos se o código HTTP é 200
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
Esse código existe
None
None
None
None
None
None
None
None
None
Testes Unitários • Extremamente rápidos • Mais difíceis de quebrar
• Testam uma pequena unidade do código
None
None
None
None
None
Mateus Guimarães Desenvolvedor @ Weenside
[email protected]
https://mguimaraes.co https://github.com/mateusjatenee https://twitter.com/mateusjatenee