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

WWDC 2021: What's New in Testing

WWDC 2021: What's New in Testing

A roundup of testing related new features from WWDC 2021. Slides from the 2021/06/10 Melbourne CocoaHeads Meetup.

Including: Xcode Cloud, XCTExpectFailure, addTearDownBlock, and Test Plans.

To learn more about testing in Swift, checkout my book Test-Driven Development in Swift.


Gio Lodi

June 10, 2021


  1. What’s new in Testing Gio Lodi, Mobile Infrastructure @ Automattic

    Melbourne CocoaHeads 2021/06/10  WWDC21
  2. • Xcode Cloud • async/await & test • XCTExpectFailure •

    Test Repetition • addTearDownBlock { }
  3. Xcode Cloud So that’s what they bough BuddyBuild for…

  4. None
  5. • Xcode Cloud docs homepage • Supports GitHub, GitHub Enterprise,

    Bitbucket Cloud, Bitbucket Server, GitLab, and GitLab self-managed instances • Environment Variables CI, CI_BUILD_ID, CI_XCODE_SCHEME, CI_TEST_PLAN, CI_PULL_REQUEST_NUMBER, … • Web Hooks – Note: You can configure up to five web hooks per Xcode Cloud product.
  6. Requirements for Using Xcode Cloud

  7. About Continuous Integration and Delivery with Xcode Cloud

  8. Review code and collaborate in Xcode

  9. Review code and collaborate in Xcode

  10. ☁ Would you trust to do all that for you

    in the ?!
  11. async/await ❤ unit tests Testing async code just go easier

  12. https://mokacoding.com/blog/how-to-test-async-await-code-in-swift/

  13. https://mokacoding.com/blog/how-to-test-async-await-code-in-swift/

  14. XCTExpectFailure The best API you should never use

  15. https://mokacoding.com/blog/xctexpectfailure

  16. https://mokacoding.com/blog/xctexpectfailure

  17. https://mokacoding.com/blog/xctexpectfailure

  18. https://mokacoding.com/blog/xctexpectfailure

  19. https://mokacoding.com/blog/xctexpectfailure

  20. https://mokacoding.com/blog/xctexpectfailure

  21. https://mokacoding.com/blog/xctexpectfailure

  22. Test Repetition More tools to avoid dealing with address flaky

  23. Diagnose unreliable code with test repetitions

  24. Diagnose unreliable code with test repetitions

  25. Diagnose unreliable code with test repetitions Until Failure

  26. Diagnose unreliable code with test repetitions Retry on Failure

  27. Diagnose unreliable code with test repetitions Up Until Maximum Repetition

  28. addTearDownBlock I couldn’t find a snarky remark for this one…

  29. None
  30. Test-Driven Development in Swift tddinswift.com

  31. One more thing…

  32. Vim key bindings So you’ll never be able to quite

    Xcode again
  33. • Vim key bindings introduce “Modal Editing” • Normal mode

    – Verb + Movement + Subject • Insert mode • Visual mode • Limited support (for now? $%)
  34. Demo Time

  35. mokacoding.com/xcode-heart-vim ❤

  36. & Gio Lodi Mobile Infrastructure Engineer @ Automattic @mokagio mokacoding.com