Upload
hugo-lu
View
156
Download
1
Embed Size (px)
Citation preview
Testing in Swifthugo
4/25/2015
軟體開發有三種⽅方式
單元測試的三個步驟
設定Target Membership
產⽣生測試檔
測試 vs 實做
測試驅動開發三階段 Test Driven Development
紅燈:寫出失敗的測試
Build: ⌘B Test: ⌘U Run: ⌘R
綠燈:讓測試通過
TDD的理由• 簡單設計
• 沒有 dead code
• 從使⽤用者⾓角度設計
• 測試涵蓋率⾼高
• 容易維護與重構
• 擁有可執⾏行的⽂文件 圖⽚片出處 http://goo.gl/R5aD5X
參考資料• How to write unit tests in Swift with XCTest
http://roadfiresoftware.com/2014/06/unit-testing-with-swift/
• Test Driven Development http://devmonologue.com/ios/category/test-driven-development/
• TDD for iOS in Swift – What’s the Goal? http://www.andrewcbancroft.com/2014/12/16/tdd-ios-swift-whats-goal/