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
80
Latinoware 2016 - Continuous Delivery com ferramentas open source
stefanteixeira
0
63
Ágiles 2016 - Using open source tools to support Continuous Delivery
stefanteixeira
0
50
6º Encontro do Grupo de Testes Carioca - Testes em um contexto de Continuous Delivery
stefanteixeira
0
42
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
81
TDC 2016 SP - Cobertura de código de procedures T-SQL com SQLCC
stefanteixeira
0
71
TDC 2016 SP - 5 libs de teste JavaScript que você deveria conhecer
stefanteixeira
0
59
Scrum Gathering Rio 2016 - Conteinerizando Testes com Docker Compose
stefanteixeira
0
66
Other Decks in Programming
See All in Programming
階層化自動テストで開発に機動力を
ickx
1
430
Googleの新しいコーディングAIエージェントJulesを使ってみた
tonionagauzzi
0
140
Google I/O Extended Incheon 2025 ~ What's new in Android development tools
pluu
1
200
状態遷移図を書こう / Sequence Chart vs State Diagram
orgachem
PRO
3
280
The Modern View Layer Rails Deserves: A Vision For 2025 And Beyond @ RailsConf 2025, Philadelphia, PA
marcoroth
2
820
React は次の10年を生き残れるか:3つのトレンドから考える
oukayuka
40
15k
Android 16KBページサイズ対応をはじめからていねいに
mine2424
0
720
Strands Agents で実現する名刺解析アーキテクチャ
omiya0555
1
110
新しいモバイルアプリ勉強会(仮)について
uetyo
1
180
The Evolution of Enterprise Java with Jakarta EE 11 and Beyond
ivargrimstad
0
530
The Niche of CDK Grant オブジェクトって何者?/the-niche-of-cdk-what-isgrant-object
hassaku63
1
710
iOS開発スターターキットの作り方
akidon0000
0
210
Featured
See All Featured
Designing for humans not robots
tammielis
253
25k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
Practical Orchestrator
shlominoach
189
11k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.2k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.9k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.3k
The Cost Of JavaScript in 2023
addyosmani
51
8.6k
Making Projects Easy
brettharned
117
6.3k
Speed Design
sergeychernyshev
32
1k
Testing 201, or: Great Expectations
jmmastey
43
7.6k
Rebuilding a faster, lazier Slack
samanthasiow
83
9.1k
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!