unit testing DomainSteps?

4 views
Skip to first unread message

szczepiq

unread,
Mar 12, 2010, 5:35:14 AM3/12/10
to givwenz...@googlegroups.com
Hi Wes, Hi guys,

Do you guys recommend writing unit tests for DomainSteps?

I saw that in one of the project and frankly speaking I find it very weird to write tests for... tests :)

What is 'official' statement from GWZ? :)
Cheers,
Szczepan

Williams, Wesley

unread,
Mar 21, 2010, 9:59:58 PM3/21/10
to givwenz...@googlegroups.com

We have tried to write unit tests for our fixtures in the past and had the same idea for our step classes as well.   Driving the java code with unit tests seems to be a good idea to me.   The unit tests still help drive a good design and allow for refactoring safely.  The fixture and step code should be continually refactored as the application changes and therefore the acceptance tests change.  I have to admit that I am not as consistent at this as I think I should be. 

 

For the most part I think the step classes should be very small and use a set of services from the application.   The support classes should definitely be unit tested.  Supporting classes such as PropertyEditors and other support classes will help keep the step class code small and they should be tested and probably moved to the production code many times.  They should be reusable especially in view of the application.  But even if they remain as part of the test only they should be driven by unit testing.

 

wes

szczepiq

unread,
Mar 22, 2010, 7:18:22 AM3/22/10
to givwenz...@googlegroups.com
Thanks for info.


>For the most part I think the step classes should be very small and use a set of services from the application.

I agree. Step classes should be thin and delegate to business objects. (IMHO unit testing this layer in general is not a good idea).


>The support classes should definitely be unit tested.  Supporting classes such as PropertyEditors and other support classes

I agree I can imaging PropertyEditor can have some meaty parsing code that interesting to test/TDD.

Cheers,
Szczepan

To unsubscribe from this group, send email to givwenzen_user+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

Reply all
Reply to author
Forward
0 new messages