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

presentation.pdf

 presentation.pdf

WWDC 2018のWhat's New in Testingのダイジェスト版です。

Shingo Tamaki

July 24, 2018
Tweet

More Decks by Shingo Tamaki

Other Decks in Technology

Transcript

  1. Code CoverageʢXcode 9.3ʣ • ΧόϨοδදࣔ·Ͱͷ࣌ؒ୹ॖ • Xcode9ͱൺ΂95%ߴ଎Խ • ΧόϨοδϑΝΠϧͷαΠζμ΢ϯ •

    Xcode9ͱൺ΂1/10ҎԼ • C++ʹ͓͚ΔϔομϑΝΠϧʹهड़͞Ε࣮ͨ૷ͷΧόϨοδ ऩू͕Մೳʹ
  2. xccov • xccov view hoge.xccovreport Name Coverage ---------------------------------------------------------------------------------- ------------- SampleLib.framework

    100.00% (3/3) /Users/you/SampleLib/Classes/SampleLib.swift 100.00% (3/3) static SampleLib.SampleLib.foo() -> Swift.String 100.00% (3/3)
  3. xccov • xccov view hoge.xccovreport --json | jq { "coveredLines":

    3, "lineCoverage": 1, "targets": [ { "coveredLines": 3, "lineCoverage": 1, "files": [ { "coveredLines": 3, "lineCoverage": 1, "path": "/Users/you/SampleLib/Classes/SampleLib.swift", "functions": [ { "coveredLines": 3, "lineCoverage": 1, "lineNumber": 11, "executionCount": 1, "name": "static SampleLib.SampleLib.foo() -> Swift.String", "executableLines": 3 } ], "name": "SampleLib.swift", "executableLines": 3 } ], "name": "SampleLib.framework", "executableLines": 3, "buildProductPath": "/Users/you/Library/Developer/Xcode/DerivedData/.../SampleLib.framework/SampleLib" } ], "executableLines": 3 }
  4. Test Selection and Order • εΩʔϜຖʹλʔήοτͷςετΛࣗಈ௥Ճ͢Δ͔Ͳ͏͔બ ΂ΔΑ͏ʹͳͬͨ • ςετͷ࣮ߦॱΛϥϯμϜʹग़དྷΔ༷ʹͳͬͨ •

    ࣮ߦॱংʹґଘͨ͠ςετΛݕग़͠΍͘͢ͳΔ • ґଘΛແ͘͠setup/teardownΛ࢖ͬͯඞཁͳঢ়ଶ͸࡞Γ ·͠ΐ͏
  5. !

  6. ࢀߟURL What's New in Testing https://developer.apple.com/videos/play/wwdc2018/403/ xccov: Xcode Code Coverage

    Report for Humans https://medium.com/xcblog/xccov-xcode-code-coverage- report-for-humans-466a4865aa18