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
New Features of XCTest on Xcode 6
Search
Tsuyoshi Yamamoto
July 11, 2014
Programming
0
540
New Features of XCTest on Xcode 6
WWDC2014で発表された、Xcode6のXCtestに追加された新機能について、説明した資料です。
この資料では、以下の項目について説明しています。
* 非同期API
* パフォーマンステスト
Tsuyoshi Yamamoto
July 11, 2014
Tweet
Share
More Decks by Tsuyoshi Yamamoto
See All by Tsuyoshi Yamamoto
立ち上げ期のフィードバックとYOWを使ってみた話、ドキュメントとの付き合い方も変わった話
nomadmonad
0
99
辛さしかないふりかえりの口当たりを良くしていった話をふりかえる
nomadmonad
0
810
ふりかえり はじめの一歩 切ってみよう
nomadmonad
0
77
ざっくりわかるHTML5
nomadmonad
1
370
Other Decks in Programming
See All in Programming
BEエンジニアがFEの業務をできるようになるまでにやったこと
yoshida_ryushin
0
100
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
280
命名をリントする
chiroruxx
1
570
rails newと同時に型を書く
aki19035vc
5
610
快速入門可觀測性
blueswen
0
480
Findy Team+ Awardを受賞したかった!ベストプラクティス応募内容をふりかえり、開発生産性向上もふりかえる / Findy Team Plus Award BestPractice and DPE Retrospective 2024
honyanya
0
130
php-conference-japan-2024
tasuku43
0
410
DevFest - Serverless 101 with Google Cloud Functions
tunmise
0
130
React 19でお手軽にCSS-in-JSを自作する
yukukotani
5
530
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
230
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
4
1k
CloudflareStack でRAGに入門
asahiiwm
0
140
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
Reflections from 52 weeks, 52 projects
jeffersonlam
348
20k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
What's in a price? How to price your products and services
michaelherold
244
12k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
19
2.3k
VelocityConf: Rendering Performance Case Studies
addyosmani
327
24k
Building Applications with DynamoDB
mza
92
6.1k
BBQ
matthewcrist
85
9.4k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.3k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
How STYLIGHT went responsive
nonsquared
96
5.3k
Transcript
New Features of XCTest on Xcode 6 Tsuyoshi Yamamoto
New Features w ඇಉظςετ༻ͷ"1* 9$5FTU&YQFDUBUJPOΫϥε FYQFDUBUJPO8JUI%FTDSJQUJPOͳͲͷ"1* ! w ύϑΥʔϚϯεଌఆ༻ͷ"1* NFBTVSF#MPDLTɺ
NFBTVSF.FUSJDTͳͲͷ"1*
APIs for Asynchronous Testing w 9$5FTU&YQFDUBUJPO ඇಉظͳৼΔ͍Λςετ͢Δͱ͖ɺ ظ௨Γʹ࣮ߦ͞Ε͔ͨΛධՁ͢ΔΫϥε ! GVMpMM͕ݺͼग़͞ΕΕظ௨Γͱఆ
APIs for Asynchronous Testing w XBJU'PS&YQFDUBUJPO8JUI5JNFPVU ඇಉظͳৼΔ͍Λ࣮ߦ͍ͯ͠Δؒɺ 3VO-PPQΛճ͠ଓ͚ͯXBJU͢ΔͨΊͷ"1* ! 9$5FTU&YQFDUBUJPO͕ظ௨Γʹಈ͍ͨͱ
ఆ͞ΕΔ͔ɺλΠϜΞτ͢Δ·Ͱػ
Sample for Asynchronous Testing - (void)testDocumentOpening { XCTestExpectation *expect =
[self expectationWithDescription:@“open”]; ! UIDocument *doc = ...; ! [doc openWithCompletionHandler:^(BOOL success) { XCTAssert(success); [expect fulfill]; } ! [self waitForExpectationsWithTimeout:5.0 handler:nil]; }
Sample for Asynchronous Testing - (void)testDocumentOpening { XCTestExpectation *expect =
[self expectationWithDescription:@“open”]; ! UIDocument *doc = ...; ! [doc openWithCompletionHandler:^(BOOL success) { XCTAssert(success); [expect fulfill]; } ! [self waitForExpectationsWithTimeout:5.0 handler:nil]; }
Other Expectations XCTestCase+AsynchronousTesting.hʹɺ Convenience APIsͱͯ͠Ճ͞Ε͍ͯͨAPI ! - keyValueObservingExpectationForObject: keyPath: expectedValue:
! - keyValueObservingExpectationForObject: keyPath: handler: ! - expectationForNotification: object: handler:
APIs for Performance Testing w NFBTVSF#MPDL Ҿͱͯ͠͞Εͨଌఆ༻ͷ#MPDLTΛ ճ࣮ߦ͠ɺ#MPDLTશମͷ ฏۉ࣮ߦ࣌ؒ
࣮ߦ࣌ؒͷΒ͖ͭ߹͍ʢඪ४ภࠩʣ Λ#BTF-JOFͱൺֱ͠ɺ ςετͷ4VDDFTT'BJMVSFΛධՁ͢Δ ! #BTF-JOFύϑΥʔϚϯεධՁ࣌ͷج४ɻ ɹҎલ࣮ߦͨ͠ςετ݁ՌͳͲΛݩʹઃఆͰ͖Δ
Sample for Performance Testing - (void)testDocumentOpeningPerformance { TestTargetClass *target =
[TestTargetClass new]; ! [self measureBlock:^{ [target openFile]; [target parse]; [target closeFile]; }]; }
Sample for Performance Testing - (void)testDocumentOpeningPerformance { TestTargetClass *target =
[TestTargetClass new]; ! [self measureBlock:^{ [target openFile]; [target parse]; [target closeFile]; }]; }
Other Measurement w NFBTVSF.FUSJDT Ҿͱͯͨ͠͠ଌఆ༻#MPDLTͷ͏ͪɺ ܭଌ͍ͨ͠ՕॴΛίʔυͰࢦఆͰ͖Δɻ ! ଞͷ༰NFBTVSF#MPDLͱಉ͡
Sample for Performance Testing - (void)testDocumentOpeningPerformance { TestTargetClass *target =
[TestTargetClass new]; ! [self measureMetrics: [[self class] defaultPerformanceMetrics] automaticallyStartMeasuring:NO forBlock:^{ [target openFile]; [self startMeasuring]; [target parse]; [self stopMeasuring]; [target closeFile]; }]; }
Sample for Performance Testing - (void)testDocumentOpeningPerformance { TestTargetClass *target =
[TestTargetClass new]; ! [self measureMetrics: [[self class] defaultPerformanceMetrics] automaticallyStartMeasuring:NO forBlock:^{ [target openFile]; [self startMeasuring]; [target parse]; [self stopMeasuring]; [target closeFile]; }]; }
Happy Testing!! This Slide uses Azusa Template