I’ve come to realize that my answers to life and the universe may vary from others. Sometimes I fall in love with my answers, but I’m nearly always quite open to ideas that differ from mine. In fact, I love the conflict in thought because it makes me re-think the original problem.
One such example is in my mind. Slightly mentioned in HWTSAM and described in detail in my chapter of Beautiful Testing is my approach to automation. When I write automation, I don’t think of test cases first. I may use a spec, notes from a spec, or just lot’s of notes in general to help me design test automation. I explore the component I’m testing– either manually, or in the debugger and create the tests as I develop the automation (skipping lot’s of design stuff because that’s not the point of this post). When I’m done, I prefer an approach where I extract the test cases from the test automation (either via c# attributes or export names or some other form of tagging meta data) and import theses test cases into the test case management system.
An alternate approach is to write the test cases first, import them into the TCM, then write the automation (optionally creating stubs automatically from the test cases). At first, I thought I didn’t like the idea at all, but I suppose it does force you to think about the details of testing up front (if that’s a good thing). One con that I haven’t resolved is what to do when the automation changes. With my approach, you just re-import the metadata. If you change the automation using the alternate approach, you probably need to update the TCM manually – but I suppose you could find a way to make that easy.
How about you – do you prefer one approach over the other or have an alternate approach?