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
Teste no Android. Porque? Como? O que utilizar?
Search
Alex Soares de Siqueira
October 11, 2019
Programming
0
20
Teste no Android. Porque? Como? O que utilizar?
Um breve resumo sobre testes no android, como fazer e o que utilizamos.
Alex Soares de Siqueira
October 11, 2019
Tweet
Share
More Decks by Alex Soares de Siqueira
See All by Alex Soares de Siqueira
Engenharia reversa no android
alexsoaresdesiqueira
0
150
Modularização, porque devemos pensar nisso?
alexsoaresdesiqueira
1
190
Segurança para Android, o que eu preciso saber?
alexsoaresdesiqueira
0
56
Other Decks in Programming
See All in Programming
サービスレベルを管理してアジャイルを加速しよう!! / slm-accelerate-agility
tomoyakitaura
1
200
Boost Your Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
770
状態と共に暮らす:ステートフルへの挑戦
ypresto
3
1.1k
Designing Your Organization's Test Pyramid ( #scrumniigata )
teyamagu
PRO
2
230
SwiftDataのカスタムデータストアを試してみた
1mash0
0
140
note の Elasticsearch 更新系を支える技術
tchov
9
3.4k
RubyKaigi Dev Meeting 2025
tenderlove
1
1.3k
開発者フレンドリーで顧客も満足?Platformの秘密
algoartis
0
170
API for docs
soutaro
4
1.6k
Browser and UI #2 HTML/ARIA
ken7253
2
170
fieldalignmentから見るGoの構造体
kuro_kurorrr
0
130
カオスに立ち向かう小規模チームの装備の選択〜フルスタックTSという装備の強み _ 弱み〜/Choosing equipment for a small team facing chaos ~ Strengths and weaknesses of full-stack TS~
bitkey
1
130
Featured
See All Featured
The Cult of Friendly URLs
andyhume
78
6.3k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
2.9k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
690
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.5k
Adopting Sorbet at Scale
ufuk
76
9.3k
Done Done
chrislema
184
16k
Into the Great Unknown - MozCon
thekraken
38
1.7k
Why You Should Never Use an ORM
jnunemaker
PRO
56
9.3k
A better future with KSS
kneath
239
17k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
Visualization
eitanlees
146
16k
Transcript
None
Alex Soares Desenvolvedor Android @a.soares.siqueira /alex-soares-siqueira /AlexSoaresDeSiqueira
Teste no android Porque? Como? O que utilizar?
Quantas pessoas aqui escrevem testes para suas aplicações?
None
Porque testar?
Garantir qualidade do código
Entrega de valor ao cliente
Documentação
Teste + android
Testes unitários Locais
Testes unitários locais ⇢ JVM
Testes unitários locais ⇢ JVM ⇢ Regras de negócio
Testes unitários locais ⇢ JVM ⇢ Regras de negócio ⇢
JUnit
Testes unitários locais ⇢ JVM ⇢ Regras de negócio ⇢
JUnit ⇢ Rápido
Testes unitários locais ⇢ JVM ⇢ Regras de negócio ⇢
JUnit ⇢ Rápido ⇢ src/teste/
Como fazer? ⇢ Sufixo Test
Como fazer? ⇢ Sufixo Test ⇢ @Test
Como fazer? ⇢ Sufixo Test ⇢ @Test ⇢ @Before
Como fazer? ⇢ Sufixo Test ⇢ @Test ⇢ @Before ⇢
@After
Como fazer? ⇢ Sufixo Test ⇢ @Test ⇢ @Before ⇢
@After ⇢ [nome do metodo]_[retorno esperado]_[input esperado]
Como fazer? ⇢ Sufixo Test ⇢ @Test ⇢ @Before ⇢
@After ⇢ [nome do metodo]_[retorno esperado]_[input esperado] ⇢ GIVEN WHEN THEN
None
None
None
None
None
None
None
None
None
Testes unitários Intrumentados
Testes unitários instrumentados ⇢ android
Testes unitários instrumentados ⇢ android ⇢ Ui
Testes unitários instrumentados ⇢ android ⇢ Ui ⇢ Espresso
Testes unitários instrumentados ⇢ android ⇢ Ui ⇢ Espresso ⇢
Demorado em relação ao teste local
Testes unitários instrumentados ⇢ android ⇢ Ui ⇢ Espresso ⇢
Demorado em relação ao teste local ⇢ src/androidTest/
Como fazer? ⇢ Sufixo Test
Como fazer? ⇢ Sufixo Test ⇢ Anotações do JUnit
Como fazer? ⇢ Sufixo Test ⇢ Anotações do JUnit ⇢
[ação]_[retorno esperado]
Como fazer? ⇢ Sufixo Test ⇢ Anotações do JUnit ⇢
[ação]_[retorno esperado] ⇢ View -> procure -> Ação
None
None
None
None
None
None
None
None
None
None
Robot Pattern
Robot Pattern
Robot Pattern
Robot Pattern
Robot Pattern
Robot Pattern
Robot Pattern
Robot Pattern
Robot Pattern
Robot Pattern
Robot Pattern
Robot Pattern
Robot Pattern
Framework externos
Frameworks externos
Frameworks externos
Frameworks externos
Frameworks externos
Frameworks externos
Code Coverage
Dedicar um tempo a mais de desenvolvimento garante uma melhor
experiência para o cliente Insight
Quando o teste Passa!!!!!!
Dúvidas?
Muito obrigado! /alex-soares-siqueira /AlexSoaresDeSiqueira
None
Referências Projeto https://github.com/AlexSoaresDeSiqueira/TestSample-TDC Robot Pattern https://jakewharton.com/testing-robots/ GIVEN WHEN THEN https://martinfowler.com/bliki/GivenWhenThen.html
Espresso https://developer.android.com/training/testing/espresso Teste Unitario Local https://developer.android.com/training/testing/unit-testing/local-unit-tests