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

What's New in Testing!!!

What's New in Testing!!!

WWDC2017のほぼ同名のセッションの内容について簡単にまとめました。

Shingo Tamaki

July 26, 2017
Tweet

More Decks by Shingo Tamaki

Other Decks in Technology

Transcript

  1. What's New in
    Testing!!!

    View full-size slide

  2. ࣗݾ঺հ
    ۄ৓৴ޛ
    iOS Engineer!
    ޷͖ͳframework͸HomeKitͱXCTestͰ͢
    झຯ"
    ిࢠ޻࡞⚡
    ےτϨ$
    ΨδΣοτ%

    View full-size slide

  3. Parallel Testing
    Localization
    Block-based test teardown
    Multi-app Testing
    FirstMatch API
    Activities
    Attachments
    Async Testing (Xcode8.3)

    View full-size slide

  4. Parallel Testing
    https://developer.apple.com/videos/play/wwdc2017/102/

    View full-size slide

  5. Localization
    ςετ࣌ͷLanguage/Regionࢦఆ͕ՄೳʹͳΓ·ͨ͠ɻ
    xcodebuildͰ͸-testLanguage,-testRegionͰࢦఆՄೳ

    View full-size slide

  6. Block-based test teardown

    View full-size slide

  7. Multi-app Testing

    View full-size slide

  8. Multi-app Testing

    View full-size slide

  9. FirstMatch API

    View full-size slide

  10. FirstMatch API

    View full-size slide

  11. ͜Ε·Ͱͷςετ

    View full-size slide

  12. ͜Ε·Ͱͷςετ

    View full-size slide

  13. ͜Ε͔Βͷςετ

    View full-size slide

  14. ࣮ߦϩά͔Βݟͨҧ͍

    View full-size slide

  15. Attachment Lifetime Policies

    View full-size slide

  16. Async Testing (Xcode 8.3)

    View full-size slide

  17. XCTWaiter
    • XCTWaiterͱͯ͠΢ΣΠτॲཧʹؔ͢Δ෦෼͕XCTestCase͔
    Β෼཭͠·ͨ͠ɻ
    • ର৅ͱͳΔexpectationΛ໌ࣔతʹෳ਺Ͱ͖ΔΑ͏ʹͳΓ·͠
    ͨɻ
    • XCTWaiterDelegate
    • XCTWaiter.Result

    View full-size slide

  18. XCTWaiter
    Explicitly expectation

    View full-size slide

  19. XCTWaiter.Result
    XCWaiter.Result͕ఆٛ͞Εɺ࣮ߦ݁Ռͱͯ͠ҎԼͷΑ͏ͳ΋ͷ
    ͕ఆٛ͞Ε͍ͯ·͢ɻ
    • completed
    • timedOut
    • incorrectOrder
    • invertedFulfillment
    • interrupted

    View full-size slide

  20. XCTWaiterDelegate
    • nestedWaiter(_:wasInterruptedByTimedOutWaiter:)
    • waiter(_:didTimeoutWithUnfulfilledExpectations:)
    • waiter(_:didFulfillInvertedExpectation:)

    waiter(_:fulfillmentDidViolateOrderingConstraintsFor:requir
    edExpectation:)

    View full-size slide

  21. XCTTestExpectation
    • expectedFulfillmentCount
    • isInverted
    • enforceOrder

    View full-size slide

  22. expectedFulfillmentCount

    View full-size slide

  23. enforceOrder

    View full-size slide

  24. XCTTestExpectation
    • ৽͍͠Expectation͕૿͑·ͨ͠ɻ
    • XCTKVOExpectation
    • XCTNSNotificationExpectation
    • XCTNSPredicateExpectation

    View full-size slide

  25. https://
    developer.apple.com
    /videos/play/
    wwdc2017/409/

    View full-size slide