
Test-Driven iOS Development with Swift 4
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
More details
Person
Dr. Dominik Hauser is an iOS developer working for a small company in western Germany. In over 11 years as an iOS developer, he has worked on many different apps, both large and small. In his spare time, Dominik builds small (often silly) apps and explores how he can become a better iOS developer. He talks at conferences, writes books, and is active in the iOS community in general. His most successful open source component (in terms of stars) is a pull-to-refresh control for a table view that consists of an actual SpriteKit game. Before Dominik became an iOS developer, he was a physicist, researching the most powerful photon sources within our galaxy.
Content
- Cover
- Title Page
- Copyright
- Credits
- About the Author
- About the Reviewer
- www.PacktPub.com
- Customer Feedback
- Table of Contents
- Preface
- Chapter 1: Your First Unit Tests
- Building your first automatic unit test
- What are unit tests?
- Implementing a unit test example
- Important built-in assert functions
- Understanding TDD
- The TDD workflow - red, green, and refactor
- Red
- Green
- Refactor
- TDD in Xcode
- An example of TDD
- Red - example 1
- Green - example 1
- Refactor - example 1
- Red - example 2
- Green - example 2
- Refactor - example 2
- A recap
- Finding information about tests in Xcode
- Test Navigator
- Tests overview
- Running tests
- Running one specific test
- Running all tests in a test case
- Running a group of tests
- The setUp() and tearDown() methods
- Debugging tests
- Breakpoint that breaks on test failure
- The test again feature
- The advantages of TDD
- The disadvantages of TDD
- What to test
- Summary
- Chapter 2: Planning and Structuring Your Test-Driven iOS App
- The task list view
- The task detail view
- The task input view
- The structure of the app
- The table view controller, the delegate, and the data source
- Table view cells
- The model
- Other view controllers
- The development strategy
- Getting started with Xcode
- Setting up useful Xcode behaviors for testing
- Useful build behaviors
- Testing behaviors
- Summary
- Chapter 3: A Test-Driven Data Model
- Implementing the ToDoItem struct
- Adding a title property
- Adding an itemDescription property
- Removing a hidden source of bugs
- Adding a timestamp property
- Adding a location property
- Implementing the Location struct
- Adding a coordinate property
- Implementing the ItemManager class
- Count
- Adding and checking items
- Equatable
- Removing all items
- Ensuring uniqueness
- Summary
- Chapter 4: A Test-Driven View Controller
- Implementing ItemListViewController
- Implementing ItemListDataProvider
- Conducting the first tests
- Fake objects
- Using mocks
- Checking and unchecking items
- Implementing ItemCell
- Implementing DetailViewController
- Implementing InputViewController
- Summary
- Chapter 5: Testing Network Code
- Implementing tests using a web service
- Implementing a login request
- Handling errors
- Summary
- Chapter 6: Putting It All Together
- Connecting parts
- The initial view controller
- Showing the input view
- Showing the detail view
- Serialization and deserialization
- Functional tests
- Adding a UI test target
- Recording and testing
- Summary
- Chapter 7: Code Coverage
- Enabling code coverage
- Code coverage in Xcode
- How much code coverage is enough?
- Automatic deployment with fastlane
- Installing fastlane
- Setting up
- Summary
- Chapter 8: Where to Go from Here
- What you have learned so far
- Integration tests
- UI tests
- Behavior-Driven Development
- TDD in existing projects
- Generating mocks with Sourcery
- More information about TDD
- Summary
- Index
System requirements
File format: ePUB
Copy protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePub works well for novels and non-fiction books – i.e., „flowing” text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our ebook Help page.