Free Sample
+ Collection
Code Files

Testing with F#

Learning
Mikael Lundin

Deliver high-quality bug-free applications by testing them with efficient, expressive, data-rich functional programming
This title is available to pre-order now and is expected to be published in
$21.60
$44.99
RRP $26.99
RRP $44.99
eBook
Print + eBook

Want this title & more?

$21.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781784391232
Paperback282 pages

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

This book is a comprehensive guide for developers who want to test their applications written in F#. No prior experience in testing F# applications is necessary, but competence in testing and knowledge of the application development life cycle is expected.

Table of Contents

What You Will Learn

  • Write unit tests, integration tests, and functional tests for F# applications
  • Extract dependencies to databases, web services, and other IO bound operations
  • Discover the best practices for developing a sustainable test suite
  • Set up a test environment in your codebase
  • Test your applications using executable specifications on a web browser

In Detail

The most important stage in the application development life cycle is testing, and modern-day testing methodologies like TDD give the developer the flexibility to plan their tests simultaneously while coding. This testing process includes unit testing, integration testing, system testing, and acceptance testing. Before any application is deployed, these four steps are necessary so that applications perform the exact tasks they are designed for. With test-driven development, we get an API that not only validates the correctness of our code, but also provides better understanding. You can write useful code in F# without touching core code, and writing tests is a great way to start. Not only does F# have a more compact syntax, it also has many nice features, such as the "double backtick" syntax that makes test names much more readable.

Starting with an introduction to the concepts behind test automation, you will learn how to write good quality code and test your F# Applications. You will learn how to set up your testing environment for unit testing and how to execute your test suite within and outside different Visual Studio frameworks such as NUnit and xUnit, as well as how to use FsUnit to build tests. You will also dive into testing in isolation, creating test doubles with the mocking framework Foq, and testing by mocking the database context using type providers.

Over the course of this book, you will learn how integration testing is performed in a functional application and gain insight into the best practices for developing a sustainable test suite. You will also learn how you can use F# to test stored procedures in a database, work with migrations in order to test database integrations in isolation, generate test data with FsCheck, and test web services interactively with F#. You will learn how to apply these techniques with the Agile methodology and turn your tests into specifications to maximize their efficiency.

Towards the end of this book, you will discover the problems that might arise while testing, and learn how to make your tests stable. By the end of this book, you will be able to test your F# applications and yield high-quality code.

Authors

Read More

Recommended for You

TestNG Beginner's Guide
$ 26.99
Instant Penetration Testing: Setting Up a Test Lab How-to
$ 14.99
Advanced Penetration Testing for Highly-Secured Environments [Video]
$ 29.75
Advanced Penetration Testing for Highly-Secured Environments: The Ultimate Security Guide
$ 35.99
Windows Phone 7.5 Application Development with F#
$ 14.99