Ummm.. for Tetris, I could write tests (one by one) to:
- Give me an empty "board"
- Put a Piece X at position x,y, get its position
- Put a Piece X at position x,y, run a cycle, get its new position
- Put a Piece Y at position x1,y1, Put Piece X at positions ... all
invalids because they are on Y
- Put a Piece Y at position x1,y1, touching floor, put Piece X above, next
cycle, Y and X are in the same position
- etc...
It's not full TDD, but many test on a simple isometric engine JavaScript
(I skipped the test at browser side, I should learn how to do them, maybe
using QUnit or Jazmine?)
See the commits, I usually commit test (one by one))
A full TDD sample, chess, see the commit
Angel "Java" Lopez
@ajlopez
github:ajlopez
toggle quoted message
Show quoted text
On Mon, Jan 21, 2013 at 5:06 PM, sh <shvfn@...> wrote:
Matteo,
hm, I'm not sure I understand. When you imagine a simple game (Pong,
Tetris), what behaviour/class would you choose?
Michael,
thank you for this insight from your coders life.
Perhaps I do worry to much. I question the method before even starting.
OK, I'll try!
Colin, Dave, Josue,
I'll try to get a copy. "Growing" software sounds a lot like the aspect
I am interested in.
Thanks for the recommendation!
Am 21.01.2013 20:28, schrieb Josue Barbosa dos Santos:
+1
On Mon, Jan 21, 2013 at 5:27 PM, Dave Rooney <daverooneyca@...>
wrote:
**
+1
Dave...
On 13-01-21 2:20 PM, Colin Vipurs wrote:
I can heartily recommend reading "Growing Object Oriented Software:
Guided
by Tests". (
).
It walks you through the entire process, and unlike alot of literature
doesn't shy away from some of the more "hairy" problems. The entire
book
is pretty much an answer to your question
On Mon, Jan 21, 2013 at 6:05 PM, Matteo Vaccari vaccari@...
wrote:
**
On Mon, Jan 21, 2013 at 6:47 PM, sh shvfn@...
wrote:
Dear Listables,
...
For example I expect to end up with
- an engine class,
- a scene or context
- a renderer,
- an event- or signal/slot-system,
- an entity/component system
- etc, etc.
When I now start to write my first tests, I guess I start with the
engine class.
... I would not start with that. I would more likely start with the
test
of a simple behaviour of the completed system. Then I'd build just as
little as possible to make the test pass.
Matteo
------------------------------------
Yahoo! Groups Links