Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Falando sobre testes automatizados
Search
Breno Oliveira
October 17, 2014
Technology
100
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Falando sobre testes automatizados
Vamos falar um pouco mais sobre testes automatizados
Breno Oliveira
October 17, 2014
More Decks by Breno Oliveira
See All by Breno Oliveira
Spring e Eureka Service Discovery
brenooliveira
0
69
Como Fazer Minha Gem e o Rails Conversarem Bem
brenooliveira
0
59
Javascript Pitfalls
brenooliveira
0
100
Elasticsearch - Turbinando sua aplicação PHP
brenooliveira
1
160
Elasticsearch
brenooliveira
1
130
Other Decks in Technology
See All in Technology
渡米前の準備を制す!re:Invent 2026徹底準備術 / The Ultimate Preparation Guide for re:Invent 2026
yuj1osm
1
530
新米を「売り越さない」、Aurora DSQLで作る在庫ゼロ死守の限定ドロップEC
yama3133
0
150
Agent Loopを組み込んだ アンビエントなAI機能を実現する / Ambient AI fetures with Agent Loop
nekorush14
0
150
200人の配信コメント、 全部Jevが仕分けます 〜 マサカリガードを作ってみた 〜
katayamatg
1
530
生き様としてのSRE
hokkai7go
1
160
re:Inventで、人生は変わったのか? / growth-builders-hub-1-reinvent-2026
mhrtech
2
300
You Have Agency(サンキュー、Ruby)
snoozer05
PRO
5
670
リアクションエンジニア ― 小さなリアクションから、話しかけやすい組織をつくる ―
ryuguyana
1
120
2026 Apache Flink Community Checkpoint
rmetzger
0
130
これだけは抑えておきたい!後悔しない re:Invent の過ごし方 / AWS re:Invent 2026 prestudy
kinunori
2
680
AI Search (Foundry IQ) におけるRAGデータの準備と配置
ryomaru0825
1
140
"計画的無茶振り"を通してAIネイティブ世代の新人を育てる
subroh0508
1
150
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
77
5.6k
We Have a Design System, Now What?
morganepeng
55
8.4k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
KATA
mclloyd
PRO
35
16k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
460
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
What does AI have to do with Human Rights?
axbom
PRO
1
2.5k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
How to build a perfect <img>
jonoalderson
1
6.2k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.4k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
510
Transcript
Falando de Testes Breno Oliveira
“Testar pra que? O que eu fiz vai funcionar …"
–dummy programmer
Quem garante QUE vai funcionar?
por isso testamos murphy's law
–William Edwards Deming “In God we Trust, all others bring
data”
Não se desespere os testes estão ai para te ajudar
Testes lhe dão a confiança para a mudança
Descrevem o comportamento do software
Facilita a Adição de melhorias
Tempo de desenvolvimento
Ajudam a reduzir o número de bugs
E principalmente …
Ninguém vai te olhar com essa cara ao ver um
código seu …
Quanto devemos testar?
–Uncle Bob 1 of Kent’s older wise sayings was: “Test
everything that could possibly break.” I think that’s a pretty good recipe.
keep it simple and stupid
Baby steps ftw
Testes Unitários Teste de funções do código independente de outras
partes do sistemas
Muitas vezes escrevemos testes de unidade Que não testam nada
Testar constante é importante Mas talvez não com teste de
unidade Escreva um teste de integração
{ Então o que poderíamos testar daquele código? }
Verifique ao passar o valor 4111 foi gerado foi um
pagamento com VISA.
Teste de Integração Testa a integração entre as funções e
objetos do sistema
garantem que suas classes comunicam-se com APIs, escrevem arquivos texto
ou mesmo gravar no banco são considerados testes de integração.
Lembre-se
Você não trabalha sozinho
TDD BDD NO TESTS ATDD ?
O que fazer então?
TDD
–Kent Beck “Desenvolvimento guiados por testes é uma forma de
administrar o medo durante a programação!”
None
None
Baby steps ftw Novamente
ERROR test_should_initialize_a_post (0:00:00.000) uninitialized constant PostTest::Post
PASS test_should_initialize_a_post
Vamos lá Eu sei que você pode fazer mais Mais
confiança cara
ERROR test_should_have_a_title_if_is_setted undefined method `title' for #<Post:0x0000010091dc90>
PASS test_should_have_a_title_if_is_setted
ERROR test_should_have_a_title_if_is_setted undefined method `title=' for #<Post:0x0000010107ca90>
PASS test_should_have_a_title_if_is_setted
FAIL test_should_have_a_blank_title_if_none_is_setted Expected: nil Actual: "my post”
PASS test_should_have_a_blank_title_if_none_is_setted
None
PASS test_should_have_a_blank_title_if_none_is_setted PASS test_should_initialize_a_post PASS test_should_have_a_title_if_is_setted
Ok … Meio idiota o exemplo Mas não temos tempo
:(
BDD
Desenvolvimento orientado ao comportamento
testar o comportamento da sua aplicação
mais sobre escrever especificações
escrever testes também é documentar
None
None
None