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)

7
votes
8answers
1k views

Advantages and disadvantages to making common unit test scaffolding code

For the project my team and me are working on we often find that we need large pieces of scaffolding code. Creating domain objects with correct values, setting up mocks for repositories, dealing with ...
1
vote
2answers
684 views

A good code coverage framework for groovy/java?

Currently, I am working on a very complex product. Unit testing is something unknown to this product till date. Hence the code base is too complex to keep it compatible with unit tests. I am supposed ...
3
votes
8answers
539 views

Emphasizing the importance of TDD to customers

The importance of TDD needs to be propagated but there's always a gap in the project timeline and time needed for developing a TDD project. Customers usually do not understand the importance of code ...
4
votes
4answers
200 views

How can I create Assert.AreEqual(myobject,somevariable) a test in TDD before writing production code?

Im researching TDD, I'm not really sure how to write a test before I have written production code. The problem is that TDD states that you make assertions and then write your code so that these ...
8
votes
6answers
2k views

Single or multiple files for unit testing a single class?

In researching unit testing best practices to help put together guidelines for my organization, I've run into the question of whether it is better or useful to separate test fixtures (test classes) or ...
3
votes
4answers
159 views

Does not testing internals entail diligent refactoring and/or rely on developer talent?

I'm not asking here what the arguments are for/against testing internal methods (though I'll restate some, and don't mind hearing others). My questions relate to the implications of only testing ...
4
votes
2answers
1k views

Should I use an aggregate root when designing my repository?

I have an entity that is called Master which is composed of a number of Slave entities. There can only be one Master in my database and I want to query repositories to get the Slave for a given id. ...
2
votes
2answers
202 views

Moving legacy application to a testable framework?

We have a web application which contains a web service with over 50 methods. The application is currently installed at a number of sites and is currently being maintained by one developer. The ...
24
votes
2answers
3k views

What are the London and Chicago schools of TDD?

I’ve been hearing about the London style vs. Chicago style (sometimes called Detroit style) of Test Driven Development (TDD). Workshop of Utah Extreme Programming User's Group: Interaction-style ...
2
votes
2answers
369 views

How do you end up with event-sourcing if you use a xDD approach?

When working in a TDD or BDD manner your unit tests are supposed to drive your design. But how do you end up with event-sourcing using a xDD techniques? As I see it event sourcing is something you ...
13
votes
4answers
858 views

Unit testing statically typed functional code

I wanted to ask you people, in which cases it makes sense to unit test statically typed functional code, as written in haskell, scala, ocaml, nemerle, f# or haXe (the last is what I am really ...
6
votes
3answers
895 views

Getting from a user-story to code while using TDD (scrum)

I'm getting into scrum and TDD and I think I have some confusion which I'd like to get your feedback about. Let's assume I have a user-story in my backlog, in order for me to start developing it as ...
14
votes
4answers
2k views

Why is Conway's “Game of Life” used for code retreats?

Code Retreat is an all-day training event that focuses on the fundamentals of software development. There's a "global" code retreat day coming up, and I'm looking forward to it. That said, I've been ...
18
votes
5answers
643 views

Does unit testing lead to premature generalization (specifically in the context of C++)?

Preliminary notes I'll not go into the distinction of the different kinds of test there are, there are already a few questions on these sites regarding that. I'll take what's there and that says: ...
7
votes
7answers
2k views

How do I do TDD on embedded devices?

I'm not new to programming and I've even worked with some low level C and ASM on AVR, but I really can't get my head around a larger-scale embedded C project. Being degenerated by the Ruby's ...
3
votes
1answer
91 views

How to deal with changes that need further testing while working on another test?

TDD means to test before you start writing production code. So I start writing a test for MyClass called MyClassTest. It fails and I start to implement the wanted functionality in MyClass. During the ...
3
votes
7answers
353 views

Steps towards TDD [duplicate]

I need some advice to take the steps for TDD. How do we think in terms of interfaces for everything when we are writing code? Most of the testing books tell you how to write tests. But I want a book ...
7
votes
4answers
300 views

How do I do TDD when expected behaviour is to be changed?

I've been doing TDD with a project I'm working on, and I have quite a large number of tests. I have quite a few automated tests around restrictions enforced in code, making sure things that shouldn't ...
37
votes
11answers
8k views

What are the disadvantages of automated testing?

There are a number of questions on this site that give plenty of information about the benefits that can be gained from automated testing. But I didn't see anything that represented the other side of ...
17
votes
5answers
533 views

How can I start testing in a testing anticulture?

