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.
9
votes
8answers
868 views
TDD: Am I doing it right?
I'm a new programmer (only been learning for about a year) and in my goal to become better at it I have just recently learned about TDD. I wanted to get into the habit of using it since it seems very ...
11
votes
2answers
334 views
Are there any scientific studies done on TDD that use total cost of ownership for a product as the measurement?
When I was reading the summary of previous work in Dogsa T, Batic D. The effectiveness of test-driven development: an industrial case study. Software Quality Journal. 2011;19(4):643-661. it struck me ...
8
votes
5answers
267 views
How to use unit tests as a source of information?
A colleague of mine was one a seminar about agile development, where he heard it is possible to use unit tests as a technical documentation. Something like using unit tests as example how to use the ...
3
votes
3answers
213 views
TDD adding simple properties
I am currently doing my first real project with TDD.
I have written tests, and implemented most of the logic for the application.
However, there are properties I know I need to have on the UI, ...
20
votes
11answers
3k views
Has test driven development (TDD) actually benefited a real world project?
I am not new to coding. I have been coding (seriously) for over 15 years now. I have always had some testing for my code. However, over the last few months I have been learning test driven ...
2
votes
3answers
151 views
Test-driven development: To create test when issue is filed or when issue is picked up by somebody?
I've recently been working on a web development project on a team of less-than-five people. Things are going good but now we are decided to go with test-driven development.
So far what I've learned ...
18
votes
4answers
608 views
Should we always unit test bugs when correcting them?
When correcting bugs, it is encouraged where I work to first write a test that fails with the given bug, and then to fix the code until the test passes.
This follows TDD practices, and is supposed to ...
9
votes
2answers
370 views
How to TDD that the correct results are returned
I'm starting a new project, and trying very very hard to use TDD to drive the design. I've been pushing for years, and finally got approval to spend the extra time on this project to use it while I ...
61
votes
16answers
5k views
When is unit testing inappropriate or unnecessary? [duplicate]
It seems to be generally assumed (on Stack Overflow at least) that there should always be unit tests, and they should be kept up to date. But I suspect the programmers making these assertions ...
4
votes
3answers
301 views
How to conduct a 3 days training on current techniques like TDD and CI
I am tasked to conduct a training for an upcoming team of 20 Java developers for a new project. The project owner wants us to use state of the art development techniques like TDD and CI. The ...
36
votes
6answers
2k views
How to deal with static utility classes when designing for testability
We are trying to design our system to be testable and in most parts developed using TDD. Currently we are trying to solve the following problem:
In various places it is necessary for us to use static ...
13
votes
3answers
900 views
Real-world examples of apps written with TDD and good test coverage?
Are there any open source applications that are developed using test driven development that serve as models of how good unit testing should work?
I'd prefer to see examples in C# and .NET. (Note ...
11
votes
10answers
728 views
How to convince teammates to use TDD
I am the only person on my team that use TDD. How do I make them to use it?
I am annoyed that when I pull, someone's code will break my tests and I am the one who has to fix them.
Will using github, ...
7
votes
1answer
487 views
How can I get started using TDD to code some simple functionality?
I basically have the gist of TDD. I'm sold that it's useful and I've got a reasonable command of the MSTEST framework. However, to date I have not been able to graduate to using it as a primary ...
45
votes
17answers
2k views
Why not write all tests at once when doing TDD?
The Red - Green - Refactor cycle for TDD is well established and accepted. We write one failing unit test and make it pass as simply as possible. What are the benefits to this approach over writing ...
0
votes
1answer
139 views
Are there any open source libraries that have file integration tests
I am writing integration tests to ensure files are getting created and written to etc but this seems like something lots of people must have done previously.
Are there any libraries that have a bunch ...
33
votes
14answers
2k views
If you had two projects with the same specification and only one was developed using TDD how could you tell?
I was asked this question in an interview and it has been bugging me ever since.
You have two projects, both with the same specification but only one of these projects was developed using Test ...
2
votes
2answers
474 views
How much extra time is needed to add unit test in a development task?
My team is considering moving to test-driven development. Currently we have almost no unit testing, we have been only relying on the user acceptance test, and developer's own manual test. Not everyone ...
30
votes
9answers
2k views
Is unit testing or test-driven development worthwhile?
My team at work is moving to Scrum and other teams are starting to do test-driven development using unit tests and user acceptance tests. I like the UATs, but I'm not sold on unit testing for ...
27
votes
11answers
2k views
Do I need to test everything?
I'm going to start my first real project in Ruby on Rails, and I'm forcing myself to write TDD tests. I don't see real advantages in writing tests, but since it seems very important, I'll try.
Is it ...
5
votes
4answers
234 views
Type mocking frameworks does not change coding practices from testability point?
Many people recommend that we should code against interfaces and avoid statics for testability.
Interfaces are not just for testability, they are sometimes a requirement. But sometimes we introduce ...
10
votes
2answers
490 views
How can I unit test audio?
I have inherited a small project and want to extend it and stabilize it at the same time by writing Unit Tests for all the new code I am adding. The first class, TypedAudioCreator, creates audio files ...
7
votes
7answers
988 views
How can I organize fast and comfortable solution compilation in VS 2010?
Most of programmers who are involved into development of more or less large project(s) know how annoying the process of compilation can be. There are some other things which are dependent on ...
47
votes
5answers
13k views
What is the difference between BDD and TDD?
I have been learning writing test cases for BDD using specflow. If I write comprehensive tests with BDD is it necessary to write TDD test separately? Is it necessary to write test cases for both TDD ...
6
votes
8answers
327 views
What's a good name for a third type of testing?
I generally have different types of tests that I work with - the standard types: Unit Tests (testing basic functionality of classes, methods etc) and Integration Tests (testing how multiple components ...
45
votes
12answers
3k views
New to TDD. Should I avoid private methods now?
I'm just now learning TDD. It's my understanding that private methods are untestable and shouldn't be worried about because the public API will provide enough information for verifying an object's ...
3
votes
1answer
253 views
Looking for resources on TDD and BDD
I'm doing a presentation this week for Uni on the application of TDD and BDD. I'm trying to focus on types of code (such as algorithms, business logic or crud) and which methodology (if at any at all) ...
35
votes
11answers
1k views
How do people doing TDD handle loss of work when doing major refactoring
For a while I have been trying to learn to write unit tests for my code.
Initially I started out doing true TDD, where I wouldn't write any code until I'd written a failing test first.
However, I ...
5
votes
1answer
379 views
Node.JS testing with Jasmine, databases, and pre-existing code
I've recently built the start of a core system which is likely going turn into a monster product. I'm building the system with node.js, and decided after I got a small base built, that It'd be a ...
8
votes
3answers
1k views
Is Test Driven Development in Javascript helpful for front-end developers?
I really need your advice. I'm reading a few articles about TDD in JavaScript but I'm really struggling to understand how to use it in my daily work. For instance I'm currently working on a page that ...
313
votes
12answers
7k views
Should I intentionally break the build when a bug is found in production?
It seems reasonable to me that if a serious bug is found in production by end-users, a failing unit test should be added to cover that bug, thus intentionally breaking the build until the bug is ...
2
votes
4answers
561 views
Development setup for TDD. Is it correct?
This is how my team has it's development environment set up:
Each team member has a local development environment on their own computer, where they check out the code from a shared repository.
Every ...
14
votes
6answers
1k views
Should we test all our methods?
So today I had a talk with my teammate about unit testing. The whole thing started when he asked me "hey, where are the tests for that class, I see only one?". The whole class was a manager (or a ...
5
votes
4answers
445 views
How to Write Unit Tests When One Fix Will Make Many Failing Tests Pass?
I have two test cases to test a fix to code that is using the wrong criteria for selecting objects from a collection:
Given one object in the collection matching the bad criteria, ensure that no ...
6
votes
8answers
856 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
439 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
497 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
191 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 ...
5
votes
6answers
833 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
134 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
...
3
votes
2answers
717 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
178 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 ...
19
votes
2answers
2k 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
333 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
609 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
641 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 ...
10
votes
4answers
1k 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
563 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
1k 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
89 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 ...
