I use Test Driven Development in the Seaside application I played with, and all my data is stored as objects in the image (as opposed to the database).
Therefore, when I run my tests, I had to be careful to store real data before it is broken by test data, for example:
ToDoTest>>setUp
savedTasks := Task tasklist.
Task deleteAllTasks.
savedProjects := ToDoProject projectlist.
ToDoProject deleteAllProjects.
savedPeople := Person peoplelist.
Person deleteAllPeople.
and
ToDoTest>>tearDown
Task tasklist: savedTasks.
ToDoProject projectlist: savedProjects.
Person peoplelist: savedPeople
The problem occurs when my tests fail, which of course they do, a debugger pops up, and I can fix it, but tearDown does not always cause a call, and therefore I can lose my real data.
I save the data in files, so this is not a huge problem, but it is not as smooth and automated as we would like.
Anyway, can I improve this?