ݺߣ

ݺߣShare a Scribd company logo
Test-driven Development
on iOS
idiel@osxdev.org
Agenda
- What we’re going to learn...
- The very basic to the TDD for iOS
- Gate to the OSXDev Codingdojo
- <= 30min
Agenda
- Test-driven Development
- Overview
- TDD for iOS
- OSXDev Client
- Unit Testing Framework
Test-driven Development
- What is it?
- Software Development Process
- repetitive short development cycle
add
test
run
tests
write
code
run
tests
refactor
code
- Software Development Process
- Waterfall
Test-driven Development
Requirements
Specification
Development
Test
Deployment
Test-driven Development
- Software Development Process
- Agile
- based on iterative and incremental development
- XP
- TDD
- FDD
Test-driven Development
- Benefits
- Lower cost of fixing bugs
Test-driven Development
- Benefits
- Lower cost of fixing bugs
Test-driven Development
- Techniques for TDD
- Test First
- Red, Green, Refactor
- Designing a Test-Driven App
- Refactoring
- YAGNI(You Aren’t Gonna Need It)
- Testing Before, During, and After Coding
TDD for iOS
- OSXDev Client
- Requirements
- Account: Login/Logout/Signup
- Thread/Post: Read/Write post
- Users: Lookup/Message
- OSXDev Rest API
- Supported Actions
- authenticate
- getactions, getuser, getavatar, getusers, getgroup,
TDD for iOS
- OSXDev Client
- Simple User Search App
TDD for iOS
- Testing Preview
- Microfeatures
- Models
- View
- Controllers
TDD for iOS
- OCUnit
- Developed by Sen:Te
- Xcode Integration
- Test Fixture
- setUp
- tearDown
- SenTestingKit
- SenTestCase
- method prefix “test”
- Editing Schemes
- Automatic Test after Build
TDD for iOS
- OCUnit
- STAssert... Macros
STFail
STAssertNil
STAssertNotNil
STAssertTrue
STAssertFalse
STAssertEquals
STAssertEqualObjects
STAssertEqualsWithAccuracy
STAssertThrows
STAssertThrowsSpecific
STAssertThrowsSpecificNamed
STAssertNoThrow
STAssertNoThrowSpecific
STAssertNoThrowSpecificNamed
STAssertTrueNoThrow
STAssertFalseNoThrow
TDD for iOS
- Alternative Unit Testing Tools
- Google Toolkit for Mac (GTM)s
- GHUnit
- CATCH
- OCMock
- http://ocmock.org
- http://alexvoller.com/posts/2010/06/28/making-fun-of-things-with-
ocmock
TDD for iOS
- Getting Started
TDD for iOS
- Model testing sample
- ODCUser
- ODCForumGroup
- ODCForum
- ODCThread
OSXDev Coding Dojo
- Coming soon...
- visit http://osxdev.org

More Related Content

2013.02.02 지앤선 테크니컬 세미나 - iOS 테스팅 이야기(OSXDEV)

  • 2. Agenda - What we’re going to learn... - The very basic to the TDD for iOS - Gate to the OSXDev Codingdojo - <= 30min
  • 3. Agenda - Test-driven Development - Overview - TDD for iOS - OSXDev Client - Unit Testing Framework
  • 4. Test-driven Development - What is it? - Software Development Process - repetitive short development cycle add test run tests write code run tests refactor code
  • 5. - Software Development Process - Waterfall Test-driven Development Requirements Specification Development Test Deployment
  • 6. Test-driven Development - Software Development Process - Agile - based on iterative and incremental development - XP - TDD - FDD
  • 7. Test-driven Development - Benefits - Lower cost of fixing bugs
  • 8. Test-driven Development - Benefits - Lower cost of fixing bugs
  • 9. Test-driven Development - Techniques for TDD - Test First - Red, Green, Refactor - Designing a Test-Driven App - Refactoring - YAGNI(You Aren’t Gonna Need It) - Testing Before, During, and After Coding
  • 10. TDD for iOS - OSXDev Client - Requirements - Account: Login/Logout/Signup - Thread/Post: Read/Write post - Users: Lookup/Message - OSXDev Rest API - Supported Actions - authenticate - getactions, getuser, getavatar, getusers, getgroup,
  • 11. TDD for iOS - OSXDev Client - Simple User Search App
  • 12. TDD for iOS - Testing Preview - Microfeatures - Models - View - Controllers
  • 13. TDD for iOS - OCUnit - Developed by Sen:Te - Xcode Integration - Test Fixture - setUp - tearDown - SenTestingKit - SenTestCase - method prefix “test” - Editing Schemes - Automatic Test after Build
  • 14. TDD for iOS - OCUnit - STAssert... Macros STFail STAssertNil STAssertNotNil STAssertTrue STAssertFalse STAssertEquals STAssertEqualObjects STAssertEqualsWithAccuracy STAssertThrows STAssertThrowsSpecific STAssertThrowsSpecificNamed STAssertNoThrow STAssertNoThrowSpecific STAssertNoThrowSpecificNamed STAssertTrueNoThrow STAssertFalseNoThrow
  • 15. TDD for iOS - Alternative Unit Testing Tools - Google Toolkit for Mac (GTM)s - GHUnit - CATCH - OCMock - http://ocmock.org - http://alexvoller.com/posts/2010/06/28/making-fun-of-things-with- ocmock
  • 16. TDD for iOS - Getting Started
  • 17. TDD for iOS - Model testing sample - ODCUser - ODCForumGroup - ODCForum - ODCThread
  • 18. OSXDev Coding Dojo - Coming soon... - visit http://osxdev.org