Minimum Viable Tests
Minimum Viable Tests
$19.00
Minimum price
$19.00
Suggested price
Minimum Viable Tests

This book is 100% complete

Completed on 2017-10-11

About the Book

You've been doing PHP development for a while but you find yourself constantly battling bugs, finding it hard to integrate bits of code together, and staying late to do deployments. You know there is a better way through test-driven development but you have no idea where to start.

You imagine yourself sitting down with an experienced developer -- just you and them, steadily working through problems and learning how to use test-driven development to design the API's and interfaces for your code while making sure nothing leaves development until you're 100% sure it's working.

In "Minimum Viable Tests" long-time PHP testing evangelist Chris Hartjes starts you off with the basics on the concepts surrounding test-driven development and shows you how a long-time grumpy programmer writes application with testing always in the front of his mind. Along the way you'll learn about:

  • Chris' concept of "metatesting"
  • The basics of what PHPUnit is and how it works
  • The role of tests in the development process
  • Effective use of test doubles
  • Understanding how to mimic your application's environment via bootstrapping
  • Writing wrappers around web API calls to make testing easier
  • How fixtures and data providers help simplify your tests both today and tomorrow
  • When you should use (and not abuse) monkey-patching tools
  • The Arrange-Act-Assert test-writing strategy
  • How to refactor existing tests

Chris has been watching and listening to people as they start their journey towards become test-driven developers. "Minimum Viable Tests" is designed to be your guide on the path to having well-tested, confidently-deployed PHP applications.

About the Author

Chris Hartjes
Chris Hartjes

Chris Hartjes has been building and testing web applications of all shapes and sizes since 1998, with a focus on best practices and how to use testing as an effective development tool.

By day he works for Mozilla testing services that the Firefox web browser talks to while by night he works on building his online info-product empire through http://grumpy-learning.com.

He lives in the snowy wilds of Lucan, Ontario, Canada,

Bundles that include this book

Build APIs You Won't Hate
Minimum Viable Tests
$48.99
Suggested Price
$50.00
Bundle Price
Minimum Viable Tests
Building Test-Driven Developers
$28.00
Suggested Price
$19.00
Bundle Price

Table of Contents

  • Foreword by Phil Sturgeon
  • Introduction
    • Who Is This Book For?
    • Why This Book?
    • What Is This Book?
    • Special Thanks
  • Metatesting
    • Mature Testing Tools Are Available
    • Open Source Drives Acceptance
    • Proof Exists to Back the Promises
    • Testing Moves Bug Fixing to a Cheaper Part of The Cycle
    • Easy-to-use Build Systems Encourage Continuous Deployment
    • There Are Awesome Complementary Tools
  • PHPUnit Basics
    • How Do We Install PHPUnit?
    • What Is PHPUnit?
    • The PHPUnit Test Runner
    • PHPUnit Test Cases
  • Testing Basics
    • What Is a Test?
    • Testing FizzBuzz
    • Handling Non-Integers
    • Testing for Fizz
    • Make Buzz Work
    • Check That FizzBuzz is Correctly Detected
    • Data Providers to Reduce Repetition
    • Things to Look out For
  • Care and Feeding for Your Test Doubles
    • Why Do We Need Doubles?
    • Identifying Dependencies
  • Bootstrapping
  • Wrapping Is Not Just for Presents
    • Wrappers from up High
  • Fixtures and Data Providers
    • When Do I Need Them
    • When Should I Use a Data Fixture?
    • When Should I Use a Data Provider
  • Monkey Patching
    • What Is Monkey Patching?
    • What Problem Is Monkey Patching Solving in Testing?
    • What Scenarios Might Monkey Patching Be Good For?
    • Enough Talking, Show Me Some Examples
    • New Test Style
    • Double Patching for Great Success
    • Monkey Patching as a Precision Tool
  • Arrange-Act-Assert
  • Refactoring Tests
    • Helper methods
    • Arrange-Act-Assert
    • Continuing The Pattern

Authors have earned$8,179,639writing, publishing and selling on Leanpub,
earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.

Learn more about writing on Leanpub

The Leanpub 45-day 100% Happiness Guarantee

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

See full terms

Free Updates. Free App. 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), EPUB (for phones and tablets), MOBI (for Kindle) and in the free Leanpub App (for Mac, Windows, iOS and Android). 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. It really is that easy.

Learn more about writing on Leanpub