Reply to Re: how do professional PHP developers handle defaults for function parameters?

Your name:

Reply:


Posted by Jerry Stuckle on 07/14/07 17:40

Dikkie Dik wrote:
>>> Do you think that documentation can be replaced by unit tests?
>
>> That's like asking if ice cream will replace airplanes. They are two
>> entirely different things.
>
> No they're not. Unit test demonstrate the behaviour of the code. Both
> the good behaviour and the bad. The accepting of a task, the rejecting
> if it, and even defaults and special environments.
>
> Any diagrams I have go with the unit tests. For a few good reasons:
> - There is no documentation. Even if there is, it is probably outdated,
> beyond reach of developers or has never existed. The real problem with
> normal documentation is that it is complete decoupled from the code and
> has therefore nothing to do with it. Even <language>Doc tags are usually
> wrong, as they are just comments and are therefore not compiled. The
> code is the documentation, as it is the only thing you can rely on to be
> accurate.

A project without accurate documentation is an incomplete project. All
the projects I've managed have had complete and accurate documentation.

And if the documentation is decoupled from the code, you have the wrong
documentation.

> - You run the tests before you start your work. So you see them. Every
> day. More than once a day. Your face is put into it, in the most heavy
> way that does not include violence. You know it exists. You know where
> it is. Hey, you might as well read them.
>
> For your info, unit tests are not a collection of red and green lights.
> They are a collection of self-explanatory tests, stating what input they
> offer, and what output is expected. AND they demonstrate that the code
> actually works that way. They also demonstrate "programming flow" like
> the need to call special initializers or disposers.
>
> Best regards

I've been programming for almost 40 years now, and consulting for almost
17 years. In that time I've managed a lot of multi-programmer projects,
and I've been involved in many more. I know what documentation and unit
tests are.

And you just proved by your very own statements that they are two
entirely different things.

And BTW - in my projects, all tests are written by an independent group
of testers - according to the documentation at hand. If the
function/class/module/unit fails the test, either the code being tested
is incorrect, or the documentation is incorrect.

Assuming, of course, the test itself isn't in error.

Obviously you've never worked on a project where documentation was a
priority. I know how it is - there are a lot of programmers in the same
position. But every project I've been on which is fully documented has
gone much more smoothly with fewer errors when they have full and
accurate documentation.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация