TDD, BDD, and the tea tasting lady
blinkingcaret.wordpress.com
blinkingcaret.wordpress.com
There is an order of magnitude difference from the projects that did not use TDD, and the projects that did. Another nice part of red mine is that I can also visualize how close we are at meeting our expectations for time estimates (they have this task tracking feature). Overall adding TDD has made development a bit slower in the front end, but a lot shorter in the back end (during QA). However when you look at the past, it would seem like something like 60% to 70% of our time was actually spent fixing issues found in QA, which was usually under estimated. So overall we're definitely seeing quantitative proof that TDD is a better methodology in comparison to our past process.
Anther cool tool for project management is we've built a set of tools that allow us to designate a requirement from our functional spec with a unit test, which runs every check in. So our project manager can get a near real time assessment of our progress. I also use that report and associate it with the code coverage report. Though this part of the system is newer, so I have no data on how effective it is.
Duration of observation team size (over time) survey of team members anyone go from one team to another? Someone with perspective across both teams would be good. Domain complexity of each project Other code metrics (cyclomatic complexity, coupling, etc)
A post would be nice as a reference (as opposed to a comment here).
Not a small request, I understand, but I'm sure others would find it very valuable too.
Beyond that though, its nice to see a bit more details on your progress as the development continues. We definitely have more productive status meetings. We used to sit down once a week, and go around the table asking people where they are, but now everyone knows the status all the time (we all can see it). That allows us to spend more time on discussing problem solutions. During development, developers keep track of their own progress with less work. As a lead, its useful for me to see areas of weakness so I can have more targeted code reviews.
To apply the scientific method to software development you need to apply methods from the social sciences. Now I don't know a great deal about these, but I do know you need lots of data which is very hard to find. The typical solution is test hypotheses on undergrad students, because that is what the experimenters have plentiful access to. The problem, which is also apparent in psychology, is generalising these results beyond this group. Are the experiences of 2nd year undergrads using Java for a 2 week project predictive of developers with 10+ years experience working on a year long project? One can reasonably argue they are not.
The Lady Tasting Tea: How Statistics Revolutionized Science in the Twentieth Century http://www.goodreads.com/book/show/106350.The_Lady_Tasting_T...
If I test random programmers by getting them to do the same project either with TDD or without, TDD proponents might (justifiably) complain that the programmers didn't do TDD properly, since they didn't know how.
If I use TDD proponents to do the TDD side of the test, and TDD skeptics the non-TDD side, then one might claim that there is a bias in the quality of programmer (either people who like TDD make better programmers, or TDD skeptics make better programmers, depending on the results).
For every test you come up with, there's a potential bias that you cannot eliminate, since there will be some hypothetical correlation somewhere that doesn't correspond to TDD itself.
Doing other tests with entirely randomly chosen programmers ensuring they're trained up in these techniques would be another way - though as you point out the training would have to ensure they got the techniques they were being tested against / you'd need to avoid bias of people having spent the last few weeks exclusively in an exclusively TDD environment due to the training.
http://dev.theladders.com/2013/02/mutation-testing-with-pit-...
Otherwise:
Sometimes code review will turn into a pissing match of who can find the most errors in other people's code
TDD will turn into a quest for a higher "coverage number" regardless of the actual testing quality
But it's mostly about, as you said, personal preferences or 'philosophies' regardless of the actual results of the code.
So you waste a lot of time because someone thinks the way you did it is not 'OO enough' or 'should be organized better' even if it is working (I'm not talking about code that's messy)
http://proceedings.informingscience.org/InSITE2012/InSITE12p...
Among other things, it includes a long list of references -- taken after searching based on:
http://mango2.vtt.fi/virtual/agile/publications.html
That again was referenced in the following blog post from 2007, that I found more interesting (if rather similar) to op:
"Jim Coplien and Bob Martin Debate TDD" http://www.youtube.com/watch?v=KtHQGs3zFAM
If you pour the milk into the tea, the first bit of milk will heat to nearly boiling, scalding it and changing its flavor. If you pour the tea into the milk, you don't have that problem.
(And as a personal note - if you need milk to make your tea taste good, maybe you just don't have good tea?)
Otherwise the concentration is higher and the temperature is lower near the bottom of the glass.
By the same reasoning, tea should actually mix better if you add the tea first, since milk has about the same density as orange juice and tea has about the same density as water. But in the case of tea and milk, you just have to bite the bullet and stir it manually if you want to avoid scalding.
I'm pretty sure I could if you let me practice beforehand. There's a pretty distinctive smell to scalded milk.
>What chemical change in the milk accounts for "scalding"?
Protein denaturing. It's a well documented effect in milk, and some recipes even specifically call for it. It's just not great in tea.
It's pretty hard to apply that same blinding to reading code with large or small methods. There are definitely ways to test it, but it's not quite as simple.
How true that is I'm not really sure.
Really, it boils down to how easy the code is to understand and maintain. Group code into logical groups. Don't break it up if the only benefit is following some arbitrary rule stating your functions should be no more than x lines long.
This has the consequence of making the methods smaller since they are narrow in scope.
It's easier to understand a well named method with a few lines of code (and believe me, it's easier to properly name it than a method with a lot of code, since the former is focused in one task and it is easy to come up with a name that describes that task; and the latter, where the method does so many things that there's no way you can name it properly [have you ever found methods with names like DoWork and then 100 lines, I'd say that is a code-smell].
Yes, and when breaking up a large function, a very important thing is that you are giving a name to various steps as well as hiding details. Large undifferentiated functions just read like one damn detail after another. Picking good names greatly helps the readability.