Op 2006-01-11, Hans Nowak schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: > >> Op 2006-01-10, Terry Hancock schreef <[EMAIL PROTECTED]>: >> >>>In unit testing, you write the code, then write code to test >>>the code, which must correctly identify the methods in the >>>code. So you have to type 'everything' twice. >> >> But you don't type attribute names twice in unit tests, >> because attributes are in general implementation details >> that are of no concern to the tester. So unit tests can >> not introduce the redundancy to find out a missed spelled >> attribute in some methods. > > I wouldn't call attributes "implementation details", at least not in > Python. And while it is true that unit tests might not find the > misspelling *directly* (i.e. you rarely test if you have misspelled > something), your tests should definitely show unexpected behavior and > results, if that attribute is of any importance. Otherwise there's a > loophole in your tests. :-)
But now we are back to my first doubt. Sure unit test will be helpfull in finding out there is a bug. I doubt they are that helpfull in tracking the bug (at least this kind). -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list