Spelling mistakes!

Hans Nowak hans at zephyrfalcon.org
Wed Jan 11 12:15:32 EST 2006


Antoon Pardon wrote:

> Op 2006-01-10, Terry Hancock schreef <hancock at anansispaceworks.com>:
> 
>>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. :-)

-- 
Hans Nowak
http://zephyrfalcon.org/



More information about the Python-list mailing list