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
9.2k
アプリのパフォーマンスを継続的に計測する
kariad
7
16k
Xcodeのカバレッジ計測ではなぜブランチカバレッジが取れないのだろうか?
kariad
3
4.5k
WACATE2019_summer_BPP
kariad
1
2.3k
Viewのテストどうしてますか?
kariad
2
1.5k
開発者として学ぶソフトウェアテスト
kariad
2
1k
Other Decks in Programming
See All in Programming
20250628_非エンジニアがバイブコーディングしてみた
ponponmikankan
0
710
The Niche of CDK Grant オブジェクトって何者?/the-niche-of-cdk-what-isgrant-object
hassaku63
1
570
iOS 26にアップデートすると実機でのHot Reloadができない?
umigishiaoi
0
140
High-Level Programming Languages in AI Era -Human Thought and Mind-
hayat01sh1da
PRO
0
850
たった 1 枚の PHP ファイルで実装する MCP サーバ / MCP Server with Vanilla PHP
okashoi
1
290
GPUを計算資源として使おう!
primenumber
1
210
猫と暮らす Google Nest Cam生活🐈 / WebRTC with Google Nest Cam
yutailang0119
0
170
Startups on Rails in Past, Present and Future–Irina Nazarova, RailsConf 2025
irinanazarova
0
210
NPOでのDevinの活用
codeforeveryone
0
880
Advanced Micro Frontends: Multi Version/ Framework Scenarios @WAD 2025, Berlin
manfredsteyer
PRO
0
370
The Evolution of Enterprise Java with Jakarta EE 11 and Beyond
ivargrimstad
0
190
PipeCDのプラグイン化で目指すところ
warashi
1
290
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
695
190k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.8k
Docker and Python
trallard
45
3.5k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Site-Speed That Sticks
csswizardry
10
700
Being A Developer After 40
akosma
90
590k
Gamification - CAS2011
davidbonilla
81
5.4k
Automating Front-end Workflow
addyosmani
1370
200k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.9k
GitHub's CSS Performance
jonrohan
1031
460k
The Language of Interfaces
destraynor
158
25k
Making the Leap to Tech Lead
cromwellryan
134
9.4k
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