TDD means you write a failing test case first before you write the actual function. You don't need TDD to "run a unit test to test a function in a fraction of a second".
TDD is only good when the spec is unambiguously defined (either in your mind, or written by a product designer). For example if you need a function that tests whether two AABBs are overlapped, TDD is perfect. But in game development, sometimes the spec is just "write a water shader that looks good enough", and "good enough" is not unambiguously defined. Therefore TDD is bad in this case.
https://hitchdev.com/hitchstory/approach/snapshot-test-drive...
Write a scenario that uses a new water shader - eyeball it - if it's good then "fix" the snapshot and pass it around.
Repeat with a few other scenarios to see it performing under all relevant circumstances.
It can be a bit tricky if the result of the shader is not deterministic - but there are sensible ways of dealing with that.
TDD may be helpful later, but as long as you don't yet have a fun gameplay loop everything else is a distraction.
Finding the fun, though…
For basic CRUD and simple business logic I see TDD work. But for example most projects I work on I have no clue what or no clue how to do it. I just write code, play around get new ideas and build upon that. It changes so frequent and is so exploratory that I can not be bothered writing any tests.
Once I "get it" I write some tests. Mostly I understand also what will need tests and what not. Personally I think this if fine.
Online everyone is writing the ideal situation. I know what to deliver, I know how to do it and this is the perfect way to do it. Mostly it is I have taken loads of assumption and figuring it out as I go. Fuck it needs to be done don't have time to "optimize" it to look perfect.
Maybe I'm just not a good developer. But I shipped enough value in my lifetime to know I'm good enough ;)
IMO I suspect we as an industry haven’t spent enough time considering the role of automated tests in video game software. I worry that it’s been written off for so long that it’s a self fulfilling prophecy. Since there isn’t tons of time spent thinking about testing whenever anyone attempts it they run into issues. When seeking help they are told tests are a waste of time. They do waste time because the “what is effective” patterns are still being discovered for as complex of software as games.
Maybe I am actually just not a good developer… But I really think there is something worth exploring.
Do you really want to have to update a test every time you want the jump button to have more or less force, when tuning your platforming mechanics?