SlideShare une entreprise Scribd logo
1  sur  31
Bye Bye Charles, Welcome Odo!
Android Stammtisch
28.Mai 2014
Danny Preussler
Leading the way in mobile
commerce
Our mobile app is available in 43 countries
Groupon’s vibrant mobile marketplace connects
consumers with their local economy
Sources: Internal Data; iTunes ranking for US stores available here -
https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewFeature?
Nearly 70 million people worldwide
have downloaded our mobile app to date; 9
million in Q4 2013.
One of the 25 most downloaded
free apps of all time
Nearly 50%
of our global transactions
completed on a mobile device in December
2013
The Problem
Test data from
WebService(s)
Mock data?
• Easy with DI frameworks
• Hard with black box test frameworks
• Do not reflect server changes
+
-
Use real data?
• Real world
• Hard to setup all test cases
(manipulate db with scripts …)
• Automation mostly breaks
because of networking
+
-
Do both
• Return mocked data if needed
• Use real world real data
• Modify data on the fly if needed
We need:
• Someone who can change
depending on what is needed?
A Solution
Odo-ed
Response Override
• Return fixed response content
• Return fixed response code
• Add delays
Response Override cont.
• Add/remove request headers
• Change content
• Change response code
Response Override cont.
• Do sequences of all those
• Supports Plugins for custom responses
i.e. makeDealSoldOut
Request Override
• Add/remove request headers
• Custom request – add/change parameters
• Change the target
i.e. send production request to staging/test
Odo Demo
Build a plugin
public class MyPlugins {
@ResponseOverride(
httpCode=302,
description="Return HTTP302")
public static String http302(String source) throws Exception {
return „<html><body>You are being redirected.</body></html>“;
}
Done
Configuration
• No installation needed, simple war file
• Webinterface
• API
API
• JSON REST API
• Java Client available
public class OdoTest extends
ActivityInstrumentationTestCase2<LoginActivity> {
Client odoClient = new Client("33", false);
public void testOdo() throws Exception {
LoginActivity activity = getActivity();
// genymotion != localhost
odoClient.setHostName("192.168.56.1");
odoClient.addMethodToResponseOverride(
"Countries",
"com.groupon.odo.internal.Common.http503");
odoClient.toggleResponseOverride("Countries", true);
}
}
What do you have to
change in your app?
Proxy proxy = new Proxy(
Proxy.Type.HTTP,
new InetSocketAddress(
"192.168.56.1", 9090));
new URL("http://api...").openConnection(proxy);
HttpUrlConnection
OkHttp
Proxy proxy = new Proxy(
Proxy.Type.HTTP,
new InetSocketAddress(
"192.168.56.1", 9090));
OkHttpClient client = new OkHttpClient();
client.setProxy(proxy);
DefaultHttpClient httpclient =
new DefaultHttpClient();
httpclient.getParams().setParameter(
ConnRoutePNames.DEFAULT_PROXY,
new HttpHost("192.168.56.1", 9090));
Old school apache
Configuration
• Supports multiple users through client id’s
• This way you can share proxy
• Apps send them as http-header
Configuration
• Forwarding proxy mode
• Man in the middle mode
• SSL certificate download page
Behind odo
• Utilizes forwarding proxy, Spring, Spring
Boot, Java servlets, embedded database
• Packaged as a .war file
• No setup required
Advantages
• Test Automation
• Avoid stub data maintenance
• Create dynamic test automation
• Manual Test
• UI allows easy configuration changes
• No coding knowledge required
• Development
• Remove dependencies on server changes for client
development
Odo + vs Charles
• Is free
• Is open source
• Is “programmable”
• Is extendable via plugins
• Has API
• Perfect for test automation
Where can I get Odo?
https://github.com/groupon
In a couple of days…

Follow us…
Abgeschottete Realität
Android Apps kontrolliert im Emulator testen
Danny Preussler, Groupon
The Day After
Lars Röwekamp, open knowledge
Danny Preussler, Groupon
Follow us…
https://engineering.groupon.co
m/
Michael Burton, Roboguice
Carlos Sessa, 50 Android hacks
David van der Bokke, RoboRemote
David Willson, Odo
….
Thank you

Contenu connexe

Tendances

Advanced Dagger talk from 360andev
Advanced Dagger talk from 360andevAdvanced Dagger talk from 360andev
Advanced Dagger talk from 360andevMike Nakhimovich
 
Contextual communications and why you should care - Droidcon DE
Contextual communications and why you should care - Droidcon DEContextual communications and why you should care - Droidcon DE
Contextual communications and why you should care - Droidcon DEMarcos Placona
 
The Screenplay Pattern: Better Interactions for Better Automation
The Screenplay Pattern: Better Interactions for Better AutomationThe Screenplay Pattern: Better Interactions for Better Automation
The Screenplay Pattern: Better Interactions for Better AutomationApplitools
 
Droidcon ES '16 - How to fail going offline
Droidcon ES '16 - How to fail going offlineDroidcon ES '16 - How to fail going offline
Droidcon ES '16 - How to fail going offlineJavier de Pedro López
 
Async task, threads, pools, and executors oh my!
Async task, threads, pools, and executors oh my!Async task, threads, pools, and executors oh my!
Async task, threads, pools, and executors oh my!Stacy Devino
 
Property based tests and where to find them - Andrzej Jóźwiak - TomTom Webina...
Property based tests and where to find them - Andrzej Jóźwiak - TomTom Webina...Property based tests and where to find them - Andrzej Jóźwiak - TomTom Webina...
Property based tests and where to find them - Andrzej Jóźwiak - TomTom Webina...Andrzej Jóźwiak
 
A friend in need - A JS indeed
A friend in need - A JS indeedA friend in need - A JS indeed
A friend in need - A JS indeedYonatan Levin
 
Testing iOS10 Apps with Appium and its new XCUITest backend
Testing iOS10 Apps with Appium and its new XCUITest backendTesting iOS10 Apps with Appium and its new XCUITest backend
Testing iOS10 Apps with Appium and its new XCUITest backendTestplus GmbH
 
Sword fighting with Dagger GDG-NYC Jan 2016
 Sword fighting with Dagger GDG-NYC Jan 2016 Sword fighting with Dagger GDG-NYC Jan 2016
Sword fighting with Dagger GDG-NYC Jan 2016Mike Nakhimovich
 
iOS Automation: XCUITest + Gherkin
iOS Automation: XCUITest + GherkiniOS Automation: XCUITest + Gherkin
iOS Automation: XCUITest + GherkinKenneth Poon
 
Android dev toolbox
Android dev toolboxAndroid dev toolbox
Android dev toolboxShem Magnezi
 
Are app servers still fascinating
Are app servers still fascinatingAre app servers still fascinating
Are app servers still fascinatingAntonio Goncalves
 
Geecon - Improve your Android-fu with Kotlin
Geecon - Improve your Android-fu with KotlinGeecon - Improve your Android-fu with Kotlin
Geecon - Improve your Android-fu with KotlinNicolas Fränkel
 
Mobile developer is Software developer
Mobile developer is Software developerMobile developer is Software developer
Mobile developer is Software developerEugen Martynov
 
Polyglot automation - QA Fest - 2015
Polyglot automation - QA Fest - 2015Polyglot automation - QA Fest - 2015
Polyglot automation - QA Fest - 2015Iakiv Kramarenko
 
To inject or not to inject: CDI is the question
To inject or not to inject: CDI is the questionTo inject or not to inject: CDI is the question
To inject or not to inject: CDI is the questionAntonio Goncalves
 
UI Testing with Earl Grey
UI Testing with Earl GreyUI Testing with Earl Grey
UI Testing with Earl GreyShyam Bhat
 
Android Unit Test
Android Unit TestAndroid Unit Test
Android Unit TestPhuoc Bui
 

Tendances (20)

Advanced Dagger talk from 360andev
Advanced Dagger talk from 360andevAdvanced Dagger talk from 360andev
Advanced Dagger talk from 360andev
 
Contextual communications and why you should care - Droidcon DE
Contextual communications and why you should care - Droidcon DEContextual communications and why you should care - Droidcon DE
Contextual communications and why you should care - Droidcon DE
 
The Screenplay Pattern: Better Interactions for Better Automation
The Screenplay Pattern: Better Interactions for Better AutomationThe Screenplay Pattern: Better Interactions for Better Automation
The Screenplay Pattern: Better Interactions for Better Automation
 
CDI: How do I ?
CDI: How do I ?CDI: How do I ?
CDI: How do I ?
 
Droidcon ES '16 - How to fail going offline
Droidcon ES '16 - How to fail going offlineDroidcon ES '16 - How to fail going offline
Droidcon ES '16 - How to fail going offline
 
Async task, threads, pools, and executors oh my!
Async task, threads, pools, and executors oh my!Async task, threads, pools, and executors oh my!
Async task, threads, pools, and executors oh my!
 
Property based tests and where to find them - Andrzej Jóźwiak - TomTom Webina...
Property based tests and where to find them - Andrzej Jóźwiak - TomTom Webina...Property based tests and where to find them - Andrzej Jóźwiak - TomTom Webina...
Property based tests and where to find them - Andrzej Jóźwiak - TomTom Webina...
 
A friend in need - A JS indeed
A friend in need - A JS indeedA friend in need - A JS indeed
A friend in need - A JS indeed
 
Testing iOS10 Apps with Appium and its new XCUITest backend
Testing iOS10 Apps with Appium and its new XCUITest backendTesting iOS10 Apps with Appium and its new XCUITest backend
Testing iOS10 Apps with Appium and its new XCUITest backend
 
Sword fighting with Dagger GDG-NYC Jan 2016
 Sword fighting with Dagger GDG-NYC Jan 2016 Sword fighting with Dagger GDG-NYC Jan 2016
Sword fighting with Dagger GDG-NYC Jan 2016
 
iOS Automation: XCUITest + Gherkin
iOS Automation: XCUITest + GherkiniOS Automation: XCUITest + Gherkin
iOS Automation: XCUITest + Gherkin
 
Android dev toolbox
Android dev toolboxAndroid dev toolbox
Android dev toolbox
 
Are app servers still fascinating
Are app servers still fascinatingAre app servers still fascinating
Are app servers still fascinating
 
JS and patterns
JS and patternsJS and patterns
JS and patterns
 
Geecon - Improve your Android-fu with Kotlin
Geecon - Improve your Android-fu with KotlinGeecon - Improve your Android-fu with Kotlin
Geecon - Improve your Android-fu with Kotlin
 
Mobile developer is Software developer
Mobile developer is Software developerMobile developer is Software developer
Mobile developer is Software developer
 
Polyglot automation - QA Fest - 2015
Polyglot automation - QA Fest - 2015Polyglot automation - QA Fest - 2015
Polyglot automation - QA Fest - 2015
 
To inject or not to inject: CDI is the question
To inject or not to inject: CDI is the questionTo inject or not to inject: CDI is the question
To inject or not to inject: CDI is the question
 
UI Testing with Earl Grey
UI Testing with Earl GreyUI Testing with Earl Grey
UI Testing with Earl Grey
 
Android Unit Test
Android Unit TestAndroid Unit Test
Android Unit Test
 

Similaire à Bye Bye Charles, Welcome Odo, Android Meetup Berlin May 2014

Integration and Automation @ mobile.de (eBay Tech Talk)
Integration and Automation @ mobile.de (eBay Tech Talk)Integration and Automation @ mobile.de (eBay Tech Talk)
Integration and Automation @ mobile.de (eBay Tech Talk)Karen Almog
 
MongoDB Mobile
MongoDB Mobile MongoDB Mobile
MongoDB Mobile MongoDB
 
MongoDB.local Atlanta: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
MongoDB.local Atlanta: MongoDB Mobile: Bringing the Power of MongoDB to Your ...MongoDB.local Atlanta: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
MongoDB.local Atlanta: MongoDB Mobile: Bringing the Power of MongoDB to Your ...MongoDB
 
MongoDB.local Austin 2018: Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch A...
MongoDB.local Austin 2018:  Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch A...MongoDB.local Austin 2018:  Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch A...
MongoDB.local Austin 2018: Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch A...MongoDB
 
Rockstar Android Testing (Mobile TechCon Munich 2014)
Rockstar Android Testing (Mobile TechCon Munich 2014)Rockstar Android Testing (Mobile TechCon Munich 2014)
Rockstar Android Testing (Mobile TechCon Munich 2014)Danny Preussler
 
MongoDB.local Berlin: MongoDB Mobile
MongoDB.local Berlin: MongoDB MobileMongoDB.local Berlin: MongoDB Mobile
MongoDB.local Berlin: MongoDB MobileMongoDB
 
MongoDB.local DC 2018: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
MongoDB.local DC 2018: MongoDB Mobile: Bringing the Power of MongoDB to Your ...MongoDB.local DC 2018: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
MongoDB.local DC 2018: MongoDB Mobile: Bringing the Power of MongoDB to Your ...MongoDB
 
MongoDB Mobile - Bringing the Power of MongoDB to your Device
MongoDB Mobile - Bringing the Power of MongoDB to your DeviceMongoDB Mobile - Bringing the Power of MongoDB to your Device
MongoDB Mobile - Bringing the Power of MongoDB to your DeviceMongoDB
 
The Hitchhicker’s Guide to Windows Azure Mobile Services | FalafelCON 2014
The Hitchhicker’s Guide to Windows Azure Mobile Services | FalafelCON 2014The Hitchhicker’s Guide to Windows Azure Mobile Services | FalafelCON 2014
The Hitchhicker’s Guide to Windows Azure Mobile Services | FalafelCON 2014FalafelSoftware
 
MongoDB.local Seattle 2019: MongoDB Mobile: Bringing the Power of MongoDB to ...
MongoDB.local Seattle 2019: MongoDB Mobile: Bringing the Power of MongoDB to ...MongoDB.local Seattle 2019: MongoDB Mobile: Bringing the Power of MongoDB to ...
MongoDB.local Seattle 2019: MongoDB Mobile: Bringing the Power of MongoDB to ...MongoDB
 
MongoDB Mobile: Bringing the Power of MongoDB to Your Device
MongoDB Mobile: Bringing the Power of MongoDB to Your DeviceMongoDB Mobile: Bringing the Power of MongoDB to Your Device
MongoDB Mobile: Bringing the Power of MongoDB to Your DeviceMongoDB
 
MongoDB.local Sydney 2019: MongoDB Mobile: Bringing the Power of MongoDB to Y...
MongoDB.local Sydney 2019: MongoDB Mobile: Bringing the Power of MongoDB to Y...MongoDB.local Sydney 2019: MongoDB Mobile: Bringing the Power of MongoDB to Y...
MongoDB.local Sydney 2019: MongoDB Mobile: Bringing the Power of MongoDB to Y...MongoDB
 
MongoDB.local Austin 2018: MongoDB Mobile: Bringing the Power of MongoDB to Y...
MongoDB.local Austin 2018: MongoDB Mobile: Bringing the Power of MongoDB to Y...MongoDB.local Austin 2018: MongoDB Mobile: Bringing the Power of MongoDB to Y...
MongoDB.local Austin 2018: MongoDB Mobile: Bringing the Power of MongoDB to Y...MongoDB
 
MongoDB Mobile: Bringing the Power of MongoDB to Your Device
MongoDB Mobile: Bringing the Power of MongoDB to Your DeviceMongoDB Mobile: Bringing the Power of MongoDB to Your Device
MongoDB Mobile: Bringing the Power of MongoDB to Your DeviceMongoDB
 
MongDB Mobile: Bringing the Power of MongoDB to Your Device
MongDB Mobile: Bringing the Power of MongoDB to Your DeviceMongDB Mobile: Bringing the Power of MongoDB to Your Device
MongDB Mobile: Bringing the Power of MongoDB to Your DeviceMatt Lord
 
Faites évoluer votre accès aux données avec MongoDB Stitch
Faites évoluer votre accès aux données avec MongoDB StitchFaites évoluer votre accès aux données avec MongoDB Stitch
Faites évoluer votre accès aux données avec MongoDB StitchMongoDB
 
Building Your First App with MongoDB Stitch
Building Your First App with MongoDB StitchBuilding Your First App with MongoDB Stitch
Building Your First App with MongoDB StitchMongoDB
 
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...MongoDB
 

Similaire à Bye Bye Charles, Welcome Odo, Android Meetup Berlin May 2014 (20)

Integration and Automation @ mobile.de (eBay Tech Talk)
Integration and Automation @ mobile.de (eBay Tech Talk)Integration and Automation @ mobile.de (eBay Tech Talk)
Integration and Automation @ mobile.de (eBay Tech Talk)
 
MongoDB Mobile
MongoDB Mobile MongoDB Mobile
MongoDB Mobile
 
MongoDB.local Atlanta: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
MongoDB.local Atlanta: MongoDB Mobile: Bringing the Power of MongoDB to Your ...MongoDB.local Atlanta: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
MongoDB.local Atlanta: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
 
MongoDB.local Austin 2018: Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch A...
MongoDB.local Austin 2018:  Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch A...MongoDB.local Austin 2018:  Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch A...
MongoDB.local Austin 2018: Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch A...
 
Rockstar Android Testing (Mobile TechCon Munich 2014)
Rockstar Android Testing (Mobile TechCon Munich 2014)Rockstar Android Testing (Mobile TechCon Munich 2014)
Rockstar Android Testing (Mobile TechCon Munich 2014)
 
MongoDB.local Berlin: MongoDB Mobile
MongoDB.local Berlin: MongoDB MobileMongoDB.local Berlin: MongoDB Mobile
MongoDB.local Berlin: MongoDB Mobile
 
MongoDB.local DC 2018: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
MongoDB.local DC 2018: MongoDB Mobile: Bringing the Power of MongoDB to Your ...MongoDB.local DC 2018: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
MongoDB.local DC 2018: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
 
MongoDB Mobile - Bringing the Power of MongoDB to your Device
MongoDB Mobile - Bringing the Power of MongoDB to your DeviceMongoDB Mobile - Bringing the Power of MongoDB to your Device
MongoDB Mobile - Bringing the Power of MongoDB to your Device
 
The Hitchhicker’s Guide to Windows Azure Mobile Services | FalafelCON 2014
The Hitchhicker’s Guide to Windows Azure Mobile Services | FalafelCON 2014The Hitchhicker’s Guide to Windows Azure Mobile Services | FalafelCON 2014
The Hitchhicker’s Guide to Windows Azure Mobile Services | FalafelCON 2014
 
MongoDB.local Seattle 2019: MongoDB Mobile: Bringing the Power of MongoDB to ...
MongoDB.local Seattle 2019: MongoDB Mobile: Bringing the Power of MongoDB to ...MongoDB.local Seattle 2019: MongoDB Mobile: Bringing the Power of MongoDB to ...
MongoDB.local Seattle 2019: MongoDB Mobile: Bringing the Power of MongoDB to ...
 
MongoDB Mobile: Bringing the Power of MongoDB to Your Device
MongoDB Mobile: Bringing the Power of MongoDB to Your DeviceMongoDB Mobile: Bringing the Power of MongoDB to Your Device
MongoDB Mobile: Bringing the Power of MongoDB to Your Device
 
MongoDB.local Sydney 2019: MongoDB Mobile: Bringing the Power of MongoDB to Y...
MongoDB.local Sydney 2019: MongoDB Mobile: Bringing the Power of MongoDB to Y...MongoDB.local Sydney 2019: MongoDB Mobile: Bringing the Power of MongoDB to Y...
MongoDB.local Sydney 2019: MongoDB Mobile: Bringing the Power of MongoDB to Y...
 
MongoDB.local Austin 2018: MongoDB Mobile: Bringing the Power of MongoDB to Y...
MongoDB.local Austin 2018: MongoDB Mobile: Bringing the Power of MongoDB to Y...MongoDB.local Austin 2018: MongoDB Mobile: Bringing the Power of MongoDB to Y...
MongoDB.local Austin 2018: MongoDB Mobile: Bringing the Power of MongoDB to Y...
 
Firefox OS Presentation
Firefox OS PresentationFirefox OS Presentation
Firefox OS Presentation
 
MongoDB Mobile: Bringing the Power of MongoDB to Your Device
MongoDB Mobile: Bringing the Power of MongoDB to Your DeviceMongoDB Mobile: Bringing the Power of MongoDB to Your Device
MongoDB Mobile: Bringing the Power of MongoDB to Your Device
 
MongDB Mobile: Bringing the Power of MongoDB to Your Device
MongDB Mobile: Bringing the Power of MongoDB to Your DeviceMongDB Mobile: Bringing the Power of MongoDB to Your Device
MongDB Mobile: Bringing the Power of MongoDB to Your Device
 
Faites évoluer votre accès aux données avec MongoDB Stitch
Faites évoluer votre accès aux données avec MongoDB StitchFaites évoluer votre accès aux données avec MongoDB Stitch
Faites évoluer votre accès aux données avec MongoDB Stitch
 
Building Your First App with MongoDB Stitch
Building Your First App with MongoDB StitchBuilding Your First App with MongoDB Stitch
Building Your First App with MongoDB Stitch
 
Android class provider in mumbai
Android class provider in mumbaiAndroid class provider in mumbai
Android class provider in mumbai
 
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
 

Plus de Danny Preussler

We aint got no time - Droidcon Nairobi
We aint got no time - Droidcon NairobiWe aint got no time - Droidcon Nairobi
We aint got no time - Droidcon NairobiDanny Preussler
 
Test Driven Development on Android (Kotlin Kenya)
Test Driven Development on Android (Kotlin Kenya)Test Driven Development on Android (Kotlin Kenya)
Test Driven Development on Android (Kotlin Kenya)Danny Preussler
 
TDD on android. Why and How? (Coding Serbia 2019)
TDD on android. Why and How? (Coding Serbia 2019)TDD on android. Why and How? (Coding Serbia 2019)
TDD on android. Why and How? (Coding Serbia 2019)Danny Preussler
 
TDD on Android (Øredev 2018)
TDD on Android (Øredev 2018)TDD on Android (Øredev 2018)
TDD on Android (Øredev 2018)Danny Preussler
 
Junit5: the next gen of testing, don't stay behind
Junit5: the next gen of testing, don't stay behindJunit5: the next gen of testing, don't stay behind
Junit5: the next gen of testing, don't stay behindDanny Preussler
 
Demystifying dependency Injection: Dagger and Toothpick
Demystifying dependency Injection: Dagger and ToothpickDemystifying dependency Injection: Dagger and Toothpick
Demystifying dependency Injection: Dagger and ToothpickDanny Preussler
 
Unit Testing on Android: why and how? DevFest Romania, Bucharest 2016
Unit Testing on Android: why and how? DevFest Romania, Bucharest 2016Unit Testing on Android: why and how? DevFest Romania, Bucharest 2016
Unit Testing on Android: why and how? DevFest Romania, Bucharest 2016Danny Preussler
 
Unit testing without Robolectric, Droidcon Berlin 2016
Unit testing without Robolectric, Droidcon Berlin 2016Unit testing without Robolectric, Droidcon Berlin 2016
Unit testing without Robolectric, Droidcon Berlin 2016Danny Preussler
 
15 tips to improve your unit tests (Droidcon Berlin 2016 Barcamp)
15 tips to improve your unit tests (Droidcon Berlin 2016 Barcamp)15 tips to improve your unit tests (Droidcon Berlin 2016 Barcamp)
15 tips to improve your unit tests (Droidcon Berlin 2016 Barcamp)Danny Preussler
 
Clean code on Android (Droidcon Dubai 2015)
Clean code on Android (Droidcon Dubai 2015)Clean code on Android (Droidcon Dubai 2015)
Clean code on Android (Droidcon Dubai 2015)Danny Preussler
 
Abgeschottete Realität - Testen im Emulator, Mobile Testing Days 2014, Berlin
Abgeschottete Realität - Testen im Emulator, Mobile Testing Days 2014, BerlinAbgeschottete Realität - Testen im Emulator, Mobile Testing Days 2014, Berlin
Abgeschottete Realität - Testen im Emulator, Mobile Testing Days 2014, BerlinDanny Preussler
 
Android Code Puzzles (DroidCon Amsterdam 2012)
Android Code Puzzles (DroidCon Amsterdam 2012)Android Code Puzzles (DroidCon Amsterdam 2012)
Android Code Puzzles (DroidCon Amsterdam 2012)Danny Preussler
 

Plus de Danny Preussler (12)

We aint got no time - Droidcon Nairobi
We aint got no time - Droidcon NairobiWe aint got no time - Droidcon Nairobi
We aint got no time - Droidcon Nairobi
 
Test Driven Development on Android (Kotlin Kenya)
Test Driven Development on Android (Kotlin Kenya)Test Driven Development on Android (Kotlin Kenya)
Test Driven Development on Android (Kotlin Kenya)
 
TDD on android. Why and How? (Coding Serbia 2019)
TDD on android. Why and How? (Coding Serbia 2019)TDD on android. Why and How? (Coding Serbia 2019)
TDD on android. Why and How? (Coding Serbia 2019)
 
TDD on Android (Øredev 2018)
TDD on Android (Øredev 2018)TDD on Android (Øredev 2018)
TDD on Android (Øredev 2018)
 
Junit5: the next gen of testing, don't stay behind
Junit5: the next gen of testing, don't stay behindJunit5: the next gen of testing, don't stay behind
Junit5: the next gen of testing, don't stay behind
 
Demystifying dependency Injection: Dagger and Toothpick
Demystifying dependency Injection: Dagger and ToothpickDemystifying dependency Injection: Dagger and Toothpick
Demystifying dependency Injection: Dagger and Toothpick
 
Unit Testing on Android: why and how? DevFest Romania, Bucharest 2016
Unit Testing on Android: why and how? DevFest Romania, Bucharest 2016Unit Testing on Android: why and how? DevFest Romania, Bucharest 2016
Unit Testing on Android: why and how? DevFest Romania, Bucharest 2016
 
Unit testing without Robolectric, Droidcon Berlin 2016
Unit testing without Robolectric, Droidcon Berlin 2016Unit testing without Robolectric, Droidcon Berlin 2016
Unit testing without Robolectric, Droidcon Berlin 2016
 
15 tips to improve your unit tests (Droidcon Berlin 2016 Barcamp)
15 tips to improve your unit tests (Droidcon Berlin 2016 Barcamp)15 tips to improve your unit tests (Droidcon Berlin 2016 Barcamp)
15 tips to improve your unit tests (Droidcon Berlin 2016 Barcamp)
 
Clean code on Android (Droidcon Dubai 2015)
Clean code on Android (Droidcon Dubai 2015)Clean code on Android (Droidcon Dubai 2015)
Clean code on Android (Droidcon Dubai 2015)
 
Abgeschottete Realität - Testen im Emulator, Mobile Testing Days 2014, Berlin
Abgeschottete Realität - Testen im Emulator, Mobile Testing Days 2014, BerlinAbgeschottete Realität - Testen im Emulator, Mobile Testing Days 2014, Berlin
Abgeschottete Realität - Testen im Emulator, Mobile Testing Days 2014, Berlin
 
Android Code Puzzles (DroidCon Amsterdam 2012)
Android Code Puzzles (DroidCon Amsterdam 2012)Android Code Puzzles (DroidCon Amsterdam 2012)
Android Code Puzzles (DroidCon Amsterdam 2012)
 

Dernier

Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 

Dernier (20)

Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 

Bye Bye Charles, Welcome Odo, Android Meetup Berlin May 2014

