Test- Driven Python Development

Siddharta Govindaraj

  • 出版商: Packt Publishing
  • 出版日期: 2015-04-30
  • 售價: $2,140
  • 貴賓價: 9.5$2,033
  • 語言: 英文
  • 頁數: 300
  • 裝訂: Paperback
  • ISBN: 1783987928
  • ISBN-13: 9781783987924
  • 相關分類: Python程式語言
  • 海外代購書籍(需單獨結帳)

相關主題

商品描述

Develop high-quality and maintainable Python applications using the principles of test-driven development

About This Book

  • Write robust and easily maintainable code using the principles of test driven development
  • Get solutions to real-world problems faced by Python developers
  • Go from a unit testing beginner to a master through a series of step-by-step tutorials that are easy to follow

Who This Book Is For

This book is intended for Python developers who want to use the principles of test-driven development (TDD) to create efficient and robust applications. In order to get the best out of this book, you should have development experience with Python.

What You Will Learn

  • Implement the test-driven development process in Python applications
  • Fully leverage Python's powerful built-in unittest and doctest modules
  • Effectively add features to existing code bases that do not have any tests
  • Safely resolve problems with the code and design, without breaking any functionality
  • Utilize Python's powerful mock and patch functionality to test complex interactions
  • Integrate unit testing into the overall software delivery process
  • Use doctest to test code with examples
  • Enhance TDD with the nose2 test runner

In Detail

This book starts with a look at the test-driven development process, and how it is different from the traditional way of writing code. All the concepts are presented in the context of a real application that is developed in a step-by-step manner over the course of the book. While exploring the common types of smelly code, we will go back into our example project and clean up the smells that we find.

Additionally, we will use mocking to implement the parts of our example project that depend on other systems. Towards the end of the book, we'll take a look at the most common patterns and anti-patterns associated with test-driven development, including integration of test results into the development process.

商品描述(中文翻譯)

使用測試驅動開發原則開發高品質且易於維護的Python應用程式

關於本書



  • 使用測試驅動開發原則撰寫堅固且易於維護的程式碼

  • 解決Python開發者面臨的真實世界問題

  • 透過一系列易於跟隨的逐步教學,從單元測試初學者成為專家

本書適合對象


本書適合希望使用測試驅動開發(TDD)原則來創建高效且堅固應用程式的Python開發者。為了充分利用本書,您應該具備Python開發經驗。

您將學到什麼



  • 在Python應用程式中實施測試驅動開發流程

  • 充分利用Python強大的內建unittest和doctest模組

  • 有效地為沒有任何測試的現有程式碼添加功能

  • 安全地解決程式碼和設計問題,而不破壞任何功能

  • 利用Python強大的模擬和補丁功能測試複雜互動

  • 將單元測試整合到整體軟體交付流程中

  • 使用doctest來測試具有範例的程式碼

  • 透過nose2測試運行器增強TDD

詳細內容


本書首先介紹了測試驅動開發流程,以及它與傳統編寫程式碼的方式有何不同。所有概念都在一個真實應用程式的背景下呈現,該應用程式在本書的過程中逐步開發。在探索常見的糟糕程式碼類型時,我們將返回到我們的示例專案並清理發現的問題。


此外,我們將使用模擬來實現依賴於其他系統的示例專案的部分功能。在本書末尾,我們將研究與測試驅動開發相關的最常見模式和反模式,包括將測試結果整合到開發流程中。