5 ms·
TDD might not apply well to games because they are used by big corporations for 15 or 20 years. It makes more sense when you're working with old legacy code and
by louhike 11y ago
TDD might not apply well to games because they are used by big corporations for 15 or 20 years. It makes more sense when you're working with old legacy code and you want to add features to it. Unit tests are definitely not a all-around solution but they have their use cases.
- enjo 11y agoIt makes more sense when you're working with old legacy code and you want to add features to it. No!! Testing is not merely about future proofing (although it's a really nice benefit), it's about proving that your code actually works now. By writing tests and verifying that they pass you can be sure that the code actually does what you think it does. Furthermore you can ensure that when other parts of the code changes your code still does what you think it does, which might be an issue tomorrow, next week, or in ten years. \* note: Testing does not prove that your code is correct, only that it satisfies the conditions of the test. As with all engineering testing is only effective as the person implementing it.
- JabavuAdams 11y agoUnit testing makes a lot of sense for game engine code, but less so for game-logic code, which tends to be highly volatile and specified only qualitatively.
- true_religion 11y agoA lot of bugs in games involve asking if state is X,Y,Z ... does A actually execute.