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
94
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
64
Como Fazer Minha Gem e o Rails Conversarem Bem
brenooliveira
0
51
Javascript Pitfalls
brenooliveira
0
95
Elasticsearch - Turbinando sua aplicação PHP
brenooliveira
1
160
Elasticsearch
brenooliveira
1
120
Other Decks in Technology
See All in Technology
AI Adaptable なテストを整える工夫 / Ways to Make Your Tests AI-Adaptable
bitkey
PRO
3
220
Oracle AI Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
6
1.9k
Platform Engineering as a Product: Criteria for Improvement and Multi-Tenant Design
kumorn5s
0
510
チームで実践する AI-DLC 思考の軌跡を残すチェックポイント設計
belongadmin
0
2.8k
もりもり新機能を一挙紹介! AgentCoreに入門して、AWS上にAIエージェントを構築しよう
minorun365
PRO
6
840
Unlocking the Apps
pimterry
0
250
Claude Code×Terraform IaC テンプレート駆動開発
itouhi
1
400
MIERUNE JCT 発表資料「宇宙から伊能忠敬ごっこ」
syuchimu
0
190
PHP と TypeScript の型システム比較:AI 時代の「型」は誰のためにあるのか? #frontend_phpcon_do / frontend_phpcon_do_2026
shogogg
1
260
Sony_KMP_Journey_KotlinConf2026
sony
2
210
「コーディング」しない人のための Claude Code 入門 ChatGPT の次の一歩 — 業務に組み込む 育成・共有・自動化
rfdnxbro
2
1.2k
コードレビューを制するチームがソフトウェアデリバリーのフローを制す / Beyond Code Review: Distributing Its Responsibilities Across the SDLC
mtx2s
4
1.2k
Featured
See All Featured
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
290
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.9k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.6k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.3k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Scaling GitHub
holman
464
140k
Into the Great Unknown - MozCon
thekraken
41
2.5k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
201
75k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.3k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.5k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
260
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