Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

VS 2008 - test driven?

3 views
Skip to first unread message

roger....@googlemail.com

unread,
Jan 28, 2008, 5:23:11 AM1/28/08
to
Hello,

Can anyone tell me whether VS 2008 has test-driven development
facilities in it? If so, in which versions?

Thanks,

Roger Pearse

AGP

unread,
Jan 29, 2008, 11:32:06 PM1/29/08
to
what does that mean?

AGP

<roger....@googlemail.com> wrote in message
news:987b8763-306d-4059...@p69g2000hsa.googlegroups.com...

roger....@googlemail.com

unread,
Jan 30, 2008, 3:15:50 PM1/30/08
to
There are lots of articles online about this, but I'll give a brief
explanation.

Historically programmers tended to sit down and write their code, then
test it, then put it live, then find bugs, modify it, and so on around
the circle. But this had the problem that code was being hand-tested,
usually unreliably, and was often brittle; small changes in one area
of the system would silently destroy the functioning of some other
piece, unknown to the developer.

The modern idea is to write automated tests as you develop, and needs
IDE support so that tests can be easily written and run as you type
code. (Usually a suite of tests is run automatically every hour as
well, and if any test fails then the team of developers is emailed
that someone has broken something!)

So if you need a class to look up an entry in a dictionary, you write
a test first, which checks that you can call the class. This fails
when you run it, of course; you haven't written the class yet! So you
write the skeletal class, and the test passes.

You now need to write code to load your dictionary. So you design a
method for the class which allows you to see if the dictionary is
loaded or not. You then write a test to check that the dictionary is
loaded; this fails because you haven't written the load code yet. So
now you write the load code, and the test passes.

Now you write a test that passes in a string that you want to look
up. This fails because you haven't implemented the method yet in the
class to do looking up. So you do, and it compiles. And thenyou
implement the lookup, and the test passes.

Then you write more tests, as you think of other things the class
should do, and make sure they all work.

At the end your class is completely covered by tests that reflect what
you think the class should do. You can change the internals as much
as you like; but the tests should all still run OK.

In this way you reduce the number of bugs in your code, by building it
in small, tested chunks, and reduce the chance of breaking stuff that
you have already written.

All the best,

Roger Pearse

On Jan 30, 4:32 am, "AGP" <sindizzy....@softhome.net> wrote:
> what does that mean?
>
> AGP
>

> <roger.pea...@googlemail.com> wrote in message


>
> news:987b8763-306d-4059...@p69g2000hsa.googlegroups.com...
>
>
>
> > Hello,
>
> > Can anyone tell me whether VS 2008 has test-driven development
> > facilities in it?  If so, in which versions?
>
> > Thanks,
>

> >Roger Pearse- Hide quoted text -
>
> - Show quoted text -

0 new messages