$30 off During Our Annual Pro Sale. View Details »

Embrace Your Inner Grumpy: Metatesting in 2016

Embrace Your Inner Grumpy: Metatesting in 2016

Presentation I gave at GPUG on January 27, 2016

Chris Hartjes

January 27, 2016
Tweet

More Decks by Chris Hartjes

Other Decks in Technology

Transcript

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

    View Slide

  2. 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

    View Slide

  3. What is Metatesting?

    View Slide

  4. It starts with…
    Magic: The Gathering?

    View Slide

  5. Mature Testing Tools
    Are Available

    View Slide

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

    View Slide

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

    View Slide

  8. Open Source
    Drives Acceptance

    View Slide

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

    View Slide

  10. Proof Exists To Back
    The Promises

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  14. Testing Moves Bugs
    To A Cheaper Phase

    View Slide

  15. 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

    View Slide

  16. Cheaper Fixes
    • cultural costs
    • opportunity costs

    View Slide

  17. Build Systems Are
    Finally Easy To Use

    View Slide

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

    View Slide

  19. Build Systems
    • Great side effects
    • Highlights pain points

    View Slide

  20. Awesome
    Complementary Tools

    View Slide

  21. Complementary Tools
    • code coverage
    • static analysis

    View Slide

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

    View Slide

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

    View Slide

  24. It will never be more
    difficult to test PHP code

    View Slide

  25. The time investment in
    tests produces tangible
    results

    View Slide

  26. I still suck at Magic but
    are good at Metatesting

    View Slide

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

    View Slide