[Lula] Intermediate C class in the LA area?
Peter Benjamin
pete at peterbenjamin.com
Mon Jul 30 21:22:12 EDT 2007
At 05:37 PM 7/30/2007, you wrote:
>I understand that framework well enough -- what I'm stuck on is
>deciding what permutations would be necessary to test.
Write code that generates them all.
Then feed them all into your software.
And if you also hand build the expected results,
this is called "unit testing" and building the
test environment first, before coding, is becoming
a common practice, for software that has a long
life, and many changes each month, so that new
bugs are caught as created and the customer never
sees them. Java is known for this.
>The ones I've
>come up with so far are:
It's a good list. Even better that you are thinking
of even making such a list, as that I have found is
the single most "KEY" ingredient in successful
programmers. That you actually make such lists,
and do so on a daily basis for code design, and
for testing. A programmer who can not do this will
always have buggy code. A programmer who can make
exhaustive and comprehensive list is getting to the
point where they can write bug free code, every time.
It's a rare skill. Definitely turn your list in as
comments in your source code. Get extra credit for it.
>text, then cat ~/foo | ./entab | ./detab | cmp - ~/foo is true),
The above can be written for each test case, likely about
30-50 test cases, and a single "report" page would have
all "true" listed.
>should examine... I get lost.
Not if you make a list, or if you study the mathematical
theory behind combinations and permutations, then you can
create a complete list of all possible cases, and test
them all.
>I think the code I have works *some of the time* -- it's those last few
>cases I can't figure out how to get a handle on...
Have you looked into "regular expressions?"
They handle stuff like this in a few lines of code.
More information about the Lula
mailing list