Unit Testing for Designers

Unit Testing for Designers

I gave this talk at the Playgrounds Conference in Melbourne, Australia, February 2017. Video should be up in a month or two!


Tamar Nachmany

February 24, 2017


  1. 8.

    Using unit testing to teach modularity & architecture Overview -

    What is unit testing? - What is modularity? - How does unit testing impact software architecture? - Modularity and change - Why? @tamarshmallows
  2. 12.

    definition: Unit tests validate individual units of code by executing

    logic and asserting expected results @tamarshmallows
  3. 17.

    Presentation logic func present(photoLibrary: PhotoLibraryViewController) { switch photoLibrary.configuration { case

    .iMessage: // Add photo library as child case .Compose: // Present photo library modally } } @tamarshmallows
  4. 18.

    Presentation logic testing func testPhotoLibraryPresentationForiMessageConfiguration() { // Make a presenting

    view controller let presentingViewController = PresentingViewController() // Make a photo library view controller let photoLibrary = PhotoLibraryViewController(configuration: .iMessage) // 'Present' photo library presentingViewController.present(photoLibrary: photoLibrary) // Assert that photo library was added as a child view controller XCTAssertEqual(photoLibrary.parentViewController, presentingViewController) } @tamarshmallows
  5. 22.

    Definition: The principle that a type should serve a specific

    defined purpose and have minimal dependencies @tamarshmallows
  6. 25.

    Modular code is: 1. Easier to understand 2. Easier to

    unit test 3. Easier to change? @tamarshmallows
  7. 35.
  8. 37.

    You needs state to validate Where does that 'exposure' come

    from? A parameter? A property? @tamarshmallows
  9. 53.

    Featured artists Rodrigo Tello Ola Szmida Patrick Sluiter Hannah Langford

    Berman Dai Ruiz Alastair Gray Joel Plosz Mathew Lucas Susanna Bauer Kennedy Dickerson @tamarshmallows