Book Image

Testing with F#

By : Mikael Lundin
Book Image

Testing with F#

By: Mikael Lundin

Overview of this book

Table of Contents (17 chapters)
Testing with F#
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Speeding up integration testing


Integration tests are slow. This is not noticeable when you are at the beginning of the product life cycle and have 50 integration tests, but when you start closing on 1,000 integration tests, they will take a long time to run. This is, of course, because they are I/O-bound, waiting for network traffic.

A unit test should never take more than 10 ms to complete. This means that 1,000 unit tests will run under 10 seconds. This is enough time to make you loose focus but not enough to be called a major hurdle in your work process.

On the other hand, it is not uncommon for an integration test to take 150 ms to complete. If you have 1,000 integration tests, it will take 2–5 minutes to complete the test run. Now, this is a bit optimistic. I had an integration test suite of 850 integration tests running in 18 minutes. Why is this important?

The time it takes to run a test suite will decide whether it will be run or not. When a test suite takes a long time to run, these...