Under the Hood: How We Keep the Code Reliable

Free Flick Football is a one-person project, which means there's no QA team, no staging environment review, and no second pair of eyes on every change. The only safety net is automated testing — and I've invested heavily in making that net as strong as possible.

The game now has over 300 automated tests covering the core library modules: formations math, daily challenge logic, stat tracking, XP and ELO calculations, theme and cosmetic unlock predicates, i18n translations, ball skin mechanics, and crest definitions. Every pure function that the game depends on is tested.

But having tests isn't enough if you can forget to run them. That's where the pre-commit hook comes in. Every time I commit code that touches the source directory, the hook automatically runs the full test suite with code coverage enabled. If any test fails, the commit is rejected. If coverage drops on any file that was previously tested, the commit is also rejected.

The coverage gate works by comparing current coverage numbers against a committed baseline file. Each tracked file has minimum thresholds for lines, branches, functions, and statements. You can improve coverage (and the baseline ratchets up), but you can't go backwards. This means every new test is a permanent improvement — once a module hits 100% line coverage, it stays there.

Why does this matter for players? Because it means game-breaking bugs are far less likely to ship. The formations you pick will always produce the correct pin layout. The daily challenge will always pick the right mode for the date. Your stats will always be calculated correctly. XP and level-ups will always work as expected.

This testing infrastructure is the foundation that lets me ship new features confidently. When I added Season Mode, I could change the stat tracking code knowing that if I accidentally broke the XP calculation, the pre-commit hook would catch it before the code ever reached production.

It's not glamorous work, but it's the kind of engineering investment that pays compound interest. Every test I write today saves debugging time tomorrow — and keeps your game running smoothly.

← All posts