Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Mastering F#

You're reading from   Mastering F# A comprehensive and in-depth guide to writing functional programs using F#

Arrow left icon
Product type Paperback
Published in Nov 2016
Publisher
ISBN-13 9781784393434
Length 264 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
 García-Caro Núñez García-Caro Núñez
Author Profile Icon García-Caro Núñez
García-Caro Núñez
 Fahad Fahad
Author Profile Icon Fahad
Fahad
Arrow right icon
View More author details
Toc

Chapter 9. Testing in F#

Enthusiasts of typed functional languages tend to say that the only errors you need to care about are compilation errors. That would indeed be the ideal situation, but even a compiler as advanced as F#'s cannot detect all errors; it is still necessary to test your code. For many years now, programmers have learned to automate these tests to avoid the time-consuming process of manual testing. There are many great tools for automated testing for all popular languages, and F# is no exception. In this chapter, we will overview several techniques from the widely used unit tests to the more advanced property-based testing.

In this chapter, we will cover the following topics:

  • How to write unit tests in F# with the popular NUnit tool, and the advantages the language offers for this. We will also see how to easily run tests in our builds with FAKE to make sure we haven't introduced regression bugs with our changes.
  • Property-based testing with FsCheck is a more robust way to...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £13.99/month. Cancel anytime
Visually different images