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
100
辛さしかないふりかえりの口当たりを良くしていった話をふりかえる
nomadmonad
0
820
ふりかえり はじめの一歩 切ってみよう
nomadmonad
0
77
ざっくりわかるHTML5
nomadmonad
1
380
Other Decks in Programming
See All in Programming
知られざるDMMデータエンジニアの生態 〜かつてツチノコと呼ばれし者〜
takaha4k
3
1.2k
Rubyでつくるパケットキャプチャツール
ydah
1
730
2024年のWebフロントエンドのふりかえりと2025年
sakito
1
210
ゼロからの、レトロゲームエンジンの作り方
tokujiros
3
1.2k
ISUCON14公式反省会LT: 社内ISUCONの話
astj
PRO
0
170
Immutable ActiveRecord
megane42
0
130
2024年のkintone API振り返りと2025年 / kintone API look back in 2024
tasshi
0
200
Flutter × Firebase Genkit で加速する生成 AI アプリ開発
coborinai
0
130
iOSエンジニアから始める visionOS アプリ開発
nao_randd
3
110
ペアーズでの、Langfuseを中心とした評価ドリブンなリリースサイクルのご紹介
fukubaka0825
2
290
Swiftコンパイラ超入門+async関数の仕組み
shiz
0
210
Writing documentation can be fun with plugin system
okuramasafumi
0
110
Featured
See All Featured
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.1k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
20
2.4k
Designing Experiences People Love
moore
139
23k
Building Your Own Lightsaber
phodgson
104
6.2k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
9
1.3k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Docker and Python
trallard
44
3.2k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.5k
Music & Morning Musume
bryan
46
6.3k
Optimizing for Happiness
mojombo
376
70k
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