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
260
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
230
Desbravando monolitos modulares
mateusjatenee
0
87
Scaling The Monolith
mateusjatenee
0
400
Escalando um Monolito em Laravel
mateusjatenee
0
330
Other Decks in Programming
See All in Programming
SLI/SLOの設定を進めるその前に アラート品質の改善に取り組んだ話
tanden
2
680
AHC 044 混合整数計画ソルバー解法
kiri8128
0
290
goにおける コネクションプールの仕組み を軽く掘って見た
aronokuyama
0
110
Devinのメモリ活用の学びを自社サービスにどう組み込むか?
itarutomy
0
1.5k
Node.js, Deno, Bun 最新動向とその所感について
yosuke_furukawa
PRO
6
3k
本当だってば!俺もTRICK 2022に入賞してたんだってば!
jinroq
0
200
PHPUnit 高速化テクニック / PHPUnit Speedup Techniques
pinkumohikan
1
1.1k
아직도 SOLID 를 '글'로만 알고 계신가요?
sh1mj1
0
350
MCP世界への招待: AIエンジニアが創る次世代エージェント連携の世界
gunta
2
500
Kubernetesで実現できるPlatform Engineering の現在地
nwiizo
2
1.7k
SideKiqでジョブが二重起動した事象を深堀りしました
t_hatachi
0
190
S3静的ホスティング+Next.js静的エクスポート で格安webアプリ構築
iharuoru
0
190
Featured
See All Featured
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
GitHub's CSS Performance
jonrohan
1030
460k
How to Think Like a Performance Engineer
csswizardry
22
1.4k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
102
18k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
366
25k
4 Signs Your Business is Dying
shpigford
183
22k
Scaling GitHub
holman
459
140k
The Language of Interfaces
destraynor
156
24k
The Pragmatic Product Professional
lauravandoore
33
6.5k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.3k
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 mateus@mguimaraes.co https://mguimaraes.co https://github.com/mateusjatenee https://twitter.com/mateusjatenee