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
Stefan Teixeira
November 07, 2016
Programming
110
0
Share
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
83
Latinoware 2016 - Continuous Delivery com ferramentas open source
stefanteixeira
0
69
Ágiles 2016 - Using open source tools to support Continuous Delivery
stefanteixeira
0
57
6º Encontro do Grupo de Testes Carioca - Testes em um contexto de Continuous Delivery
stefanteixeira
0
48
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
86
TDC 2016 SP - Cobertura de código de procedures T-SQL com SQLCC
stefanteixeira
0
76
TDC 2016 SP - 5 libs de teste JavaScript que você deveria conhecer
stefanteixeira
0
63
Scrum Gathering Rio 2016 - Conteinerizando Testes com Docker Compose
stefanteixeira
0
70
Other Decks in Programming
See All in Programming
ポーリング処理廃止によるイベント駆動アーキテクチャへの移行
seitarof
3
1.3k
RailsのValidatesをSwift Macrosで再現してみた
hokuron
0
140
20260320登壇資料
pharct
0
140
Strategy for Finding a Problem for OSS: With Real Examples
kibitan
0
130
Symfony + NelmioApiDocBundle を使った スキーマ駆動開発 / Schema Driven Development with NelmioApiDocBundle
okashoi
0
250
Fundamentals of Software Engineering In the Age of AI
therealdanvega
2
310
Java 21/25 Virtual Threads 소개
debop
0
310
夢の無限スパゲッティ製造機 -実装篇- #phpstudy
o0h
PRO
0
180
Tamach-sre-3_ANDPAD-shimaison93
mane12yurks38
0
220
今年もTECHSCOREブログを書き続けます!
hiraoku101
0
210
今こそ押さえておきたい アマゾンウェブサービス(AWS)の データベースの基礎 おもクラ #6版
satoshi256kbyte
1
220
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
350
Featured
See All Featured
Prompt Engineering for Job Search
mfonobong
0
240
Utilizing Notion as your number one productivity tool
mfonobong
4
280
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
110
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
sira's awesome portfolio website redesign presentation
elsirapls
0
200
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4k
Odyssey Design
rkendrick25
PRO
2
560
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
240
Why Our Code Smells
bkeepers
PRO
340
58k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
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!