Perl Test-driven Development Ebook

Perl Test-driven Development Ebook

A few months ago, we quietly introduced our free-ebook-in-development, Testing Strategies for Modern Perl. Since then, we’ve been hard at work, and we’ve released the first major chunk.

For this first big release, we’re beginning with a step-by-step tutorial that goes into test-driven development (TDD) in Modern Perl using Test::Class, developing working code for a Tic-Tac-Toe application using our actual development process. We start with an overview of test-first, what makes a good test, and what you can expect from Test::Class in the following pages. Then we delve into creating a new business-logic object for our sample application.

From there, we are moving on to address:

  • Table-driven testing, and other test-reuse strategies,
  • Mock objects and mocking modules, the process of creating a simplified simulation of a dependency, such as a mock method that substitutes for reading data from a file but instead always returns a constant record of data.
  • Subsystem and integration testing, testing modules working together and testing the system as a whole.
  • Testing user-interfaces, both command-line and web UI.
  • Testing with databases and application configuration files.
  • Refactoring strategies, both for production code and for refactoring tests.
  • Testing frameworks, specifically our preferred Test::Class, and a survey of Perl mocking libraries from CPAN.
  • Using Continuous Integration (CI) tools with your Perl projects to automatically run test suites and report when a code change breaks a test.
  • Testing legacy Perl, modernizing it as described in Michael Feathers’ Working Effectively with Legacy Code.
  • Testing Perl 6.

We’ve published all of our sample code and code templates on GitHub. This repository contains step-by-step commits corresponding to the tutorial text.

Here’s how you can get your copy. Click here to sign up to receive chapters from the ebook as it’s developed. In return, every month or three, you’ll get an email with another chapter or update. This is a very low volume list, which contains messages only about the ebook. We’ll also be asking for your comments, and you’ll be able to have your feedback counted.

Peace, love, and may all your TAP output turn green…

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.