I have a confession to make: Formalized automated testing was never a part of my programming background. I now work in a very large company with many developers (most of them web developers of one ...
18
votes
6answers
742 views

Does adding unit tests make sense for well-known legacy code?

I'm talking about unit tests in the TDD sense. (Not automated "integration", or what you like to call it tests.) Legacy code as in: (C++) code without tests. (see: Michael Feathers' Working ...
11
votes
5answers
706 views

How to do TDD for something with many permutations?

When creating a system like an AI, which can take many different paths very quickly, or really any algorithm that has several different inputs, the possible result set can contain a large number of ...
3
votes
2answers
587 views

Which GOF design patterns work well with TDD, and which do not?

The GOF Design Patterns book rarely mentions the test-ability of each pattern. I'm aware that there are patterns such as Singleton that would lead to code for which it is difficult to write unit ...
4
votes
2answers
163 views

How to keep settings for C++ Unit Test modules in sync with the production code modules?

Note: I'm coming from a Windows / Visual-C++ background. Note: I have already read Michael Feathers' Working Effectively with Legacy Code. Note: Broad question, asking for narrow answers, i.e. while ...
4
votes
1answer
274 views

Unit testing of “workflow” methods

We are currently developing a public API for our app. The methods on this public API are mostly putting together functionality in different corners of the system. An example would be: (names have been ...
0
votes
1answer
66 views

Verification naming confusion

According to Martin Fowler classical article, there are two types of verification: state and behaviour verification. At the same time I often see people telling about implementation vs. behaviour ...
2
votes
1answer
429 views

Does a project using proper TDD have a lot of code without tests?

Most (all?) TDD resources show you how the cycle goes: Write Test Check Test Write Production Code Check Test Clean up Production Code Check test They also - to me - seem to imply that all code ...
11
votes
4answers
961 views

Does test-driven development force me to follow SOLID?

I hear a lot from TDD practitioners that one of TDD's advantages is that it forces developers to follow SOLID principles (Single responsibility, Open-closed, Liskov substitution, Interface segregation ...
11
votes
2answers
876 views

Relation between BDD and TDD

What is the relation of BDD and TDD? From what I understood BDD adds two main things over TDD: tests naming (ensure/should) and acceptance tests. Should I follow TDD during development by BDD? If ...
15
votes
5answers
1k views

How granular should TDD tests be?

During TDD training based on medical software case we are implementing the following story: "When user presses Save button, system should add patient, add device and add device data records". The ...
33
votes
9answers
2k views

How baby are your baby-steps in TDD?

Today we were training TDD and found the following point of misunderstanding. The task is for the input "1,2" return sum of numbers which is 3. What I have written (in C#) was: numbers = ...
5
votes
2answers
467 views

Testing-related methodologies except TDD/BDD [closed]

Are there any testing-related methodologies except TDD/BDD? I see a lot of people who practice their own testing approaches (e. g., see Ayende post), but I don't see any formalization for it, no ...
11
votes
4answers
742 views

Does TDD's “Obvious Implementation” mean code first, test after?

My friend and I are relatively new TDD and have a dispute about the "Obvious Implementation" technique (from "TDD By Example" by Kent Beck). My friend says it means that if the implementation is ...
1
vote
2answers
162 views

Tdd on a datadriven webapp

How would one go about to use tdd/bdd on a mostly data driven webapp? For example a blog or a forum?
3
votes
2answers
222 views

Product Owner and automated tests

One of the claims of BDD-style development is that it bridges the gap between Product Owner and developers: the Product Owner writes a story, which can be converted in an equivalent automated test ...
8
votes
9answers
3k views

Is anyone doing “real” TDD with Visual-C++, and if yes, how do they do it?

Test Driven Development implies writing the test before the code and following a certain cycle: Write Test Check Test (run) Write Production Code Check Test (run) Clean up Production Code Check test ...
29
votes
2answers
2k views

How should C++ Unit Test code be organized for maximum Unit Test efficiency?

This question is not about Unit Testing Frameworks. This question is not about writing Unit Tests. This question is about where to put the UT code written and how/when/where to compile and run it. ...
3
votes
3answers
1k views

What is a good workflow for a C++ beginner?

I desire to become a more serious scientific C++ programmer. To do so, I need a consistent style of workflow (e.g., coding, test-driven development, etc.). My question is simply what sort of ...
9
votes
5answers
1k views

If TDD is about design why do I need it?

TDD gurus more and more tell us that TDD is not about tests, it is about design. So I know some developers who create really great design without TDD. Should they practice TDD then?
7
votes
3answers
508 views

What is understood under “unit” in unit testing

As I understand in theory under "unit" people mean method (in OOP). But in practice tests which verify some method in isolation are very fragile behaviour tests (verifying not the result but the fact ...
3
votes
2answers
170 views

Do you write unit testing or TDD as a line item requirement into your contracts or statements of work?

If you do, do you discuss coverage, continuous integration, quality control, or anything related to the difference between unit testing, functional testing and TDD in general? If clients ask, do you ...
9
votes
2answers
281 views

Orthogonality of unit tests vs. concision of unit tests

I'm writing unit tests for a steering system for a video game. The system has several behaviours (avoid this area because of reason A, avoid this area because of reason B, each adding a bit of context ...
33
votes
10answers
2k views

TDD - is it just about unit tests? [duplicate]

Do I understand it right that classical TDD is just about unit tests? Don't understand me wrong: I know the difference between TDD and just unit testing. I am asking whether it is correct to use ...
16
votes
6answers
2k views

how much time do you spend on Unit testing?

In a company I used to work for, executives insisted that the code coverage with unit tests must be 99% or more. This resulted in writing more tests than code. It took us literally 3 days to write ...
66
votes
16answers
6k views

TDD negative experience [closed]

What is a negative side of your TDD experience? Do you find baby steps (the simplest fix to make test green) annoying and useless? Do you find no-value tests (when test has sense initially but in ...
5
votes
5answers
407 views

Is it possible to be agile without use cases and tests?

Rhetoric teaches us that the answer is probably yes. However I feel that we would no longer relate to the vast majority of Agile success stories. I think that my upper management read the benefits ...
7
votes
1answer
545 views

When does TDD fail? [duplicate]

Possible Duplicate: TDD negative experience I would like to read about negative experience related to developing in the TDD style. Looks like it is very difficult to find this kind of ...
3
votes
2answers
894 views

C++ TDD open source projects

Are there any open source projects out there that are written in C++ in an agile way (TDD maybe?). I am trying to contribute to a C++ open source project in order to catch up with the language and I ...
6
votes
5answers
830 views

Questions about TDD and unit testing

I am a junior software developer and I have been researching some of the practices in the industry to make myself better. I have been looking at unit testing briefly and I cannot see how the extra ...
12
votes
2answers
528 views

Software Testing Techniques [closed]

What kinds of software testing do you know? I've heard about Test-Driven Development, Unit tests etc, but can't understand their importance and difference. For example, why are we using regression ...