  • 1. Bye Bye Charles, Welcome Odo! Android Stammtisch 28.Mai 2014 Danny Preussler
  • 2. Leading the way in mobile commerce Our mobile app is available in 43 countries Groupon’s vibrant mobile marketplace connects consumers with their local economy Sources: Internal Data; iTunes ranking for US stores available here - https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewFeature? Nearly 70 million people worldwide have downloaded our mobile app to date; 9 million in Q4 2013. One of the 25 most downloaded free apps of all time Nearly 50% of our global transactions completed on a mobile device in December 2013
  • 3. The Problem Test data from WebService(s)
  • 4. Mock data? • Easy with DI frameworks • Hard with black box test frameworks • Do not reflect server changes + -
  • 5. Use real data? • Real world • Hard to setup all test cases (manipulate db with scripts …) • Automation mostly breaks because of networking + -
  • 6. Do both • Return mocked data if needed • Use real world real data • Modify data on the fly if needed
  • 7. We need: • Someone who can change depending on what is needed?
  • 10. Response Override • Return fixed response content • Return fixed response code • Add delays
  • 11. Response Override cont. • Add/remove request headers • Change content • Change response code
  • 12. Response Override cont. • Do sequences of all those • Supports Plugins for custom responses i.e. makeDealSoldOut
  • 13. Request Override • Add/remove request headers • Custom request – add/change parameters • Change the target i.e. send production request to staging/test
  • 15. Build a plugin public class MyPlugins { @ResponseOverride( httpCode=302, description="Return HTTP302") public static String http302(String source) throws Exception { return „<html><body>You are being redirected.</body></html>“; } Done
  • 16. Configuration • No installation needed, simple war file • Webinterface • API
  • 17. API • JSON REST API • Java Client available
  • 18. public class OdoTest extends ActivityInstrumentationTestCase2<LoginActivity> { Client odoClient = new Client("33", false); public void testOdo() throws Exception { LoginActivity activity = getActivity(); // genymotion != localhost odoClient.setHostName("192.168.56.1"); odoClient.addMethodToResponseOverride( "Countries", "com.groupon.odo.internal.Common.http503"); odoClient.toggleResponseOverride("Countries", true); } }
  • 19. What do you have to change in your app?
  • 20. Proxy proxy = new Proxy( Proxy.Type.HTTP, new InetSocketAddress( "192.168.56.1", 9090)); new URL("http://api...").openConnection(proxy); HttpUrlConnection
  • 21. OkHttp Proxy proxy = new Proxy( Proxy.Type.HTTP, new InetSocketAddress( "192.168.56.1", 9090)); OkHttpClient client = new OkHttpClient(); client.setProxy(proxy);
  • 22. DefaultHttpClient httpclient = new DefaultHttpClient(); httpclient.getParams().setParameter( ConnRoutePNames.DEFAULT_PROXY, new HttpHost("192.168.56.1", 9090)); Old school apache
  • 23. Configuration • Supports multiple users through client id’s • This way you can share proxy • Apps send them as http-header
  • 24. Configuration • Forwarding proxy mode • Man in the middle mode • SSL certificate download page
  • 25. Behind odo • Utilizes forwarding proxy, Spring, Spring Boot, Java servlets, embedded database • Packaged as a .war file • No setup required
  • 26. Advantages • Test Automation • Avoid stub data maintenance • Create dynamic test automation • Manual Test • UI allows easy configuration changes • No coding knowledge required • Development • Remove dependencies on server changes for client development
  • 27. Odo + vs Charles • Is free • Is open source • Is “programmable” • Is extendable via plugins • Has API • Perfect for test automation
  • 28. Where can I get Odo? https://github.com/groupon In a couple of days… 
  • 29. Follow us… Abgeschottete Realität Android Apps kontrolliert im Emulator testen Danny Preussler, Groupon The Day After Lars Röwekamp, open knowledge Danny Preussler, Groupon
  • 30. Follow us… https://engineering.groupon.co m/ Michael Burton, Roboguice Carlos Sessa, 50 Android hacks David van der Bokke, RoboRemote David Willson, Odo ….

Notes de l'éditeur

  1. In december nearly 50% of global transactions were done on mobile.. That’s so awesome.. And it means we have to create good tools to do more effective testing.. Tonight we’ll two tools created by the mobile test engineering team at Groupon. In the future we’d like to get some of you up here to share topics that you think everyone wants to hear about. Please send me a message on meetup or come talk to me afterwards about your ideas. First up I’d like to get David Willson up here to talk about Odo…
  2. You could create the complete response and use a mock server, but that comes with the disadvantage of having to maintain the stub data whenever the service changes.
  3. You could create the complete response and use a mock server, but that comes with the disadvantage of having to maintain the stub data whenever the service changes.
  4. You could create the complete response and use a mock server, but that comes with the disadvantage of having to maintain the stub data whenever the service changes.
  5. You could create the complete response and use a mock server, but that comes with the disadvantage of having to maintain the stub data whenever the service changes.
  6. You could create the complete response and use a mock server, but that comes with the disadvantage of having to maintain the stub data whenever the service changes.
  7. Odo is a character from Star Trek Seep Space 9, he is a shapeshifter able to look like almost any object Similar to the goals we had for this project to morph data into what we need for testing purposes. Testing edge cases, simulating scenarios
  8. There are two basic override types for Odo, the request override and the response override. The request override takes place when Odo intercepts the client request to the service.
  9. There are two basic override types for Odo, the request override and the response override. The request override takes place when Odo intercepts the client request to the service.
  10. There are two basic override types for Odo, the request override and the response override. The request override takes place when Odo intercepts the client request to the service.
  11. There are two basic override types for Odo, the request override and the response override. The request override takes place when Odo intercepts the client request to the service.
  12. There are two basic override types for Odo, the request override and the response override. The request override takes place when Odo intercepts the client request to the service.
  13. In this example, we are applying a custom response and simulating a 100ms delay
  14. In this example, we are applying a custom response and simulating a 100ms delay
  15. Set prox yon differerent clients
  16. Set prox yon differerent clients
  17. Set prox yon differerent clients
  18. Man in the middle for windows phone
  19. No install, packaged along with its dependencies. Importing a preexisting configuration is a single step process.
  20. For test automation, Odo makes it easy for us to simulate complex or edge-case scenarios Manual testing get access to the same abilities through the UI Client development doesn’t need to wait for server changes to verify their feature There are additional features that make life easier, like multiple client support. With clients each user can specify their own override behavior configuration and not be affected by other clients. This allows for a central server that our developers can utilize instead of each running their own local instance.
  21. Charles: on the fly change Odo: prepare and let run