473,320 Members | 2,024 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Spelling mistakes!

I've spent hours trying to find a bug that was a simple spelling
mistake.

in an init method I declare a variable self.someLongName

later in a different method of the class I use
self.sumLongName
Now I really meant self.someLongName.
In fact I don't want a variable called sumLongName.
Frankly how are you ever to know if this type of error is occuring?

Jan 6 '06
53 3880
Op 2006-01-11, Hans Nowak schreef <ha**@zephyrfalcon.org>:
Antoon Pardon wrote:
Op 2006-01-10, Terry Hancock schreef <ha*****@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. :-)


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
Jan 12 '06 #51

Antoon> But now we are back to my first doubt. Sure unit test will be
Antoon> helpfull in finding out there is a bug. I doubt they are that
Antoon> helpfull in tracking the bug (at least this kind).

This thread seems to be going in circles. Maybe it's time to simply drop it
and move onto other things. The clear evidence from people who admit to
having practical experience using unit tests (or pylint or pychecker) is
that catching misspellings is an extremely shallow bug to find and fix if
you use the tools at your disposal.

Skip
Jan 12 '06 #52
On Wed, 11 Jan 2006 06:57:06 +0000
Steve Holden <st***@holdenweb.com> wrote:
Terry Hancock wrote:
[...]

The ideal of "don't repeat yourself" seems to get
nudged out by "repeat yourself exactly once" when it's
really important to get it right. ;-)

I suppose most readers aren't old enough to remember the
punch card days, when you would hand your work in on
coding sheets to the punch room and it would be punched
onto cards using huge machines (anyone remember the 026
and 029 punches?).


Punch cards were still in use for students at The University
of Texas as late as 1986, so I'm old enough to remember.
(Yes, the CS department had terminals and editors, but some
classes still required cards -- I guess it was supposed to
"build character" ;-)). However, I wasn't a CS student, so
I never had to use one. ;-) We had VT-220 terminals in the
Astronomy computer lab, which is where I first learned to
use Unix, Fortran, and other fun things. :-)

--
Terry Hancock (ha*****@AnansiSpaceworks.com)
Anansi Spaceworks http://www.AnansiSpaceworks.com

Jan 13 '06 #53
Op 2006-01-12, sk**@pobox.com schreef <sk**@pobox.com>:

Antoon> But now we are back to my first doubt. Sure unit test will be
Antoon> helpfull in finding out there is a bug. I doubt they are that
Antoon> helpfull in tracking the bug (at least this kind).

This thread seems to be going in circles. Maybe it's time to simply drop it
and move onto other things. The clear evidence from people who admit to
having practical experience using unit tests (or pylint or pychecker) is
that catching misspellings is an extremely shallow bug to find and fix if
you use the tools at your disposal.


I have no problem with the statement:

"Spelling errors are easy to fix if you use the tools at your disposal."

But that statement doesn't limit the tools to unit testing.

--
Antoon Pardon
Jan 13 '06 #54

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: English Teacher | last post by:
Which would be a more useful language to learn, Smalltalk or Pearl? Learning curves any different? Thanks!
10
by: gnat | last post by:
Hello c.l.c, Are there any spell checkers out that will go through C code and tell me if i have misspelled anything that is in between quotes (ie. data that may be shown to the end user)? --...
3
by: Peter | last post by:
Hello! I'm trying to implement a method, that checks spelling of a text and suggests corrections. The C# program looks like: ... Word.Application spellApp = new Word.Application();...
8
by: Nick 'The Database Guy' | last post by:
Hi, I am fully aware of the F7 spell check in access, and I am also aware that this can be automated with the statement, SendKeys "{F7}" However when you do this you are presented with a...
4
by: lyle | last post by:
Sometimes before clicking "Post" I copy my message, open Word and paste. Word is excellent, and can suggest synonyms and translations. But it takes a while for Word to open. Recently, I've been...
1
by: zafar | last post by:
Hi, I want to make a personal digital library, For that I need make a search engine, User can search by giving the key words, but the spelling of given key word may be incorrect, so It is needed...
2
by: knkk | last post by:
Hi, I came across this perl script someone wrote for spelling suggestions when someone types a wrong spelling. Can someone please convert it to PHP? It will help a lot of people. I am attaching...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.