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

Controlling complexity for large iOS projects

Controlling complexity for large iOS projects

Presented at https://www.facebook.com/events/1779675885596534/
This talk discloses some points on bringing dependency hell back under control. It also includes demo of https://github.com/soxjke/WatchDogs

Petro Korienev

June 29, 2016
Tweet

More Decks by Petro Korienev

Other Decks in Programming

Transcript

  1. ! #cocoaheadsukraine 29/Jun/2016 @ Sigma Software, Kharkiv, Ukraine ! Controlling

    complexity for large iOS projects Petro Korienev, iOS Engineer @ Techery
  2. ! #cocoaheadsukraine 29/Jun/2016 @ Sigma Software, Kharkiv, Ukraine ! •

    Sporadic crashes • Intermittent issues • Hardly debuggable code PROBLEMS WHILE SCALING
  3. ! #cocoaheadsukraine 29/Jun/2016 @ Sigma Software, Kharkiv, Ukraine ! •

    Result of deadlines pressure • Result of miscommunication • Result of laziness Growing number of dependencies and borrowed code
  4. ! #cocoaheadsukraine 29/Jun/2016 @ Sigma Software, Kharkiv, Ukraine ! •

    Control decreases over time • Consequence of growing complexity • Maintainer change • Software is not an IP carrier, author is
  5. ! #cocoaheadsukraine 29/Jun/2016 @ Sigma Software, Kharkiv, Ukraine ! Few

    more numbers • Currently 11 iOS developers • 3 full-stack feature teams • 6 backend services + different environments • Analytics, perf monitoring, etc
  6. ! #cocoaheadsukraine 29/Jun/2016 @ Sigma Software, Kharkiv, Ukraine ! •

    Trust in community and time-proven solutions • Trust in self TRUST
  7. ! #cocoaheadsukraine 29/Jun/2016 @ Sigma Software, Kharkiv, Ukraine ! •

    AFNetworking 2.5.1-2.5.2 • OpenSSL heartbleed • Numerous zero-day exploits • Just bugs TRUST IN COMMUNITY
  8. ! #cocoaheadsukraine 29/Jun/2016 @ Sigma Software, Kharkiv, Ukraine ! •

    “I’ve seen stuff like this before” • “This is pretty straightforward” • “If i’d do stuff like this, i’d do this way” TRUST IN SELF
  9. ! #cocoaheadsukraine 29/Jun/2016 @ Sigma Software, Kharkiv, Ukraine ! •

    Bugs • Exploits • Limitations • Tech debt Consequences
  10. ! #cocoaheadsukraine 29/Jun/2016 @ Sigma Software, Kharkiv, Ukraine ! BLACKBOXING

    - DON’T CARE OF IT • Simple • Unreliable • Tends to consume time when scaling
  11. ! #cocoaheadsukraine 29/Jun/2016 @ Sigma Software, Kharkiv, Ukraine ! WHITEBOXING

    • Very time-consuming • Reliable after certain effort put • Extremely difficult with closed- source
  12. ! #cocoaheadsukraine 29/Jun/2016 @ Sigma Software, Kharkiv, Ukraine ! GRAYBOXING

    • Good tradeoff between white- and blackboxing • Flexible • Applicable almost everywhere • Dynamic
  13. ! #cocoaheadsukraine 29/Jun/2016 @ Sigma Software, Kharkiv, Ukraine ! GRAYBOXING

    • Idea is to find a right place and inject something validating the correctness of contract • Unlike unit tests, verifies dynamic, run-time behaviour
  14. ! #cocoaheadsukraine 29/Jun/2016 @ Sigma Software, Kharkiv, Ukraine ! PROBLEM

    • Inconsistency and mess within CoreData across the project • Fake certainty in thread- access
  15. ! #cocoaheadsukraine 29/Jun/2016 @ Sigma Software, Kharkiv, Ukraine ! STEPS

    • Define problem places • Define ways to inject • Define ways to control
  16. ! #cocoaheadsukraine 29/Jun/2016 @ Sigma Software, Kharkiv, Ukraine ! Define

    problem places • NSManagedObjectContext save • NSManagedObject getter/setter • Everything should run in context queue
  17. ! #cocoaheadsukraine 29/Jun/2016 @ Sigma Software, Kharkiv, Ukraine ! Define

    ways to inject • swizzle save • swizzle setter/getter?
  18. ! #cocoaheadsukraine 29/Jun/2016 @ Sigma Software, Kharkiv, Ukraine ! Define

    ways to inject • swizzle resolveInstanceMethod • use seamless swizzling
  19. ! #cocoaheadsukraine 29/Jun/2016 @ Sigma Software, Kharkiv, Ukraine ! Define

    ways to control • swizzle NSManagedObjectContext init • dispatch_set_specific
  20. ! #cocoaheadsukraine 29/Jun/2016 @ Sigma Software, Kharkiv, Ukraine ! YOU

    CAN FIND ME: • https://github.com/soxjke • http://stackoverflow.com/users/ 2392973/petro-korienev • https://www.facebook.com/soxjke • https://twitter.com/soxjke