Skip to main content

Testing with F#

In July 2014 I was contacted by PACKT Publishing if I was interested in writing a title for them about Testing with F#. I did some serious thinking and came to the conclusion that, yes I have the knowledge to write that book and, yes I want to write that book.

I asked my wife three times

  • Is it ok for you if I write a book this autumn?
  • Are you sure I can write this book, it will consume a lot of time?
  • Are you really really sure? Last time to back down.

So, 21 July I signed the contract and started working on the book.

Testing with F#

I quite often get the question, why functional programming?

My main experience is with object oriented programming. I have been doing C# since 2005 and have the OOP principles rooted in my bone marrow. Sometimes I've had a nagging feeling during the years that I have been writing a lot of code for the code's sake and not solving the actual problem. You create large object graphs, and break things apart into abstractions to keep things maintainable, but not really delivering business value.

When I got in touch with F# in 2009 I was struck with how "to the point" all the code examples were. There was very little ceremony code. All there was, code and data, where code is manipulating data. This thought is a useful tool to keep things simple.

Code and Data

Getting back to the original question, why functional programming? My answer is that functional programming has better tools for keeping things simple, and F# is a functional general purpose language that is extremely accessible by being available by default in Visual Studio on Windows.

The only thing standing in way of developers creating much higher quality code today is a mind shift from object oriented programming to functional programming.

Functional programming focuses on the problem, not the code.

Test automation has been one of my main focus areas for many years. By this time it feels like I have done all the mistakes there are when it comes to unit testing, integration testing and functional tests.

Distilling down the best practices of test automation have made it possible for me to reach a point where my tests provide a direct propotional value to the code that I write.

Test Automation: Design, Verify, Explore

In this book I have taken my two favorite principles of functional programming paradigm and test automation, and combined them.

  • What are the benefits of functional programming in testing?
  • What tools and frameworks are available in F#?
  • How does testing fit into an agile development process?

Testing with F# at PACKT

Please go check out the book at PACKT.

UPDATE: Now also on Amazon.

Testing with F#

comments powered by Disqus