Shape Shape point chapter-list Group Group Group Shape Copy 12 Shape Shape Copy 3 Shape Shape dropdown editor editor Combined Shape grid Shape Copy 4 Shape Copy 7 Shape language language Shape megaphone paperback Shape platform noun_419259-2 copy play-icon BS-Question-Rounded-Circle quotes noun_610406 stacked-books-1 stacked-books-2 Group Group Group Group Group
New

iOS Test-Driven Development by Tutorials

$49.00 $59.00 5/5 6 reviews · Write a Review
  • Platform iOS 12
  • Language Swift 4.2
  • Editor Xcode 10

The book that teaches you to write maintainable and sustainable apps by building them with testing in mind or adding tests to already-written apps.

Note: This book is in Early Access. You’ll get advance access to the book while it’s in development, and you’ll get a free update to the complete digital edition of the book when it’s complete!

Estimated final release date: Fall 2019.

Developer Guide

Intermediate

For Intermediate Developers

Learn How to Test iOS Applications!

This book is for intermediate iOS developers who already know the basics of iOS and Swift development but want to learn how to write code which is both testable and maintainable. To start, you'll learn the TDD Cycle and how to implement these concepts within an iOS application. The book then takes you through Test Expressions and Expectation so that you can test synchronous code. You'll then write tests to verify networking endpoints and the ability to mock the returned results, followed by writing tests that run against authentication endpoints. Continue trouble-shooting your apps by understanding common legacy problems, as well as breaking dependencies into modules. And, finally, refactor large classes into smaller, more manageable classes and objects.

Table of Contents

Section I: Hello, TDD!

1.

What Is TDD? - New

Test-driven development, or TDD, is an iterative way to develop software by iteratively making many small changes backed by tests.

2.

The TDD Cycle - New

In the previous chapter, you learned that test-driven development boils down to a simple process called the TDD Cycle. It has four steps and is also called the Red-Green-Refactor Cycle.

Section II: Beginning TDD

3.

TDD App Setup - New

The goal of this chapter is to give you a feel for how Xcode testing works by creating a test target with a few tests. You'll do this while learning the key concepts of TDD.

4.

Test Expressions - New

This chapter covers how to use the XCTAssert functions. These are the primary actors of the test infrastructure. Next, you'll learn how to use the host application to drive view controller unit testing. Then, you'll go through gathering code coverage to verify the minimum amount of testing. Finally, you'll use the test debugger to find and fix test errors.

5.

Test Expectations - New

In the previous chapters you built out the app's state based upon what the user can do with the Start button. The main part of the app relies on responding to changes as the user moves around and records steps. These actions create events outside the program's control. XCTestExpectation is the tool for testing things that happen outside the direct flow.

6.

Dependency Injection & Mocks - New

In this chapter you'll learn how to use mocks to test code that depends on system or external services without needing to call services: They may not be available, usable or reliable. These techniques allow you to test error conditions like a failed save and to isolate logic from SDKs like CoreMotion and HealthKit.

Section III: TDD with Networking

7.

Introducing DogPatch - New

You'll complete a puppy-adoption app called Dog Patch throughout this section. This app connects dog lovers with kind, professional breeders to find the puppy of their dreams. A prospective owner first browses available puppy listings within the app.

8.

RESTful Networking - Coming Soon

This chapter will introduce how to do TDD for RESTful networking (i.e. not using WebSockets).

9.

Authentication Client - Coming Soon

This chapter will show how to TDD authentication for the app including triggering the sign-up and sign-in flows. Building upon the previous chapter, the reader will unlock portions of the app that require authentication.

10.

Authenticated Network Calls - Coming Soon

This chapter will build upon the chapter from the last project to show how to make authenticated network calls.

11.

WebSockets

This chapter will show how to do TDD for real-time chat using WebSockets. Topics include creating an injecting a mock WebSocket client, Stubbing and handling successful connections, Stubbing and handling errors, and more.

Section IV: TDD in Legacy Apps

1.

Adding Features to Existing Classes - Coming Soon

You won’t always have the time, or it may simply not be feasible, to break dependencies of a very large class. In this chapter, you’ll learn strategies to add functionality to an existing class while at the same time avoiding modifying it! You’ll learn to main strategies to do this: Sprouts and Decorators

12.

Legacy Problems - Coming Soon

Beginning TDD on an existing, “legacy” project is much different than starting TDD on a new project. Often times, the original team has long left, and the code base is not fully understood. The project has few if any unit tests, lacks documentation and is slow to build.

13.

Dependency Maps - Coming Soon

Before you can start making changes, you first need to understand how a system works and which classes relate to one another. This chapter will teach you about dependency maps.

14.

Breaking Up Dependencies - Coming Soon

It’s always safer to make a change when you have tests in place already. In the absence of existing tests, however, you may need to make changes just to be able to add tests! One of the most common reasons for this is tightly-coupled dependencies: you can’t add tests to a class because it depends on other classes that depend on other classes… View controllers especially are often victims to this issue.

15.

Refactoring Large Classes - Coming Soon

As you continue to migrate your legacy code base to using tests, you’ll start to find “test islands” of code throughout your code base that are easier to work in.

Meet the team

Average Rating

5 /5

Leave a review for this product

6 reviews

iOS Test-Driven Development by Tutorials

The book that teaches you to write maintainable and sustainable apps by building them with testing in mind or adding tests to already-written apps.

Note: This book is in Early Access. You’ll get advance access to the book while it’s in development, and you’ll get a free update to the complete digital edition of the book when it’s complete!

Estimated final release date: Fall 2019.

Top