Test-Driven Development in Go: A practical guide to writing idiomatic and efficient Go tests through real-world examples
暫譯: Go 語言的測試驅動開發:透過實際範例撰寫慣用且高效的 Go 測試的實用指南
Simion, Adelina
- 出版商: Packt Publishing
- 出版日期: 2023-04-28
- 售價: $1,690
- 貴賓價: 9.5 折 $1,606
- 語言: 英文
- 頁數: 338
- 裝訂: Quality Paper - also called trade paper
- ISBN: 1803247878
- ISBN-13: 9781803247878
-
相關分類:
Go 程式語言、TDD 測試導向開發
海外代購書籍(需單獨結帳)
買這商品的人也買了...
-
$400$300 -
$1,800$1,710 -
$650$507 -
$600$450 -
$780$663 -
$811聚沙成塔:Go語言構建高性能、分佈式爬蟲項目
-
$580$406 -
$750$495
相關主題
商品描述
Explore Go testing techniques and leverage TDD to deliver and maintain microservices architecture, including contract, end-to-end, and unit testing
Purchase of the print or Kindle book includes a free PDF eBook
Key Features:
- Write Go test suites using popular mocking and testing frameworks
- Leverage TDD to implement testing at all levels of web applications and microservices architecture
- Master the art of writing tests that cover edge cases and concurrent code
Book Description:
Experienced developers understand the importance of designing a comprehensive testing strategy to ensure efficient shipping and maintaining services in production. This book shows you how to utilize test-driven development (TDD), a widely adopted industry practice, for testing your Go apps at different levels. You'll also explore challenges faced in testing concurrent code, and learn how to leverage generics and write fuzz tests.
The book begins by teaching you how to use TDD to tackle various problems, from simple mathematical functions to web apps. You'll then learn how to structure and run your unit tests using Go's standard testing library, and explore two popular testing frameworks, Testify and Ginkgo. You'll also implement test suites using table-driven testing, a popular Go technique. As you advance, you'll write and run behavior-driven development (BDD) tests using Ginkgo and Godog. Finally, you'll explore the tricky aspects of implementing and testing TDD in production, such as refactoring your code and testing microservices architecture with contract testing implemented with Pact. All these techniques will be demonstrated using an example REST API, as well as smaller bespoke code examples.
By the end of this book, you'll have learned how to design and implement a comprehensive testing strategy for your Go applications and microservices architecture.
What You Will Learn:
- Create practical Go unit tests using mocks and assertions with Testify
- Build table-driven test suites for HTTP web applications
- Write BDD-style tests using the Ginkgo testing framework
- Use the Godog testing framework to reliably test web applications
- Verify microservices architecture using Pact contract testing
- Develop tests that cover edge cases using property testing and fuzzing
Who this book is for:
If you are an intermediate-level developer or software testing professional who knows Go fundamentals and is looking to deliver projects with Go, then this book is for you. Knowledge of Go syntax, structs, functions, and interfaces will help you get the most out of this book.
商品描述(中文翻譯)
探索 Go 測試技術並利用測試驅動開發 (TDD) 來交付和維護微服務架構,包括合約測試、端到端測試和單元測試
購買印刷版或 Kindle 版書籍可獲得免費 PDF 電子書
主要特點:
- 使用流行的模擬和測試框架編寫 Go 測試套件
- 利用 TDD 在網頁應用程式和微服務架構的各個層級實施測試
- 掌握編寫涵蓋邊界情況和併發代碼的測試的技巧
書籍描述:
經驗豐富的開發人員了解設計全面測試策略的重要性,以確保在生產環境中高效交付和維護服務。本書將向您展示如何利用測試驅動開發 (TDD),這是一種廣泛採用的行業實踐,來測試您的 Go 應用程式的不同層級。您還將探索在測試併發代碼時面臨的挑戰,並學習如何利用泛型和編寫模糊測試。
本書首先教您如何使用 TDD 解決各種問題,從簡單的數學函數到網頁應用程式。接著,您將學習如何使用 Go 的標準測試庫來結構和運行單元測試,並探索兩個流行的測試框架,Testify 和 Ginkgo。您還將使用表驅動測試這一流行的 Go 技術來實現測試套件。隨著進展,您將使用 Ginkgo 和 Godog 編寫和運行行為驅動開發 (BDD) 測試。最後,您將探索在生產環境中實施和測試 TDD 的棘手方面,例如重構代碼和使用 Pact 實施的合約測試來測試微服務架構。所有這些技術將通過一個示例 REST API 以及較小的定制代碼示例進行演示。
在本書結束時,您將學會如何為您的 Go 應用程式和微服務架構設計和實施全面的測試策略。
您將學到的內容:
- 使用 Testify 的模擬和斷言創建實用的 Go 單元測試
- 為 HTTP 網頁應用程式構建表驅動測試套件
- 使用 Ginkgo 測試框架編寫 BDD 風格的測試
- 使用 Godog 測試框架可靠地測試網頁應用程式
- 使用 Pact 合約測試驗證微服務架構
- 使用屬性測試和模糊測試開發涵蓋邊界情況的測試
本書適合誰:
如果您是一位中級開發人員或軟體測試專業人員,了解 Go 的基本概念並希望使用 Go 交付項目,那麼本書適合您。了解 Go 語法、結構、函數和介面將幫助您充分利用本書。