TDD stands for Test-Driven Development, or Test-Driven Design. It is the practice of writing a unit test before writing code to satisfy it, in what is known as the Red-Green-Refactor cycle.

learn more… | top users | synonyms (2)

23
votes
8answers
2k views

Are “TDD Tests” different to Unit Tests? [duplicate]

I read Stephen Walther's article about Test Driven Development (TDD) and unit testing. I think it was an excellent article. The author makes a distinction between what he calls "TDD Tests" and unit ...
6
votes
7answers
367 views

Do you write unit tests for all the time in TDD?

I have been designing and developing code with TDD style for a long time. What disturbs me about TDD is writing tests for code that does not contain any business logic or interesting behaviour. I know ...
95
votes
10answers
4k views

TDD vs. Productivity

In my current project (a game, in C++), I decided that I would use Test Driven Development 100% during development. In terms of code quality, this has been great. My code has never been so well ...
8
votes
7answers
536 views

Acceptance tests done first…how can this be accomplished?

The basic gist of most Agile methods is that a feature is not "done" until it's been developed, tested, and in many cases released. This is supposed to happen in quick turnaround chunks of time such ...
14
votes
6answers
986 views

TDD: What happens before the first unit test?

I mostly understand the theory of TDD, but I can't figure out how to get started. I sit down to write a unit test for a personal project and realize . . . I have no idea what I am testing. What ...
3
votes
5answers
207 views

Should the test and the fix be written by different people?

There is a common practice in TDD to write a test before fix to avoid regression and simplify fixing. I just wonder what if the test and fix will be written by different people, total spent time will ...
15
votes
5answers
900 views

How are mock objects commonly misused?

I read an article recently which said that mock objects are often misunderstood and misused. Are there any clear mocking anti-patterns which I can look out for?
7
votes
3answers
694 views

Can you use UML in a TDD project?

If so, at what stage? or it is also an iterative process? If iterative, how formal? Also, how useful is UML for a solo programmer doing open source? While I like to see a picture of the system, it ...
5
votes
4answers
297 views

Unit Testing and .Net

Coming from a native development background, I'm used to my unit test runners outputting the file and line that caused the test failure. This allowed me to run the tests as a post-build step, and if ...
5
votes
10answers
474 views

Is is possible to do TDD without a test tool?

We want to implement a fairly rough outline of test driven development which involves a developer asking themselves the tests at each stage of the development process. I have read here that its ...
13
votes
3answers
7k views

Good unit test examples for embedded C developers [closed]

I'm going to be giving a talk to my department next week about unit testing and test-driven development. As part of this, I'm going to show some real-world examples from some code I've written ...
5
votes
5answers
333 views

An alternative to requiring red in TDD: reverting code change?

According to this answer to this question, a good reason for always starting with a failing test ("Red") is to make sure that the test is working and that the code that will be written is what makes ...
14
votes
6answers
1k views

Looking for Case Studies of How TDD Improved Quality and/or Speed of Development [closed]

At my company I am trying to make a case for why we should be doing TDD. Currently most developers just do whatever they can to get the project done, then go add unit tests after the fact in order to ...
10
votes
6answers
699 views

Starting new project with TDD

I'm studying TDD and I read that it also helps you to define the design of the app, correct? So I decided to start creating a new project to help me understand it better. I want to create a simple ...
7
votes
5answers
5k views

Learning Test Driven Development [closed]

If I want to learn TDD on my own, where would I start apart from the usual Google Search? Are there any books that you would recommend or any method that you followed to learn it on your own? I am ...
2
votes
3answers
342 views

What are the organizational benefits of TDD over functional development backed by unit tests?

I've heard of TDD as an organizational development paradigm, where all developers are asked to let testing drive development, and I've also heard of organizations who don't embrace TDD so long as unit ...
73
votes
13answers
8k views

When is it appropriate to not unit test?

I work in a small company as a solo developer. I'm the only developer at the company in fact. I have several (relatively) large projects I've written and maintain regularly, and none of them have ...
10
votes
2answers
2k views

Static is bad, but what about the Factory pattern?

I'm on a TDD project, so I try to stick as much as possible to the good pratices involved with that kind of development. One of them is avoiding as much as possible static and global. I'm facing this ...
6
votes
2answers
443 views

Ruby Koans: depth and usefulness? [closed]

Several people have suggested Ruby Koans to me over just following a book, and this seems like a much better prospect. As there is no question regarding the entirety of Ruby Koans, what do SO users ...
29
votes
5answers
2k views

How do you convince management to “invest” in unit tests?

How did you convince your manager to let you unit test? By "use", I mean being allowed to develop, check-in to source control and maintain the unit tests over time, etc. Typical management ...
11
votes
4answers
2k views

Should each unit test be able to be run independently of other tests?

Say you have tests for two methods of a class. The first method gathers data from another tier and puts it into some sort of storage independent of the runtime (such as a SQL table), so all of the ...
3
votes
6answers
4k views

C# Unit Testing In A Single Project

Alright, so I'm doing my first "real" C# project. I'm chugging along, enjoying myself, nice little language I've got here, fairly easy to use, la ti da. Then I get to the point that I realize ...
14
votes
6answers
615 views

Do abstractions have to reduce code readability?

A good developer I work with told me recently about some difficulty he had in implementing a feature in some code we had inherited; he said the problem was that the code was difficult to follow. From ...
12
votes
4answers
2k views

Resources for Test Driven Development in Web Applications? [closed]

I would like to try and implement some TDD in our web applications to reduce regressions and improve release quality, but I'm not convinced at how well automated testing can perform with something as ...
28
votes
7answers
9k views

Difference Between Unit Testing and Test Driven Development

