Fight back android fragmentation

2,732 views

Published on

These are the slides for the presentation that Bitbar experts gave at Droidcon Berlin 2012 (http://de.droidcon.com/content/testing-device-compatibility-not-hard-you-think). The presentation included also a live demo of Recording tests with Testdroid Recorder 2.0 and running the same use cases with one click on all 100+ real Android devices in Testdroid Cloud.

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,732
On SlideShare
0
From Embeds
0
Number of Embeds
1,033
Actions
Shares
0
Downloads
28
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Fight back android fragmentation

  1. 1. Fight back platform fragmentation! Best practices in UI testing automation. Roman Kierzkowski Bitbar www.bitbar.com
  2. 2. Agenda1. Platform fragmentation2. Gravity & Monkey3. Monkeyrunner4. Android Instrumentation5. Robotium6. Testdroid Recorder7. Testdroid Cloud
  3. 3. What is platform fragmentation?
  4. 4. Other platforms?
  5. 5. What does fragmentation consist of?● Android version● Screen resolution & density & diagonal● CPU speed● RAM size● GPU presence & speed● Sensors presence & accuracy● SD presence & capacity● Virtual or real keyboard● Device manufacturer● Custom UI & User preferences
  6. 6. In numbers...● 13 OS Versions● Over 800 different models● Over 300 million Android devices had been activated● 850 000 activations daily!!!
  7. 7. Platform versions Versions 2.1 to 2.3.7 = 94%Data collected during a 14-day period ending on February 1, 2012 (http://developer.android.com/resources/dashboard/platform-versions.html)
  8. 8. Screen Sizes and Denisties normal mdpi + normal hdpi = 85.5%Data collected during a 7-day period ending on February 1, 2012 (http://developer.android.com/resources/dashboard/screens.html)
  9. 9. Gravitation & Monkey ● Gravity ● UI/Application Exerciser Monkey ● Stress test application (pseudo-randrom actions) ● Runs inside emulator or device $ adb shell monkey [options] <event-count> $ adb shell monkey -s 333 -p your.package.name -v 500http://developer.android.com/guide/developing/tools/monkey.html
  10. 10. Android Instrumentation Framework● Instrumentation allows to run components without their normal lifecycles● Android testing is based on JUnit● JUnit 3 lifecycle (test methods, setUp(), tearDown())● Separate test project● Runs inside of the device● Instrumentation & Application APKs must be signed with the same key!● For different components different TestCase● For activities: ActivityInstrumentationTestCase2● MoreAssert and ViewAsserts
  11. 11. Robotium● Opensource project (http://code.google.com/p/robotium/)● On top of Android instrumentation – great simplification● How does Robotium recognize elements: → Texts → Visible elements indexes → X,Y● Solo is main class. It contains various methods like: → clickOnImage(int index) → clickOnButton(String text) →enterText(int index, java.lang.String text)
  12. 12. Robotium Pros & Cons● Simplifies UI Instrumentation● UI component aware● Integrates with JUnit lifecycle● Open source● No screenshots logic● Runs only within single application
  13. 13. Testdroid Recorder● Eclipse plugin (http://www.testdroid.com/updates/)● Records monkeyrunner & Robotium● Record test from APK & Sources● Introduces R.id identification● Takes screenshots● Scalable clicks & drags● Split testcases into methods
  14. 14. Testdroid cloud● Run tests against over 100 different real devices● View test results● View screenshoots in convienient way● Use baseline feature to detect broken layouts● View logs● Follow your project statistics

×