Build Your Own Test Framework: A Practical Guide to Writing Better Automated Tests
暫譯: 建立自己的測試框架:撰寫更佳自動化測試的實用指南

Irvine, Daniel

  • 出版商: Apress
  • 出版日期: 2023-03-10
  • 售價: $1,820
  • 貴賓價: 9.5$1,729
  • 語言: 英文
  • 頁數: 269
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 1484292464
  • ISBN-13: 9781484292464
  • 海外代購書籍(需單獨結帳)

相關主題

商品描述

Learn to write better automated tests that will dramatically increase your productivity and have fun while doing so. This book is a build-your-own adventure designed for individual reading and for collaborative workshops.
You will build an xUnit automated test framework using JavaScript: initially a clone of Jest, but adding a couple of neat features borrowed from RSpec, the genre-defining tool for behavior-driven development (BDD). Along the way, you will explore the philosophy behind automated testing best practices. The automated test runner is one of the most important innovations within software engineering. But for many programmers, automated testing remains a mystery, and knowing how to write good tests is akin to sorcery.
As the chapters of this book unfold, you will see how the humble test runner is an elegant and simple piece of software. Each chapter picks a single feature to build, like the "it" function or the "beforeEach" block. It picks apart the theory of why the feature needs to exist, and how to use it effectively in your own test suites. Every chapter ends with a set of ideas for extension points should you wish to explore further, alone or in groups. The book culminates in an implementation of test doubles and mocks--one of the most difficult and misunderstood concepts within automated testing.
By the end of the book, you will have gained a solid understanding of automated testing principles that you can immediately apply to your work projects.
What You'll Learn
  • Build an xUnit automated test framework
  • See how an automated test runner works
  • Understand the best practices for automated unit testing
  • Effectively use test doubles and mocks
Who This Book Is For

Software developers with JavaScript experience who are seeking to master the art of automated testing.

商品描述(中文翻譯)

學習撰寫更好的自動化測試,這將顯著提高您的生產力,同時享受這個過程。本書是一個自訂冒險的指南,適合個人閱讀和協作工作坊。

您將使用 JavaScript 建立一個 xUnit 自動化測試框架:最初是一個 Jest 的克隆,但添加了一些從 RSpec 借來的精巧功能,這是行為驅動開發(BDD)中定義類型的工具。在這個過程中,您將探索自動化測試最佳實踐背後的哲學。自動化測試執行器是軟體工程中最重要的創新之一。但對於許多程式設計師來說,自動化測試仍然是一個謎,知道如何撰寫良好的測試就像是魔法。

隨著本書章節的展開,您將看到這個不起眼的測試執行器是一個優雅且簡單的軟體。每一章都選擇一個單一的功能來構建,例如 'it' 函數或 'beforeEach' 區塊。它剖析了為什麼這個功能需要存在的理論,以及如何在自己的測試套件中有效使用它。每一章結尾都有一組擴展點的想法,供您在個人或小組中進一步探索。本書的高潮是測試雙重和模擬的實現——這是自動化測試中最困難且最容易被誤解的概念之一。

到本書結束時,您將對自動化測試原則有一個堅實的理解,並能立即將其應用於您的工作項目。

您將學到什麼


  • 建立一個 xUnit 自動化測試框架

  • 了解自動化測試執行器的運作方式

  • 理解自動化單元測試的最佳實踐

  • 有效使用測試雙重和模擬


本書適合誰




有 JavaScript 經驗的軟體開發人員,尋求掌握自動化測試的藝術。

作者簡介

Daniel Irvine is a freelance software developer based in London. He works with a variety of languages including C#, Clojure, JavaScript, and Ruby. When he's not working, he spends time cooking, gardening and practicing yoga. He co-founded the Queer Code London meetup and is an active member of the European software craft community.

作者簡介(中文翻譯)

丹尼爾·歐文(Daniel Irvine)是一位駐紐約的自由軟體開發者。他使用多種程式語言,包括 C#、Clojure、JavaScript 和 Ruby。當他不在工作時,他會花時間烹飪、園藝和練習瑜伽。他共同創辦了 Queer Code London 會議,並且是歐洲軟體工藝社群的活躍成員。