cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reinhard Poetz <>
Subject Re: Integration tests
Date Tue, 15 Jan 2008 20:44:59 GMT
Grzegorz Kossakowski wrote:
> Reinhard Poetz pisze:
>> Grzegorz Kossakowski wrote:
>>> Reinhard Poetz pisze:
>>> Yes I was very happy to see your commits. However, I always thought that
>>> it's first that you write unit tests for covering the most basic 
>>> functionality and ITs for testing how different parts interact with each
>>> other.
>>> Doesn't it make sense to write a few unit tests first?
>> :-) yes, I fully agree. However, I wanted to explore the code by writing 
>> unit tests but I failed. Maybe I invested to less time but I came to the 
>> conclustion that it is easier to write integration tests.
> I don't understand what you mean exactly. Do you mean it was too complicated
> to write unit tests? I haven't taken a closer look at your IT work but I
> guess it should be always easier to write isolated unit tests than ITs. Am I
> wrong?

hmmm, it depends. Integration tests for Cocoon have always been tests at 
HTTP/XHTML level. The only difficult part is setting up the environment. 
Everything else is checking if an http call produces the right output which is 
fairly easy using XPath asserts or XMLDiff.

>>> What kind of ITs do you plan to write?
>> I want to test ... o absolute and relative connections to servlet services 
>> o connecting to blocks using the servlet:/ protocol o super connections o
>> accessing information coming from the original request o error handling o
>> postable sources o servlet-service generator/transformer/serializer
> I don't want to be pesky but... most of these items looks like perfect cases
> for unit tests. Don't they?
> I'm not feeling good about testing basic functionality by using ITs because
> it introduces too much dependencies, IMHO. 

What kind of dependencies?

> It was Daniel who taught me how to
> keep number of dependencies in tests as small as possible. He was endlessly
> reminding me when I was working during GSoC to use classes inheriting from
> pure TestCase and now I see he was perfectly right.
> Tests are normal code, the more complicated dependencies you introduce the
> more it's hard to maintain such code...

My problem is that the time that I can dedicate to this task is very limited and 
I fear that if it gets too complicated (for me) or time-consuming I won't do it.

>>> Sure, tell what command exactly is needed to be fired. Is mvn clean 
>>> install -P allbocks,it enough?
>> yes
> Configuration at Continuum updated.


Reinhard Pötz                            Managing Director, {Indoqa} GmbH

Member of the Apache Software Foundation
Apache Cocoon Committer, PMC member, PMC Chair

View raw message