Re: Simple Bouncing Ball Demo
Phlip <[email protected]>
| Newsgroups | gmane.comp.programming.test-driven-development,gmane.comp.programming.test-first-user-interfaces |
|---|---|
| Message-ID | <[email protected]> |
Kaoru Hosokawa wrote:
> When I write apps with GUI, I just can't wait to see
> what the graphic
> output looks like and so I tend to do as you do -
> write a bit of model
> and also a bit of the GUI. I also try to TDD the
> GUI. For your example,
> I would write a test like this. This is a test to
> test the creation of
> the PongPanel. You seem to do some setup in the
> constructor and with
> this test you can make sure that the setup is OK.
When I TDD GUIs, I also can't wait to see what the
graphical output looks like. So I often add a line
like this:
> public void testCreatePongPanel() {
> PongPanel pongPanel = new PongPanel();
> assertEquals(Color.yellow,
> pongPanel.getBackground());
> // ...
> assertTrue(pongPanel.isDoubleBuffered());
reveal(pongPanel);
> }
For each kind of GUI Toolkit, I research how to write
a robust temporary test function called "reveal()".
Then when I run that test suite, the window pops up in
its tested state. I can visually confirm that an
assertion on a graphical state is on-track.
Then I comment out the "reveal()" before integration.
=====
Phlip
http://industrialxp.org/community/bin/view/Main/TestFirstUserInterfaces
__________________________________
Do you Yahoo!?
Check out the new Yahoo! Front Page.
www.yahoo.com
------------------------ Yahoo! Groups Sponsor --------------------~-->
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/NhFolB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/testdrivendevelopment/
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/