SlideShare a Scribd company logo
SwiftConf.com
Dominik Hauser
Test-Driven iOS Development
with Swift
SwiftConf.com
You are not allowed to write any production code unless it is to
pass a failing unit test

You are not allowed to write any more of a unit test than is
sufficient to fail; and compilation failures are failures

You are not allowed to write any more production code than is
sufficient to pass the one failing unit test
The Rules (Uncle Bob)
SwiftConf.com
Red: Write a failing test

Green: Write the simplest code that makes the test pass

Refactor: Improve the code without breaking the tests
Red, Green, Refactor
SwiftConf.com
🤓 Live Coding 🤓
SwiftConf.com
Why Unit Tests?
SwiftConf.com
Fast Feedback
SwiftConf.com
Edge Cases
SwiftConf.com
Regression
SwiftConf.com
Why TDD?
SwiftConf.com
Automatic testability

Automatic modularity

High test coverage

Refactoring

Living documentation
Why TDD?
SwiftConf.com
No silver bullet

Slower at first

Training curve

Keep in mind
SwiftConf.com
Dominik Hauser

@dasdom

dominik.hauser@dasdom.de

www.swiftandpainless.com
Thank you.

More Related Content

PDF
Porque Odeio Branches
PDF
Reducing passive interruptions
PPTX
Trunk Based Development in the Enterprise - Its Relevance and Economics
PPTX
GDG Morgantown, WV: Write code you can depend on!
PDF
DevOpsDaysRiga 2018: Neil Crawford - Trunk based development, continuous depl...
PPTX
Source Control 101
PDF
Professional iOS development
PDF
Continuous Delivery for Mobile platforms (iOS and a bit of Android)
Porque Odeio Branches
Reducing passive interruptions
Trunk Based Development in the Enterprise - Its Relevance and Economics
GDG Morgantown, WV: Write code you can depend on!
DevOpsDaysRiga 2018: Neil Crawford - Trunk based development, continuous depl...
Source Control 101
Professional iOS development
Continuous Delivery for Mobile platforms (iOS and a bit of Android)

What's hot (20)

PPTX
How to Get Started with Cypress
PPTX
Software development terminology
PDF
A Introduction to the World of Node, Javascript & Selenium
PDF
Peer Code Review: In a Nutshell
KEY
How we git - commit policy and code review
PDF
Testing, CI and CD in the real world
PPTX
How to Work Efficiently in a Hybrid Git-Perforce Environment
PDF
Testing your app with Selenium on Travis CI
PDF
London Atlassian User Group - February 2014
PDF
Trunk based development for Beginners
PDF
Continuous Integration
ODP
Enterprise Workflows When You Aren't Enterprise
PDF
From git to forge
PDF
Continuous Integration at T3CON08
PDF
Integration Testing for Polyglot Ecosystems
PDF
Crucible
PDF
Merge hells!! feature toggles to the rescue
PPTX
continous integration and delivery
PPT
Test Driven Development and Automation
How to Get Started with Cypress
Software development terminology
A Introduction to the World of Node, Javascript & Selenium
Peer Code Review: In a Nutshell
How we git - commit policy and code review
Testing, CI and CD in the real world
How to Work Efficiently in a Hybrid Git-Perforce Environment
Testing your app with Selenium on Travis CI
London Atlassian User Group - February 2014
Trunk based development for Beginners
Continuous Integration
Enterprise Workflows When You Aren't Enterprise
From git to forge
Continuous Integration at T3CON08
Integration Testing for Polyglot Ecosystems
Crucible
Merge hells!! feature toggles to the rescue
continous integration and delivery
Test Driven Development and Automation
Ad

Viewers also liked (12)

PDF
Mocking In Swift
PDF
iOS Unit Testing Like a Boss
PDF
How To Build iOS Apps Without interface Builder
PDF
iOS Test-Driven Development
PDF
Storyboards - Pros & Cons
PDF
Automated UI testing for iOS apps using KIF framework and Swift
PDF
Tech Talk #5 : KIF-iOS Integration Testing Framework - Nguyễn Hiệp
PDF
Kotlin, Spek and tests
PDF
Component-driven UIs - Mobile Era 2016
PDF
Writing Swift code with great testability
PDF
Mockito, Robobinding
PDF
Kotlin 사용기
Mocking In Swift
iOS Unit Testing Like a Boss
How To Build iOS Apps Without interface Builder
iOS Test-Driven Development
Storyboards - Pros & Cons
Automated UI testing for iOS apps using KIF framework and Swift
Tech Talk #5 : KIF-iOS Integration Testing Framework - Nguyễn Hiệp
Kotlin, Spek and tests
Component-driven UIs - Mobile Era 2016
Writing Swift code with great testability
Mockito, Robobinding
Kotlin 사용기
Ad

Recently uploaded (20)

PDF
Heart disease approach using modified random forest and particle swarm optimi...
PPTX
A Presentation on Touch Screen Technology
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
A Presentation on Artificial Intelligence
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPTX
1. Introduction to Computer Programming.pptx
Heart disease approach using modified random forest and particle swarm optimi...
A Presentation on Touch Screen Technology
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
WOOl fibre morphology and structure.pdf for textiles
NewMind AI Weekly Chronicles - August'25-Week II
A Presentation on Artificial Intelligence
A comparative analysis of optical character recognition models for extracting...
Encapsulation_ Review paper, used for researhc scholars
Assigned Numbers - 2025 - Bluetooth® Document
Unlocking AI with Model Context Protocol (MCP)
Univ-Connecticut-ChatGPT-Presentaion.pdf
A comparative study of natural language inference in Swahili using monolingua...
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
SOPHOS-XG Firewall Administrator PPT.pptx
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
1. Introduction to Computer Programming.pptx

Tdd