Testing with F#
暫譯: 使用 F# 進行測試

Mikael Lundin

  • 出版商: Packt Publishing
  • 出版日期: 2015-02-27
  • 售價: $2,010
  • 貴賓價: 9.5$1,910
  • 語言: 英文
  • 頁數: 282
  • 裝訂: Paperback
  • ISBN: 1784391239
  • ISBN-13: 9781784391232
  • 相關分類: F#
  • 海外代購書籍(需單獨結帳)

商品描述

Deliver high-quality, bug-free applications by testing them with efficient and expressive functional programming

About This Book

  • Maximize the productivity of your code using the language features of F#
  • Leverage tools such as FsUnit, FsCheck, Foq, and TickSpec to run tests both inside and outside your development environment
  • A hands-on guide that covers the complete testing process of F# applications

Who This Book Is For

If you are a developer who wants to test applications using F#, this is the book for you. Basic experience of testing and intermediate experience of functional programming in F# is expected.

What You Will Learn

  • Set up a test environment in your code base
  • Write unit tests, integration tests, and functional tests for F# applications
  • Leverage tools such as FsUnit, Foq, Canopy, and TickSpec to run tests both inside and outside your development environment
  • Maximize the productivity of your test code using the language features of F#
  • Extract dependencies to databases, web services, and other IO bound operations
  • Test your applications using executable specifications on a web browser
  • Discover the best practices for developing a sustainable test suite

In Detail

Starting with an introduction to the concepts behind test automation, you will learn how to set up your test environment for unit testing and how to execute your test suite within and outside of Visual Studio. Using different test frameworks as MSTest, NUnit, and xUnit, you will learn how to write tests in isolation, create test doubles with Foq, and write expressive assertions with FsUnit.

You will learn techniques used to mock database contexts, test stored procedures, use migrations to test databases in isolation, control a web browser with Canopy, and test web services with F# interactive. You will learn how these techniques apply to Agile principles and discover how testing fits into your project.

商品描述(中文翻譯)

透過高效且具表達力的函數式程式設計來交付高品質、無錯誤的應用程式

本書簡介


  • 利用 F# 的語言特性來最大化您的程式碼生產力

  • 利用 FsUnit、FsCheck、Foq 和 TickSpec 等工具在開發環境內外執行測試

  • 一本涵蓋 F# 應用程式完整測試過程的實用指南

本書適合誰閱讀

如果您是一位希望使用 F# 測試應用程式的開發者,這本書就是為您而寫。預期讀者需具備基本的測試經驗及中級的 F# 函數式程式設計經驗。

您將學到什麼

  • 在您的程式碼庫中設置測試環境
  • 為 F# 應用程式撰寫單元測試、整合測試和功能測試
  • 利用 FsUnit、Foq、Canopy 和 TickSpec 等工具在開發環境內外執行測試
  • 利用 F# 的語言特性來最大化您的測試程式碼生產力
  • 提取對資料庫、網路服務和其他 IO 限制操作的依賴
  • 使用可執行規範在網頁瀏覽器上測試您的應用程式
  • 發現開發可持續測試套件的最佳實踐

詳細內容

從測試自動化背後的概念介紹開始,您將學習如何為單元測試設置測試環境,以及如何在 Visual Studio 內外執行測試套件。使用 MSTest、NUnit 和 xUnit 等不同的測試框架,您將學習如何獨立撰寫測試、使用 Foq 創建測試替身,以及使用 FsUnit 撰寫具表達力的斷言。

您將學習用於模擬資料庫上下文的技術、測試儲存過程、使用遷移在隔離環境中測試資料庫、使用 Canopy 控制網頁瀏覽器,以及使用 F# 互動式測試網路服務。您將了解這些技術如何應用於敏捷原則,並發現測試如何融入您的專案中。