Test Driven Development (TDD) as a part of agile methodology

Software (especially Python) developers know that there are a lot of complications on the way to the production code and even more after adding changes to it. This is the reason why more and more businesses start to shift to agile technologies and test-based practices for software developing.
Test Driven Development (TDD) is a software development methodology that demands writing of tests prior to the writing of application code. TDD fundamentally changed approach to the developing process and started applying tests not only for the verification of the written code, but as the first and essential step of application building. TDD helps developers to concentrate on the small consecutive functional parts that working together will result into solid and fail-proof application code. Python syntax becomes even more reliable and maintainable.

Red-Green-Refactoring


TDD is a set of strict cyclic actions:
    Test Driven Development
  1. Write a test. 
    Programmer must fully understand the app requirements and divide them into the most simple parts. Each test must concern very limited scope and describe only one feature that needs to be implemented.
  2. Run the test and make sure it fails. 
    Since test is written before the actual code exists, it will definitely fail. It is essential to run all the tests and verify that only the newest one fails. It is a proof that all previously written code is working correctly. Moreover, this step will ensure that test doesn’t pass mistakenly, still requires a new code, and tests the right feature.
  3. Write just minimal code to make the test pass. 
    Programmer on this stage writes the bare minimum of code to implement the feature and pass the test successfully. This code is not final and will be modified on the next stages.
  4. Pass all tests. 
    The developer checks if new test along with all previous ones succeeds. This step verifies that written code meets all test requirements and doesn’t cause any other tests to fail.
  5. Refactor your code. 
    Refactoring is the process of code restructuring and optimization. Code is made simpler and more comprehensible.TDD encourages and aids refactoring. In this way code guidelines are met and code is neatly organized at the same time.
  6. Repeat the cycle and add new test. 
    Programmer produced a working code for a certain feature. But test-driven development is a cyclic process and programmer needs to define a new feature and start the process by writing a new test for it.
TDD is also called Red-Green-Refactoring micro-cycle, since most testing tools give red when test fails, green - when it passes and use refactoring to clean up the code. By repeating this steps, developer ensures that all code lines are used to perform tasks they were designed for and won’t add irrelevant functionality or dead code (code that is written in application but is never executed). With TDD programmer receives feedback from code almosts immediately and it is always more productive to find that something is not working on the earlier stages of the development than after the app is deployed to production.
The advantages of TDD approach are numerous:
  • Test coverage. Every code line is executed, tested and used in application. There are tests for all production code that can be run at any time and verify that code changes don’t intervene with the work of application.
  • Valuable documentation. Since the tests describe how the app should work and ensure that code meets requirements, it can be a form of documentation. Usually tests are simple to read and unambiguous. They can’t be outdated because production code passes them.
  • User-friendly. When programmers write tests before the code they have to put themselves into user’s shoes and make an API easy and convenient to work with. It improves the resulting design and helps to achieve aim using the shortest path.
  • Shorter debugging time. When programmer has a test and uses it every few steps, the code has fewer defects and debugger is used less frequently that improves code quality and reduces time for debugging.

Test-driven development results into software solution with tested and productive code in any language, e.g. Python, JavaScript, etc. Each TDD step improves and extends the application, maintaining all available functionality at the same time. TDD as a part of our Agile development methodology is certainly a way in which high-performance applications should be developed.


.

Python Development

Testimonials

It is a pleasure working with the Plone developers at Quintagroup. They are very knowledgeable, efficient, and customer-focused. I have found Plone to be a powerful and user-friendly Content Management System.

August 13, 2013
Robert Loftur-Thun

Wonderful Plone developers. Fast, efficient and very knowledgeable.

August 12, 2013
Jason Atwood

Thanks a lot... I've always appreciated the level of services provided by your company, I'm a big fan and shall continue to advertise your services among my fellow Zope developers!

Nov 30, 2011
Dominique Trembloy

I have used a Plone site environment hosted by Quintagroup to develop a workflow application for my business. Since January 2010 ... I have been a customer of Quintagroup and I am very happy about the good and reliable service, including update of the website to version 4.1 of Plone.

Apr 20, 2011
Maarten de Vries
www.insolweb.info

...I was a very satisfied customer for 7 years. They made sure that my website was always up, even during a couple episodes of being "slashdotted", and fixed the very few problems that I had in record time. This is a very professionally run outfit...

Feb 14, 2011
Mario Butter

http://silent-tower.org

I just want to thank each of you for your work... My business has increased and my anxiety level has been lowered since using Plone...It's been such a pleasure working with a professional and intelligent group like your.

Tom Parish
http://tomparish.com

Follow