Test driven development

Valentin Kozhevnikov, Senior Software Project Manager at Archer Software, Smartling Project

 

Test Driven Development: Our Story 1

 

Plenty of discussions is going on around writing tests for the code before writing the actual code. This practice is commonly known as Test Driven Development approach (TDD) – also called Test First Development methodology (or Design Driven).

Why this practice arises such a big interest? What advantages of test driven development can the developer make use of?

We asked our Project Manager, Valentin Kozhevnikov, about TDD and the Archer’s  experience with it.

 

Q: What is TDD?

A: TDD as a part of Agile methodology became popular around 2003.

TDD is a software development approach where automated unit tests are used to drive the design of software. The result of using this practice is a comprehensive suite of unit tests that can be run at any time to provide feedback that the software is still working.

Unlike in traditional software development approach, first the tests are written by a developer to ensure that the new feature does not exist. Only after that the code is written.

TDD cycle can be represented by a following scheme:

 

TDD enables a developer to repeat a very short development cycle every time while writing software.

  • add a test, get it to fail, and write code to pass the test

  • remove duplication

These are two basic rules minutely uncovered and illustrated by examples in Java and Python in ‘Test driven development: by example’ book by Kent Beck. As a general rule TDD can be successfully applied with any of modern programming languages be it Ruby, PHP, .Net or и node.js, appropriate frameworks and libraries exist for each.

 

The other aspect of TDD notably manifested in agile test driven development is that TDD approach induce the developer to shape the requirements in details before creating functional code (refer Martin, Newkirk, and Kess, Agile Software Development, Principles, Patterns, and Practices).

 

Q: What were the challenges faced by Archers’ team while switching to TDD?

A: To successfully adopt TDD methodology it has to be the primary focus of the whole business – from CTO to developers. Everyone in the team has to understand all Pros and Cons of this advanced technique. In our case we have strong belief in this approach on all levels, from our CTO to development team.

Our app was already live when we decided to follow TDD principles. For the app that was already running, we needed significant investment of efforts and time to get an existing features covered by tests.

Now, after half a year, we have all new features created covered by test, and legacy part covered for more than 70%.

 

Q: What are the benefits that our customer gained from using TDD in comparison with initially employed approach?

A: TDD methodology brings the following advantages:

  • The costs of support and development of the application significantly decreased .

  • The suite of unit tests provides constant feedback that each component is still working.

  • Increased ownership and responsibility of the developers. We have no QAs now, quality is fully supported by developers and product owners.

  • Improved productivity of the developers.

  • Decreased time-to-market of the new features (for the app that is already live).

  • Improved quality of the final product, reduced debugging time.

 

Q: Where we can learn more about Archer’s experience with adopting TDD practices ?

A: In Archer Software, we use TDD methodology at several projects: Smarting, Musketeer and others.

Our colleague Katya Kameneva will share the details of our TDD journey  in presentation “How I lost my QA job” at JAVADAY Summit in Kiev in October 17-18, 2014