Minimum Viable Tests cover page

Minimum Viable Tests

Minimum Viable Tests


There is so much you need to learn in order to just start testing your PHP code that you don't know where to even start. Wouldn't it be great if someone who has already done it could share what they've learned? In "Minimum Viable Tests" long-time PHP testing evangelist Chris Hartjes goes over what he feels is the minimum you need to know to get started.

Minimum Viable Tests Edit
This book is 100% complete

Updated

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

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.

Read more

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

Read More

About the Author

The Leanpub Unconditional, No Risk, 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks. We process the refunds manually, so they may take a few days to show up.
See full terms