News for hackers. Stuff that matters.
Re:An External Replication on the Effects of Test-driven Dev... by hackuser on Wednesday October 19, 2016 @12:41AM (#12741124)
It may be unfair to say this in response to the parent comment, but the great majority of HN discussions start with a comment like this one: It's seriously flawed, etc. Occasionally it's true, but the noise drowns out the signal.

In a graduate-level engineering class, the students were making similar statements about all the studies we read. One day the professor said: It's easy to find flaws in someone else's work; humans are flawed. The real challenge and benefit is to find the value in their work - find what has lasting value, learn from it, and carry it forward.

Re:An External Replication on the Effects of Test-driven Dev... by tikhonj on Wednesday October 19, 2016 @01:08AM (#12741235)
I completely disagree. The reason we care about these studies is to make decisions. If a study is flawed... maybe it's flawed. Maybe it shouldn't be relied upon any more than some random opinion blog post. (Maybe even less!) But just being "a study" lends it a lot of weight compared to that same random blog post, so it absolutely should be held to strong scrutiny.

It might be a "real challenge" to find value in every one of those blog posts too, but it's by no means useful or valuable. It's a waste of time if not outright counterproductive.

If all the studies are flawed, maybe the field is flawed. Maybe the subject is just not susceptible to (cheap) experimental studies. It's hard to trust peer review when there might be problems with the whole field. We may very well be better off relying on experience and opinions because realistic experiments are so far off the mark.

It can be even worse: generalizing the results of a bad experiment might even be dangerously wrong. Psychology results from experiments on young, Western college students are a great example—we don't want to make laws or base diagnoses purely on experiments like that because that could actively harm groups that are fundamentally unlike young, Western college students.

And all that is pretty much exactly where I see experimental software engineering: the results just don't generalize. And sometimes, I suspect, results generalize in ways that are counterproductive to experienced programmers working on large projects—exactly the people I actually care about. And yet empirical studies (even bad ones) still inherently carry a lot of unearned cachet. The real challenge at the end is overcoming this cachet, not finding value where there just might not be all that much.

Re:An External Replication on the Effects of Test-driven Dev... by tlarkworthy on Wednesday October 19, 2016 @01:29AM (#12741311)
It's a total waste of scientific resources to insist every study requires an army of test subjects, and the top statisticians of the times to apply the latest modeling, to work blind and replicated independently before publication.

There are limited resources to do research. You can get insights into how the world works much cheaper if you use critical thinking and facts outside the controls. Casually dismissing every study as irrelevant due to lack of rigor is wasteful.

Re:An External Replication on the Effects of Test-driven Dev... by jdlshore on Wednesday October 19, 2016 @01:42AM (#12741365)
If studies don't need to be rigorous, what's the point of doing them? Why not just write a persuasive essay instead? Is the format of a "study" just a rhetorical device, a glammed-up appeal to authority?

The whole point of careful statistics and well-designed experiments is so that we can learn whether a premise is true or not. Without rigor, we prove nothing; this study for example, neither proves NOR disproves anything about TDD in a professional setting. For us professionals, it's noise. Yet it's sitting at the #1 spot on HN, fulfilling people's preconceptions.

Also, the replication crisis [1] would disagree with you.

[1] https://en.wikipedia.org/wiki/Replication_crisis

Re:An External Replication on the Effects of Test-driven Dev... by beambot on Wednesday October 19, 2016 @02:15AM (#12741512)
> The whole point of careful statistics and well-designed experiments is so that we can learn whether a premise is true or not.

That's where you're wrong... even with "careful statistics", the point of sample-based studies is to disprove the null hypothesis with some confidence level. There is no requirement that it be 100% confident. In fact, with p<0.05, you might expect some small fraction of repeat experiments to show no significant effect.

(See, it's easy to get this wrong!)

Re:An External Replication on the Effects of Test-driven Dev... by adwn on Wednesday October 19, 2016 @03:19AM (#12741755)
Although I believe that you're technically correct, your objection does not refute jdlshore's central point.
Re:An External Replication on the Effects of Test-driven Dev... by beambot on Wednesday October 19, 2016 @04:37AM (#12742111)
Sure it does. In the social sciences (which includes questions about productivity a la TDD), there is no "proof" or "truth" in the mathematical sense. Results are based on statistical relevance subject to the sampling (and their biases).

This study is meaningful in that it provides some limited evidence. It's fine to question biases and confounding factors... but that doesn't change the relevance of their results, merely the scope. In this case, what the researchers actually found: "At <X> confidence interval, TDD doesn't work for white, male graduate students at <Y> University working on <Z> problem. Generalize at your own peril." But that's a shitty headline.

Re:An External Replication on the Effects of Test-driven Dev... by adwn on Wednesday October 19, 2016 @04:48AM (#12742170)
> Sure it does. In the social sciences (which includes questions about productivity a la TDD), there is no "proof" or "truth" in the mathematical sense.

Neither jdlshore nor I were talking about "proof" or "truth" in the mathematical sense.

> Results are based on statistical relevance subject to the sampling (and their biases).

The point was that this study doesn't have sufficient statistical relevance to give any evidence whether TDD is effective in general. It doesn't matter if this study gives any evidence whether TDD is effective when used by graduate students working on toy problems, because that was not the intention of the study (besides, nobody cares about this highly specific case).

Re:An External Replication on the Effects of Test-driven Dev... by beambot on Wednesday October 19, 2016 @02:39PM (#12746449)
> [...] whether TDD is effective in general.

If you read the actual article (even just the abstract), you would realize that evaluating TDD in a general professional settings was neither the goal nor the conclusion of the authors. You are arguing a straw man and hoping to make inferences that are unsupported by the paper's claims. The authors do a good job of scientific communication about their methods, results, and limitations. This is good practice for scientific communications. Don't think it's sufficiently generalizable? Fine, feel free to expand upon their work. That's how science functions.

("truth", "prove", and "rigor" were verbatim, primary components of jdlshore's comment. The two former words have very specific scientific meaning.)

Re:An External Replication on the Effects of Test-driven Dev... by hackuser on Wednesday October 19, 2016 @02:11AM (#12741492)
While I can see your point of view, perhaps that is an ideal and not a realistic view of how science actually works. Similarly, someone might have an ideal view of software development, but if they saw how it actually worked and read actual in-production code ... and I think that describes every profession.

Science does work pretty well; it predicts things with accuracy and reliability otherwise unknown by humanity (AFAIK). It's an interesting question: If not by hewing close to this ideal, how does it actually achieve results?

Re:An External Replication on the Effects of Test-driven Dev... by adwn on Wednesday October 19, 2016 @03:27AM (#12741799)
You're conflating the "hard" sciences (which rely on reproducible experiments to explore natural laws) with the "soft" sciences (which rely on studies to explore human behavior). The track record of the latter is significantly worse than that of the former. Software engineering, and by extension this study, falls firmly into the soft sciences territory.

You should be a lot more sceptical of supposed facts in soft sciences than in hard sciences. Not because of prejudice or arrogance, but because it's much harder to be reasonably certain about anything in a soft science than in a hard science.

Re:An External Replication on the Effects of Test-driven Dev... by hackuser on Wednesday October 19, 2016 @08:43AM (#12743211)
I know the differences you are referring to talking about. I mean all sciences, but really I mean that we need to hear from actual practitioners about how they really work.
Re:An External Replication on the Effects of Test-driven Dev... by vacri on Wednesday October 19, 2016 @02:03AM (#12741444)
Studies with small 'n' are feeder studies, exploring large amounts of problem space quickly. When patterns emerge, they can be retested or expanded upon.

Equating a somewhat flawed study to 'a persuasive essay' is wholly disingenuous. As is claiming n=20 to be 'tiny'. It's small, sure, but not ridiculously small.

This kind of study isn't a final nail in the coffin, but a data point to add to the discussion.

Re:An External Replication on the Effects of Test-driven Dev... by slavik81 on Wednesday October 19, 2016 @03:17AM (#12741745)
The use of students for this purpose reminds me of a story about a man who designs a flying machine.

After months of calculations and material research, he determines that only if he builds his machine out of birch will it be light enough to fly. According to his calculations, nothing else will work.

Days later, his best friend is visiting him in the hospital. He carries over a piece of the broken machine. With a puzzled look on his face, the friend asks, "Why did you build it out of pine when you knew you needed birch?"

"Because I didn't have any birch."

Re:An External Replication on the Effects of Test-driven Dev... by ChoHag on Wednesday October 19, 2016 @03:31AM (#12741815)
How short the internet's memory is.

Le mieux est l'ennemi du bien. It was right here not a couple of days ago.

Sheesh why do I bother?

Re:An External Replication on the Effects of Test-driven Dev... by ggus on Wednesday October 19, 2016 @04:05AM (#12741962)
the point is that the study appears flawed, so much that it is not even good. let alone perfect.
Re:An External Replication on the Effects of Test-driven Dev... by kriro on Wednesday October 19, 2016 @02:52AM (#12741642)
I'm not sure it's pure noise for professionals. These students eventually turn into professionals so there's probably some relationship (at least that would be my hypothesis).

Regarding the replication crisis...this is actually a replication and there's actually more replication for TDD than for most topics I read about.

Re:An External Replication on the Effects of Test-driven Dev... by avarun on Wednesday October 19, 2016 @03:00AM (#12741676)
Again, as a convenience sample with a tiny sample size, there's no conclusion we can even draw about students, let alone professionals.
Re:An External Replication on the Effects of Test-driven Dev... by SatvikBeri on Wednesday October 19, 2016 @02:06AM (#12741464)
There are really two types of studies: exploration and validation. Exploratory studies on small samples are still useful for refining hypotheses and figuring out whether they deserve more resources, but shouldn't be seen as significant evidence towards a conclusion–they are generally _less_ valid than opinions from people experienced in the field.

In contrast, validating studies _should_ have large enough sample sizes to be statistically significant, precommit to sharing results in order to avoid publication bias, have well-validated experimental designs, etc.

The problem is that these two are often conflated, so most people either blindly trust studies or put no faith in them whatsoever.

Re:An External Replication on the Effects of Test-driven Dev... by jaredklewis on Wednesday October 19, 2016 @01:44AM (#12741371)
Well, if we are discussing the allocation of resources, I for one would much prefer fewer, more rigorous studies than a large volume of studies with mediocre methodology and sample sizes. Such studies carry little more weight than one's own intuitions.

I do feel that small studies like this one serve a very important purpose: to let scientists hone their experiments. Most any large study should first be attempted as a small study to work out any kinks.

Re:An External Replication on the Effects of Test-driven Dev... by r00fus on Wednesday October 19, 2016 @01:39AM (#12741351)
Nobody needs an army of test subjects - just statistically valid numbers. But even with 20 test subjects the study fails at trying to make that 20 representative of any meaningful population.
Re:An External Replication on the Effects of Test-driven Dev... by vacri on Wednesday October 19, 2016 @02:04AM (#12741451)
Out of curiousity, how many subjects would you say are necessary to start being statistically valid?
Re:An External Replication on the Effects of Test-driven Dev... by jaggederest on Wednesday October 19, 2016 @03:03AM (#12741687)
Kind of the wrong question. It's more about qualitative sample selection and the expected effect size than it is the number of subjects.

Based on my admittedly poor understanding, I would expect to see a sample size of around 70 to have the power to detect a small effect in a single-tailed T test. I would also expect to have the samples selected and balanced carefully, preferably from the target group (i.e. experienced professional programmers in the language at hand)

From what I can tell, for an effect to be detected at least 80% of the time in a sample of 20 people, you'd need the effect to be >60%. I would definitely not expect that a short term project would show 60% improvement when employing similar levels of testing, changing only either before or after writing the code under test.

Re:An External Replication on the Effects of Test-driven Dev... by jacquesm on Wednesday October 19, 2016 @04:37AM (#12742107)
Especially not because the major benefit of TDD hits much later in the cycle, during refactoring a large chunk of code or when doing some major surgery on the whole project (and let's hope the tests are at the interface level).
Re:An External Replication on the Effects of Test-driven Dev... by ericdykstra on Wednesday October 19, 2016 @12:54AM (#12741176)
The conversation around TDD is tired, and the conclusion is always the same: "it depends." It depends on the person writing the code, the type of problem they're tackling, the language they're using, the needs of the business, etc.

This study doesn't bring anything new to the table except: "in this manufactured environment we found a single point of data that equates to noise."

I'm guessing the only reason the story was upvoted at all in the first place is because some people who agree with the title clicked the up arrow without looking at the article.

Re:An External Replication on the Effects of Test-driven Dev... by tbrownaw on Wednesday October 19, 2016 @01:14AM (#12741258)
the conclusion is always the same: "it depends."

Er, no. The studies I've read all end up showing that principled testing helps, but test-first and TDD (strict red/green cycle, code only enough to pass the new test, etc) provide no additional benefit over anything else that gets the tests written.

The "it depends" always comes from the echo chamber trying to justify their desire to believe that TDD isn't completely useless. It actually feels quite similar to the claims I've seen from practitioners that reikei, faith healing, etc aren't complete bunk.

Re:An External Replication on the Effects of Test-driven Dev... by bjelkeman-again on Wednesday October 19, 2016 @01:29AM (#12741312)
> provide no additional benefit over anything else that gets the tests written.

Isn't this enough though? The tests gets written, which probably was the main point in the first place?

Re:An External Replication on the Effects of Test-driven Dev... by zorked on Wednesday October 19, 2016 @02:00AM (#12741434)
You can also add a coverage tool to your CI and get the same result (tests get written) without any of the ideology (TDD fairies sprinkle unicorn dust everywhere).
Re:An External Replication on the Effects of Test-driven Dev... by vidarh on Wednesday October 19, 2016 @03:56AM (#12741921)
That assumes you are disciplined enough to act on the result.

Which is what most of these mechanism are about: Finding what causes sufficient friction to get the tests written.

(I'm making this comment because I know of a team with a coverage tool tied into CI where the coverage has been ignored for years)

Re:An External Replication on the Effects of Test-driven Dev... by _ikke_ on Wednesday October 19, 2016 @03:54AM (#12741912)
Coverage tools are not sufficient for getting good test coverage. One can easily make code 'covered' without having proper tests for them.

By writing tests early, you make sure the code you are testing is testable and your knowledge about the code is fresh.

Re:An External Replication on the Effects of Test-driven Dev... by lomnakkus on Wednesday October 19, 2016 @04:15AM (#12742013)
> By writing tests early, you make sure the code you are testing is testable and your knowledge about the code is fresh.

IME you also end up writing tests which are far too tied to the implementation. (With the resulting churn that that implies when the implementation changes.)

You get far more mileage from QuickCheck-type tests IME. Granted, not everything is very amenable to testing using QC-type tests, but a lot of stuff is.

Re:An External Replication on the Effects of Test-driven Dev... by dllthomas on Wednesday October 19, 2016 @12:41PM (#12745330)
I've heard that tests written specifically to drive up coverage metrics aren't much better than no tests.
Re:An External Replication on the Effects of Test-driven Dev... by ericdykstra on Wednesday October 19, 2016 @03:42AM (#12741855)
I really don't believe any study or meta-study could come close to being able to suss out the nuance of when TDD may provide an advantage and when it doesn't.

I'd rather just trust programmers to consider what approach works best for their problem and mindset and go from there.

I personally don't TDD most things, but it's a tool I have available and I bring it out when a situation arises.

Re:An External Replication on the Effects of Test-driven Dev... by raverbashing on Wednesday October 19, 2016 @04:17AM (#12742018)
Well, with TDD you waste time writing red tests first, then with tests that "just pass" and finally make the thing as it is supposed to be

I find it surprising that's not slower than Test-Last (maybe if you really leave it for last then you'll need some time to fit your functions to your test)

Re:An External Replication on the Effects of Test-driven Dev... by dllthomas on Wednesday October 19, 2016 @12:41PM (#12745324)
I think we could, but it'd be very expensive (multiple large and careful studies) and only possibly worth it.

> I'd rather just trust programmers to consider what approach works best for their problem and mindset and go from there.

People are often surprisingly good at fooling themselves. I'd rather have actual empirical validation. And also a pony.

Re:An External Replication on the Effects of Test-driven Dev... by djsumdog on Wednesday October 19, 2016 @01:45AM (#12741373)
You know, this study and others don't take about long term maintainability or brekability.

In fact, isn't this a good thing? If it has little impact on development time, we should totally be doing it. That way, we have tests. We have them from the start. We met the conditions we wanted instead of guessing conditions at the end.

Re:An External Replication on the Effects of Test-driven Dev... by Strilanc on Wednesday October 19, 2016 @02:11AM (#12741487)
> the great majority of HN discussions start with a comment like this one: It's seriously flawed, etc.

That's easily the best part of HN and reddit. A great help with the Murray Gell-Mann Amnesia effect.

I don't think it's that HN is negative (though HN can certainly be negative), I think most articles really are just kinda crummy. Could be oversimplified, probably overhyped, maybe some wildly skewed sense of "providing both sides", or one of a million other possible problems. The comments will tell you about these problems, and that makes them a better barometer of "is this worth it?" than the title or even the content.

Re:An External Replication on the Effects of Test-driven Dev... by divanvisagie on Wednesday October 19, 2016 @01:15AM (#12741266)
If it is unfair to say in here then you should have waited for a better time to write this comment instead of just venting yourself on the first comment you see like it.

This study has the potential to be misused by people to get their senseless argument across and could cause a lot of headache for people in the industry. It's hard enough as it is for a consultant to get people to pay for testable software.

That line about your professor is cute, but the issue is the media gobbles up studies and reports on them no matter what the quality leaving large chunks of the population misinformed. So publishing a study that is inaccurate is frankly irresponsible.

Re:An External Replication on the Effects of Test-driven Dev... by NumberCruncher on Wednesday October 19, 2016 @02:30AM (#12741566)
Scientific methods were invented to minimise the flaws in scientific work. If you ignore these methods and base your study on biased data you better forget calling your results scientific. Fortunately there are folks on HN reminding you on this.
Re:An External Replication on the Effects of Test-driven Dev... by flukus on Wednesday October 19, 2016 @01:22AM (#12741290)
We live in a world with too much information. There are probably more words written everyday than we can read in a lifetime.

The sooner you can remove worthless information the better.

Re:An External Replication on the Effects of Test-driven Dev... by EdiX on Wednesday October 19, 2016 @02:21AM (#12741533)
> In a graduate-level engineering class, the students were making similar statements about all the studies we read

Yeah, that's because they are all terrible.

Re:An External Replication on the Effects of Test-driven Dev... by jacquesm on Wednesday October 19, 2016 @04:34AM (#12742092)
Well, he did find value in the work, just not as much as the hyped title would have you believe and I'm perfectly ok with that.

The fact that it matches my experience (that TDD has benefits but only for projects of a certain size with programmers of a certain minimum experience level) helps with that, but it is always good to be reminded of the importance of sample size and other priors related to a study that makes a very bold claim.

Re:An External Replication on the Effects of Test-driven Dev... by EugeneOZ on Wednesday October 19, 2016 @03:06AM (#12741699)
And words of that professor don't fix anything, really. I absolutely, 101% agree with comment you are replying.
Re:An External Replication on the Effects of Test-driven Dev... by Ar-Curunir on Wednesday October 19, 2016 @12:48AM (#12741150)
Exactly this; I find too many HN comments to be critical in a non-constructive manner.
Re:An External Replication on the Effects of Test-driven Dev... by smallnamespace on Wednesday October 19, 2016 @01:01AM (#12741206)
The criticism was very constructive though. Increase the sample size, put it in a more realistic setting.
Re:An External Replication on the Effects of Test-driven Dev... by vacri on Wednesday October 19, 2016 @02:18AM (#12741521)
How do you propose to gather more experienced, professional developers into the same location and get them to work on a topic that isn't making them tons of money? They can't be left to do the problems in their own workplace, or the next criticism will be "uncontrolled variables!". They also have to be vetted for minimum skills (there are plenty of experienced, professional devs out there who aren't worth a second look). The parent also wants more complex tasks done.

So... where is the money coming from? Who is going to pay for this multitude of professional programmers to converge to the same environment, be vetted, and spend a non-trivial amount of time coding the same thing as the others in the group?

Of course the researchers in the article would have loved to have those kind of resources and do the perfect, wide-ranging, deeply detailed study, but the OP's criticisms just show how divorced the OP is from experimenting with real-world humans in real-world situations, and with real-world resources.

Re:An External Replication on the Effects of Test-driven Dev... by smallnamespace on Wednesday October 19, 2016 @02:45AM (#12741616)
This may sound harsh, but taking the researcher's difficulties into account is not our responsibility.

The research presented here is weak. Honestly pointing that out without pulling punches is better than simply giving them a pass because 'doing good research is hard'.

Re:An External Replication on the Effects of Test-driven Dev... by vacri on Wednesday October 19, 2016 @06:36AM (#12742599)
Where did I say 'simply give them a pass'? This idea that research is either a polarised "ideal" or "trash" is moronic. Taking the nature of any study into account is part of science, and part of how you caveat the knowledge gained from that study.
Re:An External Replication on the Effects of Test-driven Dev... by smallnamespace on Wednesday October 19, 2016 @02:41PM (#12746475)
I completely agree with you. Pointing out a study's flaws is indeed part of the process of 'caveat[ing] the knowledge gained from that study'.
Re:An External Replication on the Effects of Test-driven Dev... by vidarh on Wednesday October 19, 2016 @04:03AM (#12741955)
You could start by finding a corporate sponsor with a lot of developers and a vested interest in finding out which methods will be best for them. The advantage of that being that you could even test it on a real project (the sponsor would "just" need to be willing to dedicate twice the number of developers to a suitably small project).

It'd still not be easy, and of course there'd still be issues (e.g. is there anything about the corporate culture or training in that company that would affect the result?), but it'd still be far better than a bunch of students and toy problems.

Re:An External Replication on the Effects of Test-driven Dev... by vacri on Wednesday October 19, 2016 @06:42AM (#12742625)
Corporate places do research like that all the time; they just don't publish them all that often. A corporation with a vested interest is a corporation with a competitive interest.
Re:An External Replication on the Effects of Test-driven Dev... by flukus on Wednesday October 19, 2016 @02:48AM (#12741627)
Maybe we have to accept that it's untestable.

Though I think we could derive some more realistic scenarios, like evolving requirements and switching developers mid project that would be more enlightening.

Re:An External Replication on the Effects of Test-driven Dev... by yomly on Wednesday October 19, 2016 @03:45AM (#12741868)
Whereas the cost of finding the Higgs Boson was only a mere $13.25Bn, cheap compared to all those pesky extortionate SV engineers...

As others have said, good research costs money...

Re:An External Replication on the Effects of Test-driven Dev... by mwat on Wednesday October 19, 2016 @02:51AM (#12741638)
We can't arrange a good study, so let's churn out deeply flawed ones instead.
Re:An External Replication on the Effects of Test-driven Dev... by icebraining on Wednesday October 19, 2016 @02:49AM (#12741629)
How do you propose to gather more experienced, professional developers into the same location and get them to work on a topic that isn't making them tons of money?

Hackatons seem to manage. Why not set one up?

Re:An External Replication on the Effects of Test-driven Dev... by vacri on Wednesday October 19, 2016 @06:40AM (#12742615)
Hackathons wouldn't satisfy the OP's requirements for complexity, nor demographics - you'd be looking at a self-selecting group of highly motivated people, skewing young, who would come together hackathon style. There aren't going to be many thirty- or forty-something coders with young families spending a weekend (to work on the same set problems as everyone else) at the hackathon, yet there are plenty of those in industry.
Re:An External Replication on the Effects of Test-driven Dev... by unclebucknasty on Wednesday October 19, 2016 @12:48AM (#12741152)
Indeed. It is predictable and--as a discussion point--stifling.

It's far more interesting to discuss the actual merits than to dismiss the subject out of hand.