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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Mateus Guimarães
October 08, 2016
Programming
290
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
More Decks by Mateus Guimarães
See All by Mateus Guimarães
Unveiling the Modular Monolith — Laracon EU 2024
mateusjatenee
0
360
Desbravando monolitos modulares
mateusjatenee
0
100
Scaling The Monolith
mateusjatenee
0
490
Escalando um Monolito em Laravel
mateusjatenee
0
390
Other Decks in Programming
See All in Programming
AIキャラアプリkaiwaの低遅延音声通話基盤をどう作ったか - AWS Gravitonで支える低遅延・低コストAI Agent基盤
mogamit
0
110
Contextとはなにか
chiroruxx
1
380
A2UI という光を覗いてみる
satohjohn
1
160
SREは、MCPとSRE Agentをこう使え!
kazumax55
0
120
JavaDoc 再入門
nagise
1
420
Oxlintのカスタムルールの現況
syumai
6
1.2k
気圧・高度・GPSを記録&可視化するアプリ「Koudo」を作った話
hjmkth
1
320
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
750
Vite+ Unified Toolchain for the Web
naokihaba
0
360
The ROI of Quarkus for Spring Boot Applications
hollycummins
0
140
dRuby over BLE
makicamel
2
390
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
790
Featured
See All Featured
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
Skip the Path - Find Your Career Trail
mkilby
1
150
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.6k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
330
Designing for humans not robots
tammielis
254
26k
Odyssey Design
rkendrick25
PRO
2
710
A better future with KSS
kneath
240
18k
Bash Introduction
62gerente
615
220k
The Curse of the Amulet
leimatthew05
2
13k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Side Projects
sachag
455
43k
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