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
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Testing with f#

You're reading from   Testing with f# Deliver high-quality, bug-free applications by testing them with efficient and expressive functional programming

Arrow left icon
Product type Paperback
Published in Feb 2015
Publisher Packt
ISBN-13 9781784391232
Length 286 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Mikael Lundin Mikael Lundin
Author Profile Icon Mikael Lundin
Mikael Lundin
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. The Practice of Test Automation FREE CHAPTER 2. Writing Testable Code with Functional Programming 3. Setting Up Your Test Environment 4. Unit Testing 5. Integration Testing 6. Functional Testing 7. The Controversy of Test Automation 8. Testing in an Agile Context 9. Test Smells 10. The Ten Commandments of Test Automation Index

Chapter 1. The Practice of Test Automation

Test automation is a practice that will make you think differently about coding. A typical non-tester approaches a problem by squabbling about some code in the editor and changing it until it works. Like working with clay, you start from a lump and carefully craft it into a bowl, and once satisfied, let it dry. Once it has dried, there is no way you can change it.

When you start doing test automation, you will quickly identify the key issues with how you've been writing code before:

  • You start writing code on a blank sheet without any clear intent on the result
  • You don't know when it's time to stop writing code
  • You don't know whether your code will keep on working when you add more code

Test automation comes to grips with these issues and provides a process for writing code in a more structured and organized fashion. You start out with a clear intent, implement the code until your tests are green, and refactor it until you're happy with the end result.

Functional programming will open your mind to the flaws in the code you've written previously. You will find that the number of programming errors are reduced when your code becomes stateless. Complexity is reduced by removing the deep object dependency graph from your application. The intent gets clearer when all it consists of is functions and data, where functions operate on data.

Together, test automation and functional programming is a harmonious match that brings together good coding practice with good code, making you, the programmer, fall into the pit of success. By reading this book, you will understand how to combine the two and become a better programmer.

In this chapter, we will cover the following topics:

  • What is testing
  • The purpose of testing
  • Testing with intent
  • Writing regression tests
You have been reading a chapter from
Testing with f#
Published in: Feb 2015
Publisher: Packt
ISBN-13: 9781784391232
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 $19.99/month. Cancel anytime
Banner background image