[Twg] stand alone testing

Bruce Korb bruce_korb at xyratex.com
Tue May 15 16:16:11 UTC 2012


On 5/15/12 9:02 AM, Chris wrote:
>>   1. Do we want to have an ability to run each test independently?

Yes.

>At first I thought this was a good target but actually after some
>thought I think quite the opposite is true.
>
>Having each discrete step a separate test is very useful, for example.
>
>test 1: create a file
>test 2: rename the file
>test 3: chmod the file
>test 4: test file can't be deleted
>test 5: copy the file to file2
>test 6: compare file to file2
>test 7: chmod the file and file 2
>test 8: test file and file 2 can be deleted
>
>These tests are linked

Alternatively, these tests are one.  A test to verify "chmod"
on a renamed file would be in several phases:
   phase 1) create a file || die cannot create
   phase 2) rename it || die cannot rename
   phase 3) chmod it || die cannot chmod
   cleanup) remove file || report cleanup failure

This does not prevent any of these phases from being in a library
for use by any test, but it would mean that a given test cannot
presuppose that some other test had been run before it.

In order to reduce redundant testing, as an example you would not
want to regularly run the "create a file" stand alone test, given
that few other tests would go far if that feature were broken.
But there is too much confusion if every separately identifiable
test does not stand on its own.



More information about the Twg mailing list