Thursday, July 14, 2011

Automated Testing: deletion before creation v.s. finally block (teardown, etc)

Deletion (if exist) before creation is the in general more recommended:

1.  Assuming that the Deletion logic is valid, the test cases should be guaranteed to rerun properly, even in case such as the Test run thread is forced to stop (JUnit stop button in Eclipse, anyone has not ever pressed?)


2. In some case, it is good to leave the data created/updated in the data store to assist test failure investigation.

No comments:

Post a Comment