# 500 integration tests later: what regression coverage actually caught
HR rules are the kind of logic that punishes guessing. Overtime depends on the shift, the shift depends on the calendar, the calendar has three kinds of holiday, and every company on the platform has an exception it considers obvious. So the suite grew to about five hundred tests, and after a year I went back to see which ones had ever earned their runtime.
## Integration over unit, for this domain
Almost none of these are unit tests. They hit the database, run through the real service classes, and assert on the numbers a payroll export would show. Mocking the calendar would have made them faster and would also have removed the only part I did not trust.
# the loop that actually finds bugs: same case, every shift type $ php artisan test --filter=Overtime PASS Tests\Feature\OvertimeTest ✓ pays night differential on a rotating shift ✓ ignores minutes below the daily grace period ✓ stacks holiday rate over weekend rate Tests: 512 passed (1384 assertions)
## Which tests failed for a good reason
- ▸Date and boundary cases. Month ends, shifts crossing midnight, and the week a country moved its weekend. This group caught real regressions repeatedly and is worth every second it costs.
- ▸Permission and visibility tests. Cheap to write, and they failed every time someone refactored a policy. Two of those failures would have been customer-visible data leaks.
- ▸Happy-path CRUD tests. Roughly a third of the suite, and I cannot point to one bug they found. They fail when the code changes, which is not the same as finding a bug.
A test that only fails when you rename something is a cost, not a safety net.
## What I changed after looking
I stopped writing CRUD tests for new endpoints unless the endpoint has real rules behind it, and I started writing the boundary cases first, before the implementation, because that is where I get the requirements wrong. The suite grew more slowly after that and caught more.
## The habit worth keeping
When a bug reaches production, the first commit of the fix is a failing test that reproduces it. That rule added maybe thirty tests over the year, and those thirty are the ones I would rewrite from scratch if the suite disappeared.