Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Testando Models
Search
Diogo Beato
June 16, 2016
Programming
44
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Testando Models
slides para o workshop de teste de models
Diogo Beato
June 16, 2016
More Decks by Diogo Beato
See All by Diogo Beato
Cloud Native Banking
diogobeato
1
120
Logging proativo com ELKW
diogobeato
0
270
Isomorphic Javascript
diogobeato
0
180
Fundamentos da JVM
diogobeato
0
350
MinMax
diogobeato
0
110
TDC - Breaking Build
diogobeato
0
90
Breaking Build
diogobeato
0
270
Boas Práticas em APIs REST
diogobeato
2
770
Design para Programadores - Layout
diogobeato
1
67
Other Decks in Programming
See All in Programming
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
290
APNsからLive Activityを開始する話
yumnumm
0
170
コードで差別化できない時代の ソフトウェアエンジニアリング / Software Engineering in an Era Where Code Doesn’t Differentiate
kishida
2
180
気持ちぃ〜角丸 Squircle
ryu1013
0
310
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
210
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
35
17k
R8 の設定見直しでアプリサイズ削減
andpad
0
220
Verilogで学ぶCPU自作入門
uyuki234
8
4.1k
AmebaブログはKMPから卒業します
kmars0605
0
190
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
150
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
170
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Kaigi on Rails 2026, Tokyo, Japan
marcoroth
2
220
Featured
See All Featured
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
2
2k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
560
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
30 Presentation Tips
portentint
PRO
1
430
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
Speed Design
sergeychernyshev
33
2.2k
The Curious Case for Waylosing
cassininazir
1
570
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
Chasing Engaging Ingredients in Design
codingconduct
0
360
Why Our Code Smells
bkeepers
PRO
340
58k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
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