Click here to Skip to main content
15,887,485 members

The Insider News

   

The Insider News is for breaking IT and Software development news. Post your news, your alerts and your inside scoops. This is an IT news-only forum - all off-topic, non-news posts will be removed. If you wish to ask a programming question please post it here.

Get The Daily Insider direct to your mailbox every day. Subscribe now!

 
NewsNot all ad blockers are the same. Here’s why the EFF’s Privacy Badger is different Pin
Kent Sharkey11-May-14 13:01
staffKent Sharkey11-May-14 13:01 
GeneralRe: Not all ad blockers are the same. Here’s why the EFF’s Privacy Badger is different Pin
Rob Grainger12-May-14 23:01
Rob Grainger12-May-14 23:01 
GeneralRe: Not all ad blockers are the same. Here’s why the EFF’s Privacy Badger is different Pin
Kent Sharkey13-May-14 4:27
staffKent Sharkey13-May-14 4:27 
NewsMicrosoft Web server software closes in on Apache's lead Pin
Kent Sharkey11-May-14 10:25
staffKent Sharkey11-May-14 10:25 
GeneralRe: Microsoft Web server software closes in on Apache's lead Pin
Dan Neely12-May-14 7:10
Dan Neely12-May-14 7:10 
GeneralRe: Microsoft Web server software closes in on Apache's lead Pin
Kent Sharkey12-May-14 7:13
staffKent Sharkey12-May-14 7:13 
NewsThe pitfalls of Test-Driven Development Pin
Kent Sharkey11-May-14 10:17
staffKent Sharkey11-May-14 10:17 
GeneralRe: The pitfalls of Test-Driven Development PinPopular
Marc Clifton11-May-14 12:01
mvaMarc Clifton11-May-14 12:01 
In the article TDD is dead.  Long live testing.  and a subsequent response The pitfalls of Test-Driven Development, both authors, in my opinion, are missing the mark by a mile. In the real world, walking into an existing code base, the reason you need TDD (but can't use it) is because programmers didn't spend sufficient time on good architecture practices, resulting in code that is an entangled morass of intertwined concerns, and yes, as one of the author's points out, because the code itself was never intended to be tested except through, at best, acceptance test procedures (most likely the pen and paper variety -- with the developer watching in the background hoping he rolls a 20.)  There is an overall lack of attention paid to designing a component with sufficient abstraction that it can accommodate changing requirements, and little or no attention paid to separating (decoupling) the behaviors between components such that component A shouldn't ever care about what component B is doing. We have a philosophy of refactoring with "just get the minimum to work" to blame for that -- the days of thinking about architecture and abstraction are long gone.

The metaphor of building a sky-scraper is inaccurate because anyone building a sky-scraper would know that you can't make the walls of the first floor so weak that they can't support a second floor. Except it is accurate because, not paying attention to the requirements and living in a "do the minimum work" philosophy, promoted by the likes of Kent Beck's Extreme Programming and Martin Fowler's refactoring philosophies, this actually is exactly what ends up happening, and thus TDD is an absolute necessary fallout of a broken coding paradigm. A more accurate metaphor would have been, the requirements called for a single story building, then the requirements changed. Again, with sufficient abstraction up front, the straw-bale walls could be replaced with titanium reinforced hay quite easily.

As for Rails (or rather Ruby, or rather any duck-typed language), TDD is again essential because duck-typing allows for variances in the behavior at runtime, both of type and function calls. The non-strictness of duck-typing is leveraged in lieu of good object-oriented design--why create sub-classes when I can just pass in an instance that quacks just like the other "ducks." While object-oriented programming cannot be done well without object-oriented design (and yes, I've seen both the "P" and the "D" done horribly and have done it horribly myself) a duck-type language allows the programmer to completely eliminate the "D" -- class, method, quack, quack. Perhaps we should take a clue from the name, "duck-typing", that it is actually quackery, and like medical quackery, promises rapid "feel good" development that you end up paying for in little fragments of time running unit and integration tests because you didn't do the necessary up front design, you haven't clearly abstracted how the rules are handled, you haven't clearly decoupled the behaviors of complex systems to identify the dependencies (which all complex systems will have.) If you add up all the time spent running those tests (which of course spawned whole new technologies to run those tests faster and faster) you will discover that over the lifetime of the product, you spent far more time watching little green bars (or red ones) than you would have spent on solid up-front architecture, particularly in the areas of abstraction. But nay, it quacks, and it's fast. At first.

As for "the industry's sorry lack of automated, regression testing", here, let's not blame the programmer directly even though they consistently over-promise and under-estimate, but rather, let's blame a culture, yes, starting with "the geek" but also placing responsibility firmly on the business practices of management and the continually demonstrated lack of understanding of the importance of regression testing, and the time & cost that developing regression tests and even more costly, maintaining those tests, requires. As with essentially all other aspects of our society, we are living in a constant tension between short-term gains and long-term investment (TDD can be considered an investment) and we all know which side is winning. We have a culture that rewards quick results and punishes the methodical and (seen as) slow thinker. Some of this may be justifiable due to market pressures and real budgetary constraints, but what is lacking is the consciousness to balance planning and activity.  So what we have instead is a knee-jerk culture oriented to quick results (Extreme Programming and Refactoring) which, to support a broken development paradigm, demands TDD as the "fix", but nobody seems sees that.

When one of the author's writes "I have yet to see a concrete illustration of how to use Test-Driven Development to test a back-end system interacting with a 20-year-old mainframe validating credit card transactions" I laugh because I have done just that -- CC validation systems all have the means of simulating transactions, it's actually trivial to write TDD's against such systems. Yes, the author does have a point that much of the "...source code [encountered in legacy systems]...was never designed to be tested in the first place...", but again, that's missing the point -- TDD is clearly the wrong tool for those systems. TDD works best in an environment:

  • lacking architecture,
  • most likely using duck-typing languages,
  • and, most importantly, one that has started from ground zero with testing as one of the coding requirements.

This is independent of whether it's a 200 line gem (as in Ruby library as opposed to a "great thing") or a 100 million line application. If those 100 million lines were written with the intention of being unit / feature tested, then there is no problem. Except that it's TDD and probably not well architected out of the gate.  And let me be clear that TDD, when applied to a well architected application, is a perfectly valid and beneficial practice, but then TDD is also simplified because it ends up testing behaviors, not architectural flaws and geese trying to pretend to be ducks.

So, is the failure TDD? No. The failure is in a culture entrenched at all levels of software development that says that Extreme Programming and Refactoring can replace thinking and it's brothers "design" and "planning."  We have Kent Beck and Martin Fowler (I commit sacrilege in criticizing the gods) to squarely blame for that "regression", excuse me, "story."  And it's those two aspects (pun intended) of programming that should be given the boot, not TDD, which has a validity in and of itself under the right conditions.

modified 11-May-14 18:40pm.

GeneralRe: The pitfalls of Test-Driven Development Pin
Kent Sharkey11-May-14 13:08
staffKent Sharkey11-May-14 13:08 
GeneralRe: The pitfalls of Test-Driven Development Pin
Marc Clifton11-May-14 13:23
mvaMarc Clifton11-May-14 13:23 
GeneralRe: The pitfalls of Test-Driven Development Pin
Nagy Vilmos12-May-14 2:46
professionalNagy Vilmos12-May-14 2:46 
GeneralRe: The pitfalls of Test-Driven Development Pin
  Forogar  12-May-14 5:19
professional  Forogar  12-May-14 5:19 
GeneralRe: The pitfalls of Test-Driven Development Pin
_Maxxx_12-May-14 20:35
professional_Maxxx_12-May-14 20:35 
NewsAs mobile roars ahead, it’s time to finally admit the web is dying Pin
Kent Sharkey11-May-14 10:15
staffKent Sharkey11-May-14 10:15 
GeneralRe: As mobile roars ahead, it’s time to finally admit the web is dying Pin
  Forogar  12-May-14 6:58
professional  Forogar  12-May-14 6:58 
NewsWayback Machine hits 400,000,000,000! Pin
Kent Sharkey11-May-14 10:11
staffKent Sharkey11-May-14 10:11 
NewsSpurious Correlations finds the hidden, totally pointless connections between everything Pin
Kent Sharkey11-May-14 9:44
staffKent Sharkey11-May-14 9:44 
GeneralRe: Spurious Correlations finds the hidden, totally pointless connections between everything Pin
Bernhard Hiller12-May-14 0:11
Bernhard Hiller12-May-14 0:11 
NewsAsk Ars: Why are some programming languages faster than others? Pin
Kent Sharkey11-May-14 9:40
staffKent Sharkey11-May-14 9:40 
NewsOracle wins, Google loses in copyright ruling on Java APIs Pin
Kent Sharkey11-May-14 7:14
staffKent Sharkey11-May-14 7:14 
GeneralRe: Oracle wins, Google loses in copyright ruling on Java APIs Pin
Member 1008817111-May-14 8:13
Member 1008817111-May-14 8:13 
GeneralRe: Oracle wins, Google loses in copyright ruling on Java APIs Pin
Kent Sharkey11-May-14 9:39
staffKent Sharkey11-May-14 9:39 
NewsMicrosoft seeds doubt by erasing XP line in the sand Pin
Kent Sharkey8-May-14 13:54
staffKent Sharkey8-May-14 13:54 
GeneralRe: Microsoft seeds doubt by erasing XP line in the sand Pin
Duncan Edwards Jones8-May-14 21:56
professionalDuncan Edwards Jones8-May-14 21:56 
NewsAndroid users are more likely to take the bus, while the frequent fliers choose iPhones Pin
Kent Sharkey8-May-14 13:06
staffKent Sharkey8-May-14 13:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.