iOS Unit Testing by Example (Pragmatic Bookshelf)

PragmaticBookshelf
Manual code and UI testing get slower the deeper your navigation hierarchy goes. It can take several taps just to reach a particular screen, never mind the actual workflow tests.

Jon Reid @jonreid

edited by Michael Swaine @michaelswaine

Manual code and UI testing get slower the deeper your navigation hierarchy goes. It can take several taps just to reach a particular screen, never mind the actual workflow tests. Automatic unit testing offers such rapid feedback that it can change the rules of development. Bring testing to iOS development, even for legacy code. Use XCTest to write unit tests in Swift for all your code.

iOS developers typically reserve unit tests for their model classes alone. But that approach skips most of the code common to iOS apps, especially with UIViewControllers. Learn how to unit test these view controllers to expand your unit testing possibilities. Since good unit tests form the bedrock for safe refactoring, you’re empowered to make bold changes. Learn how to avoid the most common mistakes Swift programmers make with the XCTest framework. Use code coverage to find holes in your test suites. Learn how to identify hard dependencies.

Reshape the design of your code quickly, with less risk and less fear.


  • Full details: Search
  • View this book’s portal and details on how to post errata and suggestions here.

Don’t forget you can get 35% off with your Devtalk discount! Just use the coupon code “devtalk.com" at checkout :+1:

Latest Threads About This Book Top

JohnBrewer
Section III of the book consists of a bunch of refactoring of an initially poorly-factored class. Unfortunately, the source code for the ...
New
nazaralwi
In the print version of this book, page 171, top paragraph, the Show Attributes shortcut is typo: ⌥ - ⌘ - 4 It should be: ⌥ - ⌘ - 5
New
nazaralwi
In the print version of this book, page 170, 4th paragraph, the Show Connections Inspector shortcut is typo: ⌥ - ⌘ - 6 It should be: ⌥...
New
nazaralwi
In the print version of this book, page 172, 4th paragraph, to deselect Connect Hardware Keyboard: I/O → Keyboard → Connect Hardware Key...
New
JohnBrewer
The text says “The test loads the view controller from the storyboard. Then it sets the make- Analytics property to a closure returning a...
New
JohnBrewer
The statement “If you can delete lines of production code and the tests still pass, then those lines aren’t covered,” was important enoug...
New
JohnBrewer
I had to back up and search for the instruction. I was busy clicking on disclosure arrows. Please either circle the button in the illustr...
New
JohnBrewer
The unit test does indeed run fast. But running the UI tests at the same time is slooooooow. Perhaps advise the reader to disable UI test...
New
tbatty7
In the part where it is explaining how to create a segue, it says: "Select the segue, then in the Identity Inspector, set its identifier ...
New
tbatty7
Title: IOS Unit Testing by Example - The default color in Swift labels has changed to white, so you cannot see the text on a white backgr...
New

Most Active This Week Top

Most Active This Month Top

Most Active This Year Top

Most Active Last Three Years Top

Most Active Over Three Years Top

dsmith42
Hey there, I’m enjoying this book and have learned a few things alredayd. However, in Chapter 4 I believe we are meant to see the “>...
New
PragmaticBookshelf
Manual code and UI testing get slower the deeper your navigation hierarchy goes. It can take several taps just to reach a particular scre...
New
charlesmuchene
Title: iOS Unit Testing by Example - Unused UIKit module import in CoveredClass.swift (page 39) #pragprog
New
vinhdbn
Title: Name of book: iOS Unit Testing by Example I bought the ebook and downloaded the example codes but I couldn’t run unit tests becau...
New
jav-solo
In the print version of this text, on page 162 right before the second code sample toward the bottom of the page, the book states to add ...
New
rolisanchez
Title: iOS Unit Testing by Example - Broken link to Pragmatic Programmers Magazine on FIRST acronym (page 27) https://pragprog.com/magaz...
New
jav-solo
In the print version of this text, on page 116 toward the top, the book states to connect each button to it’s @IBAction in ViewController...
New
nica
@jonreid Hello Jon, i bought the ebook and downloaded the last example codes with the fix to Swift 5.3 compiler https://github.com/jonr...
New
jav-solo
Title: iOS Unit Testing by Example: loadViewIfNeeded() call (page 90) I recently purchased the printed version of this text and on page ...
New
JohnBrewer
The text says “The test loads the view controller from the storyboard. Then it sets the make- Analytics property to a closure returning a...
New
tbatty7
Title: IOS Unit Testing by Example - The default color in Swift labels has changed to white, so you cannot see the text on a white backgr...
New
tbatty7
In the part where it is explaining how to create a segue, it says: "Select the segue, then in the Identity Inspector, set its identifier ...
New
nazaralwi
In the print version of this book, page 171, top paragraph, the Show Attributes shortcut is typo: ⌥ - ⌘ - 4 It should be: ⌥ - ⌘ - 5
New
JohnBrewer
Section III of the book consists of a bunch of refactoring of an initially poorly-factored class. Unfortunately, the source code for the ...
New
JohnBrewer
I had to back up and search for the instruction. I was busy clicking on disclosure arrows. Please either circle the button in the illustr...
New

Get money off!

The Pragmatic Bookshelf

35% off any eBook

Simply use coupon code "devtalk.com" at checkout. See full details here.