Behat for characterisation on tests
summary
Shows how Behat captures existing API and UI behavior so teams can refactor big, running systems with confidence — used to refactor 5+ year old apps by first recording current outputs, then changing code. Uses Behat + Gherkin at the HTTP layer for characterization tests, Mountebank for HTTP mocks to simulate downstream services, and Mink + Selenium (Chrome) for browser tests. Recommends snapshot testing (PHPUnit extension) for large outputs, one test per boundary, and keeping characterization tests short-lived.
AI-written summary · about
chapters (22)
- 0:00Intro
- 0:53No tests
- 1:28Without fear
- 1:59Hello
- 3:20Overview
- 3:45What is legacy code
- 6:19Unintended changes
- 7:23Characterization tests
- 13:24Do not change the card
- 15:07Minimum number of tests
- 16:09Dont overstate it
- 17:46Identify pinch points
- 18:52Behatgherkin
- 19:51Installation
- 20:36HTTP API
- 24:34Different types of tests
- 26:32HTTP endpoints
- 27:35HTTP mocks
- 29:45Browser automation
- 31:57Custom steps
- 38:29Snapshot testing
- 43:40Recap
related talks
45mBehat from 0 to Hero: a Practical Guide
27mAutomated Web Acceptance Testing with Behat
45mBehaviour Driven Development and Behat: Telling Stories Through Code
31mTesting API's written in PHP using the Behat feature testing tool
34mTesting APIs written in PHP using the Behat feature testing tool
49mBending Behat's Benefits: A live coding adventure
26mBehaviour Driven Development with Laravel
34mWriting end to end tests with a smile
