57825Re: [SCRUMDEVELOPMENT] TDD effectiveness
- May 28, 2014I'll just add that a significant number of people using TDD use it "too big." What I mean is...- They write an API call test that fails.- Then they write 500 to 2,000 lines of code to implement the API call.- Then the test passes.TDD is intended to be done on a much smaller scale than this typical example. The cycle of "writing a test that fails, write code so the test passes, refactor" should happen several times per hour, at least.TDD is not a way to build an API or entire module test harness. It is supposed to help all along the way as the code is designed and written.AlanOn Wed, May 28, 2014 at 10:29 AM, Adam Sroka adam.sroka@... [SCRUMDEVELOPMENT] <SCRUMDEVELOPMENT@yahoogroups.com> wrote:
TDD lets me write a test that uses the API I want to create. So, it is a design/specification technique.Once I have the tests I can run them anytime something changes to make sure it still works the way I expect. So, it is a validation technique.Any small change I make will either pass all the tests or break one or more of them. If I only change things in ways that pass all the tests I can modify any code I want safely. So, it is a way to write clean code and maintain it.TDD tests are programs written in code, and the modules they touch are pieces of programs also written in code. So, it is a programming technique.To say that TDD is only one of these things, or that it is different things depending on the context, misses the bigger picture of what TDD is allowing you to do safely.
On Wednesday, May 28, 2014, gec929@... [SCRUMDEVELOPMENT] <SCRUMDEVELOPMENT@yahoogroups.com> wrote:
While I agree with Markus in general, it's important to understand the goal of TDD for your project...
TDD is an evolutionary approach to development which combines test-first development where you write a test before you write just enough production code to fulfill that test and refactoring. So what is the primary goal of TDD? One view is the goal of TDD is specification and not validation. In other words, it’s one way to think through your requirements or design before your write your functional code, implying that TDD is both an important agile requirements and agile design technique. Another view is that TDD is a programming technique (it seems this is your goal), to write clean code that works. I think that there is merit in both arguments, however, I think the goal may be different in different situations. For example, brand new project on a brand new product vs. enhancing existing product/s or service/s.
- << Previous post in topic Next post in topic >>