The Art of Unit Testing: with examples in C#, 2/e (Paperback)
暫譯: 單元測試的藝術:C# 範例(第二版,平裝本)

Roy Osherove

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

相關主題

商品描述

content<div><p><b>Summary</b> </p><p><i>The Art of Unit Testing, Second Edition</i> guides you step by step from writing your first simple tests to developing robust test sets that are maintainable, readable, and trustworthy. You'll master the foundational ideas and quickly move to high-value subjects like mocks, stubs, and isolation, including frameworks such as Moq, FakeItEasy, and Typemock Isolator. You'll explore test patterns and organization, working with legacy code, and even "untestable" code. Along the way, you'll learn about integration testing and techniques and tools for testing databases and other technologies. </p><p><b>About this Book</b> </p><p>You know you should be unit testing, so why aren't you doing it? If you're new to unit testing, if you find unit testing tedious, or if you're just not getting enough payoff for the effort you put into it, keep reading. </p><p><i>The Art of Unit Testing, Second Edition</i> guides you step by step from writing your first simple unit tests to building complete test sets that are maintainable, readable, and trustworthy. You'll move quickly to more complicated subjects like mocks and stubs, while learning to use isolation (mocking) frameworks like Moq, FakeItEasy, and Typemock Isolator. You'll explore test patterns and organization, refactor code applications, and learn how to test "untestable" code. Along the way, you'll learn about integration testing and techniques for testing with databases. </p><p>The examples in the book use C#, but will benefit anyone using a statically typed language such as Java or C++. </p><p>Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications. </p><p><b>What's Inside</b></p><ul><li>Create readable, maintainable, trustworthy tests</li> <li>Fakes, stubs, mock objects, and isolation (mocking) frameworks</li> <li>Simple dependency injection techniques</li> <li>Refactoring legacy code</li></ul><p><b>About the Author</b> </p><p><b>Roy Osherove</b> has been coding for over 15 years, and he consults and trains teams worldwide on the gentle art of unit testing and test-driven development. His blog is at ArtOfUnitTesting.com. </p><p><b>Table of Contents</b></p><ol><h5>PART 1 GETTING STARTED</h5><ol><li>The basics of unit testing</li> <li>A first unit test</li><br/><h5>PART 2 CORE TECHNIQUES</h5> <li>Using stubs to break dependencies</li><br/><li>Interaction testing using mock objects</li><br/><li>Isolation (mocking) frameworks</li><br/><li>Digging deeper into isolation frameworks</li><br/><h5>PART 3 THE TEST CODE</h5> <li>Test hierarchies and organization</li><br/><li>The pillars of good unit tests</li><br/><h5>PART 4 DESIGN AND PROCESS</h5> <li>Integrating unit testing into the organization</li><br/><li>Working with legacy code </li> <li>Design and testability</li></ol></ol></div>sourceProduct Description

商品描述(中文翻譯)

內容

**摘要**
《單元測試的藝術,第二版》逐步指導您從編寫第一個簡單的測試開始,發展出可維護、可讀且值得信賴的穩健測試集。您將掌握基礎概念,並迅速進入高價值主題,如 mocks、stubs 和隔離,包括 Moq、FakeItEasy 和 Typemock Isolator 等框架。您將探索測試模式和組織,處理遺留代碼,甚至是「無法測試」的代碼。在此過程中,您將學習集成測試以及測試數據庫和其他技術的技術和工具。

**關於本書**
您知道應該進行單元測試,那麼為什麼不這麼做呢?如果您是單元測試的新手,覺得單元測試繁瑣,或者只是覺得付出的努力得不到足夠的回報,請繼續閱讀。

《單元測試的藝術,第二版》逐步指導您從編寫第一個簡單的單元測試開始,建立完整的可維護、可讀且值得信賴的測試集。您將迅速進入更複雜的主題,如 mocks 和 stubs,同時學習使用隔離(mocking)框架,如 Moq、FakeItEasy 和 Typemock Isolator。您將探索測試模式和組織,重構代碼應用,並學習如何測試「無法測試」的代碼。在此過程中,您將學習集成測試和使用數據庫進行測試的技術。

書中的範例使用 C#,但對於使用靜態類型語言(如 Java 或 C++)的人也會有幫助。

購買印刷版書籍可獲得 Manning Publications 提供的免費 PDF、Kindle 和 ePub 格式電子書。

**內容概覽**
- 創建可讀、可維護、值得信賴的測試
- Fakes、stubs、mock 物件和隔離(mocking)框架
- 簡單的依賴注入技術
- 重構遺留代碼

**關於作者**
**Roy Osherove** 擁有超過 15 年的編程經驗,並在全球範圍內為團隊提供有關單元測試和測試驅動開發的溫和藝術的諮詢和培訓。他的部落格位於 ArtOfUnitTesting.com。

**目錄**
**第一部分 開始**
- 單元測試的基本概念
- 第一個單元測試

**第二部分 核心技術**
- 使用 stubs 來打破依賴
- 使用 mock 物件進行互動測試
- 隔離(mocking)框架
- 深入挖掘隔離框架

**第三部分 測試代碼**
- 測試層次結構和組織
- 良好單元測試的支柱

**第四部分 設計與過程**
- 將單元測試整合到組織中
- 與遺留代碼合作
- 設計與可測試性