SlideShare a Scribd company logo
Testing in Swift
hugo
4/25/2015
軟體開發有三種⽅方式
藝⾼高⼈人膽⼤大
圖⽚片出處 http://goo.gl/fqvzJv
不敢玩真的
圖⽚片出處http://goo.gl/gWI6cY
安全的冒險
圖⽚片出處 http://goo.gl/sp3GPT
單元測試的三個步驟
設定Target Membership
產⽣生測試檔
測試 vs 實做
測試驅動開發三階段
Test Driven Development
紅燈:寫出失敗的測試
Build: ⌘B
Test: ⌘U
Run: ⌘R
綠燈:讓測試通過
重構:改善既有程式
圖⽚片出處 http://goo.gl/Njgoe6
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/

More Related Content

What's hot (18)

PDF
TDD (Test-driven development, 測試驅動開發) 基本教學
潘 冠辰
 
PPTX
Open CV Setting For Android Studio
Phoebe Huang
 
PDF
Vs2013新功能介紹 twMVC#11
twMVC
 
PDF
跟著 geerlingguy 大神
一起測試 Ansible Roles
Chen Cheng-Wei
 
ODP
Clojure cnclojure-meetup
sunng87
 
PDF
用最潮的 Java script 盡情開發 kde qt 程式
Fred Chien
 
PDF
My DevOps Tour 0.1
Chu-Siang Lai
 
PDF
Unit test
shan chen
 
PPTX
jsdoc-toolkit
satans17
 
PDF
測試是什麼
Yvonne Yu
 
PPT
Grails敏捷项目开发
Michael Yan
 
PDF
twMVC#24 | 開發團隊的敏捷之路(未完成)
twMVC
 
PPT
Yii phpunit
chenjinlong
 
PDF
twMVC#29 -Learning Machine Learning with Movie Recommendation
Mia Chang
 
PPT
The way to continuous delivery
Qiao Liang
 
PDF
iThome Serverless All-Star 開場
Chen Cheng-Wei
 
PDF
Node.js 進攻桌面開發
Fred Chien
 
PDF
北護樂學程式冬令營 2017
Hamilton Wong
 
TDD (Test-driven development, 測試驅動開發) 基本教學
潘 冠辰
 
Open CV Setting For Android Studio
Phoebe Huang
 
Vs2013新功能介紹 twMVC#11
twMVC
 
跟著 geerlingguy 大神
一起測試 Ansible Roles
Chen Cheng-Wei
 
Clojure cnclojure-meetup
sunng87
 
用最潮的 Java script 盡情開發 kde qt 程式
Fred Chien
 
My DevOps Tour 0.1
Chu-Siang Lai
 
Unit test
shan chen
 
jsdoc-toolkit
satans17
 
測試是什麼
Yvonne Yu
 
Grails敏捷项目开发
Michael Yan
 
twMVC#24 | 開發團隊的敏捷之路(未完成)
twMVC
 
Yii phpunit
chenjinlong
 
twMVC#29 -Learning Machine Learning with Movie Recommendation
Mia Chang
 
The way to continuous delivery
Qiao Liang
 
iThome Serverless All-Star 開場
Chen Cheng-Wei
 
Node.js 進攻桌面開發
Fred Chien
 
北護樂學程式冬令營 2017
Hamilton Wong
 

Viewers also liked (14)

PPTX
Unit Testing in Swift
GlobalLogic Ukraine
 
PPTX
Unit Testing Concepts and Best Practices
Derek Smith
 
PPTX
UNIT TESTING PPT
suhasreddy1
 
ZIP
Unit Testing in Java
guy_davis
 
PDF
Swift testing ftw
Jorge Ortiz
 
PDF
Testing iOS10 Apps with Appium and its new XCUITest backend
Testplus GmbH
 
PDF
Unit testing in swift 2 - The before & after story
Jorge Ortiz
 
PPTX
Protocol-Oriented Programming in Swift
GlobalLogic Ukraine
 
PPT
Generating test cases using UML Communication Diagram
Praveen Penumathsa
 
PDF
7 Stages of Unit Testing in iOS
Jorge Ortiz
 
PDF
iOS Unit Testing Like a Boss
Salesforce Developers
 
PDF
iOS advanced architecture workshop 3h edition
Jorge Ortiz
 
PDF
Unit testing best practices
nickokiss
 
PDF
Unit Testing & TDD Training for Mobile Apps
Marcelo Busico
 
Unit Testing in Swift
GlobalLogic Ukraine
 
Unit Testing Concepts and Best Practices
Derek Smith
 
UNIT TESTING PPT
suhasreddy1
 
Unit Testing in Java
guy_davis
 
Swift testing ftw
Jorge Ortiz
 
Testing iOS10 Apps with Appium and its new XCUITest backend
Testplus GmbH
 
Unit testing in swift 2 - The before & after story
Jorge Ortiz
 
Protocol-Oriented Programming in Swift
GlobalLogic Ukraine
 
Generating test cases using UML Communication Diagram
Praveen Penumathsa
 
7 Stages of Unit Testing in iOS
Jorge Ortiz
 
iOS Unit Testing Like a Boss
Salesforce Developers
 
iOS advanced architecture workshop 3h edition
Jorge Ortiz
 
Unit testing best practices
nickokiss
 
Unit Testing & TDD Training for Mobile Apps
Marcelo Busico
 
Ad

More from hugo lu (11)

PDF
WSO2 IoTS Device Manufacturer Guide
hugo lu
 
PDF
Dev ops 簡介
hugo lu
 
PDF
關於測試,我說的其實是......
hugo lu
 
PDF
Sql injection 幼幼班
hugo lu
 
PDF
Sql or no sql, that is the question
hugo lu
 
PDF
Continuous integration
hugo lu
 
PDF
Swift 2.0 的新玩意
hugo lu
 
PDF
精實執行工作坊
hugo lu
 
PDF
畫出商業模式
hugo lu
 
PDF
The linux networking architecture
hugo lu
 
PDF
精實軟體度量
hugo lu
 
WSO2 IoTS Device Manufacturer Guide
hugo lu
 
Dev ops 簡介
hugo lu
 
關於測試,我說的其實是......
hugo lu
 
Sql injection 幼幼班
hugo lu
 
Sql or no sql, that is the question
hugo lu
 
Continuous integration
hugo lu
 
Swift 2.0 的新玩意
hugo lu
 
精實執行工作坊
hugo lu
 
畫出商業模式
hugo lu
 
The linux networking architecture
hugo lu
 
精實軟體度量
hugo lu
 
Ad

Testing in swift