testing en ios - agilecyl - pucela testing days 2013
DESCRIPTION
Esta charla forma parte de un ciclo sobre testing que se dio en AgileCyL (http://agilecyl.org/2013/11/27/pucelatestingdays-testing-en-ios-y-testing-en-android/). Se puede ver la presentación (más bien escuchar, porque el video es pésimo) en Youtube: http://youtu.be/6ruv6vMUTtETRANSCRIPT
![Page 1: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/1.jpg)
T E S T I N G E N I O SP U C E L A T E S T I N G D A Y S
J O R G E M A R O T O G A R C Í A ( @ PA T O R O C O ) A G I L E C Y L - 3 0 N O V I E M B R E 2 0 1 3
![Page 2: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/2.jpg)
Jorge Maroto García.
[xxx]-Developer
+3 años jugando con iOS.
Fanboy.
Hola
![Page 3: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/3.jpg)
D I S C L A I M E R
• Charla introductoria.
• Presentación CDD(Coffee Driven Development).
• Playback.
• Tiempo indeterminado.
![Page 4: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/4.jpg)
D I S C L A I M E R
![Page 5: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/5.jpg)
X C O D E . E L I D E .
![Page 6: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/6.jpg)
![Page 7: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/7.jpg)
![Page 8: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/8.jpg)
![Page 9: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/9.jpg)
F R A M E W O R K S D E T E S T I N G
• OCUnit (< iOS7)
• XCTest (iOS7)
• GHUnit (https://github.com/gh-unit/gh-unit)
![Page 10: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/10.jpg)
O C U N I T
STAssertTrue(expression, msg, ...)STAssertEqualObjects(a1, a2, msg, ...)
STAssertEquals(a1, a2, msg, ...)STAssertEqualsWithAccuracy(a1, a2, msg, ...)
STFail(msg, ...)STAssertNil(a1, msg, ...)
STAssertNotNil(a1, msg, ...)STAssertTrueNoThrow(expression, msg, ...)
STAssertFalse(expression, msg, ...)STAssertFalseNoThrow(expression, msg, ...)
STAssertThrows(expression, msg, ...)STAssertThrowsSpecific(expression, exception, msg, ...)
STAssertThrowsSpecificNamed(expression, exception, name, msg, ...)STAssertNoThrow(expression, msg, ...)
STAssertNoThrowSpecific(expression, exception, msg, ...)STAssertNoThrowSpecificNamed(expression, exception, msg, ...)
![Page 11: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/11.jpg)
X C T E S T
XCTFail (format…)XCTAssertNil (a1, format…)
XCTAssertNotNil (a1, format…)XCTAssert (a1, format…)
XCTAssertTrue (a1, format…)XCTAssertFalse (a1, format…)
XCTAssertEqualObjects (a1, a2, format…)XCTAssertEquals (a1, a2, format…)
XCTAssertEqualsWithAccuracy (a1, a2, accuracy, format…)XCTAssertThrows (expression, format…)
XCTAssertThrowsSpecific (expression, specificException, format…)XCTAssertThrowsSpecificNamed (expression, specificException, exceptionName, format…)
XCTAssertNoThrow (expression, format…)XCTAssertNoThrowSpecific (expression, specificException, format…)
XCTAssertNoThrowSpecificNamed (expression, specificException, exceptionName, format…)
![Page 12: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/12.jpg)
![Page 13: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/13.jpg)
![Page 14: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/14.jpg)
![Page 15: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/15.jpg)
T E S T L I F E C Y C L E
• +(void)setup
• +(void)tearDown
• -(void)setup
• -(void)tearDown
• -(void)test<whatever>
![Page 16: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/16.jpg)
![Page 17: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/17.jpg)
T D D . C A L C U L AT O R 3 0 0 0 .
![Page 18: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/18.jpg)
![Page 19: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/19.jpg)
![Page 20: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/20.jpg)
![Page 21: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/21.jpg)
![Page 22: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/22.jpg)
![Page 23: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/23.jpg)
![Page 24: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/24.jpg)
![Page 25: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/25.jpg)
![Page 26: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/26.jpg)
![Page 27: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/27.jpg)
![Page 28: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/28.jpg)
M I E N T R A S TA N T O E N E L M U N D O R E A L …
![Page 29: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/29.jpg)
C L A S E S D E U T I L I D A D
![Page 30: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/30.jpg)
E J E M P L O R E A L : M A P E A R J S O N
![Page 31: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/31.jpg)
E J E M P L O R E A L : M A P E A R J S O N
![Page 32: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/32.jpg)
E J E M P L O R E A L : T O R P E Z A
![Page 33: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/33.jpg)
E J E M P L O R E A L : T O R P E Z A
![Page 34: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/34.jpg)
E J E M P L O R E A L : T O R P E Z A
![Page 35: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/35.jpg)
E J E M P L O R E A L : S I N G L E T O N
• API en singleton.
• I de FIRST.
• ¿Cómo inyecto la API en un test?
![Page 36: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/36.jpg)
E J E M P L O R E A L : S I N G L E T O N
• API en singleton.
• I de FIRST.
• ¿Cómo inyecto la API en un test?
• Ideaca: usar @property para apuntar a la API y así puedo ‘allocar’ un singleton distinto en cada test.
![Page 37: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/37.jpg)
E J E M P L O R E A L : S I N G L E T O N
• API en singleton.
• I de FIRST.
• ¿Cómo inyecto la API en un test?
• Ideaca: usar @property para apuntar a la API y así puedo ‘allocar’ un singleton distinto en cada test.
• Consecuencias: subclasear para testing.
![Page 38: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/38.jpg)
![Page 39: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/39.jpg)
![Page 40: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/40.jpg)
C H A P U ZA
![Page 41: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/41.jpg)
¡ A Ú N Q U E D A E S P E R A N Z A !
https://github.com/jonreid/OCMockito
![Page 42: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/42.jpg)
O C M O C K I T O : I N S TA L A C I Ó N
*Presentación CocoaPods: http://maroto.me/ttzc
![Page 43: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/43.jpg)
O C M O C K I T O : I N S TA L A C I Ó N
![Page 44: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/44.jpg)
O C M O C K I T O : E J E M P L O S
![Page 45: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/45.jpg)
O C M O C K I T O : E J E M P L O S
![Page 46: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/46.jpg)
O C H A M C R E S T: M AT C H E R S
https://github.com/hamcrest/OCHamcrest
Ejemplo de matchers:
![Page 47: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/47.jpg)
U N PA S I T O M Á S . K I W I .
https://github.com/allending/Kiwi
![Page 48: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/48.jpg)
K I W I : I N S TA L A C I Ó N
![Page 49: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/49.jpg)
K I W I : U S O
![Page 50: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/50.jpg)
K I W I : E J E M P L O S
![Page 51: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/51.jpg)
K I W I : E J E M P L O S
![Page 52: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/52.jpg)
K I W I : E J E M P L O S
![Page 53: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/53.jpg)
![Page 54: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/54.jpg)
U I A U T O M AT I O N
![Page 55: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/55.jpg)
![Page 56: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/56.jpg)
D E M O
http://maroto.me/vu7f
![Page 57: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/57.jpg)
M O L A N D O
http://vimeo.com/39888743
![Page 58: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/58.jpg)
T E S T E A N D O M I E N T R A S D U E R M E S .
![Page 59: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/59.jpg)
T R AV I S
• Gratuito para proyectos open source.
• Integrado con github.
• .travis.yml
![Page 60: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/60.jpg)
![Page 61: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/61.jpg)
https://travis-ci.org/patoroco/JMGFrame
![Page 62: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/62.jpg)
![Page 63: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/63.jpg)
J E N K I N S E S PA R A P O B R E S
![Page 64: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/64.jpg)
O S X S E R V E R
![Page 65: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/65.jpg)
Tutorial para montar bots: http://maroto.me/vu7h
![Page 66: Testing en iOS - AgileCyL - Pucela Testing Days 2013](https://reader033.vdocument.in/reader033/viewer/2022052601/558df2b11a28ab91598b457a/html5/thumbnails/66.jpg)
GRAC IAStwitter: @patoroco
git.jorgemaroto.es
in.jorgemaroto.es
jorgemaroto.es