Search:
|
Access:
» Unit Testing Using Test Driven Development (TDD)Related categories: High quality and secure programming | TDD | Unit Testing Joanna Nowakowska, Lucjan StappViewed: 9631 | Article date: 2006-01-19 11:27:40 Test Driven Development (TDD) solves many problems between developers and testers which concern unit testing. In this article the authors will show that code development following the TDD methodology is neither expensive nor time-consuming and greatly improves quality of the final product. They will begin by presenting a basic concepts of TDD, after which we will describe a simple experiment demonstrating the achieved effects. We will also present an example collection of tools facilitating preparation of modules adhering to this methodology.
Joanna Nowakowska is Quality Assurance Consultant at Rodan Systems S.A, where among her other tasks she is responsible for methodology of conducting unit tests. The first person in Poland who received the ISTQB Certified Tester Full Advanced Level certificate in March 2005. Co-founder of SJSI, a member of German Testing Board. Contact with the author: j.nowakowska@sjsi.org
Lucjan Stapp, PhD in mathematical sciences, is academic staff member of Warsaw University of Technology. He worked as a leader of project and quality assurance teams. An advocate of light-weight methodologies, also in testing. Co-founder of SJSI, chairman of the SJSI Revision Committee. Contact with the author: l.stapp@sjsi.org
Research conducted in the field shows that about 80 % of all errors made while developing software are bugs in code of particular components (the main source of bugs in software is project documentation - usually because of its imprecision, incompleteness, inconsistency, frequently-made changes etc.; here on the other hand we're talking about mistakes made directly in the software). As a consequence, their detection and correction should greatly affect the quality of the system being developed. As the same time, the cost of fixing a bug strongly depends on the moment the bug has been found. According to Barry Boehm, removal of a bug found during unit testing can cost up to several hundred times less than removal of the same bug after the software has already been shipped to the customer. Therefore, conduction of unit (component) tests greatly influences the quality of developed software. The main goal of conducting such tests is to dynamic, now-level verification of systems under tests (from hereafter referred to as SUT) at an early stage of course of a project. Having defined components of SUT such as modules, classes and their methods, one should verify correct operation of each of those components separately (in isolation) from the rest of the application.
Figure 1. The V model
What unit tests give us:
What is more, the classic V model (see Figure 1.) implies unit testing is the first stage of dynamic testing for developed software. In many organisations this leads to a conflict between the development and the testing teams regarding who should be responsible for preparation and execution of unit tests. On one hand, arguments exist for handing these tasks over to a programmer, as:
On the other hand, programmers do not want to test their own code because they think that:
Advocates of soft methodologies know a solution to this problem - namely, the methodology called Test Driven Development (TDD in short). Its application facilitates solving problems between the developers and the testers that concern uni testing. Nevertheless, it causes reluctance in many environments, including project and development team leaders, as there are always misgivings that its application would generate certain - high, possibly - additional cost and increase the time required to create code, with mediocre or no final effect. In this article we will show that code development following the TDD methodology is neither expensive nor time-consuming and greatly improves quality of the final product. In order to be well-understood we will begin by presenting the basic concepts of TDD, after which we will describe a simple experiment demonstrating the achieved effects. We will also present an example collection of tools facilitating preparation of modules adhering to this methodology.
|
|
Copyright C 2006 by Software Developer's Journal. All rights reserved.






SDJ Users:
Shopping Cart









