Test-Driven Development with Java: Create higher-quality software by writing tests first with SOLID and hexagonal architecture

Mellor, Alan

  • 出版商: Packt Publishing
  • 出版日期: 2023-01-13
  • 售價: $1,700
  • 貴賓價: 9.5$1,615
  • 語言: 英文
  • 頁數: 348
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 180323623X
  • ISBN-13: 9781803236230
  • 相關分類: Java 程式語言TDD 測試導向開發
  • 立即出貨 (庫存=1)

相關主題

商品描述

Drive development with automated tests and gain the confidence you need to write high-quality software

Key Features

- Get up and running with common design patterns and TDD best practices
- Learn to apply the rhythms of TDD – arrange, act, assert and red, green, refactor
- Understand the challenges of implementing TDD in the Java ecosystem and build a plan

Book Description

Test-driven development enables developers to craft well-designed code and prevent defects. It's a simple yet powerful tool that helps you focus on your code design, while automatically checking that your code works correctly. Mastering TDD will enable you to effectively utilize design patterns and become a proficient software architect.

The book begins by explaining the basics of good code and bad code, bursting common myths, and why Test-driven development is crucial. You'll then gradually move toward building a sample application using TDD, where you'll apply the two key rhythms -- red, green, refactor and arrange, act, assert. Next, you'll learn how to bring external systems such as databases under control by using dependency inversion and test doubles. As you advance, you'll delve into advanced design techniques such as SOLID patterns, refactoring, and hexagonal architecture. You'll also balance your use of fast, repeatable unit tests against integration tests using the test pyramid as a guide. The concluding chapters will show you how to implement TDD in real-world use cases and scenarios and develop a modern REST microservice backed by a Postgres database in Java 17.

By the end of this book, you'll be thinking differently about how you design code for simplicity and how correctness can be baked in as you go.

What you will learn

- Discover how to write effective test cases in Java
- Explore how TDD can be incorporated into crafting software
- Find out how to write reusable and robust code in Java
- Uncover common myths about TDD and understand its effectiveness
- Understand the accurate rhythm of implementing TDD
- Get to grips with the process of refactoring and see how it affects the TDD process

Who this book is for

This book is for expert Java developers and software architects crafting high-quality software in Java. Test-Driven Development with Java can be picked up by anyone with a strong working experience in Java who is planning to use Test-driven development for their upcoming projects.

商品描述(中文翻譯)

以自動化測試推動開發,獲得撰寫高品質軟體所需的信心

主要特點:
- 熟悉常見的設計模式和測試驅動開發(TDD)最佳實踐
- 學習應用TDD的節奏 - 安排、執行、斷言和紅綠重構
- 了解在Java生態系統中實施TDD的挑戰並建立計劃

書籍描述:
測試驅動開發使開發人員能夠製作設計良好的代碼並防止缺陷。這是一個簡單而強大的工具,可以幫助您專注於代碼設計,同時自動檢查代碼的正確性。精通TDD將使您能夠有效地應用設計模式並成為熟練的軟體架構師。

本書首先解釋了良好代碼和糟糕代碼的基礎,打破了常見的迷思,並解釋了為什麼測試驅動開發至關重要。然後,您將逐漸開始使用TDD構建一個示例應用程序,並應用兩個關鍵節奏 - 紅綠重構和安排、執行、斷言。接下來,您將學習如何通過使用依賴反轉和測試替身來控制外部系統,例如數據庫。隨著進一步的學習,您將深入探討高級設計技巧,如SOLID模式、重構和六邊形架構。您還將根據測試金字塔的指導,平衡使用快速可重複的單元測試和集成測試。最後幾章將向您展示如何在實際用例和場景中實施TDD,並使用Java 17開發支持Postgres數據庫的現代REST微服務。

通過閱讀本書,您將以不同的方式思考如何簡化代碼設計以及如何在開發過程中確保正確性。

學到的內容:
- 發現如何在Java中撰寫有效的測試案例
- 探索如何將TDD納入軟體開發過程
- 學習在Java中撰寫可重複且堅固的代碼
- 揭開有關TDD的常見迷思並了解其有效性
- 理解實施TDD的正確節奏
- 掌握重構過程並了解其對TDD過程的影響

適合對象:
本書適合在Java中製作高品質軟體的專業Java開發人員和軟體架構師。任何具有豐富的Java工作經驗並計劃在未來的項目中使用測試驅動開發的人都可以閱讀《Java測試驅動開發》。

目錄大綱

1. Building the Case for TDD
2. Using TDD to Create Good Code
3. Dispelling Common Myths about TDD
4. Building a typical application using TDD
5. Writing our First Test
6. Following the Rhythms of TDD
7. Driving Design: TDD and SOLID
8. Test Doubles: Stubs and Mocks
9. Hexagonal Architecture: Decoupling external systems
10. FIRST Tests and the Test Pyramid
11. Exploring TDD with Quality Assurance
12. Test First, Test Later, Test Never
13. Driving the domain layer
14. Driving the database layer
15. Driving the Web Layer

目錄大綱(中文翻譯)

1. 建立 TDD 的案例
2. 使用 TDD 創建良好的程式碼
3. 打破關於 TDD 的常見迷思
4. 使用 TDD 建立典型的應用程式
5. 撰寫我們的第一個測試
6. 遵循 TDD 的節奏
7. 驅動設計:TDD 和 SOLID
8. 測試替身:Stub 和 Mock
9. 六角形架構:解耦外部系統
10. FIRST 測試和測試金字塔
11. 探索 TDD 與品質保證
12. 先測試,後測試,永不停止測試
13. 驅動領域層
14. 驅動資料庫層
15. 驅動網頁層