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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Alex Soares de Siqueira
October 11, 2019
Programming
43
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
More Decks by Alex Soares de Siqueira
See All by Alex Soares de Siqueira
Engenharia reversa no android
alexsoaresdesiqueira
0
210
Modularização, porque devemos pensar nisso?
alexsoaresdesiqueira
1
230
Segurança para Android, o que eu preciso saber?
alexsoaresdesiqueira
0
78
Other Decks in Programming
See All in Programming
【やさしく解説 設計編 #0】DDDのコード、読めるのに分からない人へ
panda728
PRO
2
300
Terraform標準の組織で AWS CDKをどう使うか
mu7889yoon
1
450
なぜ関数型プログラミングで「型」と「証明」が語られるのか #fp_matsuri
kajitack
3
1.1k
今さら聞けない .NET CLI
htkym
0
170
メールのエイリアス機能を履き違えない
isshinfunada
0
200
AI Engineeringは、AIプロダクトだけのものか? 〜AIがソフトウェアを作る時代の新しい当たり前〜 / No AI in your product. AI Engineering in your development.
rkaga
4
320
PHPだって関数型したい 〜できること、できないこと〜 / fp-in-php
jsoizo
1
260
信頼性について考えてみる(SRE NEXT 2026 miniLT)
hayama17
0
230
2年かけて Deno に DOMMatrix を実装した話 / How I implemented DOMMatrix in Deno over two years
petamoriken
0
190
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
460
ここ半年くらいでAIに作らせたR用ツール
eitsupi
0
360
AI時代に設計が 最大の生産性レバーになる 意図駆動開発とデータを消さない設計|Don't Delete Your Data or Your Intent — Design as the Deepest Lever in the AI Era
tomohisa
0
230
Featured
See All Featured
For a Future-Friendly Web
brad_frost
183
10k
AI: The stuff that nobody shows you
jnunemaker
PRO
9
860
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
We Are The Robots
honzajavorek
0
290
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.7k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
450
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
620
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Embracing the Ebb and Flow
colly
88
5.1k
Product Roadmaps are Hard
iamctodd
55
12k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.9k
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