With which class to start Test Driven Development of card game application? And what would be the next 5 to 7 tests?
- by Maxis
I have started to write card game applications.
Some model classes:
CardSuit, CardValue, Card
Deck, IDeckCreator, RegularDeckCreator, DoubleDeckCreator
Board
Hand
and some game classes:
Turn, TurnHandler
IPlayer, ComputerPlayer, HumanPlayer
IAttackStrategy, SimpleAttachStrategy, IDefenceStrategy, SimpleDefenceStrategy
GameData, Game
are already written. My idea is to create engine, where two computer players could play game and then later I could add UI part.
Already for some time I'm reading about Test Driven Development (TDD) and I have idea to start writing application from scratch, as currently I have tendency to write not needed code, which seems usable in future. Also code doesn't have any tests and it is hard to add them now.
Seems that TDD could improve all these issue - minimum of needed code, good test coverage and also could help to come to right application design.
But I have one issue - I can't decide from where to start TDD? Should I start from bottom - Card related classes or somewhere on top - Game, TurnHandler, ... ?
With which class you would start? And what would be the next 5 to 7 tests? (use the card game you know the best)
I would like to start TDD with your help and then continue on my own!