Effective tests and testing effectively
summary
Walk-through of concrete tactics: measure test timestamps and profile suites, cache views configs routes to avoid framework boot cost, prefer factories over heavy seeders and use transactions, and mock external calls mail queues to eliminate network I/O. Uses Pest/PHPUnit on Laravel, mentions Codecov and facades for easy mocking, and calls out a surprising rule of thumb — the critical 40 percent of coverage matters most. Ends with a live Lego demo that exposes an integration failure so the examples actually build and break.
AI-written summary · about
chapters (21)
- 0:00Start
- 1:00Three themes for the talk: speed, coverage and testing mindset
- 1:40How a test runs: framework boot, schema creation, data setup, external calls and assertions
- 2:58Speed principle: build less and cache everything that will not change between tests
- 3:52Speed principle: avoid heavy seeders, prefer factories and minimise database I/O
- 5:47Speed principle: mock external calls, mail, queues and anything not under test
- 7:15Measuring performance: log timestamps, profile your suite and optimise the largest bottleneck
- 8:06When your project only has the default two tests, why that is an opportunity not a crisis
- 8:53Coverage mindset: progress over perfection and thinking in terms of development plus testing time
- 9:44Not all coverage is equal: identifying the critical 40 percent that actually matters
- 10:52High use critical functions: the features your app cannot survive without
- 11:49High use critical reputation: the flows that damage user trust even if they technically work
- 12:54Bug spray mindset: break, test, fix as a team commitment to never repeat a bug
- 13:35Preventing regressions by writing the failing test before fixing the bug
- 14:27Incremental refactors and writing idiomatic Laravel to make testing easier
- 15:32Do not test the framework anecdote: acting as, login events and learning boundaries
- 16:36Introducing unit, feature and integration tests and their responsibilities
- 17:01Live Lego demo with Gary Yeatman and Marty Friedl to illustrate testing layers
- 18:38Unit test demonstration: examining individual bricks and their properties
- 20:51Feature test demonstration: assembling towers and seeing where brittle pieces fail
- 22:03Integration test demonstration: attempting to build the bridge and observing systemic failure
related talks
52mLaravel Testing Tips, Techniques and Pitfalls
41mTesting done right: From bugs to brilliance
56mUnit Testing by Example
01h 05mMicrotesting
26mTesting the Tricky Stuff
57mAdvanced Testing Techniques: Tips from the trenches
44mTesting the untestable - patterns and use cases analysis
34mBetter Testing in Laravel
