`

Thinking about TDD

 
阅读更多
 

What is TDD?

As we know TDD(Test-driven development) isa software development process that relies on the repetition of a very shortdevelopment cycle: first the developer writes an initially fialing test casethat defines a desired improvement or new function, then produces the minimumamount of code to pass the test, and finally refactors the new code toacceptable standard. The development cycle recemand by Kent Beck in ‘Test-DrivenDevelopment by Example’:

1.      Add a test to make thedeveloper focus on the requestiment before writing the code.

Run the test and see if the new one fails(Red in unit test)

2.      Write minimun amount(no furtherfunctionality should be predicted) of code to pass the test

Run tests trun green that all test case pass and developercan be confident the new code meets the test requirements.

3.      Refator code as the growingcode base must be cleaned up regularly to improve readability andmaintainability. The developer get comfidence by continually re-running thetest case throughout each refactoring.

In below diagram shows to you how toincrease a new feature in TDD.

图片

The Challenge

We know TTD can lead to more modularzied,flexible and extensible code and the ealy frqurent testing helps to catchdefects early in the devleopemnt cycle. But team member though it is defficulteven haven’t tried to learn. In the team(STP3), there are two parts of member infarimilar with TDD. One part(Part A) of person who know the TDD and eager to tryin project but they did not know how to start, other part(Part B) is they didnot know the concept of TDD and never practice. The reason why is hard for PartA to start is we learn simple example in book and following the simple stepsthat provided. We overly focused on the process without understanding therationale behind it. And TDD process give us very little guidance as to how topractice it. As we didn’t how to appropriately abstract our design, whichrequires in-depth knowledge of OO desing, pattern and refactor technique,etc.This is our bigest changelle to make TDD effective and success untill someof these gaps(foundation knowledge) are filled.

Approach and Plan

Before team start, we need understand themechanism of TDD. One class is required with kind of example to learn thebasics of the red-green-refactor process and why TDD works. This tutorial can helpthe new TDD pracititioners(Part B) a way to have a base background and guidethem start TDD.

As menation above, the challenge is lack offoundation knowledge or capiticality to make our TDD effectively. With the suggestionof cocah, team can set Coding Dojo as regualr events every two weeks. A CodingDojo is a meeting where a bunch of coders get together to work on a programmingchallenge. They are there have fun and to engage in deliberate practice inorder to improve their skills.During those series of events, individual needlearn and improve how to write better unit test, the principlesin of Refactoring,pair programming pratice and effective code review meeting. Team can desing acollaborative games to make more fun and promote a better learning enviroment.With that said, team need a half year plan that we can have in 2-week Dojo Gameto pracice. Below plan that team drafted with Agile Coach.

 

 

 

Jan

Feb

Mar

Apr

May

Jun

July

TDD-Coding Dojo

Tutorial of TDD

αversion of Dojo Game(two people who are enthusiastic about TDD)

βversion of Dojo Game(team can attend)

γversion of Dojo Game(GC group can attend)

The Coding Dojo is a forum for learning TDDand effecitve way to improve skill. With this approach the organization havehigher code quailty, team have a better learning enviroment and individual improvethe coding skill. We will find TDD well worth the effort.

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics