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.3k
コードカバレッジとの付き合い方を知ってテストを書く
Daiki Katayama
April 10, 2019
Tweet
Share
More Decks by Daiki Katayama
See All by Daiki Katayama
iOSアプリのパフォーマンス計測をおさらいする
kariad
2
8.8k
アプリのパフォーマンスを継続的に計測する
kariad
6
15k
Xcodeのカバレッジ計測ではなぜブランチカバレッジが取れないのだろうか?
kariad
3
4.3k
WACATE2019_summer_BPP
kariad
1
2.2k
Viewのテストどうしてますか?
kariad
2
1.4k
開発者として学ぶソフトウェアテスト
kariad
2
950
Other Decks in Programming
See All in Programming
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
260
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
Content Security Policy入門 セキュリティ設定と 違反レポートのはじめ方 / Introduction to Content Security Policy Getting Started with Security Configuration and Violation Reporting
uskey512
1
530
リアーキテクチャxDDD 1年間の取り組みと進化
hsawaji
1
220
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
320
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
860
Amazon Qを使ってIaCを触ろう!
maruto
0
400
Quine, Polyglot, 良いコード
qnighy
4
640
Jakarta EE meets AI
ivargrimstad
0
130
Realtime API 入門
riofujimon
0
150
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
160
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
Featured
See All Featured
Faster Mobile Websites
deanohume
305
30k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Happy Clients
brianwarren
98
6.7k
Scaling GitHub
holman
458
140k
Producing Creativity
orderedlist
PRO
341
39k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Thoughts on Productivity
jonyablonski
67
4.3k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
RailsConf 2023
tenderlove
29
900
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
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