Game Development Community

How do you implement Test Driven Development with TX and TXB?

by Tuna Sack · in Torque X 2D · 09/20/2007 (2:11 pm) · 3 replies

I am just learning the TX engine, (which is great, by the way) but I'm having some issue figuring out the best way to test your code and components. How do you do testing while in development? Do you have any examples of how you would use TDD methods to make sure all of your code is correct?

For example, I have just finished the Blaster tutorial but my enemy ships appear to bounce in spots before activating the collision detections and blow each other up before getting onto the viewable part of the screen after cd is implemented. This seems like a fairly trivial problem, but without a systematic and automated way to test, I feel I'm left to searching in the proverbial hay stack. Since this is a fairly simple and easy example, I can only imagine how significant this issue of testing becomes on larger projects.

Any suggestions?

About the author

Recent Threads


#1
09/20/2007 (5:06 pm)
I use TestDriven.Net but Microsoft recently threatened to sue the developer if he did not remove support for Visual Studio Express and he caved in to the pressure and did it in all the newer versions.

It is apparent Microsoft wants to keep very tight control over just what we can and can't do with XNA Game Studio Express and this is one area where they've definitely caused me a bit of aggravation.

However, there's really nothing that can't be debugged using traditional methods, and you can write unit tests without a fancy framework, if you need them. You have an excellent debugger and easy to understand code in the form of C# so I would just not worry too much about it and instead focus on requirement-driven development.

Note that it is possible to develop for XNA in the full versions of Visual Studio, but it is a bit of a hack. XNA 2.0 will supposedly integrate with the full version of Visual Studio as well, but we still have months to go on that one. In both of these cases you could use TestDriven.Net or some other unit testing solution to make your life easier.
#2
09/20/2007 (5:08 pm)
Do keep in mind that TorqueX has a built in unit test harness, and you can use that for at least part of your testing needs.
#3
09/21/2007 (9:15 am)
The documentation mentions that Torque X events can be logged and replayed for debugging.
But does it inlcude XNA device state information which might e.g. be wanted for multi-button actions using Microsoft.Xna.Framework.Input.Keyboard.GetState()?