Tuesday, February 10, 2004

Note to self: Acceptance tests don't replace Unit tests!

I have been developing a lightweight project management tool. This is the first real WinForms application I have witten. One aspect of the functionality I wanted was for the customer to be able to specify acceptance test scripts and run them to see progress of the functionality. By way of a bootstrapping experiment I have been developing this application Acceptance-test-first. The problem I keep having is that once I have the acceptance test in place, I am getting very lax about writing the supporting unit tests. The effect on the application is that the codebase is turning into a pile of fettid dingo's kidneys. Without the unit tests there the design is not being driven.

I am finding the acceptance tests are really useful. Developing the framework to run them is however taking up a lot of my development time. I can see the benefits, and I am even able to test how the GUI pretty well.

I plan to make my Winforms Acceptance test running framework available soon. Espeically if there is some interest in it. Currently it is usable in several diffrent forms. There is a class you can call methods on like PressButton("Add"). There is also a script interpreter that understands a simple scripting language. eg. ":PressButton Add". Basically it allows you to instanciate a form, and perform commands on the form. The commands give you the ability to ask a dialog questions like "Is field 'title' enabled" or "Does field 'Description' have the value 'Ooow look a description'". You can also exercise the controls in the form with commands like "Press button with the text of 'Add'". This is very extencible, and only currently supports the types of controls I have been using. Namely text boxes, tree controls, buttons and menues.

If you wish to hear more about this, email me.

Update: I have halted development in favor of using NUnitForms.

I may integrate the two ideas later.

No comments:

GitHub Projects