A practical guide to testing in Modern Perl
Minimum price
Suggested price

A practical guide to testing in Modern Perl

About the Book

The book is in progress. Your feedback means a lot. Please let us know what you would like to read!

This is a book for pragmatic programmers. A little bit of theory and a lot of practical examples on how to test your software inside-out and outside-in. We try not to be very opinionated and explain different techniques and approaches to testing. You will find a lot of references if you're into the academia, but with examples applied to the real world problems that we are all facing in our day to day programming.

We will tackle together such important topics as the simplicity and effectiveness of unit tests, importance of integration tests and the business value of end to end testing. We will see how the tests can guide the development, fight the bug regressions and speed up feature implementations.

About the Authors

Viacheslav Tykhanovskyi
Viacheslav Tykhanovskyi

I am an open source freak with almost ~200 open repos (github.com/vti). Also I am a software quality addict, this is why I created kritika.io. In my free time (who has it?) I ride my road bicycle and participate in long-distance audax events (so-called randonneuring).

Gregor Goldbach
Gregor Goldbach

Hi, I'm Gregor. I've been a software developer for over 20 years now. My roles included team member and team lead in both software development and quality assurance. I live with my family and two cats in sunny Northern Germany.

Table of Contents

  • Introduction
    • Who should read this book
    • What this book is about
    • What this book is not about
  • The purpose of testing
  • Quick Start
    • Minimum prerequisites
    • Testing a logging module
  • The Testing Infrastructure
    • What are tests anyway?
    • Proving that we are wrong
    • The “Test Anything” Protocol
    • Testing a subroutine
    • Arrange, Act and Assert
    • Key Take Aways
  • CPAN Testers
    • Reporting tests as a user
    • Becoming a CPAN Tester
    • Improving your tests as an author
  • Autotest
    • Building the command line tool
      • Running a test program
      • Checking for change
      • Testing the application logic
      • Key Take Aways
    • Building the REST server
      • A word about resources
      • Testing a basic REST server
      • Incorporating our working code
      • Testing an API
      • Key Take Aways
    • Building the web application
      • Testing outside-in
      • Testing the client, not the server
      • Testing the functionality, not the GUI
      • Key Take Aways
  • Temporary data
    • Temporary directories and files
    • Temporary databases
    • Temporary version control repositories
  • Fake Services
    • Fake email server
  • Web Framework Testing
    • Catalyst
  • Non-deterministic code and tests
    • Side effects
    • Dates
      • Dependency injection
      • Factory method mocking
      • System call mocking
    • Race conditions
    • Unwanted randomness
    • Wanted randomness
      • Frequency test
      • Serial test
      • Poker test
      • Runs test
      • Autocorrelation test
  • Alternative test approaches and runners
    • Specification tests
    • Class-based testing
    • Cucumber/BDD/Gherkin
    • QuickCheck
  • Interactions with the outside world
    • Test results formatters
    • Continious integration services
    • Results reporting
  • Advanced testing patterns
    • Testing asynchronous code
  • Exotic testing patterns and methods
    • Mutation Testing
  • Notes

The Leanpub 60-day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

80% Royalties. Earn $16 on a $20 book.

We pay 80% royalties. That's not a typo: you earn $16 on a $20 sale. If we sell 5000 non-refunded copies of your book or course for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earnedover $12 millionwriting, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub