Slide 1

Slide 1 text

Embrace Your Inner Grumpy Metatesting in 2016 Chris Hartjes GPUG - January 27, 2016

Slide 2

Slide 2 text

A little something about me • PHP user since 1998 • testing advocate since 2004 • writer of PHP books at http://grumpy-learning.com • working at Mozilla as QA engineer in Cloud Services • organize TrueNorthPHP • /dev/hell podcast • OpenCFP head honcho

Slide 3

Slide 3 text

What is Metatesting?

Slide 4

Slide 4 text

It starts with… Magic: The Gathering?

Slide 5

Slide 5 text

Mature Testing Tools Are Available

Slide 6

Slide 6 text

Mature Testing Tools • PHPUnit — http://phpunit.de • Behat — http://behat.org • PHPSpec — http://www.phpspec • Codeception — http://codeception.com

Slide 7

Slide 7 text

Mature Testing Tools • Don’t reinvent mature tools • Extend them for your own needs

Slide 8

Slide 8 text

Open Source Drives Acceptance

Slide 9

Slide 9 text

Open Source • Every popular framework has extensive test suites • Lack of tests speaks volumes about intent • Great entry point into contributing

Slide 10

Slide 10 text

Proof Exists To Back The Promises

Slide 11

Slide 11 text

Proof Exists • Study commissioned by IBM and Microsoft • White paper -> http://research.microsoft.com/en- us/groups/ese/nagappan_tdd.pdf

Slide 12

Slide 12 text

Proof Exists • TDD clearly takes more time… • …but results in fewer bugs in production

Slide 13

Slide 13 text

“Hey boss, for just one extra day per week on this project we can get up to 90% fewer bugs making it into production”

Slide 14

Slide 14 text

Testing Moves Bugs To A Cheaper Phase

Slide 15

Slide 15 text

Cheaper Fixes • cheapest time to fix bugs is when the developer finds them during their work • cost of bugs needs to be evaluated as multiples of developer costs

Slide 16

Slide 16 text

Cheaper Fixes • cultural costs • opportunity costs

Slide 17

Slide 17 text

Build Systems Are Finally Easy To Use

Slide 18

Slide 18 text

Build Systems • Jenkins — https://jenkins-ci.org • Travis-CI — https://travis-ci.org

Slide 19

Slide 19 text

Build Systems • Great side effects • Highlights pain points

Slide 20

Slide 20 text

Awesome Complementary Tools

Slide 21

Slide 21 text

Complementary Tools • code coverage • static analysis

Slide 22

Slide 22 text

Complementary Tools • Code Climate — https://codeclimate.com • Scrutinizer — https://scrutinizer-ci.com

Slide 23

Slide 23 text

“Tracking improvements via tests lets you know the team is on track and doing good work.”

Slide 24

Slide 24 text

It will never be more difficult to test PHP code

Slide 25

Slide 25 text

The time investment in tests produces tangible results

Slide 26

Slide 26 text

I still suck at Magic but are good at Metatesting

Slide 27

Slide 27 text

Questions? [email protected] Twitter - @grmpyprogrammer Buy my stuff at http://grumpy-learning.com