connect four (game)

nospam.Chris Angelico rosuav at gmail.com
Sun Nov 26 21:38:00 EST 2017


On Mon, Nov 27, 2017 at 1:55 PM, Michael Torrie <torriem at gmail.com> wrote:
> On 11/26/2017 07:11 AM, bartc wrote:
>>> You may argue that testing doesn't matter for his small game, written
>>> for his own education and amusement.  The fact is that software in
>>> general is of abysmal quality across the boards, and promoting a habit
>>> of unit testing is good, even for trivial, home-grown stuff.
>>
>> I thought people were being hard on the OP.
>
> I wasn't being hard on the OP. My observation is about the state of
> *all* software.  My software especially, your software, Microsoft's
> software.  It all is of rather poor quality compared to the rigors of
> other industries like civil engineering, manufacturing, etc.

Not all software is poor quality compared to all examples of those industries.
You'll find the equivalent of software bugs in a lot of hardware situations;
the difference with software is that we have 100% perfect reproduction in the
end-user products, so we call it a design flaw instead of a production
artifact. (How often do you buy a box of something and find that a couple of
them just break?) Even in large-scale civil engineering projects, there are
plenty of stupidities. The house I'm living in has a place where the tiled
floor doesn't quite align with the wall that it meets, and I can't figure out
why; somewhere, two things that ought to have been parallel just aren't.
Bridges have been known to crack, cars break down for no good reason, your
hamburger just doesn't taste right today.

Aviators have pinned down the best solution to this, I think. A pilot is not
expected to be perfect; he is expected to follow checklists. A preflight
checklist. A departure checklist. A landing checklist. Everything that needs to
 be done right is mentioned on the list, and you just go through the list and
make sure you've done everything. Interestingly enough, that approximately
corresponds to unit testing (or maybe integration testing) - you design a suite
 of tests, and every time you do something, you make sure all the tests pass.
Neither test suites nor checklists can prevent all problems - but they CAN
prevent the same problems from cropping up again and again. (Which is kinda
important when you're dealing with airliners carrying hundreds of people. They
crash very rarely because the crew follow their checklists religiously, and
when they do, there's an investigation that can result in new tests being
added.)

ChrisA




More information about the Python-list mailing list