On 2 Feb 2012, at 09:50, Romain Tribes wrote:

> Hello,
> 
> I'm writing webgames with Rails and I want to test my code (and even TDD) but 
> I'm really stuck figuring what to test.
> I read a lot of articles on the subject but I still don't know what to do in 
> my case: how to start?
> 
> For instance, a simple interaction in most game: a character attacks another 
> one. What should be tested?
> With words, here is what I can say about an attack:
> 
> It's an action from an attacker to a target.
> The attacker may have a weapon and the target may have an armor.
> In order to be successful, the attacker must hit the target, according to the 
> combat skill of each actor and the precision of the weapon.
> When the target is hit, it receives damages according to the attacker power, 
> the weapon damages and the resistance.
> A part of these damages may be absorbed by it's armor.
> So, what could my specs be with that? I really can't start… :(

Have you started to design a domain model for this? Could we see a picture?

cheers,
Matt

--
Freelance programmer & coach
Author, http://pragprog.com/book/hwcuc/the-cucumber-book
Founder, http://www.relishapp.com/
Twitter, https://twitter.com/mattwynne


_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to