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.1k
アプリのパフォーマンスを継続的に計測する
kariad
6
16k
Xcodeのカバレッジ計測ではなぜブランチカバレッジが取れないのだろうか?
kariad
3
4.4k
WACATE2019_summer_BPP
kariad
1
2.3k
Viewのテストどうしてますか?
kariad
2
1.5k
開発者として学ぶソフトウェアテスト
kariad
2
990
Other Decks in Programming
See All in Programming
新しいPHP拡張モジュールインストール方法「PHP Installer for Extensions (PIE)」を使ってみよう!
cocoeyes02
0
380
Youtube Lofier - Chrome拡張開発
ninikoko
0
2.4k
リストビュー画面UX改善の振り返り
splcywolf
0
140
Dissecting and Reconstructing Ruby Syntactic Structures
ydah
0
650
Memory API : Patterns, Performance et Cas d'Utilisation
josepaumard
0
130
Being an ethical software engineer
xgouchet
PRO
0
210
[NG India] Event-Based State Management with NgRx SignalStore
markostanimirovic
1
150
Coding Experience Cpp vs Csharp - meetup app osaka@9
harukasao
0
750
PHP で学ぶ OAuth 入門
azuki
1
190
Chrome Extension Techniques from Hell
moznion
1
160
AWSで雰囲気でつくる! VRChatの写真変換ピタゴラスイッチ
anatofuz
0
160
生成AIを使ったQAアプリケーションの作成 - ハンズオン補足資料
oracle4engineer
PRO
3
220
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
Agile that works and the tools we love
rasmusluckow
328
21k
Music & Morning Musume
bryan
47
6.5k
Testing 201, or: Great Expectations
jmmastey
42
7.5k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Visualization
eitanlees
146
16k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Documentation Writing (for coders)
carmenintech
69
4.7k
A designer walks into a library…
pauljervisheath
205
24k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.1k
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