Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
26
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
180
Modularização, porque devemos pensar nisso?
alexsoaresdesiqueira
1
210
Segurança para Android, o que eu preciso saber?
alexsoaresdesiqueira
0
60
Other Decks in Programming
See All in Programming
UIデザインに役立つ 2025年の最新CSS / The Latest CSS for UI Design 2025
clockmaker
18
7.6k
AIの誤りが許されない業務システムにおいて“信頼されるAI” を目指す / building-trusted-ai-systems
yuya4
6
3.8k
LLMで複雑な検索条件アセットから脱却する!! 生成的検索インタフェースの設計論
po3rin
4
870
TUIライブラリつくってみた / i-just-make-TUI-library
kazto
1
400
チームをチームにするEM
hitode909
0
350
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
0
120
ゆくKotlin くるRust
exoego
1
110
非同期処理の迷宮を抜ける: 初学者がつまづく構造的な原因
pd1xx
1
740
TestingOsaka6_Ozono
o3
0
170
モデル駆動設計をやってみようワークショップ開催報告(Modeling Forum2025) / model driven design workshop report
haru860
0
270
愛される翻訳の秘訣
kishikawakatsumi
3
330
20251212 AI 時代的 Legacy Code 營救術 2025 WebConf
mouson
0
200
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
225
10k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
Un-Boring Meetings
codingconduct
0
160
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
1k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.3k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
160
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
The Spectacular Lies of Maps
axbom
PRO
1
390
Automating Front-end Workflow
addyosmani
1371
200k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
64
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
29
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