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
290
Desbravando monolitos modulares
mateusjatenee
0
94
Scaling The Monolith
mateusjatenee
0
440
Escalando um Monolito em Laravel
mateusjatenee
0
360
Other Decks in Programming
See All in Programming
楽して成果を出すためのセルフリソース管理
clipnote
0
190
「手軽で便利」に潜む罠。 Popover API を WCAG 2.2の視点で安全に使うには
taitotnk
0
870
AIと私たちの学習の変化を考える - Claude Codeの学習モードを例に
azukiazusa1
11
4.4k
1から理解するWeb Push
dora1998
7
1.9k
基礎から学ぶ大画面対応(Learning Large-Screen Support from the Ground Up)
tomoya0x00
0
3.3k
FindyにおけるTakumi活用と脆弱性管理のこれから
rvirus0817
0
530
詳解!defer panic recover のしくみ / Understanding defer, panic, and recover
convto
0
250
OSS開発者という働き方
andpad
5
1.7k
ProxyによるWindow間RPC機構の構築
syumai
3
1.2k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
410
個人軟體時代
ethanhuang13
0
330
CJK and Unicode From a PHP Committer
youkidearitai
PRO
0
110
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
696
190k
Site-Speed That Sticks
csswizardry
10
820
Intergalactic Javascript Robots from Outer Space
tanoku
272
27k
Faster Mobile Websites
deanohume
309
31k
Agile that works and the tools we love
rasmusluckow
330
21k
Facilitating Awesome Meetings
lara
55
6.5k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Music & Morning Musume
bryan
46
6.8k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Building Applications with DynamoDB
mza
96
6.6k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
The Cost Of JavaScript in 2023
addyosmani
53
8.9k
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