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
38
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
97
Logging proativo com ELKW
diogobeato
0
250
Isomorphic Javascript
diogobeato
0
160
Fundamentos da JVM
diogobeato
0
340
MinMax
diogobeato
0
100
TDC - Breaking Build
diogobeato
0
84
Breaking Build
diogobeato
0
260
Boas Práticas em APIs REST
diogobeato
2
750
Design para Programadores - Layout
diogobeato
1
63
Other Decks in Programming
See All in Programming
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
710
Package Management Learnings from Homebrew
mikemcquaid
0
210
CSC307 Lecture 03
javiergs
PRO
1
490
AI Agent Tool のためのバックエンドアーキテクチャを考える #encraft
izumin5210
6
1.8k
ThorVG Viewer In VS Code
nors
0
770
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
1k
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
560
CSC307 Lecture 09
javiergs
PRO
1
830
CSC307 Lecture 02
javiergs
PRO
1
780
Patterns of Patterns
denyspoltorak
0
1.4k
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
120
CSC307 Lecture 07
javiergs
PRO
0
550
Featured
See All Featured
Reality Check: Gamification 10 Years Later
codingconduct
0
2k
Building Adaptive Systems
keathley
44
2.9k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
130
The World Runs on Bad Software
bkeepers
PRO
72
12k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
240
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
57
50k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
Designing Powerful Visuals for Engaging Learning
tmiket
0
230
Information Architects: The Missing Link in Design Systems
soysaucechin
0
770
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Bash Introduction
62gerente
615
210k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
160
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