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
Falando sobre testes automatizados
Search
Breno Oliveira
October 17, 2014
Technology
0
87
Falando sobre testes automatizados
Vamos falar um pouco mais sobre testes automatizados
Breno Oliveira
October 17, 2014
Tweet
Share
More Decks by Breno Oliveira
See All by Breno Oliveira
Spring e Eureka Service Discovery
brenooliveira
0
57
Como Fazer Minha Gem e o Rails Conversarem Bem
brenooliveira
0
45
Javascript Pitfalls
brenooliveira
0
87
Elasticsearch - Turbinando sua aplicação PHP
brenooliveira
1
150
Elasticsearch
brenooliveira
1
120
Other Decks in Technology
See All in Technology
Fabric + Databricks 2025.6 の最新情報ピックアップ
ryomaru0825
1
150
Yamla: Rustでつくるリアルタイム性を追求した機械学習基盤 / Yamla: A Rust-Based Machine Learning Platform Pursuing Real-Time Capabilities
lycorptech_jp
PRO
4
140
本が全く読めなかった過去の自分へ
genshun9
0
590
Welcome to the LLM Club
koic
0
190
Lambda Web Adapterについて自分なりに理解してみた
smt7174
5
130
作曲家がボカロを使うようにPdMはAIを使え
itotaxi
0
140
Amazon Bedrockで実現する 新たな学習体験
kzkmaeda
2
610
Clineを含めたAIエージェントを 大規模組織に導入し、投資対効果を考える / Introducing AI agents into your organization
i35_267
4
1.7k
生成AI時代の開発組織・技術・プロセス 〜 ログラスの挑戦と考察 〜
itohiro73
1
300
AWS テクニカルサポートとエンドカスタマーの中間地点から見えるより良いサポートの活用方法
kazzpapa3
2
560
AIとともに進化するエンジニアリング / Engineering-Evolving-with-AI_final.pdf
lycorptech_jp
PRO
0
110
How Community Opened Global Doors
hiroramos4
PRO
1
120
Featured
See All Featured
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
46
9.6k
The Pragmatic Product Professional
lauravandoore
35
6.7k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.3k
A Modern Web Designer's Workflow
chriscoyier
694
190k
Producing Creativity
orderedlist
PRO
346
40k
Typedesign – Prime Four
hannesfritz
42
2.7k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
A better future with KSS
kneath
239
17k
Speed Design
sergeychernyshev
32
1k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
281
13k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
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