SlideShare ist ein Scribd-Unternehmen logo
1 von 21
1
Automated Tests for Android apps
2
Who is that guy ?
Clement Quaquin
Twitter : @openkwaky
Android Lead developer @Equasoft
5 years XP in Android app development
Apps : Xivo / SmartGPS / FdjScan / EuroMillions /
Who am I ? / Chanel UV / Kurio Store / Darty Store /
France Bleu / Rating Reminder lib / ...
3
Why writing Tests ?
● Minimize regressions
● Optimize testing time by iteration
● Improve code quality
#qualitymatters
● Monitor performance
● TDD
4
Test levels
Test levels for an app :
● Unit test (independant and modular code)
● Integration test (code inspection)
● Functionnal test (check user stories)
● Acceptance test (check project's compliance to 
initial requests)
5
Test levels
Android tests
Local unit tests
(on JVM)
in src/test
Instrumentation tests
(require Android device)
in src/androidTest
6
Unit tests
● Test small modular code
● Should be fast (<100ms by test)
● Not dependant of a device
● Run in JVM
7
Unit tests
JUnit 
● facilitates the automated tests writing
● provides useful verification methods :
assertEquals()
assertFalse()
assertNull()
assertNotNull()
assertSame()
assertNotSame()
assertTrue()
8
Unit tests
JUnit : check your objects and methods
9
Instrumented Unit tests : Mockito
Create fake objects behaviour
10
Instrumented Unit tests : Mockito
Verify object's calls
… Rolling !!!
11
Ui tests
● Test screens UI behaviour
● Check user's interactions
● Define UI scenarios
12
Ui tests : JUnit & Espresso
Espresso
● simulates user's clicks, swipes and 
more
● checks view's status and presence
● allows multi-activities scenarios
13
Ui tests : Espresso
● ActivityTestRule launches a starting activity for
the tests
● ServiceTestRule allows calls to a service
(startService, StopService, etc)
14
Ui tests : Espresso
● onView selects a view in the current screen by id
or text displayed
● onData selects a view controlled by an adapter
in the current screen (ListView)
● perform makes an action on a view (click)
● check checks status of a view
15
Ui tests : Espresso
16
Ui tests :
ActivityInstrumentationTestCase2
ActivityInstrumentationTestCase2
● References the activity to test
● Used for more advanced tests on views
● Allows to test views properties
17
Ui tests : ActivityInstrumentationTestCase2
18
Ui tests :
ActivityInstrumentationTestCase2
19
Ui tests : Run
20
Refs
Unit tests :
http://developer.android.com/training/testing/unit-testing/local-unit-tests.html
http://www.vogella.com/tutorials/AndroidTesting/article.html
http://site.mockito.org/mockito/docs/current/org/mockito/Mockito.html
UI tests with Espresso :
http://developer.android.com/training/testing/ui-testing/espresso-testing.html
http://www.vogella.com/tutorials/AndroidTestingEspresso/article.html
https://github.com/vgrec/EspressoExamples
#qualitymatters
http://artemzin.com/blog/android-development-culture-the-document-qualitymatters/
Demo UI tests for France Bleu app :
https://youtu.be/GofurEVYvbo
21
Questions ?
Thank you !

Weitere ähnliche Inhalte

Was ist angesagt?

Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
VincitOy
 
More than Programming!
More than Programming!More than Programming!
More than Programming!
Sophy Eung
 

Was ist angesagt? (20)

Project Management: Burn-Down Chart / OrangeHRM Project MOD (eng)
Project Management: Burn-Down Chart / OrangeHRM Project MOD (eng)Project Management: Burn-Down Chart / OrangeHRM Project MOD (eng)
Project Management: Burn-Down Chart / OrangeHRM Project MOD (eng)
 
Choosing the Best Open Source Test Automation Tool for You
Choosing the Best Open Source Test Automation Tool for YouChoosing the Best Open Source Test Automation Tool for You
Choosing the Best Open Source Test Automation Tool for You
 
Inside Android Testing
Inside Android TestingInside Android Testing
Inside Android Testing
 
Automation using RobotFramework for embedded device
Automation using RobotFramework for embedded deviceAutomation using RobotFramework for embedded device
Automation using RobotFramework for embedded device
 
Robot framework - SAST Väst Q3
Robot framework - SAST Väst Q3Robot framework - SAST Väst Q3
Robot framework - SAST Väst Q3
 
Unit Testing Your Application
Unit Testing Your ApplicationUnit Testing Your Application
Unit Testing Your Application
 
Acceptance Test Driven Development and Robot Framework
Acceptance Test Driven Development and Robot FrameworkAcceptance Test Driven Development and Robot Framework
Acceptance Test Driven Development and Robot Framework
 
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
 
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
 
