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
0
110
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
Tweet
Share
More Decks by Stefan Teixeira
See All by Stefan Teixeira
Scrum Gathering Portugal 2016 - Containerizing Tests with Docker
stefanteixeira
0
81
Latinoware 2016 - Continuous Delivery com ferramentas open source
stefanteixeira
0
66
Ágiles 2016 - Using open source tools to support Continuous Delivery
stefanteixeira
0
53
6º Encontro do Grupo de Testes Carioca - Testes em um contexto de Continuous Delivery
stefanteixeira
0
43
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
82
TDC 2016 SP - Cobertura de código de procedures T-SQL com SQLCC
stefanteixeira
0
73
TDC 2016 SP - 5 libs de teste JavaScript que você deveria conhecer
stefanteixeira
0
60
Scrum Gathering Rio 2016 - Conteinerizando Testes com Docker Compose
stefanteixeira
0
67
Other Decks in Programming
See All in Programming
Web フロントエンドエンジニアに開かれる AI Agent プロダクト開発 - Vercel AI SDK を観察して AI Agent と仲良くなろう! #FEC余熱NIGHT
izumin5210
3
460
iOSエンジニア向けの英語学習アプリを作る!
yukawashouhei
0
190
After go func(): Goroutines Through a Beginner’s Eye
97vaibhav
0
240
Back to the Future: Let me tell you about the ACP protocol
terhechte
0
130
AI Coding Meetup #3 - 導入セッション / ai-coding-meetup-3
izumin5210
0
640
Railsだからできる 例外業務に禍根を残さない 設定設計パターン
ei_ei_eiichi
0
380
(Extension DC 2025) Actor境界を越える技術
teamhimeh
1
240
Six and a half ridiculous things to do with Quarkus
hollycummins
0
130
SpecKitでどこまでできる? コストはどれくらい?
leveragestech
0
610
Local Peer-to-Peer APIはどのように使われていくのか?
hal_spidernight
2
460
『毎日の移動』を支えるGoバックエンド内製開発
yutautsugi
2
210
Introducing ReActionView: A new ActionView-Compatible ERB Engine @ Kaigi on Rails 2025, Tokyo, Japan
marcoroth
3
960
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.2k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
YesSQL, Process and Tooling at Scale
rocio
173
14k
jQuery: Nuts, Bolts and Bling
dougneiner
64
7.9k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
890
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Navigating Team Friction
lara
189
15k
How to train your dragon (web standard)
notwaldorf
96
6.3k
Context Engineering - Making Every Token Count
addyosmani
5
200
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
970
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!