2006-11-20

Odd thoughts about testing

Approaches promoted in TDD and something that many people consider to be unit tests are like apples and oranges. In Test Driven Development tests are the way of thinking, one cannot create a program without writing tests to it. To write tests before the code is easy, to write unit tests after it is boring, useless and very often impossible.

All kind of tests are important.

In the traditional TDD there is no loss of time for tests writing by definition.

I'm not used to think by tests. I can assume that it is hard for many people too.

Possibility of automate testing <= Low coherence <= Good architecture.
There is also the reverse chain.

To estimate the coherence from the tests point of view is more easy.

It is not necessary to test everything for early finding problems out. A complex problem that was not found in the low level as the snowball will grow to snow slide and bring dawn the most banal tests of the high level. But before the fixing you'll have to write the test, all the same :)

Tests are documenting errors. Write a test, fix a bug, run the test — it's a guarantee that neither you, nor your mates will trigger this backflash again (that is especially important during the refactoring).

Refactoring without tests <=> you have only yourself to blame

If after the refactoring test is not compiled it's a reason to let your team mates know about changes and ways of moving the old code.

Pre- and post conditions it is not automatic tests (emphasis is placed on any word to your taste). They still need a set of automated scripts.

Unlike homemade solutions unit tests are an industry standard of automated scripts design. There is support from IDE for them.

Tests automate the developer labor, supplement IDE with its specific functionality. Tests highlight the place of errors. Tests simplify debugging. One click and you are in the place of a problem.

There is no good code, there is a code which is easy to rewrite. Tests are one of ways of achievement of ease.

There is a separate chapter in Lingvo - "Easy-to-test"

The main thing is brain, still tests do not guarantee success.

The four large letters IMHO before each peremptory statement about the software development can be dropped only in a personal LJ.

No comments:

Post a Comment