Traversing Test Pyramid for Android
development

Dubinsky Dee Soares
Jigish Chawda
Agenda
Test Pyramid
Why TDD?
Approaches of unit testing.
Problems and solutions for unit testing.
Sample tests.
Functional...
Test Pyramid

Functional Tests
Integration Tests

Unit Tests
Why Testing for Android?
Stable and better quality applications.
Apps are as important as the websites.
Ubiquitous.
Overview of Unit Testing in Android
Business logic

View validations
Behavior

Unit Test
Android Test Framework - Problems….
•
•

ACTIVITY

•

Low test coverage

•

UI interactions & data
binding untested.

POJO...
How can we solve these problems ?

ACTIVITY

POJO

RED

.class

REFACTOR

Virtual Machine
GREEN

JVM
Let’s have a look at a few tests.
Overview of Functional Testing
Actual Application
Business Use Case
Visual Appearance
Realistic

Mobile Challenges
Fragmen...
Functional Testing Tool Expectation
Business language
Expressive
Keep up with times
Robust
Realism
CI Support
Functional Test : Approaches

Instrumented technique
Non- Instrumented technique
Functional Testing : Instrumented Approach
•

Android Testing
Framework

Flexible APIs
WebView support.

•

Robotium

•
•
...
A Demo - Calabash-android
Functional Testing : Non Instrumentation
Not restricted to one App
Custom Components
External Interactions
Hardware Driver...
Continuous Integration
CI BOX

Pass

Fail
References
http://robolectric.org/
http://martinfowler.com/bliki/TestPyramid.html
http://developer.android.com/tools/testi...
You can reach us at
Jigish Chawda:
Twitter: @jigishchawda
Github: https://github.com/jigishchawda

Dubinsky Dee Soares:
Tw...
Upcoming SlideShare
Loading in …5
×

Traversing the Test Pyramid for Android Development

686 views

Published on

Dubinsky and Jigish walk through the testing practices followed by an Agile Team while building Mobile Applications.

In this talk they traverse the Testing pyramid focussing on the importance of the balance of Unit/Functional automated tests.
They go on to talk about how to integrate all of these tests with your CI server to deliver high quality applications.



Mobile Developer Summit 2013 Bangalore http://www.developermarch.com/mds/index.html

Published in: Education, Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
686
On SlideShare
0
From Embeds
0
Number of Embeds
13
Actions
Shares
0
Downloads
6
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • Ask opening questions.How many of you know about the Test Pyramid?How many of you practice TDD in normal software development?Explain pyramidWhat to test at each level?Tell them a story.- I joined a mobile development project one and a half years back, knowing nothing about Android development, nothing about TDD in Android development. We continued to write code without tests. Being a TDD fanatic, at some point in time, questions arose in our minds: Why are we not testing the code base? ; Why have we not thought of using TDD approach for the development?The overall answer to these questions came out to be MATURITY. Maturity of testing frameworks available out there. Maturity of Android to support testing during application development.From that point onward, we have started finding viable solutions for testing the Android mobile application.We think that our experience ought to be told to a larger audience.
  • Mobile apps were not the main stream business, when android was in its infancy. Hence not much attention was given to app development.The ubiquity of Android increased with pace greater than its maturity and tools for app development. At this time, it was a great opportunity for the small and big enterprise to reach to the larger audience and penetrate different markets. This became a serious money making business and suddenly there was a need for stable and better quality mobile apps in the market place. Think about a case when you have an app in the market store and people are cribbing about this bug or problem? TDD has always proved to churn out quality software. Since apps have become equally important as the website, testing your android code is not an option. It’s a priority.
  • Unit testing is being used for quite a while for android development, however over time the approach has changed and improved.Android SDK ships Android Instrumentation Framework, which provides ability to test your code.What to test and what not to ?Why more unit tests
  • Statistics: 100 tests run 23s in robolectric
  • We will show code sample here.
  • Points to be covered:Why and when functional testing in android?Story
  • You can develop powerful test cases, with minimal knowledge of the application under test.The framework handles multiple Android activities automatically.Minimal time needed to write solid test cases.Readability of test cases is greatly improved, compared to standard instrumentation tests.Test cases are more robust due to the run-time binding to GUI components.Fast test case execution.Integrates smoothly with Maven or Ant to run tests as part of continuous integration.
  • We will show a sample project here
  • USEcasesHoneyDew – ShamlessMsrketing
  • To put things in perspective, we run the entire pyramid
  • Traversing the Test Pyramid for Android Development

    1. 1. Traversing Test Pyramid for Android development Dubinsky Dee Soares Jigish Chawda
    2. 2. Agenda Test Pyramid Why TDD? Approaches of unit testing. Problems and solutions for unit testing. Sample tests. Functional Testing – overview. Various frameworks and approaches followed. Functional Test - demo. Continuous Integration
    3. 3. Test Pyramid Functional Tests Integration Tests Unit Tests
    4. 4. Why Testing for Android? Stable and better quality applications. Apps are as important as the websites. Ubiquitous.
    5. 5. Overview of Unit Testing in Android Business logic View validations Behavior Unit Test
    6. 6. Android Test Framework - Problems…. • • ACTIVITY • Low test coverage • UI interactions & data binding untested. POJO Framework runs on DVM Time consuming
    7. 7. How can we solve these problems ? ACTIVITY POJO RED .class REFACTOR Virtual Machine GREEN JVM
    8. 8. Let’s have a look at a few tests.
    9. 9. Overview of Functional Testing Actual Application Business Use Case Visual Appearance Realistic Mobile Challenges Fragmentation Release
    10. 10. Functional Testing Tool Expectation Business language Expressive Keep up with times Robust Realism CI Support
    11. 11. Functional Test : Approaches Instrumented technique Non- Instrumented technique
    12. 12. Functional Testing : Instrumented Approach • Android Testing Framework Flexible APIs WebView support. • Robotium • • Calabash DSL Support iOS & Android • Continuous Integration
    13. 13. A Demo - Calabash-android
    14. 14. Functional Testing : Non Instrumentation Not restricted to one App Custom Components External Interactions Hardware Drivers Tools UI Automator, HoneyDew, Appium
    15. 15. Continuous Integration CI BOX Pass Fail
    16. 16. References http://robolectric.org/ http://martinfowler.com/bliki/TestPyramid.html http://developer.android.com/tools/testing/testing_android.html https://github.com/androidbootcamp/RobolectricDemo/tree/mds _demo https://github.com/calabash/calabash-android https://github.com/amplify-education/honeydew
    17. 17. You can reach us at Jigish Chawda: Twitter: @jigishchawda Github: https://github.com/jigishchawda Dubinsky Dee Soares: Twitter: @dubinskysoares Github: https://github.com/dubinskysoares

    ×