|
From: David H. <em...@da...> - 2006-11-28 21:29:10
|
Luke, If you don=B9t mind all my n00b questions, I=B9ll keep asking them! I will prefix them with =8CASUnit 101=B9 and then I and others can find them later. I have ASUnit installed and working, and my app structure is like this: /assets --> for images and other compile time assets /deploy --> for SWFs, HTML, XML, and other runtime items /source --> FLA and classes /test --> ASUnit framework and test harness code The app I am building is a room layout tool; users can lay out walls, and arrange room objects like furniture and cabinets. The output is an XML-base= d description of the room and a series of area measurements. I have a rough MVC structure planned, as well as an object model. But where do I start with my test-code-simplify cycle? It seems that every object requires something that would come from another object, and if I wan= t my tests to mirror real-world conditions (which they should do, yes?) I nee= d to create those objects first and then use them in my later tests. Should I start at the top, with my main application class, and work inwards= , or should I start with my smallest classes (like Polygon, which will be use= d by the Room object), and build out, adding new classes as I need them? I ask because it already seems like a lot of extra work. I don't know how t= o think of it in test-first terms yet. Normally I would just sketch out my MV= C structure, and then jump into building it, using trace() to check my work a= s I go. But now I am trying to think of tests for each little method and property, tests that will become part of the permanent test harness, and it's such a different way to think that I am sort of stymied by it. I understand that TDD is supposed to provide a more understandable and maintainable app, a leaner codebase, and an automated test suite, at the expense of a little extra time and extra code produced, in the form of all the test cases. I am just confused as to how to start As always, any help you or others can provide is greatly appreciated. I wil= l adapt what I learn and put it in the wikiBook. OK DAH BTW, I am trying to follow the Test First Guidelines as described here: http://xprogramming.com/xpmag/testFirstGuidelines.htm |