I understand very well your point but I don't think you understood mine ...
:-)
What I am saying is that unit tests are fine-grained and can exercise all
needed tests. For example I don't see any unit test to verify that when the
server returns 2 cookies in 2 different HTTP headers it works fine ! ....
Why ? Because if you test this by hitting real servers it is going to be
*very* hard to simulate. In principle you'll want to exercise the full
client HTTP RFC and this is going to be impossible by hitting real servers.
It is however very easy to do with Mock Objects.
I alsol agree that we also need some coarse grain functional tests which hit
real servers but it comes as a complement to the unit tests.
Thanks
-Vincent
----- Original Message -----
From: "Morgan Delagrange" <[EMAIL PROTECTED]>
To: "Vincent Massol" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Monday, August 27, 2001 5:01 PM
Subject: Re: [httpclient] unit test suite
> I don't think I got my point across here. I'm all in favor of having unit
> tests. I just think that the unit tests should bang on real servers, not
> mock objects.
>
> ----- Original Message -----
> From: "Vincent Massol" <[EMAIL PROTECTED]>
> To: "Morgan Delagrange" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Monday, August 27, 2001 10:57 AM
> Subject: Re: [httpclient] unit test suite
>
>
> > Hi Morgan,
> >
> > There are 2 kinds of tests :
> > * unit tests
> > * functional tests
> >
> > I was referring to the unit tests which are supposed to fully test the
> code
> > logic. It is also easily automatable and need to be run every time you
> > modify something to ensure you don't break anything. It is quite
> > fine-grained tests compare to functional tests.
> >
> > Functional tests are harder to automate but can be done (see Cactus).
> > However, we'll have to say which test can be run on which server because
> as
> > I saw in the comment of some test Tomcat 3.x does not support OPTIONS
> > request for example so these tests should not be executed on Tomcat 3.x,
> ...
> > Also we need to control the page that is hit by the test so we'll
probably
> > need to provide some test pages to deploy to the test server.
> >
> > I don't see what would be the problem of providing unit tests ! The more
> > tests the better (provided they are executed all the time and corrected
> when
> > modifications or new APIs are introduced). I am also a partisan of test
> > first .... but I won't ask you to do that ... (although you should try
one
> > day, I'm sure you'll like it) :-)
> >
> > Thanks
> > -Vincent
> >
> > ----- Original Message -----
> > From: "Morgan Delagrange" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > Sent: Monday, August 27, 2001 3:00 PM
> > Subject: Re: [httpclient] unit test suite
> >
> >
> >
> > Vincent Massol wrote on 8/25/01 12:02 pm:
> >
> > >I think that if we wish to
> > >provide a strong and reliable
> > >http client framework we
> > >ought to have a good suite of
> > >unit test that we will enrich
> > >as we go along and find bugs.
> > >I have had a brief look at the
> > >current tests and we really
> > >need to refine them.
> >
> > Agreed, we could definitley use more tests.
> >
> > >They also rely on the
> > >installation of a web server
> > >on your machine which I don't
> > >like too much as the test will
> > >pass and fail depending on
> > >which one you use ...
> >
> > Isn't that an advantage? After all, wouldn't you want to try running
your
> > tests on the actual server you will be communicating with?
> >
> > >Instead I propose to simply
> > >use Mock Objects to provide
> > >a reliable suite of tests,
> > >which is independent of the
> > >web server installed. The
> > >principle is simple: we simply
> > >need to create a mock
> > >Socket class and a way to
> > >pass this mock to the
> > >HttpClient class. The idea is
> > >that it is possible from our
> > >test case to set the
> > >behaviour that we expect
> > >from the mock Socket class,
> > >like what data it will return
> > >on the output stream, ...
> > >there is absolutely no logic in
> > >the mock implementation,
> > >just setters and getters.
> >
> > I think we want to be testing real servers, so we can uncover a wider
> > variety of problems.
> >
> > >I'll write one ASAP but I'd like
> > >to know if I can be voted in ....
> > >I am yearning to go forward
> > >especially as Cactus now
> > >relies on HttpClient.
> >
> > You don't need our approval to be a committer, but I don't know if this
> > particular task is a good idea.
> >
> > - Morgan
> >
> >
> > _________________________________________________________
> > Do You Yahoo!?
> > Get your free @yahoo.com address at http://mail.yahoo.com
> >
> >
> >
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>