Re: Timeless Classics of Software Engineering

From: rem642b_at_Yahoo.Com <(rem642b_at_Yahoo.Com)>
Date: Thu, 19 Aug 2004 22:18:47 -0700
Message-ID: <REM-2004aug19-004_at_Yahoo.Com>


> From: "Phlip" <phlip_cpp_at_yahoo.com>
> Manual or automated unit tests?

Currently when I'm just writing software for my own use, nobody else ever looks at my code or runs it, it's all manual tests. I write a new function one line at a time, manually checking it's correct before proceeding to write the next line of code. At the top of the function are SETQs for the parameters to have canned values for testing purpose. When I finish writing and testing every line of code, I wrap it into a function definition, and comment out the SETQs at the start, so it uses the parameters as given instead of my canned test values. I then copy&paste the function declaration and those test SETQs, several different sets of tests in some cases, and edit the copy to yield a test function call, which I then immediately try. Then I comment out that test-call and leave it sitting permanently as such a comment immediately after the function.

But back when I was doing A.I. research at Stanford, working on an English language command-language for a simulated robot, I made a much more formal test rig, whereby I collected actual input to the parser and output from the parser, and when I ran a test it told me each place where the output wasn't the same as before, so I could check whethe those discrepancies were bugfixes or oops. I would expect something similar when coding for a company in the future. Also by making a test rig for each function, I could demonstrate day-by-day progress to my supervisor, hypothetically anyway if said supervisor were at all interested.

> > Are there any consumers interested in hiring me in this way?
> If you refactor your code together between each feature, and if your
> bug-rate is absurdly low, and if each feature makes you faster, then
> what's the problem?

I don't know anybody who has surplus money and who has any desire for me to write any software for them. No company in this whole SF bay area is hiring programmers. This recession has been running for a long time with no serious sign of let-up yet. I have only a few more months to find a decent source of income, or become homeless.

Oh, back on topic of testing: If more than one programmer works on the same function, then of course automated testing is essential! Received on Fri Aug 20 2004 - 07:18:47 CEST

Original text of this message