How Would BDD Effect an Application's Efficiency?

190 Views Asked by At

I'm contemplating using BDD for a personal project of mine. However, it is a video game (a bio-sim game at that, coded in C# with XNA) and I'm not sure that the modularity BDD enforces would be beneficial in terms of run time.

Basically, the user needs to be able to speed up the simulation as fast as imaginably possible in order to traverse time more quickly; the faster the better. Thus, processing speed is critical, and I debate using BDD because modularity implies more function calls (I know, we're talking low level). However, I want to implement both an evolution and AI mechanic, and well... with so many interconnected engines, a suite of tests could easily save me a LOT of debugging.

Can anyone give me an informed opinion as to how appropriate BDD would be in this situation? Any recommended alternatives (besides finding more sane things to do with my time)?

Thanks

2

There are 2 best solutions below

2
On BEST ANSWER

BDD has (almost) nothing to do with application efficiency. What you're really asking is if a modular design can be high-performance enough for your needs. Now this is a very though question to answer, but I presume yes, because the basic outline of your design (modular approach, testable components, separate AI, etc...) doesn't differ a lot from the outline of most game engines I know.

The .NET JITTER will help you a lot in making your game run more efficient, stuff like in-lining small methods so that you don't have to worry about the call overhead. (as long as you're targeting the PC, the .NET Jitter on WP7/Xbox360 doesn't do this)

While programming and profiling you will most likely discover that your game has some sort of critical path that limits your performance, once in a very far stage of programming, try to asses if the performance is good enough, then use good profiling tools (like ANTS) to optimize this critical path (and only the critical path).

0
On

BDD isn't particularly well suited to performance tests. What you could do with a BDD tool is use it to explore and capture the functionality, irrespective of performance, then use a more traditional performance testing tool as Roy mentions above to improve performance.

BDD isn't really about testing. The scenarios help to support conversations, which help you discover misunderstandings between the development team members and various stakeholders. You can then capture the scenarios you discussed.

In your situation, it looks like you really are testing, rather than exploring what it is you need to do. For that, look to traditional test tools, rather than BDD ones.