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
Agile Brazil 2016 - 5 fundamentos essenciais de...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Stefan Teixeira
November 07, 2016
Programming
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Agile Brazil 2016 - 5 fundamentos essenciais de padrões xUnit
Palestra apresentada no Agile Brazil 2016, no dia 07/11.
Stefan Teixeira
November 07, 2016
More Decks by Stefan Teixeira
See All by Stefan Teixeira
Scrum Gathering Portugal 2016 - Containerizing Tests with Docker
stefanteixeira
0
88
Latinoware 2016 - Continuous Delivery com ferramentas open source
stefanteixeira
0
73
Ágiles 2016 - Using open source tools to support Continuous Delivery
stefanteixeira
0
63
6º Encontro do Grupo de Testes Carioca - Testes em um contexto de Continuous Delivery
stefanteixeira
0
51
TDC 2016 SP - Desmistificando cobertura de código como métrica de qualidade
stefanteixeira
0
130
TDC 2016 SP - Continuous Delivery para aplicações Java com ferramentas open-source
stefanteixeira
0
90
TDC 2016 SP - Cobertura de código de procedures T-SQL com SQLCC
stefanteixeira
0
81
TDC 2016 SP - 5 libs de teste JavaScript que você deveria conhecer
stefanteixeira
0
66
Scrum Gathering Rio 2016 - Conteinerizando Testes com Docker Compose
stefanteixeira
0
75
Other Decks in Programming
See All in Programming
Javaの型とAI時代に型が大事な理由 / java types and type in AI era
kishida
2
150
AIを活用したE2Eテスト実装効率化のあゆみ / ebisu-mobile-14-kotetu
kotetuco
0
130
技術記事、 専門家としてのプログラマ、 言語化
mizchi
13
6.6k
dRuby over BLE
makicamel
2
390
才能?センス?知らん、 続けたもん勝ちだ。-- 結婚・出産・癌を越えてなお、私がプロダクトを創り続ける理由
16bitidol
1
470
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
610
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
210
Oxlintのカスタムルールの現況
syumai
6
1.2k
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
7
1.5k
さぁV100、メモリをお食べ・・・
nilpe
0
160
気圧・高度・GPSを記録&可視化するアプリ「Koudo」を作った話
hjmkth
1
320
AIで効率化できた業務・日常
ochtum
0
150
Featured
See All Featured
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
250
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.5k
Navigating Weather and Climate Data
rabernat
0
240
Music & Morning Musume
bryan
47
7.2k
Ethics towards AI in product and experience design
skipperchong
2
320
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Facilitating Awesome Meetings
lara
57
7k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.6k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.6k
Mind Mapping
helmedeiros
PRO
1
260
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Transcript
5 fundamentos essenciais de padrões xUnit Stefan Teixeira @stefan_teixeira
[email protected]
• QA Automation Engineer @ Toptal • Co-organizador dos Meetups
DevOps Carioca e Grupo de Testes Carioca • Blogs: stefanteixeira.com.br (pt-br) / stefanteixeira.com (en) Contatos: • E-mail:
[email protected]
• Twitter: twitter.com/stefan_teixeira • LinkedIn: linkedin.com/in/stefanteixeira • GitHub: github.com/stefanteixeira • SlideShare: slideshare.net/stefanteixeira Sobre
Motivação
Testes Automatizados
Feedback rápido é essencial!
Testes facilitam refactoring
O que é xUnit?
None
http://xunitpatterns.com/
None
Alguns frameworks
Mas é só para unit tests? Não!
5 fundamentos essenciais
1. Conceitos básicos
Classes de teste
Métodos de teste
Four-phase Test
Assertions
Suites
2. Verificação de resultados
Delta assertion
None
Guard assertion
None
None
None
Custom assertions
None
None
3. Organização de testes
Suites
Helpers
Métodos utilitários
4. Manutenção de fixtures
Setup/Teardown • @BeforeClass
Setup/Teardown • @BeforeClass • @Before
Setup/Teardown • @BeforeClass • @Before • @After
Setup/Teardown • @BeforeClass • @Before • @After • @AfterClass
Shared fixtures
None
Shared fixtures • Tempo de execução mais rápido
Shared fixtures • Tempo de execução mais rápido • Cuidado
com estado entre testes!
Fresh fixtures
None
Fresh fixtures • Tempo de execução mais lento
Fresh fixtures • Tempo de execução mais lento • Evita
possíveis problemas de estado entre testes
5. Padrões para testes com bancos de dados
Testando Stored Procedures
Transaction rollback
Table truncation
Leituras recomendadas
None
Stefan Teixeira @stefan_teixeira
[email protected]
Obrigado!