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.
3
votes
4answers
114 views
End-to-end tests versus unit tests, should tests be decoupled?
At our company we typically make sure that we write an end-to-end test for our websites/web apps. That means we access a URL, fill in a form, submit the form to another URL and check the results of ...
1
vote
1answer
42 views
Production or Custom Test Data for Unit Testing?
I've recently had a little disagreement with fellow developers. We're transforming various ontologies from the original source format (Pica+, RDF, etc) into our data format and have several converters ...
1
vote
2answers
266 views
Fundamental TDD: stuck with writing a test so I can write code that I want
I have a Season class. This Season has a few properties: among them, a list of Games. This should be populated from the same source that populated the rest of the Season properties.
I have a test ...
2
votes
1answer
88 views
Shared factories: good or bad?
RSpec allows users to share factories across tests / examples, which would reduce the number of code lines in my app by a significant amount.
On the other hand, one of the reasons why I'm using ...
4
votes
2answers
782 views
A weakness of the TDD method?
This is in summary the TDD method:
Write a test
check if thes test fails
write production code
run test
I think that TDD as presented works only in ideal circumstances. I'll take a simple ...
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 ...
3
votes
1answer
82 views
Stubbing and mocking boundaries
Suppose I'm building a JSON API and would like to include an endpoint that returns a list of recently created posts. Somewhere in my system is an existing Post model with the following test:
create ...
1
vote
2answers
123 views
How do you test database abstraction in PHP?
I apologise in advance if this question is too subjective but I'm struggling to find a good answer, probably as there is not really a correct answer to give.
I'm currently writing a database ...
7
votes
8answers
733 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.
-2
votes
1answer
153 views
Do you unit-test your PODs? [closed]
do you create unit-tests for PODs (Plain Old Data Structure)? And why?
I'm interested in your opinions.
Regards
Tobias
20
votes
10answers
688 views
Automated Testing: Explaining its Business Value
To start I don't think this is a repeat of other questions on unit testing. What I'm looking for help with is articulating its value to a team of programmers, analysts, managers and testers. By ...
2
votes
5answers
269 views
How to time the sprints in Scrum to allocate time for TDD?
We have sprints of 4 weeks duration. What I have been doing is 3 weeks dev time and 1 week of pure manual/automated testing, stabilization and shipment assurance testing.
How to manage TDD within ...
26
votes
6answers
2k views
How should you TDD a Yahtzee game?
Let's say you're writing a Yahtzee game TDD style. You want to test the part of the code that determines whether or not a set of five die rolls is a full house. As far as I know, when doing TDD, you ...
1
vote
1answer
125 views
Why do we write our specs in different files from our source?
The D Programming Language supports writing unit tests inline with source. There's a Ruby gem called test_inline that lets you write specs in the same file as your code.
Why is it generally ...
9
votes
3answers
463 views
What to do when your colleagues don't value code maintainability [duplicate]
I've been working in the same software development department for a few years now. In that time, the average stay of a developer has been 6-9 months. A handful have been around for over 2 years, but ...
4
votes
2answers
724 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 ...
12
votes
4answers
1k 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 ...
34
votes
6answers
4k views
Good example of complex code using TDD
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 ...
8
votes
2answers
223 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 ...
7
votes
3answers
458 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 ...
2
votes
5answers
372 views
Understanding unit tests/TDD for ASP.NET webforms [closed]
I'm the lead programmer at a small software firm (currently 4 developers including myself), we develop bespoke ASP.NET WebForms applications for businesses. I joined there in 2010 just after ...
7
votes
5answers
393 views
How to TDD test that objects are being added to a collection if the collection is private?
Assume that I planned to write a class that worked something like this:
public class GameCharacter {
private Collection<CharacterEffect> _collection;
public void Add(CharacterEffect e) ...
4
votes
3answers
320 views
In TDD, if I write a test case that passes without modifying production code, what does that mean?
These are Robert C. Martin's rules for TDD:
You are not allowed to write any production code unless it is to
make a failing unit test pass.
You are not allowed to write any more
of a unit test than ...
0
votes
0answers
199 views
What's the next logical TDD move in this learning example?
I'm inching my way up the TDD ladder and I've got to a point where I'd like to get advice on the "next move". I realize there might not be a single answer here, so any logical suggestion would be ...
25
votes
5answers
1k views
Why is it often said that the test cases need to be made before we start coding? [duplicate]
Why is it often said that the test cases need to be made before we start coding?
What are its pros and what the cons if we don't listen to this advice?
Moreover, does that advice refer to black box ...
0
votes
2answers
210 views
Should I use TDD and BDD if my project is changing fast?
I have my own little project I am creating using RoR, I plan it to have small-medium load.
With no doubt I started with BDD and TDD (Cucumber and RSpec to be exact, but I am also experienced with ...
3
votes
2answers
180 views
Do I need to learn python first to understand the part 2 of the book Test Driven development?
It seems like Python is used as a coding language for part 2 of Kent Beck's book Test Driven Development. I have read the first part of that book and started appreciating the value of TDD . First part ...
0
votes
1answer
258 views
GUI Test Runner for Boost.Test
Does a Boost.Test have a GUI version of a test runner? The closest thing what I found is a Boost.Adapter for Galio (https://github.com/ndl/Gallio.BoostAdapter), but as that project been dead for two ...
4
votes
1answer
144 views
Is there a modern replacement for a mutation testing tool like Jester for Java?
“Why just think your tests are good when you can know for sure?
Sometimes Jester tells me my tests are airtight, but sometimes the
changes it finds come as a bolt out of the blue. Highly ...
4
votes
2answers
252 views
Can I start with a passing unit test?
Uncle Bob's rules for TDD are specified here.
You are not allowed to write any production code unless it is to
make a failing unit test pass.
You are not allowed to write any more
of a unit test ...
1
vote
2answers
227 views
Any pre-rolled System.IO abstraction libraries out there for Unit Testing?
To test methods that use the file system we need to basically put System.IO behind a set of interfaces that we can then mock, I do this with a DiskIO class and interface.
As my DiskIO code gets ...
125
votes
23answers
6k views
Why does automated testing keep failing in my company?
We have tried to introduce developer automated testing several times at my company. Our QA team uses Selenium to automate UI tests, but I always wanted to introduce unit tests and integration tests. ...
16
votes
4answers
1k views
Why is test driven development missing from Joel's Test?
I was reading this blog by Joel Spolsky about 12 steps to better code. The absence of Test Driven Development really surprised me. So I want to throw the question to the Gurus. Is TDD not really worth ...
30
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 ...
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 ...
50
votes
13answers
4k 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 ...
37
votes
11answers
5k 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 ...
45
votes
5answers
12k 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 ...
8
votes
1answer
279 views
Unit testing on visualization (3D graphics) frameworks
This is a follow up to this question. There I was asking how to do unit testing when you have a library of scientific algorithms. I have a similar problem now but with a different project.
I'm ...
17
votes
11answers
946 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 ...
11
votes
1answer
744 views
Should I write a test to prove that deleting code fixes a bug?
Occasionally I'll run into the situation where fixing a bug requires that I delete a section of code. The TDD purist would (I assume) advocate writing a failing test, deleting the code, then watching ...
2
votes
2answers
155 views
Functional testing and Acceptance testing leading to redundant code
What I know is:
A Functional test aims to test a single component (like a WebApp's Controller) from the point of view of the developer. => Did I achieve all the requirements to make it work well?
...
12
votes
8answers
345 views
Alternative to “Passing/Broken build” indicator?
When having a continuous integration executing the tests at each commit, a common best practice is to have all the tests passing at all times (aka "do not break the build").
I find some problems with ...
1
vote
2answers
143 views
organising classes / folder structure for TDD-based development
Due to test-driven development, one ends up with many classes doing just one thing. It is quite a headache just to see where such classes would be placed inside the folder structure.
First of all, ...
2
votes
2answers
129 views
Unit test and Code Coverage of Ant build scripts
In our development environment We have more and more build scripts for ant to perform the build tasks for several different build jobs.
These build scripts sometimes become large and do a lot of ...
2
votes
1answer
261 views
In which cases Robolectric is a relevant solution?
As you may now, Robolectric is a framework that provides stubs for Android objects, in order to make tests runnable outside the Dalvik environment.
My concern is that, by doing this, one can fake a ...
8
votes
1answer
131 views
Should I refactor my unit tests when I extract a class out of the System Under Test?
I wrote this class that does a few things (perhaps this is a violation of the Single Responsibility Principle). I realize now that some other part of the project needs a piece of that logic and the ...
5
votes
2answers
305 views
Write tests for unit tests in TDD?
In an answer to another question, I suggested creating a randomized value for input to a specific method. In my experience this has been useful for making tests more readable and it lets you skip the ...
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 ...
5
votes
2answers
257 views
Helper static methods in TDD
I am creating an application which will be testable(unit + integration). In this application I have a FileHelper static class,
public static class FileHelper
{
public static void ...