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
260
Desbravando monolitos modulares
mateusjatenee
0
90
Scaling The Monolith
mateusjatenee
0
420
Escalando um Monolito em Laravel
mateusjatenee
0
340
Other Decks in Programming
See All in Programming
なぜ適用するか、移行して理解するClean Architecture 〜構造を超えて設計を継承する〜 / Why Apply, Migrate and Understand Clean Architecture - Inherit Design Beyond Structure
seike460
PRO
1
690
地方に住むエンジニアの残酷な現実とキャリア論
ichimichi
5
1.3k
ニーリーにおけるプロダクトエンジニア
nealle
0
470
なぜ「共通化」を考え、失敗を繰り返すのか
rinchoku
1
510
型付きアクターモデルがもたらす分散シミュレーションの未来
piyo7
0
810
技術同人誌をMCP Serverにしてみた
74th
1
350
Julia という言語について (FP in Julia « SIDE: F ») for 関数型まつり2025
antimon2
3
980
「ElixirでIoT!!」のこれまでとこれから
takasehideki
0
370
Benchmark
sysong
0
270
GraphRAGの仕組みまるわかり
tosuri13
8
480
C++20 射影変換
faithandbrave
0
530
Enterprise Web App. Development (2): Version Control Tool Training Ver. 5.1
knakagawa
1
120
Featured
See All Featured
The Cult of Friendly URLs
andyhume
79
6.5k
Faster Mobile Websites
deanohume
307
31k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
107
19k
Designing for Performance
lara
609
69k
Build The Right Thing And Hit Your Dates
maggiecrowley
36
2.8k
Docker and Python
trallard
44
3.4k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.4k
Automating Front-end Workflow
addyosmani
1370
200k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Rebuilding a faster, lazier Slack
samanthasiow
82
9.1k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
46
9.6k
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