Leanpub Header

Skip to main content

Minimum Viable Tests

There's so much you need to learn in order to start testing your PHP code that you don't know where to begin. 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.

The author is letting you choose the price you pay for this book!

Pick Your Price...
PDF
EPUB
WEB
498
Readers
About

About

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.

Share this book

Categories

Price

Pick Your Price...

Minimum price

$19.00

$19.00

You pay

$19.00

Author earns

$15.20
$

All prices are in US $. You can pay in US $ or in your local currency when you check out.

EU customers: prices exclude VAT, which is added during checkout.

...Or Buy With Credits!

Number of credits (Minimum 2)

2
The author will earn $24.00 from your purchase!
You can get credits monthly with a Reader Membership

Author

About the Author

Chris Hartjes

Chris Hartjes has been helping teams try and produce fewer bugs in production since 1998 with a recent focus on tools and test automation in PHP and Python.

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

Leanpub Podcast

Episode 68

An Interview with Chris Hartjes

Translations

Translations

Languages

Contents

Table of Contents

Foreword by Phil Sturgeon

Introduction

  1. Who Is This Book For?
  2. Why This Book?
  3. What Is This Book?
  4. Special Thanks

Metatesting

  1. Mature Testing Tools Are Available
  2. Open Source Drives Acceptance
  3. Proof Exists to Back the Promises
  4. Testing Moves Bug Fixing to a Cheaper Part of The Cycle
  5. Easy-to-use Build Systems Encourage Continuous Deployment
  6. There Are Awesome Complementary Tools

PHPUnit Basics

  1. How Do We Install PHPUnit?
  2. What Is PHPUnit?
  3. The PHPUnit Test Runner
  4. PHPUnit Test Cases

Testing Basics

  1. What Is a Test?
  2. Testing FizzBuzz
  3. Handling Non-Integers
  4. Testing for Fizz
  5. Make Buzz Work
  6. Check That FizzBuzz is Correctly Detected
  7. Data Providers to Reduce Repetition
  8. Things to Look out For

Care and Feeding for Your Test Doubles

  1. Why Do We Need Doubles?
  2. Identifying Dependencies

Bootstrapping

Wrapping Is Not Just for Presents

  1. Wrappers from up High

Fixtures and Data Providers

  1. When Do I Need Them
  2. When Should I Use a Data Fixture?
  3. When Should I Use a Data Provider

Monkey Patching

  1. What Is Monkey Patching?
  2. What Problem Is Monkey Patching Solving in Testing?
  3. What Scenarios Might Monkey Patching Be Good For?
  4. Enough Talking, Show Me Some Examples
  5. New Test Style
  6. Double Patching for Great Success
  7. Monkey Patching as a Precision Tool

Arrange-Act-Assert

Refactoring Tests

  1. Helper methods
  2. Arrange-Act-Assert
  3. Continuing The Pattern

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

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.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

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

In fact, authors have earned over $14 million writing, 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