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
60
Other Decks in Programming
See All in Programming
2分台で1500examples完走!爆速CIを支える環境構築術 - Kaigi on Rails 2025
falcon8823
3
3.6k
Range on Rails ―「多重範囲型」という新たな選択肢が、複雑ロジックを劇的にシンプルにしたワケ
rizap_tech
0
140
Software Architecture
hschwentner
6
2.3k
Catch Up: Go Style Guide Update
andpad
0
230
Swift Concurrency - 状態監視の罠
objectiveaudio
2
520
Advance Your Career with Open Source
ivargrimstad
0
540
CSC305 Lecture 06
javiergs
PRO
0
230
明日から始めるリファクタリング
ryounasso
0
140
kiroとCodexで最高のSpec駆動開発を!!数時間で web3ネイティブなミニゲームを作ってみたよ!
mashharuki
0
430
CSC509 Lecture 03
javiergs
PRO
0
340
monorepo の Go テストをはやくした〜い!~最小の依存解決への道のり~ / faster-testing-of-monorepos
convto
2
490
Devoxx BE - Local Development in the AI Era
kdubois
0
130
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
34
8.9k
Docker and Python
trallard
46
3.6k
How to Ace a Technical Interview
jacobian
280
24k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
The Straight Up "How To Draw Better" Workshop
denniskardys
238
140k
Building a Scalable Design System with Sketch
lauravandoore
463
33k
Embracing the Ebb and Flow
colly
88
4.8k
It's Worth the Effort
3n
187
28k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
33
2.5k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.4k
Facilitating Awesome Meetings
lara
56
6.6k
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