Web Site

Economy-point.org



» Economics » Procedural model (software) » Topics begins with T » Test-driven development


Page modified: Friday, June 23, 2006 20:30:58

When one designates test-driven development (programming also test-steered, English test roofridge development or development, abbreviation TDD, sometimes also jokeful extremes Testing test driven) a Agile method for the development of a computer program, with which the programmers Software-Tests develop before that to testing components. Unit tests of the test-driven development are Grey box tests instead of White box tests. The probably most well-known Agile method is those extremes of the Programming.

Classical way tests are developed parallel independently after or to the system which can be tested. This can lead perhaps to the fact that the desired and/or necessary test cover is not obtained. Possible reasons for it are among other things:

  • Acute lack of time
  • Unsatisfactory testability (the system which can be tested possesses characteristics, which make testing more difficult)
  • Putridness and/or discipline lacking of the programmers
  • Firm politics forbid investment of non-functional program sections

A further disadvantage of classical unit tests than White box tests is the fact that the developer knows the system which can be tested and its peculiarities and thus possibly inadvertently "“around errors"” tests.

The test-driven development is a beginning, the reasons for a not sufficient test cover and unites disadvantages of the White box tests to work against.

Proceeding

The proceeding differs between testing in the small one (unit test, White box test) and testing generally speaking (systematical test, black box test, acceptance test).

With unit tests test stand and unit stand are parallel developed. Actual programming takes place in small micro iterations. Such an iteration, which should take only few minutes, consists of three main steps:

  1. Write a small test for the next which can be implemented. This test should not function.
  2. Fulfill the test with as little a code as possible, in order to return fast again to the "“green bar"” (all tests run).
  3. Clear up the code, in addition the distance of Duplikation, introduction of necessary abstractions and shifting of the code conventions belongs. A goal of this clearing up is the simple form of the code.

These steps are repeated until no more meaningful tests occur to the developer, which would fail and so that the unit is finished for the instant. The consistent conversion of this procedure leads to evolutionary Design, a draft style, which moves the constant advancement of a system into the foreground.

Because the individual unit test exhibits both characteristics of a White box test and a black box test, it as Grey box test are designated.

With systematical test those of systematical test before the actual system are developed or specified at least. Task of the system is not with test-driven development any more, in writing formulated requirements, but specified systematical test to fulfill.

In both cases great importance is attached to as complete an test automation as possible. For test-driven development it is necessary that all tests can be implemented simply ("“by push of a button"”) and as fast as possible. For unit tests that means few seconds, for systematical test usually maximally some minutes.

Apart from working against some disadvantages of the classical "“afterwards"” - testing possesses the test-driven development still some further advantages.

Considerable advantages are:

  • The fulfilment of the requirements becomes an easily measurable Metrik.
  • The unit tests are Grey box tests instead of White box tests.
  • The execution of Refaktorisierungen is afflicted with fewer errors (ideally error free).
  • The simple, fast execution of tests makes it for the programmers possible to work most time on a correct system.

Operational areas

The test-driven development is a firm component extremes of the Programming (XP) and other agiler methods. Also outside by XP it is to be found frequently in connection with pair programming.

Conversion

The substantial components of the conversion are:

  • Framework for test development
  • Framework for test automation
  • Framework for Build automation, e.g. CruiseControl

Into Java for it JUnit and Ant are usually used. For most other programming languages similar tools exist.

With the development of complex systems in those several components to co-operate must be developed, independently e.g. the development of an application of business the one data base as persistence medium used, to become Mock objects used, in order to be able to test individual components like e.g. the data base accesses without the necessary existence of a data base. The Mock object simulates the behavior of a data base with a fixed behavior in the case.

The test-driven conversion of acceptance tests and systematical test becomes for example by FIT ONE (Framework for Integrated test)] possible. A popular fIT-variant places fit-eats, a Wiki server with integrated tester position and environment of remark test.

Critical view

Programmers, still no experience in the test-driven development possess, find sometimes difficult or impossible the conversion. They ask themselves, how one is to test something, which is not yet present. That can to it lead that they neglect the test-driven development, what in particular with agilen methods like extremes the Programming difficulties or even the collapse of the development process can release. Without sufficient unit tests no sufficient test cover for e.g. Refaktorisierungen and the desired quality is reached. One can work against that with pair programming and training.

Related links

Literature


Articles in category "Test-driven development"

We found here 1 articles.

T

» Test-driven development

Related Websites

We found here 3 related websites.

Page cached: Wednesday, July 5, 2006 14:58:22
Valid XHTML 1.0!  Valid CSS!

Page copy protected against web site content infringement by Copyscape