Click here to Skip to main content
15,895,011 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
QuestionTDD vs. just being careful Pin
Mat Fergusson9-Jun-14 11:42
Mat Fergusson9-Jun-14 11:42 
AnswerRe: TDD vs. just being careful Pin
Marc Clifton9-Jun-14 12:25
mvaMarc Clifton9-Jun-14 12:25 
GeneralRe: TDD vs. just being careful Pin
_Maxxx_9-Jun-14 14:29
professional_Maxxx_9-Jun-14 14:29 
GeneralRe: TDD vs. just being careful Pin
Marc Clifton10-Jun-14 2:53
mvaMarc Clifton10-Jun-14 2:53 
GeneralRe: TDD vs. just being careful Pin
Super Lloyd9-Jun-14 17:49
Super Lloyd9-Jun-14 17:49 
GeneralRe: TDD vs. just being careful Pin
Marc Clifton10-Jun-14 2:56
mvaMarc Clifton10-Jun-14 2:56 
GeneralRe: TDD vs. just being careful Pin
PIEBALDconsult9-Jun-14 14:24
mvePIEBALDconsult9-Jun-14 14:24 
AnswerRe: TDD vs. just being careful Pin
_Maxxx_9-Jun-14 14:27
professional_Maxxx_9-Jun-14 14:27 
I am neither an advocate of, nor am I opposed to it in principal.

The great thing about unit tests in general, is that they should prevent side-effects creeping into a system when a small, seemingly unrelated change is made.

If you are using TDD then there shouldn't be many places where you find bits that can't be tested - because you write the tests first and then program to pass the test. Sometimes (certainly more often than I'd like) this means structuring a solution in a way to suit unit tests, and not in a way that one would otherwise choose. (a good example is the static service class - an ideal use of a static class, but because of the difficulty in unit testing, would need to be engineered as a non static class and injected)

Mat Fergusson wrote:
What is so wrong with actually thinking hard about what it is you are being asked to do, working out the best way to achieve it and then carefully implementing it properly?


The problem is that, even very smart people, who are gobsmackingly awesome developers, can make mistakes when maintaining complex systems that are not well documented, because they will make well-thought-out changes, imlement them in the best possible way, properly and, after deployment, it will transpire that one client uses the system differently and a side-effect of that change is that the system falls into a black hole, and everyone starts shouting. And I hate shouting!


Mat Fergusson wrote:
using the crutch of automated testing encourages doing it right the first time.

When scuba diving, one checks one's own equipment, then checks one's buddy's equipment. Does this make you lazy and more likely to miss something, leaving it up to your buddy to prevent you drowning? Possibly. Does it therefore lead to more drownings? No - because that second check gets done. (and, frankly, one doesn't want to be caught out and embarrassed by one's buddy gleeful cry of "not turning your air on, today then?"


Mat Fergusson wrote:
it worked ok in the punch-card days.


Yep - and in those days we also wrote full flow charts before writing code, and documented to the nth degree - so making a change involved a lot of up-=front thought, and the changes to the flowchart and documentation being checked by humans. These days we can use computers to do some of that checking - it's what they are good at, shirley?



IMHO, when starting a new project, using TDD can be useful over the life of the project. Adding tests to an existing project - place in the 'too-hard' basket and move on.
GeneralRe: TDD vs. just being careful Pin
Dan Neely10-Jun-14 2:54
Dan Neely10-Jun-14 2:54 
GeneralRe: TDD vs. just being careful Pin
Mat Fergusson10-Jun-14 11:05
Mat Fergusson10-Jun-14 11:05 
GeneralRe: TDD vs. just being careful Pin
Dan Neely10-Jun-14 11:11
Dan Neely10-Jun-14 11:11 
GeneralRe: TDD vs. just being careful Pin
Mat Fergusson10-Jun-14 11:12
Mat Fergusson10-Jun-14 11:12 
AnswerRe: TDD vs. just being careful Pin
Super Lloyd9-Jun-14 16:41
Super Lloyd9-Jun-14 16:41 
AnswerRe: TDD vs. just being careful Pin
BobJanova10-Jun-14 0:15
BobJanova10-Jun-14 0:15 
AnswerRe: TDD vs. just being careful Pin
Andy Brummer10-Jun-14 0:36
sitebuilderAndy Brummer10-Jun-14 0:36 
NewsGreat moment for AI! Pin
ridoy9-Jun-14 10:04
professionalridoy9-Jun-14 10:04 
GeneralRe: Great moment for AI! Pin
Kenneth Haugland9-Jun-14 10:14
mvaKenneth Haugland9-Jun-14 10:14 
GeneralRe: Great moment for AI! Pin
PIEBALDconsult9-Jun-14 10:14
mvePIEBALDconsult9-Jun-14 10:14 
GeneralRe: Great moment for AI! PinPopular
Pete O'Hanlon9-Jun-14 10:17
mvePete O'Hanlon9-Jun-14 10:17 
GeneralRe: Great moment for AI! Pin
Kenneth Haugland9-Jun-14 10:22
mvaKenneth Haugland9-Jun-14 10:22 
GeneralRe: Great moment for AI! Pin
Kornfeld Eliyahu Peter9-Jun-14 10:25
professionalKornfeld Eliyahu Peter9-Jun-14 10:25 
GeneralRe: Great moment for AI! Pin
Pete O'Hanlon9-Jun-14 10:31
mvePete O'Hanlon9-Jun-14 10:31 
GeneralRe: Great moment for AI! Pin
Kornfeld Eliyahu Peter9-Jun-14 10:37
professionalKornfeld Eliyahu Peter9-Jun-14 10:37 
GeneralRe: Great moment for AI! Pin
Mike Hankey9-Jun-14 10:31
mveMike Hankey9-Jun-14 10:31 
GeneralRe: Great moment for AI! Pin
Kornfeld Eliyahu Peter9-Jun-14 10:35
professionalKornfeld Eliyahu Peter9-Jun-14 10:35 

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.