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
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
92
Latinoware 2016 - Continuous Delivery com ferramentas open source
stefanteixeira
0
78
Ágiles 2016 - Using open source tools to support Continuous Delivery
stefanteixeira
0
65
6º Encontro do Grupo de Testes Carioca - Testes em um contexto de Continuous Delivery
stefanteixeira
0
52
TDC 2016 SP - Desmistificando cobertura de código como métrica de qualidade
stefanteixeira
0
140
TDC 2016 SP - Continuous Delivery para aplicações Java com ferramentas open-source
stefanteixeira
0
96
TDC 2016 SP - Cobertura de código de procedures T-SQL com SQLCC
stefanteixeira
0
82
TDC 2016 SP - 5 libs de teste JavaScript que você deveria conhecer
stefanteixeira
0
74
Scrum Gathering Rio 2016 - Conteinerizando Testes com Docker Compose
stefanteixeira
0
76
Other Decks in Programming
See All in Programming
Building an Out-of-Order CPU
latte72
1
710
PyO3 で既存 Python 評価器を Rust core 化する ー wasm-bindgen でブラウザにも配るための設計
kdash
1
510
RSSとCodexを使ってX投稿自動化してみた
ochtum
0
110
XHTMLが残したもの
yosuke_furukawa
PRO
2
420
Pythonの実行はどこまで賢くなったのか? CPythonとPyPyから見る最適化のしくみ
curekoshimizu
4
2.8k
業務時間外もAIに働いてもらう話
colorful12
3
10k
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
2
1.6k
[GoCon2026] When Goroutines Are Not Enough: Runtime Locality in High-Throughput Go
takehaya
3
390
The Good Stuff, Not the Slop: Engineering High-Quality Android Apps with Modern AI Tooling
danybony
1
190
ALB ログから Trace を気合で繋げる技術
fohte
7
880
iOS開発×AI駆動開発 〜最近使って便利だったスキルの話〜
nogu66
0
140
LoopHub - ローカルで動く GitHub で、AI と共同開発
jugyo
0
450
Featured
See All Featured
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
920
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
290
How STYLIGHT went responsive
nonsquared
100
6.3k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1k
Why Our Code Smells
bkeepers
PRO
340
58k
Six Lessons from altMBA
skipperchong
29
4.5k
The Curious Case for Waylosing
cassininazir
1
500
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Site-Speed That Sticks
csswizardry
13
1.5k
AI: The stuff that nobody shows you
jnunemaker
PRO
9
980
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
570
The World Runs on Bad Software
bkeepers
PRO
72
12k
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!