Stewart Stremler wrote:
Regression testing. Putting a framework of testing in place is a good
way to verify bugs... when a bug report comes in, you write a test that
would recreate the indicated problem.

Yeah, that's what I was thinking. It seems I often modify something and end up breaking it and it becomes difficult to track down.

For each function you define, you create the appropriate environment,
create the input data set if any, make the call, and check the output
and changes to the environment.  This can get painful if side-effects
are relied on -- but you're playing with functional programming now,
so you should be minimizing the side-effects by habit, yes?

Well, I am mostly just reading about it. Have not really coded anything really functional. But avoiding side effects does sound like a good idea.

It also helps with some of the OO viewpoints -- instead of passing in
a string parameter that contains a filename, you can pass in a file
object (or better yet, a stream).  That way your unit tests can pass
in an instrumented object, and your production code doesn't have to.

This is strictly procedural structured code at the moment. I have been wondering how to best take advantage of OO for this.

It's _hard_ to insert unit-testing after the fact, as the design and
implementation of code that wasn't designed to be tested is, oddly
enough, difficult to test.

Fortunately this is still a small project so it should not be that hard. I just need to figure out the best way to go about it.


--
Tracy R Reed                  http://ultraviolet.org
A: Because we read from top to bottom, left to right
Q: Why should I start my reply below the quoted text

--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to