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. Joaquin Engelmo
    [email protected]
    Mobile apps at Tuenti
    “Architecture and Testing”

    View Slide

  2. Tuenti Apps
    Android
    iOS

    View Slide

  3. Tuenti Apps
    Android
    iOS

    View Slide

  4. 76%
    24%

    View Slide

  5. View Slide

  6. rchitecture
    A

    View Slide

  7. 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.

    View Slide

  8. What are we going to use?
    • Clean Architecture
    • S.O.L.I.D
    • Dependency Injection

    View Slide

  9. Did you said
    ‘Clean’?

    View Slide

  10. Uncle Bob
    Clean
    https://www.youtube.com/watch?v=WpkDN78P884
    http://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html

    View Slide

  11. Tuenti
    Clean

    View Slide

  12. Tuenti
    Clean

    View Slide

  13. Tuenti
    Clean

    View Slide

  14. Tuenti
    Clean

    View Slide

  15. Tuenti
    Clean

    View Slide

  16. Did you said
    ’SOLID’ too?

    View Slide

  17. Uncle Bob
    S.O.L.I.D.
    http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod
    • Single Responsibility
    • Open-Close
    • Liskov Substitution
    • Interface Segregation
    • Dependency Inversion

    View Slide

  18. View Slide

  19. Talk is cheap.
    Show me the code.

    View Slide

  20. View Slide

  21. esting
    T

    View Slide

  22. Testability
    Quick review

    View Slide

  23. Testability
    Quick review

    View Slide

  24. Testability
    Quick review

    View Slide

  25. Testability
    Quick review

    View Slide

  26. 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

    View Slide

  27. By Martin Fowler
    http://martinfowler.com/bliki/TestPyramid.html

    View Slide

  28. • 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

    View Slide

  29. Acceptance Tests
    Environment

    View Slide

  30. Acceptance Tests
    Lifecycle
    • Device data clean-up
    • App get launched
    • Test gets executed
    • Result and artifacts gets saved

    View Slide

  31. • 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

    View Slide

  32. Integration Tests
    Environment

    View Slide

  33. • Create App (onCreate)
    • Test setUp (@Before)
    • Test method
    • Test tearDown (@After)
    • Terminate App (onTerminate)
    Integration Tests
    Lifecycle

    View Slide

  34. • JVM
    • Application classes in isolation
    • Test doubles
    • No app context
    • Build time
    • Really fast tests
    Unit Tests
    Concepts

    View Slide

  35. Unit Tests
    Environment
    • Fast
    • Isolated
    • Repeatable
    • Self-Verifing
    • Timely

    View Slide

  36. Unit Tests
    Lifecycle
    • Test setUp (@Before)
    • Test method
    • Test tearDown (@After)

    View Slide

  37. Thanks!

    View Slide