[Webtest] [dev] source cleanup?

Marc Guillemot webtest@lists.canoo.com
Thu, 30 Sep 2004 10:59:22 +0200


>>>I agree, remember we need that for site deployment.
>>>It is more difficult to do since we have dependencies in the xml entity
>>>defs.
>>
>>what about using xsl:document in the xslt rather than entities in 
>>the xml? Indeed the doctype with the entities is the 
>>cause of all the errors reported during the xslt transformation.
> 
> Does xsl:document remove the dependency?

it should.

>>>>- move junit tests in a separate source folder and remove all
>>>>AllTests.java
>>>
>>>I disagree.
>>
>>why? It's a common usage on numerous great open source projects.
> 
> Aha. Any numerous great open source projects out there with a test coverage
> over 90%? Moving tests away from the code is the first step into
> ignoring them.
 > What would be the benefit from moving them away?

webtest has a "good" test coverage... in percent. But even a 100% percent test coverage is not that good when the test 
quality is poor. And that is the case for many of the webtests unit tests. The reason is that we are working on web 
pages in the real life but not in the tests. Htmlunit will allow us to greatly improve the test quality because it 
provides mock objects allowing to work on fast real web pages from the tests.
htmlunit is a good example of a project having very good unit tests, a high test coverage, a clean source structure... 
and tests in a separate source dir.

>>>>- use jsp for selftests instead of html generated from a servlet
>>>
>>>I disagree.
>>
>>why? The jsp are easier to read and to maintain. Who uses freely 
>>servlets to generate html code today? Personnaly, I was 
>>quite discouraged when I wanted to made my first webtest 
>>"commitable" after having seen this servlet.
> 
> I agree that the current implementation of the FormTestServlet
> is overloaded as it serves too many purposes at once. But this
> doesn't mean that it is the wrong technology for the purpose.
> 
> JSP are sometimes easier to read, i.e. in the most simple cases.
> They are certainly harder to maintain as they tend to
> collect massive duplication as their number grows.
> 
> I'm happy to use static html for simple clicking tests.
> I'm happy to use JSP for the simplest logic.
> I'm happy to use plain Servlets when more logic is needed.
> 
> BTW: We use Servlets freely and generate html for a number of
> web applications that run on our customer's sites, 
> serving literally millions of pages with 
> consistent look and behaviour. Maintenance effort is some orders of
> magnitude lower than with all the templating approaches that
> our customers have in other places.

the selftest application doesn't need to server thousands of web pages. It's only there to allow... selftest. Most of 
the tests only needs mainly static pages and therefore the easiest way for me to achieve this it to use html pages or 
jsp and not a servlet.

Marc.