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
210
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
79
Desbravando monolitos modulares
mateusjatenee
0
56
Scaling The Monolith
mateusjatenee
0
330
Escalando um Monolito em Laravel
mateusjatenee
0
260
Other Decks in Programming
See All in Programming
スキーマ駆動開発による品質とスピードの両立 - 私達は何故、スキーマを書くのか
kentaroutakeda
0
170
Site Reliability Engineering for GMO
pyama86
8
1k
Zero Waste, Radical Magic, and Italian Graft – Quarkus Efficiency Secrets
hollycummins
0
230
禅の心を手に入れよ
eltociear
1
170
Ruby GitHub Packages
bkuhlmann
0
630
Goのエラースタックトレースの歴史と今後
sonatard
9
1.6k
はてなにおける CSS Modules、及び CSS Modules に足りないもの / CSS Modules in Hatena, and CSS Modules missing parts
mizdra
7
950
Milestoner
bkuhlmann
1
410
PHPはいつから死んでいるかの調査
chiroruxx
1
400
PHP8.3の機能を振り返る / Review of PHP 8.3 features
seike460
PRO
1
110
TCAとKMPを用いた新規動画配信アプリ 「ABEMA Live」の設計
tomu28
1
120
VSCodeでのDatabricks開発もお勧めしたい/I would also recommend Databricks development with VSCode.
kazumain
0
260
Featured
See All Featured
WebSockets: Embracing the real-time Web
robhawkes
59
7k
A better future with KSS
kneath
231
16k
Music & Morning Musume
bryan
41
5.6k
GraphQLとの向き合い方2022年版
quramy
32
12k
The Invisible Side of Design
smashingmag
294
49k
What's in a price? How to price your products and services
michaelherold
237
11k
Into the Great Unknown - MozCon
thekraken
10
1k
Adopting Sorbet at Scale
ufuk
68
8.6k
How GitHub Uses GitHub to Build GitHub
holman
468
290k
Fashionably flexible responsive web design (full day workshop)
malarkey
398
65k
Facilitating Awesome Meetings
lara
42
5.6k
Learning to Love Humans: Emotional Interface Design
aarron
267
39k
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