$30 off During Our Annual Pro Sale. View Details »

How to quickly eat your own dog food in iOS

How to quickly eat your own dog food in iOS

RestlessThinker

March 12, 2014
Tweet

More Decks by RestlessThinker

Other Decks in Technology

Transcript

  1. How to quickly eat your own dog
    food in iOS
    @RestlessThinker

    View Slide

  2. When a company uses it’s own product to determine
    quality and capabilities of the product
    What is dog fooding?

    View Slide

  3. Why is it important?
    • Testing when developing isn’t good enough
    • Faster Feedback
    • Find "Jankyness" faster
    • Iterate quickly on things that matter
    • Validate assumptions and hypotheses

    View Slide

  4. Who is dog fooding?
    • Google
    • Microsoft
    • Atlassian
    • Foursquare
    • Apple

    View Slide

  5. Before Gmail was released to the public…
    • Sergei and Larry used it
    as their personal email
    clients in early stages
    • 3000 Google employees
    • Obsessed about speed

    View Slide

  6. Facebook
    Home
    • They should have spent
    more time “Droidfooding”!
    • Launched April 12, 2013
    • In June, Facebook
    announced a beta testing
    program for Android users
    • User complaints about
    battery life and user
    experience

    View Slide

  7. Dog Fooding
    Test-driven development
    Timeboxing
    Acceptance testing
    Spike
    Sprint Planning
    Planning Poker
    Story Point Estimation
    User Stories
    Sprint
    Pair Programming
    Behavior-driven development
    Velocity Tracking Scrum

    View Slide

  8. Cocoapods
    Two-Binary
    System
    Automate
    Builds
    App
    distribution
    The Formula!
    Feedback
    &
    Logging

    View Slide

  9. Cocoapods

    View Slide

  10. Cocoapods
    What is Cocoapods?!
    • library dependency management system
    for Xcode projects
    • Similar to Ruby Gems or Java Maven

    View Slide

  11. Cocoapods
    Why Cocoapods?!
    • Alternatives to this aren’t really that great
    right now
    • Many components and libraries to
    choose from
    • Allows reuse of internal code libraries
    • Reduces error when dealing with
    framework search paths

    View Slide

  12. Cocoapods
    Things to consider!
    • Don’t be afraid to have your own internal pods
    • Pods are 3rd party libraries and are not “silver bullets”
    • Revisit before shipping to production and use a
    checklist for accepting a 3rd party library
    • For more information visit http://cocoapods.org

    View Slide

  13. Two-Binary
    System

    View Slide

  14. Benefits
    • Alpha/Beta or Beta/
    Production environments
    • Debugging Services 

    (SSL vs. Non SSL)
    • Separate push
    notifications
    • Feature toggling
    • Separate analytics
    Two-Binary
    System

    View Slide

  15. How to setup for Two Binaries
    Two-Binary
    System

    View Slide

  16. Two-Binary
    System
    iOS App Identifiers
    Create 2 unique app identifiers

    View Slide

  17. Two-Binary
    System
    Production Certificates
    If your app is using notifications create one for each app ID

    View Slide

  18. Two-Binary
    System
    Provision Profile (Development)
    Two separate profiles

    View Slide

  19. Two-Binary
    System
    Provision Profile (Distribution)
    Two separate profiles

    View Slide

  20. Remember to
    treat it as two
    separate apps!
    We do compile and ship two separate
    binaries.

    View Slide

  21. Two-Binary
    System
    Xcode Setup

    View Slide

  22. Start by duplicating the app target
    Two-Binary
    System
    Xcode Setup

    View Slide

  23. Two-Binary
    System
    Copy Target

    View Slide

  24. Two-Binary
    System
    Create a 2nd Plist

    View Slide

  25. Rename the duplicate target name
    Two-Binary
    System
    Rename for Beta

    View Slide

  26. Rename plist identifier
    Two-Binary
    System
    Renaming for Beta

    View Slide

  27. After duplication, change the provision profile
    Two-Binary
    System
    Copy Target

    View Slide

  28. Two-Binary
    System
    Duplicate Test Targets

    View Slide

  29. Project -> Manage Schemes
    Two-Binary
    System
    Managing Schemes

    View Slide

  30. Two-Binary
    System
    Preprocessor Macros

    View Slide

  31. In the end you should have two runtime targets
    Two-Binary
    System
    Two Binaries Complete

    View Slide

  32. Feature Toggling
    Now the fun begins!

    View Slide

  33. Setting up Feature Toggling
    Two-Binary
    System
    As a Constant vs using the preprocessor macro

    View Slide

  34. Feature Toggling (Constants)
    Two-Binary
    System

    View Slide

  35. Stubbing Data
    Feature Toggling (Services)
    Two-Binary
    System

    View Slide

  36. Debugging end points on SSL
    Feature Toggling (Services)
    Two-Binary
    System

    View Slide

  37. Feature Toggling (Views)
    Two-Binary
    System

    View Slide

  38. • Can get out of hand easily
    • If you’re using pre-processor macros
    you lose come compile time checking
    per target, test on separate targets
    • You can just define a constant set by
    the pre-processor macro
    • Keep it simple!
    Feature Toggling (Views)
    Two-Binary
    System

    View Slide

  39. Automated
    Builds
    Bringing everything together

    View Slide

  40. Why is it important?
    • Helps eliminate human
    error
    • Builds are asynchronous
    so you can spend your
    time being productive
    while you wait
    • Saves time doing
    repetitive tasks
    • Makes the two binary
    system and feature
    toggling easier to
    manage
    • Teams can get passive
    notifications versus PMs
    asking for the status
    Automated
    Builds

    View Slide

  41. Key points
    • Have the team decide on a build schedule - i.e. Once a
    day, twice a day etc.
    • Try to be strict about your build regimen
    • Don't get overwhelmed by automation scripts, think of
    builds as a living document that will always change as
    your app requirements and team requirements change.
    Automated
    Builds

    View Slide

  42. Choose what works for you
    • Jenkins - jenkins-ci.org
    • Bamboo - atlassian.com
    • Team City - jetbrains.com
    • Xcode bots - ships with Xcode 5
    Automated
    Builds

    View Slide

  43. Once you decide...
    • Almost every CI will use a plugin for building iOS
    • If you are using Cocoapods, remember to use
    workspaces not projects
    • Automate uploading to a distribution system
    Automated
    Builds

    View Slide

  44. • For unit tests use xctool https://github.com/facebook/
    xctool
    • UIAutomation tests use Bwoken - https://github.com/
    bendyworks/bwoken
    • Cross Platform automation Appium - http://appium.io/
    When you have tests…
    Automated
    Builds

    View Slide

  45. App
    Distribution
    Getting your app to more dog
    fooders!

    View Slide

  46. App
    Distribution
    What is App Distribution?!
    iTunes
    Store
    Users
    Ad Hoc
    Beta
    Users
    Dog Fooders

    View Slide

  47. Example of 2 apps in hockey app
    App
    Distribution
    Create two apps!!

    View Slide

  48. • Gets your app into the
    wild
    • Testers can get daily
    builds
    • Don't need the testers
    physical device to install
    the app
    • Some allow feedback
    modules in-app
    • Some have crash
    reporting services
    • Isolate bugs on a per
    binary basis
    • Keeps track of dSYM and
    IPA files instead of
    checking it into source
    control
    App
    Distribution
    Why is it important?!

    View Slide

  49. • Hockey App - hockeyapp.net
    • Test Flight - testflightapp.com
    App
    Distribution
    Choose what works for you!

    View Slide

  50. Feedback &
    Logging

    View Slide

  51. Feedback &
    Logging
    Users are your lifeline!

    View Slide

  52. Feedback &
    Logging
    Crash Reporting!
    • PLCrashReporter
    • Usually bundled with SDKs for analytics and ad-hoc
    distribution systems
    • Keep your dSYM files

    View Slide

  53. Feedback &
    Logging
    Crash Reporting!
    • Hockeyapp http://hockeyapp.net
    • Test Flight http://testflightapp.com
    • Crashlytics http://crashlytics.com

    View Slide

  54. Feedback &
    Logging
    Logging!
    • Not all errors will crash the app
    • Use analytics systems to log errors!

    (Google Analytics, Mixpanel)
    • Track the “error” as an “event”

    View Slide

  55. Feedback &
    Logging
    Logging!

    View Slide

  56. Cocoapods
    Two-Binary
    System
    Automate
    Builds
    App
    distribution
    Feedback
    &
    Logging

    View Slide

  57. Thank You
    @RestlessThinker

    View Slide