Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
コードカバレッジとの付き合い方を知ってテストを書く
Search
Daiki Katayama
April 10, 2019
Programming
2
2.4k
コードカバレッジとの付き合い方を知ってテストを書く
Daiki Katayama
April 10, 2019
Tweet
Share
More Decks by Daiki Katayama
See All by Daiki Katayama
iOSアプリのパフォーマンス計測をおさらいする
kariad
2
9k
アプリのパフォーマンスを継続的に計測する
kariad
6
16k
Xcodeのカバレッジ計測ではなぜブランチカバレッジが取れないのだろうか?
kariad
3
4.4k
WACATE2019_summer_BPP
kariad
1
2.2k
Viewのテストどうしてますか?
kariad
2
1.5k
開発者として学ぶソフトウェアテスト
kariad
2
980
Other Decks in Programming
See All in Programming
Jakarta EE meets AI
ivargrimstad
0
370
Serverless Rust: Your Low-Risk Entry Point to Rust in Production (and the benefits are huge)
lmammino
1
150
ファインディLT_ポケモン対戦の定量的分析
fufufukakaka
0
920
なぜイベント駆動が必要なのか - CQRS/ESで解く複雑系システムの課題 -
j5ik2o
14
4.6k
Visual StudioのGitHub Copilotでいろいろやってみる
tomokusaba
1
210
技術を改善し続ける
gumioji
0
120
Djangoにおける複数ユーザー種別認証の設計アプローチ@DjangoCongress JP 2025
delhi09
PRO
4
460
PHPのバージョンアップ時にも役立ったAST
matsuo_atsushi
0
220
Introduction to kotlinx.rpc
arawn
0
760
XStateを用いた堅牢なReact Components設計~複雑なClient Stateをシンプルに~ @React Tokyo ミートアップ #2
kfurusho
1
980
CI改善もDatadogとともに
taumu
0
200
メンテが命: PHPフレームワークのコンテナ化とアップグレード戦略
shunta27
0
300
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.5k
For a Future-Friendly Web
brad_frost
176
9.6k
Being A Developer After 40
akosma
89
590k
A Tale of Four Properties
chriscoyier
158
23k
Automating Front-end Workflow
addyosmani
1368
200k
We Have a Design System, Now What?
morganepeng
51
7.4k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
Building an army of robots
kneath
303
45k
Gamification - CAS2011
davidbonilla
80
5.2k
It's Worth the Effort
3n
184
28k
Scaling GitHub
holman
459
140k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Transcript
ίʔυΧόϨοδͱͷ͖߹͍ํ ΛͬͯςετΛॻ͘ 2019/04/10 Otemachi.swift #3 kariad/͔Γ͋Ͳ(@kariad_uu) 1
ࣗݾհ • kariad / @kariad_uu • ยࢁ େथ • ΦΠγοΫεɾϥɾେ
iOS App Developer • / / V / ςετ / ઃܭ 2
ίʔυΧόϨοδܭଌͯ͠·͔͢ʁ 3
• ΧόϨοδ100%ͳΒ શ෦ςετͰ͖͍ͯͯେৎɺ Ͱͳ͍…ʂ
ΧόϨοδͷछྨʹΑΔ
ΧόϨοδʹछྨ͕͋Δ • εςʔτϝϯτΧόϨοδ(C0) • ϒϥϯνΧόϨοδ(C1) • ίϯσΟγϣϯΧόϨοδ(C2)
εςʔτϝϯτΧόϨοδ • ໋ྩจͷ௨ա
x: 2, y: 2ͷ1έʔεͰΧόϨοδ100%
ϒϥϯνΧόϨοδ • ذͷཏ
(x: 2, y: 2), (x: 0, y: 0)ͷ2έʔεͰΧόϨοδ100%
• εςʔτϝϯτΧόϨοδͲͷ ifจʹೖΒͳ͍ೖྗ͕ͳͯ͘ 100% ➡ શཏͱ͍͏؍Ͱ࿙Ε͕͋Δ
x: 0, y: 0ͳͯ͘100%
• XcodeͰܭଌͰ͖Δͷεςʔτ ϝϯτΧόϨοδ(ϥΠϯΧό Ϩοδ) • JaCoCoJestϒϥϯνΧόϨο δ͕औΕΔ…
ΧόϨοδͰ ݟΔ͜ͱ͕Ͱ͖ͳ͍
ΧόϨοδ100%ͰΓͳ͍෦ ςετͷೖྗ͕10ͩͱ͕݅5Ҏ্Ͱޭ͢Δ
• ڥքੳ • όά͕ى͖͍͢ͷ͜͏ݴͬͨ ڥքͷ෦ͳͷͰڥքʹண͢Δ
·ͱΊ • ΧόϨοδ100%Λͨͩࢦͯ͠ޮՌݮ • ΧόϨοδͷܭଌํ๏ڥքΛҙ্ࣝͨ͠ͰՁ ͷ͋ΔςετΛॻ͜͏ • Γ͍ͯΔࣄΛূ໌Ͱ͖ͳ͍͕ɺΓ͍ͯͳ͍ ࣄূ໌Ͱ͖ΔͨΊɺΧόϨοδΛܭଌ͢Δ͜ͱ େࣄ
ٕज़ॻయ6 ͚11 https://techbookfest.org/event/tbf06/circle/54660004
ͳͥεςʔτϝϯτΧόϨοδ ͚ͩͳͷ͔ • AppleͷυΩϡϝϯτʹ ʮCode coverage in Xcode is a
testing option supported by LLVMʯ ➡ ΧόϨοδऔಘLLVMͷػೳ https://developer.apple.com/library/archive/documentation/DeveloperTools/ Conceptual/testing_with_xcode/chapters/07-code_coverage.html
ClangͷυΩϡϝϯτʹҎԼͷ 4͕ͭܭଌͰ͖Δͱॻ͍ͯ͋Δ • Function coverage • Instantiation coverage • Line
coverage • Region coverage ClangͰ৭ʑऔΕΔͳΒಉ͡LLVM͏SwiftͰऔΕͳ͍͔ͳ… https://clang.llvm.org/docs/SourceBasedCodeCoverage.html
https://llvm.org/docs/ CoverageMappingFormat.html https://llvm.org/docs/CommandGuide/llvm- cov.html ͦͷଞࢀߟURL