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
87
辛さしかないふりかえりの口当たりを良くしていった話をふりかえる
nomadmonad
0
790
ふりかえり はじめの一歩 切ってみよう
nomadmonad
0
77
ざっくりわかるHTML5
nomadmonad
1
370
Other Decks in Programming
See All in Programming
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
600
Laravel や Symfony で手っ取り早く OpenAPI のドキュメントを作成する
azuki
2
120
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
220
Jakarta Concurrencyによる並行処理プログラミングの始め方 (JJUG CCC 2024 Fall)
tnagao7
1
290
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
330
色々なIaCツールを実際に触って比較してみる
iriikeita
0
330
ローコードSaaSのUXを向上させるためのTypeScript
taro28
1
610
LLM生成文章の精度評価自動化とプロンプトチューニングの効率化について
layerx
PRO
2
190
RubyLSPのマルチバイト文字対応
notfounds
0
120
cmp.Or に感動した
otakakot
2
150
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
Featured
See All Featured
KATA
mclloyd
29
14k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Scaling GitHub
holman
458
140k
Being A Developer After 40
akosma
86
590k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Optimizing for Happiness
mojombo
376
70k
It's Worth the Effort
3n
183
27k
Building Your Own Lightsaber
phodgson
103
6.1k
Statistics for Hackers
jakevdp
796
220k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
Git: the NoSQL Database
bkeepers
PRO
427
64k
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