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
130
辛さしかないふりかえりの口当たりを良くしていった話をふりかえる
nomadmonad
0
860
ふりかえり はじめの一歩 切ってみよう
nomadmonad
0
77
ざっくりわかるHTML5
nomadmonad
1
390
Other Decks in Programming
See All in Programming
LINEヤフー データグループ紹介
lycorp_recruit_jp
0
770
Using AI Tools Around Software Development
inouehi
0
1.2k
Go1.25からのGOMAXPROCS
kuro_kurorrr
1
790
deno-redisの紹介とJSRパッケージの運用について (toranoana.deno #21)
uki00a
0
130
Select API from Kotlin Coroutine
jmatsu
1
190
GraphRAGの仕組みまるわかり
tosuri13
7
470
ktr0731/go-mcpでMCPサーバー作ってみた
takak2166
0
170
Effect の双対、Coeffect
yukikurage
5
1.4k
童醫院敏捷轉型的實踐經驗
cclai999
0
120
Result型で“失敗”を型にするPHPコードの書き方
kajitack
4
120
なぜ「共通化」を考え、失敗を繰り返すのか
rinchoku
1
420
Julia という言語について (FP in Julia « SIDE: F ») for 関数型まつり2025
antimon2
3
970
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
430
65k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
60k
4 Signs Your Business is Dying
shpigford
184
22k
Writing Fast Ruby
sferik
628
61k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
281
13k
Into the Great Unknown - MozCon
thekraken
39
1.9k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
2.8k
Typedesign – Prime Four
hannesfritz
42
2.7k
Product Roadmaps are Hard
iamctodd
PRO
53
11k
BBQ
matthewcrist
89
9.7k
Building Adaptive Systems
keathley
43
2.6k
Why You Should Never Use an ORM
jnunemaker
PRO
56
9.4k
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