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
340
Desbravando monolitos modulares
mateusjatenee
0
100
Scaling The Monolith
mateusjatenee
0
460
Escalando um Monolito em Laravel
mateusjatenee
0
380
Other Decks in Programming
See All in Programming
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
6.1k
izumin5210のプロポーザルのネタ探し #tskaigi_msup
izumin5210
1
140
React Native × React Router v7 API通信の共通化で考えるべきこと
suguruooki
0
100
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
140
Oxlintはいいぞ
yug1224
5
1.4k
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
1.7k
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
180
dchart: charts from deck markup
ajstarks
3
1k
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
200
CSC307 Lecture 08
javiergs
PRO
0
670
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
Featured
See All Featured
Prompt Engineering for Job Search
mfonobong
0
160
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.2k
HDC tutorial
michielstock
1
390
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
sira's awesome portfolio website redesign presentation
elsirapls
0
150
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
150
The Cult of Friendly URLs
andyhume
79
6.8k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
94
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.3k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.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
[email protected]
https://mguimaraes.co https://github.com/mateusjatenee https://twitter.com/mateusjatenee