From reading the descriptions, I understand that in TDD tests are done prior to writing the function and in Unit Testing, its done afterwards. Is this the main difference, or the two terms can't even ...
10
votes
5answers
6k views

What are the best resources for learning TDD? [closed]

I want to learn (and master) TDD. What are the best: books websites videos list of exercises personal words of wisdom for learning, appreciating, and using TDD?
4
votes
6answers
299 views

Newbie worried about CASE tool

I'm looking for some guidance on CASE tools and whether my concerns are valid. Recently I was in a meeting between my employer and an external software company which have a CASE tool currently in ...
4
votes
2answers
967 views

Is the difference between BDD and TDD nothing more than a vocabulary shift? [duplicate]

I recently made a start on learning BDD (Behaviour Driven Development) after watching a Google tech talk presented by David Astels. He made a very interesting case for using BDD and some of the ...
26
votes
5answers
20k views

What is an integration test exactly?

My friends and I have been struggling to classify exactly what is an integration test. Now, on my way home, I just realised, that every time I try to give a real world example of an integration ...
4
votes
4answers
1k views

Unit testing data access objects

I have recently started using test-driven development and unit testing, and it has paid off immensely in the areas where I have aplied it. One area that it has been helpful in is database access. When ...
6
votes
2answers
1k views

How would you TDD the functionality of getting the corresponding process of a running windows service?

Purpose Over the last year or more I've been learning unit testing via books I've read recently like The Art of Unit Testing, Working Effectively with Legacy Code, and others. I've also been using ...
16
votes
11answers
1k views

At what point would you drop some of your principles of software development for the sake of more money?

I'd like to throw this question out there to interestingly see where the medium is. I'm going to admit that in my last 12 months, I picked up TDD and a lot of the Agile values in software ...
8
votes
5answers
322 views

How do I check that my tests were not removed by other developers?

I've just came across an interesting collaborative coding issue at work. I've written some unit/functional/integration tests and implemented new functionality into application that's got ~20 ...
2
votes
2answers
1k views

Using JSTestdriver to test UI/DOM?

Can JSTestDriver be used to test DOM behaviors and interactions? I see I can write tests to exercise pure JS but how do I go about testing against HTML or DOM? Can I deliver with each test HTML for ...
18
votes
7answers
2k views

TDD/Tests too much an overhead/maintenance burden?

So you've heard it many times from those who do not truly understand the values of testing. Just to start things out, I'm a follower of Agile and Testing... I recently had a discussion about ...
44
votes
14answers
5k views

Does TDD really work for complex projects?

I’m asking this question regarding problems I have experienced during TDD projects. I have noticed the following challenges when creating unit tests. Generating and maintaining mock data It’s hard ...
71
votes
20answers
8k views

Why does TDD work?

Test-driven development (TDD) is big these days. I often see it recommended as a solution for a wide range of problems here in Programmers SE and other venues. I wonder why it works. From an ...
3
votes
7answers
195 views

Test code that will be changed soon

My question is whether I should test code that I know will be changed in a short time. I'm doing TDD in ruby, and I often meet with this question. I'm interested about best practices about this, pro ...
12
votes
7answers
596 views

TDD with limited resources

I work in a large company, but on a just two man team developing desktop LOB applications. I have been researching TDD for quite a while now, and although it is easy to realize its benefits for ...
10
votes
4answers
918 views

When should I use mock objects?

I've read a lot of things about TDD but I still have doubts. For example, I have these class diagrams: It's a simple example, just to learn about TDD and mock objects. Which test should I write ...
20
votes
8answers
1k views

What are the disadvantages of writing code before writing unit tests?

I have always seen the recommendation that we should first write unit tests and then start writing code. But I feel that going the other way is much more comfortable (for me) - write code and then the ...
2
votes
2answers
312 views

Testing website content with graphs

I'm looking for a way to test my webpages that have dynamically generated graphs (using such things like Google Graphs). Does anyone know if there are such tools that exist (perhaps Selenium would do ...
9
votes
6answers
587 views

test driven development - Who should write the tests?

Originally, it is the duty of the developer to write the test, but I noticed that in many cases/e-mature developers those cases are not giving even 80% coverage. How about I have a QA person dedicated ...
5
votes
1answer
379 views

The use of Test-Driven Development in Non-Greenfield Projects?

So here is a question for you, having read some great answers to questions such as "Test-Driven Development - Convince Me". So my question is: "Can Test-Driven Development be used effectively on ...
7
votes
5answers
688 views

BDD/TDD vs JAD?

I've been proposing that my workplace implement Behavior-Driven-Development, by writing high-level specifications in a scenario format, and in such a way that one could imagine writing a test for it. ...
6
votes
6answers
504 views

“Software features that can't be demonstrated by automated tests simply don't exist”— Is it too extreme a statement?

Kent Beck famously said that Software features that can't be demonstrated by automated tests simply don't exist But is this too extreme? I mean, I can't demonstrate that my UI really works, ...
9
votes
4answers
586 views

A new name for unit tests

I never used to like unit testing. I always thought it increased the amount of work I had to do. Turns out, that's only true in terms of the actual number of lines of code you write and furthermore, ...
9
votes
3answers
1k views

How does NUnit for C# compare with Unit Test facility integrated with Visual Studio

I need to work in a team to develop a mid scale Desktop application developed using C# .NET. Prior to this, I have not applied Unit Testing and Test Driven Development. I am aware that there exists ...
8
votes
6answers
1k views

Do you really have to do BDD/TDD in a test first manner?

Even though I haven't been in a TDD or BDD project, or I have been in some that say they are doing TDD but are pretty far from it, these are things that I think about and really try to read as much as ...
36
votes
9answers
7k views

Can you be Agile without doing TDD (test driven development)?

Is is possible to correctly call yourself (or your team) "Agile" if you don't do TDD (Test-Driven Development)?