Test-Driven Development in Swift
eBook - ePub

Test-Driven Development in Swift

Compile Better Code with XCTest and TDD

  1. English
  2. ePUB (mobile friendly)
  3. Available on iOS & Android
eBook - ePub

Test-Driven Development in Swift

Compile Better Code with XCTest and TDD

About this book

Leverage Swift to practice effective and efficient test-driven development (TDD) methodology. Software testing and TDD are evergreen programming concepts—yet Swift developers haven't widely adopted them. What's needed is a clear roadmap to learn and adopt TDD in the Swift world. Over the past years, Apple has invested in XCTest and Xcode's testing infrastructure, making testing a new top priority in their ecosystem. Open-source libraries such as Quick and Nimble have also reached maturity. The tools are there. This book will show you how to wield them. 

TDD has much more to offer than catching bugs. With this book, you'll learn a philosophy for building software. TDD enables engineers to solve problems incrementally, writing only as much code as necessary. By decomposing big problems into small steps, you can move along at a fast pace, always making visible progress. 

Participate in the test-driven development journey by building a real iOS application and incorporating new concepts through each chapter. The book's concepts will emerge as you figure out ways to use tests to drive the solutions to the problems of each chapter. Through the TDD of a single application, you'll be introduced to all the staples and advanced concepts of the craft, understand the trade offs each technique offers, and review an iterative process of software development. 

Test-Driven Development in Swift provides the path for a highly efficient way to make amazing apps.

What You'll Learn

  • Write tests that are easy to maintain
  • Look after an ever-growing test suite
  • Build a testing vocabulary that can be applied outside the Swift world
  • See how Swift programming enhances the TDD flow seen in dynamic languages 
  • Discover how compiler errors can provide the same helpful guidance as failing tests do

Who This Book Is For

Mid-level developers keen to write higher quality code and improve their workflows. Also, developers that have already been writing tests but feel they are not getting the most out of them. 

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Test-Driven Development in Swift by Gio Lodi in PDF and/or ePUB format, as well as other popular books in Computer Science & Operating Systems. We have over one million books available in our catalogue for you to explore.

Information

Table of contents

  1. Cover
  2. Front Matter
  3. 1. Why Test-Driven Development?
  4. 2. XCTest Introduction
  5. 3. Getting Started with Test-Driven Development
  6. 4. Test-Driven Development in the Real World
  7. 5. Changing Tests with Fixtures
  8. 6. Testing Static SwiftUI Views
  9. 7. Testing Dynamic SwiftUI Views
  10. 8. Testing Code Based on Indirect Inputs
  11. 9. Testing JSON Decoding
  12. 10. Testing Network Code
  13. 11. Injecting Dependencies with @EnvironmentObject
  14. 12. Testing Side Effects
  15. 13. Testing a Conditional View Presentation
  16. 14. Fixing Bugs and Changing Existing Code with TDD
  17. 15. Keeping Tests Isolated with Fakes and Clear with Dummies
  18. 16. Conclusion
  19. Back Matter