Shift left Mobile ApplicationTesting
Satyajit Malugu
Urbanspoon
Specification Design Development Maintenance
Domain Finder
Specification Design Development Maintenance
Still had lot of problems
• Testing unable to fit into agile dev cycle
• UI automation unable to keep up with constant changes
• A very low coverage after weeks of playing catchup
Test pyramid reversed
http://adventuresinqa.com/2015/10/19/mobile-test-pyramid/#more-3194
Godaddy Investor
Specification Design Development Maintenance
What is “Shift left”
• Start test processes as early in SDLC as possible
• Continue to provide early feedback
Why Shift left
• Cost of fixing bugs exponential across SDLC
Specification Design Development Maintainance
Reclaiming the pyramid
Enabling Agile
• Agile is all about adaptability to change
• Enabled through fast feedback loops
• Test early and often
Challenges for shift left in mobile
• Tool support not mature
• Device fragmentation
• Culture of native development teams
Tool support is getting better
• Companies dedicated to mobile testing
• Real device clouds
• Network variations
• Sensor simulation
Android tool support
• Unit tests – Junit
• Code coverage – Jacoco
• Continuous integration – Jenkins
• Functional tests –Roboelectric
• E2E testing – Appium, Espresso
• Continuous deployment – Alpha, beta releases in play store
• Device emulation – adb, genymotion
• Performance testing – rendering profiler, traceview
iOS tool support
• Unit tests – XCTest,
• Code coverage – Xcode server with bots
• Continuous integration – Jenkins, Xcode server
• Functional tests – EarlGrey
• E2E testing – Appium, KIF, Calabash, XCUITest
• Continuous deployment –Testflight alpha, beta
• Device emulation – Xcode
• Performance testing – XCTest, instruments
Step I – Measure unit test code coverage
• What you can’t measure, can’t be improved
• Get the team to agree on a good coverage %
• Send coverage report everyday
Slack bots reporting daily coverage
Step II– Create a CI infrastructure
• For running unit, functional, UI tests
• Build various environments
• Code coverage reports
Pull Request triggers unit and UI tests
Jenkins UI test run sample
Step III– Replace some UI tests with unit tests
• As a principle prefer lower level test over a higher one
• Don’t repeat a test - DRY
Step IV- Partial integration testing
• Create test hooks for navigating into app directly
• Deep links, shortcuts
• Level – 1 verifications
• Not everything need to be verified through UI
Setup Action Verification
StepV- Re-architect E2E tests
• Should be atomic not interdependent
• Enables running in parallel
• Design tests so that they can be triggered in multiple ways
• Different language
• Different screensize
• Different OS
• Should be minimal
• Run them continuously
• On a cloud provider
Specification Design Development Maintenance
1. Continuous testing
2. Crash Monitoring
3. Performance Monitoring
4. App store reviews monitoring
5. Engagement monitoring
1. Functional tests
2. UITests
3. Unit tests
1. Testability hooks
2. Accessibility ids
3. API level testing
4. Unit test
coverage%
1. Test infrastructure
2. CI/CD setup
3. Device lab
Summary
On the horizon – React Native
• Bringing web like deployment capabilities to native world
• Learn once, write anywhere
• Very high importance to testing
Questions

Shift left mobile application testing

  • 1.
    Shift left MobileApplicationTesting Satyajit Malugu
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
    Still had lotof problems • Testing unable to fit into agile dev cycle • UI automation unable to keep up with constant changes • A very low coverage after weeks of playing catchup
  • 7.
  • 8.
  • 9.
    Specification Design DevelopmentMaintenance What is “Shift left” • Start test processes as early in SDLC as possible • Continue to provide early feedback
  • 10.
    Why Shift left •Cost of fixing bugs exponential across SDLC Specification Design Development Maintainance
  • 11.
  • 12.
    Enabling Agile • Agileis all about adaptability to change • Enabled through fast feedback loops • Test early and often
  • 13.
    Challenges for shiftleft in mobile • Tool support not mature • Device fragmentation • Culture of native development teams
  • 14.
    Tool support isgetting better • Companies dedicated to mobile testing • Real device clouds • Network variations • Sensor simulation
  • 15.
    Android tool support •Unit tests – Junit • Code coverage – Jacoco • Continuous integration – Jenkins • Functional tests –Roboelectric • E2E testing – Appium, Espresso • Continuous deployment – Alpha, beta releases in play store • Device emulation – adb, genymotion • Performance testing – rendering profiler, traceview
  • 16.
    iOS tool support •Unit tests – XCTest, • Code coverage – Xcode server with bots • Continuous integration – Jenkins, Xcode server • Functional tests – EarlGrey • E2E testing – Appium, KIF, Calabash, XCUITest • Continuous deployment –Testflight alpha, beta • Device emulation – Xcode • Performance testing – XCTest, instruments
  • 17.
    Step I –Measure unit test code coverage • What you can’t measure, can’t be improved • Get the team to agree on a good coverage % • Send coverage report everyday
  • 18.
    Slack bots reportingdaily coverage
  • 19.
    Step II– Createa CI infrastructure • For running unit, functional, UI tests • Build various environments • Code coverage reports
  • 20.
    Pull Request triggersunit and UI tests
  • 21.
    Jenkins UI testrun sample
  • 22.
    Step III– Replacesome UI tests with unit tests • As a principle prefer lower level test over a higher one • Don’t repeat a test - DRY
  • 23.
    Step IV- Partialintegration testing • Create test hooks for navigating into app directly • Deep links, shortcuts • Level – 1 verifications • Not everything need to be verified through UI Setup Action Verification
  • 24.
    StepV- Re-architect E2Etests • Should be atomic not interdependent • Enables running in parallel • Design tests so that they can be triggered in multiple ways • Different language • Different screensize • Different OS • Should be minimal • Run them continuously • On a cloud provider
  • 25.
    Specification Design DevelopmentMaintenance 1. Continuous testing 2. Crash Monitoring 3. Performance Monitoring 4. App store reviews monitoring 5. Engagement monitoring 1. Functional tests 2. UITests 3. Unit tests 1. Testability hooks 2. Accessibility ids 3. API level testing 4. Unit test coverage% 1. Test infrastructure 2. CI/CD setup 3. Device lab Summary
  • 26.
    On the horizon– React Native • Bringing web like deployment capabilities to native world • Learn once, write anywhere • Very high importance to testing
  • 27.

Editor's Notes

  • #2 Good afternoon everyone, my name is Satya, I am currently a senior mobile SDET at Godaddy. Before I talk about shift left, let me talk a bit about my background and how I got started about mobile application testing. Tell a bit of my history and experience with mobile testing and automation
  • #8 It is not just about WHEN testing got involved, it is how testing is being done
  • #9 Talk about the app in more detail and the advantages that I got by involving in the design phase.
  • #16 Tool support for various aspects of CI/CD pipeline
  • #23 Get breakdown of tests Unit vs Roboelectric vs appium vs mock
  • #24 Diagram