Re: c# 2004 (Whidbey)
I'm confused now.
What is the point of doing both unit tests and stepping thru a debugger then
(on corporate time that is)? What would one method uncover that the other
one won't since they are in fact doing the exact same thing - assuming that
you spent the day writing a unit test to examine every line of code (which
is feasible but very impractical). Seems like we all ought to go with Nial's
suggestion and forget about the debugger and just rely on unit tests to keep
the airplane from hitting the mountain.
Case in point. My function takes a date string examines it, returns a
formatted string or empty if the date is bogus. There are many ways to enter
bogus dates obviously. Would your unit test, generate every possible bogus
date? No? A subset of bogus dates maybe? Well you are flying blind hoping
that the date entered was a date your unit test actually used. Is it not
easier to flush out this bug by examining what the string looks like in a
debugger? It's now easy to tell how your function can handle it for every
possible case. Not the best case in point but sufficient to demonstrate what
I am thinking.
That mountain sure looks close to us now. wonder if the date string the
pilot entered was tested.
"Jon Skeet" <skeet@pobox.co m> wrote in message
news:MPG.199de0 a91916e09d98a2b 8@news.microsof t.com...[color=blue]
> Alvin Bruney <vapordan_spam_ me_not@hotmail_ no_spamhotmail. com> wrote:[color=green][color=darkred]
> > > That's true of everything - but I'd rather put effort into unit[/color][/color][/color]
testing[color=blue][color=green][color=darkred]
> > > properly than into stepping through code properly once.[/color]
> >
> > You missed the point. I didn't, or can't remember saying I wouldn't unit
> > test. In fact, I didn't say that! what i had a gripe with was Nial[/color][/color]
saying he[color=blue][color=green]
> > didn't step thru written code instead relying on unit tests to fish out
> > bugs. That is wrong and will always be wrong. Every line of written code
> > must be stepped thru in the debugger. There is no compromise on this.[/color][/color]
none[color=blue][color=green]
> > at all. You can unit test before after or during the process. I[/color][/color]
encourage[color=blue][color=green]
> > it.[/color]
>
> But unit testing *does* (or at least should) execute all the code,
> getting complete coverage. What does it matter whether or not that
> happens in a debugger?
>[color=green][color=darkred]
> > > Where did Niall say that someone *else* would be writing the unit
> > > tests? Typically it's the person writing the code who writes the unit
> > > tests in the first place.[/color]
> >
> > No, that's not even the recommended way.[/color]
>
> It is from everyone I've heard recommending unit testing...
>[color=green]
> > In my case, unit tests were prepared by the testing department.[/color]
>
> And that sounds like a lousy idea to me - and you've said it didn't
> work. In my experience, testing departments should be dealing much more
> with system tests than with unit tests. Unit tests are on a much lower
> level than I believe most testing departments should care about.
>[color=green]
> > We were made to participate in a one day
> > seminar by some expert who taught that this was the recommended way to
> > proceed. Hence it was an assumption on my part based on my experience.[/color]
>
> It sounds like your "expert" wasn't actually very expert at all. Just
> because he recommended something that doesn't work doesn't mean that
> things that *do* work aren't recommended by other people.
>
> --
> Jon Skeet - <skeet@pobox.co m>
> http://www.pobox.com/~skeet/
> If replying to the group, please do not mail me too[/color]
I'm confused now.
What is the point of doing both unit tests and stepping thru a debugger then
(on corporate time that is)? What would one method uncover that the other
one won't since they are in fact doing the exact same thing - assuming that
you spent the day writing a unit test to examine every line of code (which
is feasible but very impractical). Seems like we all ought to go with Nial's
suggestion and forget about the debugger and just rely on unit tests to keep
the airplane from hitting the mountain.
Case in point. My function takes a date string examines it, returns a
formatted string or empty if the date is bogus. There are many ways to enter
bogus dates obviously. Would your unit test, generate every possible bogus
date? No? A subset of bogus dates maybe? Well you are flying blind hoping
that the date entered was a date your unit test actually used. Is it not
easier to flush out this bug by examining what the string looks like in a
debugger? It's now easy to tell how your function can handle it for every
possible case. Not the best case in point but sufficient to demonstrate what
I am thinking.
That mountain sure looks close to us now. wonder if the date string the
pilot entered was tested.
"Jon Skeet" <skeet@pobox.co m> wrote in message
news:MPG.199de0 a91916e09d98a2b 8@news.microsof t.com...[color=blue]
> Alvin Bruney <vapordan_spam_ me_not@hotmail_ no_spamhotmail. com> wrote:[color=green][color=darkred]
> > > That's true of everything - but I'd rather put effort into unit[/color][/color][/color]
testing[color=blue][color=green][color=darkred]
> > > properly than into stepping through code properly once.[/color]
> >
> > You missed the point. I didn't, or can't remember saying I wouldn't unit
> > test. In fact, I didn't say that! what i had a gripe with was Nial[/color][/color]
saying he[color=blue][color=green]
> > didn't step thru written code instead relying on unit tests to fish out
> > bugs. That is wrong and will always be wrong. Every line of written code
> > must be stepped thru in the debugger. There is no compromise on this.[/color][/color]
none[color=blue][color=green]
> > at all. You can unit test before after or during the process. I[/color][/color]
encourage[color=blue][color=green]
> > it.[/color]
>
> But unit testing *does* (or at least should) execute all the code,
> getting complete coverage. What does it matter whether or not that
> happens in a debugger?
>[color=green][color=darkred]
> > > Where did Niall say that someone *else* would be writing the unit
> > > tests? Typically it's the person writing the code who writes the unit
> > > tests in the first place.[/color]
> >
> > No, that's not even the recommended way.[/color]
>
> It is from everyone I've heard recommending unit testing...
>[color=green]
> > In my case, unit tests were prepared by the testing department.[/color]
>
> And that sounds like a lousy idea to me - and you've said it didn't
> work. In my experience, testing departments should be dealing much more
> with system tests than with unit tests. Unit tests are on a much lower
> level than I believe most testing departments should care about.
>[color=green]
> > We were made to participate in a one day
> > seminar by some expert who taught that this was the recommended way to
> > proceed. Hence it was an assumption on my part based on my experience.[/color]
>
> It sounds like your "expert" wasn't actually very expert at all. Just
> because he recommended something that doesn't work doesn't mean that
> things that *do* work aren't recommended by other people.
>
> --
> Jon Skeet - <skeet@pobox.co m>
> http://www.pobox.com/~skeet/
> If replying to the group, please do not mail me too[/color]
Comment