Search the web
Sign In
New User? Sign Up
testdrivendevelopment · Test-driven Development
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Testing a service class above the DAOs   Message List  
Reply | Forward Message #27079 of 32007 |
Hi everyone,

I'd like some advice/opinions on how to test some existing code. It's a web
application using Spring and struts.

I have a class called the ProcessedFilesManager which contains a number of
methods used by Struts Action classes. This manager communicates with five
different DAOs to get the information that some of the Struts actions are
interested in. Now, I want to test this manager class
(ProcessedFilesManager). The way I've started doing it is stubbing up each
of the five DAOs, however, this is proving to be quite painful. I didn't
want to use a mocking approach, nor did I want to use a DB solution like
Hypersonic, but now I'm open to suggestions.

Seeing as there a number of approaches I could use, what do you think would
be best for this situation?

It feels wrong to stub the DAOs because what if I'm introducing behaviour in
there that differs from the actual DAOs? My tests will not be accurate.

Any advice/comments would be much appreciated.

- annie


[Non-text portions of this message have been removed]




Thu Dec 20, 2007 6:09 am

annie.laney
Offline Offline
Send Email Send Email

Forward
Message #27079 of 32007 |
Expand Messages Author Sort by Date

Hi everyone, I'd like some advice/opinions on how to test some existing code. It's a web application using Spring and struts. I have a class called the...
Annie Lane
annie.laney
Offline Send Email
Dec 20, 2007
7:07 am

... What exactly about it is painful?...
Carfield Yim
c8133594
Offline Send Email
Dec 20, 2007
2:23 pm

Can you elaborate on why you don't want to mock the dao calls? I tend to think that by mocking them, you're saying this is what I think the interface of the...
Rob Park
rpark68
Offline Send Email
Dec 22, 2007
10:56 pm

... Actually you can create seperate data access (non-unit) tests for real DAOs, so that you can be sure of your stub and real DAOs work in the same way. In ...
Seyit Caglar Abbasoglu
scabbasoglu
Offline Send Email
Dec 26, 2007
11:49 am

... http://jbrains.ca/permalink/165 ... J. B. (Joe) Rainsberger :: http://www.jbrains.ca Your guide to software craftsmanship JUnit Recipes: Practical Methods...
J. B. Rainsberger
nails762
Offline Send Email
Dec 30, 2007
10:37 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help