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
Testando Models
Search
Diogo Beato
June 16, 2016
Programming
0
35
Testando Models
slides para o workshop de teste de models
Diogo Beato
June 16, 2016
Tweet
Share
More Decks by Diogo Beato
See All by Diogo Beato
Cloud Native Banking
diogobeato
1
91
Logging proativo com ELKW
diogobeato
0
240
Isomorphic Javascript
diogobeato
0
160
Fundamentos da JVM
diogobeato
0
330
MinMax
diogobeato
0
97
TDC - Breaking Build
diogobeato
0
79
Breaking Build
diogobeato
0
250
Boas Práticas em APIs REST
diogobeato
2
740
Design para Programadores - Layout
diogobeato
1
59
Other Decks in Programming
See All in Programming
🔨 小さなビルドシステムを作る
momeemt
4
680
もうちょっといいRubyプロファイラを作りたい (2025)
osyoyu
1
430
MCPでVibe Working。そして、結局はContext Eng(略)/ Working with Vibe on MCP And Context Eng
rkaga
5
2.3k
Vue・React マルチプロダクト開発を支える Vite
andpad
0
110
Ruby Parser progress report 2025
yui_knk
1
440
Updates on MLS on Ruby (and maybe more)
sylph01
1
180
Oracle Database Technology Night 92 Database Connection control FAN-AC
oracle4engineer
PRO
1
440
機能追加とリーダー業務の類似性
rinchoku
2
1.3k
テストカバレッジ100%を10年続けて得られた学びと品質
mottyzzz
2
590
さようなら Date。 ようこそTemporal! 3年間先行利用して得られた知見の共有
8beeeaaat
3
1.4k
そのAPI、誰のため? Androidライブラリ設計における利用者目線の実践テクニック
mkeeda
2
300
The Past, Present, and Future of Enterprise Java with ASF in the Middle
ivargrimstad
0
110
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
135
9.5k
For a Future-Friendly Web
brad_frost
180
9.9k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.7k
Designing for humans not robots
tammielis
253
25k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
KATA
mclloyd
32
14k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.4k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.9k
Transcript
TESTANDO MODELS
O Bug do model de ocorrencia_agendamento O PROBLEMA
ENTIDADE OCORRÊNCIA AGENDAMENTO
TABELA DE OCORRENCIA_AGENDAMENTO
ENTIDADE OCORRÊNCIA AGENDAMENTO
COMO FAZER UM TESTE PARA PREVINIR ESSES BUGS?
BOAS PRÁTICAS NOS MAPEAMENTOS
BEAN VALIDATION • @NotNull • @Size • @Min • etc…
• Grouping Constraints ->
BOAS PRÁTICAS DE INTEGRIDADE
PORQUÊ TESTAR MODELS? • Teste de regressão • Base de
toda aplicação MVC • Garantir integridade dos dados • Encontrar Smells no seu modelo
DIFICULDADE EM TESTAR MODELS • setup de ambiente de teste
de integração • criar o banco • popular os dados para o teste • voltar o banco ao estado inicial.
DIFICULDADE EM TESTAR MODELS • setup de ambiente de teste
de integração • criar o banco (DOCKER) • popular os dados para o teste (FIXTURE FACTORY???) • voltar o banco ao estado inicial (DOCKER)
PROBLEMAS COM FIXTURE FACTORY • Template engessado. • Problema com
referencia cíclica. • Fixtures geradas com Regex.
HTTPS://GITHUB.COM/DVBEATO/ROOKIE SOLUÇÃO ALTERNATIVA • Templates flexíveis • Facilidade na geração
de dados em grande volume. • Facilidade na geração de dados com relacionamento.
\,,/ DEMO ^ ^ V
PRÓXIMOS PASSOS • aplicar as técnicas no erp-models. • fazer
ele compilar independente (como o erp-commons): • adicionar um sonar pra ele no pull-request e quebrar o build quando baixar as métricas.
None