Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Mobile apps architecture at Tuenti

Tuenti
April 11, 2015

Mobile apps architecture at Tuenti

Mobile apps architecture & testing at Tuenti

Tuenti

April 11, 2015
Tweet

More Decks by Tuenti

Other Decks in Programming

Transcript

  1. What was wrong? • 0 structure • Connected domain •

    API Requests from Activities and Fragments • Business Logic everywhere • Network operations updating data repositories • Data repositories in memory • Tons of duplicated code.
  2. What are we going to use? • Clean Architecture •

    S.O.L.I.D • Dependency Injection
  3. Testability Quick review • Mixing object graph construction with application

    logic • Ask for things, don’t look for things • Doing work in constructor • Global State/Singletons • Static methods
  4. • Black-box oriented tests • End to end • Instrument

    deployed app in phone/simulator • No tests doubles can be used • Needs a full and provisionable server environment • Slow tests Acceptance Tests Concepts
  5. Acceptance Tests Lifecycle • Device data clean-up • App get

    launched • Test gets executed • Result and artifacts gets saved
  6. • Outside of the emulator (JVM) • No need external

    env set up • Tests run in build time • App context • Use test doubles • Slower tests than unit tests Integration Tests Concepts
  7. • Create App (onCreate) • Test setUp (@Before) • Test

    method • Test tearDown (@After) • Terminate App (onTerminate) Integration Tests Lifecycle
  8. • JVM • Application classes in isolation • Test doubles

    • No app context • Build time • Really fast tests Unit Tests Concepts