Changing var names

Victor Subervi victorsubervi at gmail.com
Sat Jan 16 09:49:10 EST 2010


On Fri, Jan 15, 2010 at 3:47 PM, Phlip <phlip2005 at gmail.com> wrote:

> Victor Subervi wrote:
>
> > Should I re-write it in classes before testing units? Right now it's
> > very monolithic.
>
> The "Unit" in unit tests is a misnomer. It refers to an old QA concept, for
> high-end projects, that the failure of any test should implicate only one
> unit.
>
> We only need "developer tests". They help, when we change the code, to
> avoid excessive debugging. And to test a given method you must be able to
> access it, so tests force your code to be decoupled. But a test may call as
> many functions as it needs, regardless what "unit" they live in.
>
> If you don't have tests yet, then sometimes a rewrite is indicated (and
> sometimes it's very easy and will produce _very_ clear code!). But in most
> cases like yours the best advice is to write your next feature using "test
> driven development". Write the test first, get it to fail, then change the
> code as little as possible to get it to pass. Repeat until done,
> occasionally refactoring.
>
> If old code now works, just leave it alone. Until it needs a new feature,
> and then wham! it has tests.
>

:) k. Thanks
beno
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100116/0b89b014/attachment.html>


More information about the Python-list mailing list