狠狠撸

狠狠撸Share 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://road?resoftware.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)

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

Viewers also liked (14)

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

More from hugo lu (11)

WSO2 IoTS Device Manufacturer Guide
WSO2 IoTS Device Manufacturer GuideWSO2 IoTS Device Manufacturer Guide
WSO2 IoTS Device Manufacturer Guide
hugo lu
?
Dev ops 簡介
Dev ops 簡介Dev ops 簡介
Dev ops 簡介
hugo lu
?
关於测试,我说的其实是......
关於测试,我说的其实是......关於测试,我说的其实是......
关於测试,我说的其实是......
hugo lu
?
Sql injection 幼幼班
Sql injection 幼幼班Sql injection 幼幼班
Sql injection 幼幼班
hugo lu
?
Sql or no sql, that is the question
Sql or no sql, that is the questionSql or no sql, that is the question
Sql or no sql, that is the question
hugo lu
?
Continuous integration
Continuous integrationContinuous integration
Continuous integration
hugo lu
?
Swift 2.0 的新玩意
Swift 2.0 的新玩意Swift 2.0 的新玩意
Swift 2.0 的新玩意
hugo lu
?
精实执行工作坊
精实执行工作坊精实执行工作坊
精实执行工作坊
hugo lu
?
画出商业模式
画出商业模式画出商业模式
画出商业模式
hugo lu
?
The linux networking architecture
The linux networking architectureThe linux networking architecture
The linux networking architecture
hugo lu
?
精实软体度量
精实软体度量精实软体度量
精实软体度量
hugo lu
?
WSO2 IoTS Device Manufacturer Guide
WSO2 IoTS Device Manufacturer GuideWSO2 IoTS Device Manufacturer Guide
WSO2 IoTS Device Manufacturer Guide
hugo lu
?
Dev ops 簡介
Dev ops 簡介Dev ops 簡介
Dev ops 簡介
hugo lu
?
关於测试,我说的其实是......
关於测试,我说的其实是......关於测试,我说的其实是......
关於测试,我说的其实是......
hugo lu
?
Sql injection 幼幼班
Sql injection 幼幼班Sql injection 幼幼班
Sql injection 幼幼班
hugo lu
?
Sql or no sql, that is the question
Sql or no sql, that is the questionSql or no sql, that is the question
Sql or no sql, that is the question
hugo lu
?
Continuous integration
Continuous integrationContinuous integration
Continuous integration
hugo lu
?
Swift 2.0 的新玩意
Swift 2.0 的新玩意Swift 2.0 的新玩意
Swift 2.0 的新玩意
hugo lu
?
精实执行工作坊
精实执行工作坊精实执行工作坊
精实执行工作坊
hugo lu
?
画出商业模式
画出商业模式画出商业模式
画出商业模式
hugo lu
?
The linux networking architecture
The linux networking architectureThe linux networking architecture
The linux networking architecture
hugo lu
?
精实软体度量
精实软体度量精实软体度量
精实软体度量
hugo lu
?

Testing in swift