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.2k
コードカバレッジとの付き合い方を知ってテストを書く
Daiki Katayama
April 10, 2019
Tweet
Share
More Decks by Daiki Katayama
See All by Daiki Katayama
iOSアプリのパフォーマンス計測をおさらいする
kariad
1
8.2k
アプリのパフォーマンスを継続的に計測する
kariad
6
14k
Xcodeのカバレッジ計測ではなぜブランチカバレッジが取れないのだろうか?
kariad
3
3.9k
WACATE2019_summer_BPP
kariad
1
2.1k
Viewのテストどうしてますか?
kariad
2
1.3k
開発者として学ぶソフトウェアテスト
kariad
2
870
Other Decks in Programming
See All in Programming
受託開発でGitLab CI を活用していく
xiombatsg
1
130
phpunit/php-code-coverageって何をしてるんだ #phperkaigi
o0h
PRO
2
220
「コンパイル時のユニットテスト」導入するとユニットテストを 書かなくてよくなるのか?
tomohisa
9
2.2k
Introduction for Open Source Swift Workshop
giginet
PRO
0
290
htmx is fun!
codehex
2
190
incrementalモデルの理解を深める
ikkimiyazaki
2
640
PHP 8.3で追加されたjson_validate()を徹底的に深掘りしてみよう
mashirou1234
1
730
両面どころかインフラもTSでできるよ ~ 全方位TypeScriptによるプロダクト開発 ~
myfinder
8
2.3k
Why 1 + 1 = 2 in Swift?
1plus4
1
250
OpenTelemetry のサービスという概念について
azukiazusa1
1
410
The Future of C++ Interoperability: Insights from Porting a Game to Swift
teamhimeh
0
270
せっかくモデル図描くのなら、嬉しいことが多い方がいいよね!
kuboaki
1
1.8k
Featured
See All Featured
Being A Developer After 40
akosma
56
580k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
113
18k
Fireside Chat
paigeccino
19
2.6k
Debugging Ruby Performance
tmm1
68
11k
Visualization
eitanlees
135
14k
Fantastic passwords and where to find them - at NoRuKo
philnash
35
2.4k
JazzCon 2018 Closing Keynote - Leadership for the Reluctant Leader
reverentgeek
178
11k
How to train your dragon (web standard)
notwaldorf
71
5.1k
Code Review Best Practice
trishagee
54
15k
Designing the Hi-DPI Web
ddemaree
275
33k
How STYLIGHT went responsive
nonsquared
92
4.7k
Creatively Recalculating Your Daily Design Routine
revolveconf
209
11k
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