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)

4
votes
4answers
927 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
851 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 ...
17
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
312 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
1k 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 ...
42
votes
14answers
4k 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 ...
66
votes
19answers
7k 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
193 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
580 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
854 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
274 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
515 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
367 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
653 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
492 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
558 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 ...
7
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 ...
31
votes
9answers
6k 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)?
36
votes
6answers
6k views

Good example of complex code using TDD [closed]

What would be a good example of the use of TDD in large, real-life, complex, projects? All the examples I've seen so far are toy projects for the purpose of a book or a paper... Can you name an ...
26
votes
11answers
2k views

Writing the minimum code to pass a unit test - without cheating!

When doing TDD and writing a unit test, how does one resist the urge to "cheat" when writing the first iteration of "implementation" code that you're testing? For example: Let's I need to calculate ...
8
votes
2answers
543 views

What is the role of a Software Architect in the Test-Driven Development process?

As I understand it, Test-Driven Development is about writing tests to define the program specifications (you can correct me if I'm wrong). If there is someone responsible for writing the ...
14
votes
5answers
1k views

Whats the real overhead of TDD once the entire team is used to it?

What percentage of time is saved and costed doing TDD. I assume this percentage of cost and reward changes during a projects life-cycle. I'd imagine the initial phase has a lot more cost but little ...
9
votes
3answers
602 views

Is it a good idea to do TDD on low level components?

I'm considering writing a low level driver or OS components/kernels. The osdev.org folks seem to think that the important bits are not meaningfully testable this way, but I have read some discussions ...
12
votes
3answers
791 views

TDD for batch processing: How to do it?

I like "red/green/refactor" for RoR, etc. just fine. My day job involves batch processing very large files from third-parties in python and other custom tools. Churn on the attributes of these files ...
25
votes
5answers
3k views

I want to start using TDD. Any tips for a beginner? [closed]

I never used an automated test mechanism in any of my projects and I feel I'm missing a lot. I want to improve myself, so I have to start tackling some issues I've been neglecting like this and trying ...
39
votes
9answers
1k views

How to test the tests?

We test our code to make it more correct (actually, less likely to be incorrect). However, the tests are also code -- they can also contain errors. And if your tests are buggy, they hardly make your ...
7
votes
8answers
757 views

Why isn't TDD part of programming lessons at school [closed]

My daughter and my son are learning Java with BlueJ. I really don't understand why the first thing they learn isn't to write code to bring a testcase to green light.
29
votes
7answers
1k views

Unit testing newbie team needs to unit test

I'm working with a new team that has historically not done ANY unit testing. My goal is for the team to eventually employ TDD (Test Driven Development) as their natural process. But since TDD is ...
4
votes
4answers
6k views

What does Software Engineer in Test do? [closed]

Normally unit tests were written by developer who write the code, i.e. Test Driven Development. So what does Software Engineer in Test do?
10
votes
3answers
207 views

How do you efficiently keep your tests working as you redesign?

A well-tested codebase has a number of examples, but testing certain aspects of the system results in a codebase that is resistant to some types of change. An example is testing for specific ...
9
votes
5answers
1k views

How do you keep your unit tests working when refactoring?

In another question, it was revealed that one of the pains with TDD is keeping the testing suite in sync with the codebase during and after refactoring. Now, I'm a big fan of refactoring. I'm not ...
29
votes
5answers
5k views

What are the disadvantages of test-first programming?

It's all the rage nowadays. "Everyone" recommends it. That in and of itself makes me suspicious. What are some disadvantages you have found when doing test-first (test-driven) development? I'm ...
28
votes
5answers
2k views

Test driven development - convince me! [closed]

I know some people are massive proponents of test driven development. I have used unit tests in the past, but only to test operations that can be tested easily or which I believe will quite possibly ...
29
votes
4answers
1k views

Are there areas where TDD provides a high ROI and other areas where the ROI is so low that it is not worth following? [closed]

Test driven development. I get it, like it. But writing tests does require overhead. So should TDD be used universally throughout the code base, or are there areas where TDD provides a high ROI and ...