Practical Test-Driven Development using C# 7: Unleash the power of TDD by implementing real world examples under .NET environment and JavaScript
暫譯: 實用的 C# 7 測試驅動開發:在 .NET 環境和 JavaScript 中通過實作真實世界範例釋放 TDD 的力量

John Callaway, Clayton Hunt

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

相關主題

商品描述

Develop applications for the real world with a thorough software testing approach

Key Features

  • Develop a thorough understanding of TDD and how it can help you develop simpler applications with no defects using C# and JavaScript
  • Adapt to the mindset of writing tests before code by incorporating business goals, code manageability, and other factors
  • Make all your software units and modules pass tests by analyzing failed tests and refactoring code as and when required

Book Description

Test-Driven Development (TDD) is a methodology that helps you to write as little as code as possible to satisfy software requirements, and ensures that what you've written does what it's supposed to do. If you're looking for a practical resource on Test-Driven Development this is the book for you. You've found a practical end-to-end guide that will help you implement Test-Driven Techniques for your software development projects.

You will learn from industry standard patterns and practices, and shift from a conventional approach to a modern and efficient software testing approach in C# and JavaScript. This book starts with the basics of TDD and the components of a simple unit test. Then we look at setting up the testing framework so that you can easily run your tests in your development environment. You will then see the importance of defining and testing boundaries, abstracting away third-party code (including the .NET Framework), and working with different types of test double such as spies, mocks, and fakes.

Moving on, you will learn how to think like a TDD developer when it comes to application development. Next, you'll focus on writing tests for new/changing requirements and covering newly discovered bugs, along with how to test JavaScript applications and perform integration testing. You'll also learn how to identify code that is inherently un-testable, and identify some of the major problems with legacy applications that weren't written with testability in mind.

By the end of the book, you'll have all the TDD skills you'll need and you'll be able to re-enter the world as a TDD expert!

What you will learn

  • The core concepts of TDD
  • Testing in action with a real-world case study in C# and JavaScript using React
  • Writing proper Unit Tests and testable code for your application
  • Using different types of test double such as stubs, spies, and mocks
  • Growing an application guided by tests
  • Exploring new developments on a green-field application
  • Mitigating the problems associated with writing tests for legacy applications
  • Modifying a legacy application to make it testable

Who This Book Is For

This book is for software developers with a basic knowledge of Test Driven Development (TDD) who want a thorough understanding of how TDD can benefit them and the applications they produce. The examples in this book are in C#, and you will need a basic understanding of C# to work through these examples.

Table of Contents

  1. Why TDD is important
  2. Setting up the Test Environment
  3. Setting up the JavaScript Environment
  4. What Else Should I Know Before Getting Started?
  5. Tabula Rasa - Approaching an Application with TDD in Mind
  6. Approaching the Problem
  7. Test Driving C# Applications
  8. Abstract Away Problems
  9. Testing JavaScript Applications
  10. Exploring Integrations
  11. Change in Requirements?
  12. The Legacy Problem
  13. Unraveling a Mess
  14. A Better Foot Forward

商品描述(中文翻譯)

**用徹底的軟體測試方法開發現實世界的應用程式**

### 主要特點
- 徹底理解測試驅動開發(TDD)及其如何幫助您使用 C# 和 JavaScript 開發無缺陷的簡單應用程式
- 通過結合商業目標、程式碼可管理性及其他因素,適應在編寫程式碼之前先編寫測試的思維方式
- 通過分析失敗的測試並在需要時重構程式碼,使所有軟體單元和模組通過測試

### 書籍描述
測試驅動開發(TDD)是一種方法論,幫助您編寫盡可能少的程式碼以滿足軟體需求,並確保您所編寫的程式碼能夠如預期運作。如果您正在尋找有關測試驅動開發的實用資源,這本書就是為您而寫。您找到了一本實用的端到端指南,將幫助您在軟體開發專案中實施測試驅動技術。

您將學習行業標準的模式和實踐,並從傳統方法轉向現代高效的 C# 和 JavaScript 軟體測試方法。本書從 TDD 的基本概念和簡單單元測試的組成部分開始。接著,我們將設置測試框架,以便您能夠輕鬆地在開發環境中運行測試。然後,您將看到定義和測試邊界、抽象第三方程式碼(包括 .NET Framework)的重要性,以及如何使用不同類型的測試替身,如間諜、模擬和假物件。

接下來,您將學習在應用程式開發中如何像 TDD 開發者一樣思考。然後,您將專注於為新的/變更的需求編寫測試,並涵蓋新發現的錯誤,以及如何測試 JavaScript 應用程式和執行整合測試。您還將學習如何識別本質上無法測試的程式碼,以及識別一些未考慮可測試性的舊有應用程式的主要問題。

在書籍結束時,您將擁有所有所需的 TDD 技能,並能夠重新進入世界,成為 TDD 專家!

### 您將學到的內容
- TDD 的核心概念
- 使用 C# 和 JavaScript(使用 React)的實際案例研究中的測試實踐
- 為您的應用程式編寫適當的單元測試和可測試的程式碼
- 使用不同類型的測試替身,如存根、間諜和模擬
- 在測試指導下發展應用程式
- 探索綠地應用程式的新開發
- 減輕為舊有應用程式編寫測試所帶來的問題
- 修改舊有應用程式以使其可測試

### 本書適合誰
本書適合對測試驅動開發(TDD)有基本了解的軟體開發人員,想要徹底理解 TDD 如何使他們及其所產生的應用程式受益。本書中的範例使用 C#,您需要對 C# 有基本的理解才能進行這些範例的學習。

### 目錄
1. 為什麼 TDD 重要
2. 設置測試環境
3. 設置 JavaScript 環境
4. 開始之前還需要知道什麼?
5. Tabula Rasa - 以 TDD 為考量的方法接近應用程式
6. 接近問題
7. 測試驅動 C# 應用程式
8. 抽象問題
9. 測試 JavaScript 應用程式
10. 探索整合
11. 需求變更?
12. 舊有問題
13. 解開混亂
14. 更好的前進步伐