Android Testing: An Overview
Android Testing: An OverviewAndroid Testing: An Overview
Android Testing: An Overview
 
Continuous Inspection of Code Quality: SonarQube
Continuous Inspection of Code Quality: SonarQubeContinuous Inspection of Code Quality: SonarQube
Continuous Inspection of Code Quality: SonarQube
 
More than Programming!
More than Programming!More than Programming!
More than Programming!
 
Static Analysis with Sonarlint
Static Analysis with SonarlintStatic Analysis with Sonarlint
Static Analysis with Sonarlint
 
Android Devops : Master Continuous Integration and Delivery
Android Devops : Master Continuous Integration and DeliveryAndroid Devops : Master Continuous Integration and Delivery
Android Devops : Master Continuous Integration and Delivery
 
Introduction to Robot Framework
Introduction to Robot FrameworkIntroduction to Robot Framework
Introduction to Robot Framework
 
Orientation Program on Automated Software testing Powered by Infaum Education...
Orientation Program on Automated Software testing Powered by Infaum Education...Orientation Program on Automated Software testing Powered by Infaum Education...
Orientation Program on Automated Software testing Powered by Infaum Education...
 
Android testing
Android testingAndroid testing
Android testing
 
How we test the code analyzer
How we test the code analyzerHow we test the code analyzer
How we test the code analyzer
 
Hands-on Experience Model based testing with spec explorer
Hands-on Experience Model based testing with spec explorer Hands-on Experience Model based testing with spec explorer
Hands-on Experience Model based testing with spec explorer
 
Android testing
Android testingAndroid testing
Android testing
 

Andere mochten auch

Andere mochten auch (13)

Inleefstage
InleefstageInleefstage
Inleefstage
 
Trabajo 2
Trabajo 2Trabajo 2
Trabajo 2
 
Prenda damarta short2
Prenda damarta short2Prenda damarta short2
Prenda damarta short2
 
Tata Steel
Tata SteelTata Steel
Tata Steel
 
Circuito rc
Circuito rcCircuito rc
Circuito rc
 
EPIC RESEARCH SINGAPORE - Daily SGX Singapore report of 11 January 2016
EPIC RESEARCH SINGAPORE - Daily SGX Singapore report of 11 January 2016EPIC RESEARCH SINGAPORE - Daily SGX Singapore report of 11 January 2016
EPIC RESEARCH SINGAPORE - Daily SGX Singapore report of 11 January 2016
 
Embarazo precoz
Embarazo precozEmbarazo precoz
Embarazo precoz
 
EPIC RESEARCH SINGAPORE - Daily SGX Singapore report of 05 February 2016
EPIC RESEARCH SINGAPORE - Daily SGX Singapore report of 05 February 2016EPIC RESEARCH SINGAPORE - Daily SGX Singapore report of 05 February 2016
EPIC RESEARCH SINGAPORE - Daily SGX Singapore report of 05 February 2016
 
Artículos de María Carolina Dávila Llinás
Artículos de María Carolina Dávila LlinásArtículos de María Carolina Dávila Llinás
Artículos de María Carolina Dávila Llinás
 
Portfolio2015 Lucia Pecorari
Portfolio2015 Lucia PecorariPortfolio2015 Lucia Pecorari
Portfolio2015 Lucia Pecorari
 
Erfolgs- und Differenzierungsfaktoren im Schweizer E-Commerce 2015 - topsoft ...
Erfolgs- und Differenzierungsfaktoren im Schweizer E-Commerce 2015 - topsoft ...Erfolgs- und Differenzierungsfaktoren im Schweizer E-Commerce 2015 - topsoft ...
Erfolgs- und Differenzierungsfaktoren im Schweizer E-Commerce 2015 - topsoft ...
 
저녁있는 삶으로 인도하는 통합된 업무환경 : Office365 솔루션즈로 나의 업무환경 스마트하게 통합하기_조규승 원노트 MVP / 트루인포
저녁있는 삶으로 인도하는 통합된 업무환경 : Office365 솔루션즈로 나의 업무환경 스마트하게 통합하기_조규승 원노트 MVP / 트루인포저녁있는 삶으로 인도하는 통합된 업무환경 : Office365 솔루션즈로 나의 업무환경 스마트하게 통합하기_조규승 원노트 MVP / 트루인포
저녁있는 삶으로 인도하는 통합된 업무환경 : Office365 솔루션즈로 나의 업무환경 스마트하게 통합하기_조규승 원노트 MVP / 트루인포
 
HT15, DA354A - Fel- och filhantering
HT15, DA354A - Fel- och filhanteringHT15, DA354A - Fel- och filhantering
HT15, DA354A - Fel- och filhantering
 

Ähnlich wie Automated Tests for Android apps

