Test-Driven iOS Development with Swift 4 - Third Edition

Dr. Dominik Hauser

買這商品的人也買了...

相關主題

商品描述

Key Features

  • A practical guide to writing effective, organized, and clean code that works well
  • Learn test-driven principles to help you build better-designed apps with fewer bugs
  • A comprehensive overview of the techniques available for TDD in Swift

Book Description

Test-driven development (TDD) is a proven way to find software bugs early. Writing tests before you code improves the structure and maintainability of your apps. Using TDD, in combination with Swift 4's improved syntax, means there is no longer any excuse for writing bad code.

This book will help you understand the process of TDD and how to apply it to your apps written in Swift.

Through practical, real-world examples, you'll learn how to implement TDD in context. You will begin with an overview of the TDD workflow and then delve into unit-testing concepts and code cycles.

You will also plan and structure your test-driven iOS app, and write tests to drive the development of view controllers and helper classes. Next, you'll learn how to write tests for network code and explore how the test-driven approach-in combination with stubs-helps you write network code even before the backend component is finished.

Finally, the book will guide you through the next steps to becoming a testing expert by discussing integration tests, Behavior Driven Development (BDD), open source testing frameworks, and UI Tests (introduced in Xcode 9).

What you will learn

  • Implement TDD in Swift application development
  • Find bugs before you enter code using the TDD approach
  • Use TDD to build models, view controllers, and views
  • Test network code with asynchronous tests and stubs
  • Write code that is a joy to read and maintain
  • Develop functional tests to ensure the app works as planned

About the Author

Dr. Dominik Hauser completed his PhD in physics from the University of Heidelberg. While working as a university professor, he started iOS development in his spare time. His first app on physics has been an astounding success worldwide. Since then, he has turned himself into a full-time iOS developer, with a number of successful apps to his name. He has been a Swift developer since day one and runs a blog on iOS development.

Table of Contents

  1. Your First Unit Tests
  2. Planning and Structuring Your Test Driven iOS App
  3. A Test Driven Data Model
  4. Test Driven View Controllers
  5. Testing Network Code
  6. Put It All Together
  7. Code Coverage And Continuous Integration
  8. Where To Go From Here

商品描述(中文翻譯)

主要特點


  • 實用指南,教你如何撰寫有效、有組織且乾淨的程式碼

  • 學習測試驅動開發原則,幫助你建立設計更佳且較少錯誤的應用程式

  • 全面介紹 Swift 中可用的測試驅動開發技術

書籍描述

測試驅動開發(TDD)是一種早期發現軟體錯誤的有效方法。在編寫程式碼之前先撰寫測試可以改善應用程式的結構和可維護性。利用 TDD 搭配 Swift 4 的改進語法,再也沒有寫糟糕程式碼的藉口了。

本書將幫助你了解 TDD 的過程以及如何應用於使用 Swift 撰寫的應用程式。

透過實際的實例,你將學習如何在實際情境中實施 TDD。你將首先瞭解 TDD 的工作流程,然後深入探討單元測試的概念和程式碼循環。

你還將計劃和結構化你的測試驅動 iOS 應用程式,並撰寫測試來驅動視圖控制器和輔助類別的開發。接下來,你將學習如何為網路程式碼撰寫測試,並探索測試驅動方法如何幫助你在後端組件完成之前就撰寫網路程式碼。

最後,本書將引導你進一步成為測試專家,討論整合測試、行為驅動開發(BDD)、開源測試框架和 UI 測試(在 Xcode 9 中引入)。

你將學到什麼


  • 在 Swift 應用程式開發中實施 TDD

  • 使用 TDD 方法在編寫程式碼之前找出錯誤

  • 使用 TDD 建立模型、視圖控制器和視圖

  • 使用非同步測試和存根測試網路程式碼

  • 撰寫易於閱讀和維護的程式碼

  • 開發功能測試以確保應用程式按計劃運作

關於作者

Dominik Hauser 博士在海德堡大學取得物理學博士學位。他在擔任大學教授的同時,開始在業餘時間進行 iOS 開發。他的第一個物理學應用程式在全球取得了驚人的成功。此後,他全職從事 iOS 開發,並擁有多個成功的應用程式。他從 Swift 誕生的第一天起就成為 Swift 開發者,並在 iOS 開發上運營一個部落格。

目錄


  1. 你的第一個單元測試

  2. 計劃和結構化你的測試驅動 iOS 應用程式

  3. 測試驅動的資料模型

  4. 測試驅動的視圖控制器

  5. 測試網路程式碼

  6. 將所有元素結合起來

  7. 程式碼覆蓋率和持續整合

  8. 下一步該往哪裡走