Shailaja_SoftwareEngineerQA_4.9Exp
Shailaja_SoftwareEngineerQA_4.9ExpShailaja_SoftwareEngineerQA_4.9Exp
Shailaja_SoftwareEngineerQA_4.9Exp
Shailaja Chundru
 
UIAutomation_Testing
UIAutomation_TestingUIAutomation_Testing
UIAutomation_Testing
Krunal Soni
 
2012 mobile testingsummit-moet
2012 mobile testingsummit-moet2012 mobile testingsummit-moet
2012 mobile testingsummit-moet
Eing Ong
 
Testing & continuous delivery
Testing & continuous deliveryTesting & continuous delivery
Testing & continuous delivery
Nelson Melina
 
Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Unit testing, UI testing and Test Driven Development in Visual Studio 2012Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Jacinto Limjap
 
Automated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsAutomated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra Solutions
Quontra Solutions
 
Stop guessing, start testing – mobile testing done right - Timo Euteneuer
Stop guessing, start testing – mobile testing done right - Timo EuteneuerStop guessing, start testing – mobile testing done right - Timo Euteneuer
Stop guessing, start testing – mobile testing done right - Timo Euteneuer
JAXLondon_Conference
 

Ähnlich wie Automated Tests for Android apps (20)

Front-end Testing (manual, automated, you name it) - Erich Jagomägis - Develo...
Front-end Testing (manual, automated, you name it) - Erich Jagomägis - Develo...Front-end Testing (manual, automated, you name it) - Erich Jagomägis - Develo...
Front-end Testing (manual, automated, you name it) - Erich Jagomägis - Develo...
 
Unit Testing in Android
Unit Testing in AndroidUnit Testing in Android
Unit Testing in Android
 
Shailaja_SoftwareEngineerQA_4.9Exp
Shailaja_SoftwareEngineerQA_4.9ExpShailaja_SoftwareEngineerQA_4.9Exp
Shailaja_SoftwareEngineerQA_4.9Exp
 
UIAutomation_Testing
UIAutomation_TestingUIAutomation_Testing
UIAutomation_Testing
 
Mobile Application Testing
Mobile Application TestingMobile Application Testing
Mobile Application Testing
 
Mobile Application Testing
Mobile Application Testing Mobile Application Testing
Mobile Application Testing
 
Unit testing (eng)
Unit testing (eng)Unit testing (eng)
Unit testing (eng)
 
2012 mobile testingsummit-moet
2012 mobile testingsummit-moet2012 mobile testingsummit-moet
2012 mobile testingsummit-moet
 
Android TDD
Android TDDAndroid TDD
Android TDD
 
Automated Generation, Evolution and Maintenance: a perspective for mobile GUI...
Automated Generation, Evolution and Maintenance: a perspective for mobile GUI...Automated Generation, Evolution and Maintenance: a perspective for mobile GUI...
Automated Generation, Evolution and Maintenance: a perspective for mobile GUI...
 
Testing & continuous delivery
Testing & continuous deliveryTesting & continuous delivery
Testing & continuous delivery
 
2.Android App Development_ Types of Automated Unit Tests.pdf
2.Android App Development_ Types of Automated Unit Tests.pdf2.Android App Development_ Types of Automated Unit Tests.pdf
2.Android App Development_ Types of Automated Unit Tests.pdf
 
Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Unit testing, UI testing and Test Driven Development in Visual Studio 2012Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Unit testing, UI testing and Test Driven Development in Visual Studio 2012
 
Automated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsAutomated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra Solutions
 
Testing concepts
Testing conceptsTesting concepts
Testing concepts
 
Fight back android fragmentation
Fight back android fragmentationFight back android fragmentation
Fight back android fragmentation
 
Mobile Automation Meetup Presentation [English]
Mobile Automation Meetup Presentation [English]Mobile Automation Meetup Presentation [English]
Mobile Automation Meetup Presentation [English]
 
Stop guessing, start testing – mobile testing done right - Timo Euteneuer
Stop guessing, start testing – mobile testing done right - Timo EuteneuerStop guessing, start testing – mobile testing done right - Timo Euteneuer
Stop guessing, start testing – mobile testing done right - Timo Euteneuer
 
LDNSE: Testdroid for Mobile App and Web Testing (London Selenium Meetup)
LDNSE: Testdroid for Mobile App and Web Testing (London Selenium Meetup)LDNSE: Testdroid for Mobile App and Web Testing (London Selenium Meetup)
LDNSE: Testdroid for Mobile App and Web Testing (London Selenium Meetup)
 
Client Side Unit Testing
Client Side Unit TestingClient Side Unit Testing
Client Side Unit Testing
 

Kürzlich hochgeladen

Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Christo Ananth
 

Kürzlich hochgeladen (20)

Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 

Automated Tests for Android apps