Hi,

I can speak to 3 and 4, but I'll leave 1 and 2 to the more experienced list members.

I'd *really* appreciate the input of those experienced list members, if they can perhaps make a couple of minutes to enlighten me. My original email is below...



> 3.) Has anybody come across affordable (or, better yet, free!) tools to automate testing from a browser, at least with forms? By this I mean I'd like to store several sets of form input data in some file and "replay" them by sending each in turn to the server and making sure I get the proper response.


You might look at Latka, a project in the Apache Jakarta Commons http://jakarta.apache.org/commons . It is a functional testing tool, which sounds like what you want. Another idea is HTTPUnit, which is a bit lower level than latka. Try Ward's wiki for current unit testing info.

Ahhhh, Latka does look like what I'm looking for. I wish the documentation was somewhat fuller, but I'll be thankful anyhow. HTTPUnit seems potentially even better, although I haven't taken a good look at it yet.



4.) Do you think it's a good idea to validate data read out of the database? I validate it before storing it and assume that nobody is touching the db except my app, so it seems rather foolhardy to validate it again. But what do you think?


I agree with you, it seems redundant to validate the data again. However, if it is not a performance concern, why not leave it alone? Extra data vaidation doesn't hurt.

That's true, but it happens to be a performance *concern* here. I emphasize concern because I haven't conducted any formal tests to determine the exact performance penalty the validation-on-read causes.


This site will be an e-commerce site, so scaling to serving high #s of product pages (each of which involves a db read and creation of a Product class) is a priority. That's why I started wondering if there's a better way.

Anyhow, thanks for help. Your comments are always welcome.

Regards,

Sonny


-- Ryan Hoegg ISIS Networks http://www.isisnetworks.net


Sonny Sukumar wrote:



Hi everyone,


This is partly a Cocoon question, partly a design best practices question, and partly I'm just plain curious. :-) Besides, I think we can all benefit in some way by discussing it.

Let's say I'm using Cocoon to build an admin interface for a product catalog. So I have the following:

1.) An HTML form with entry fields corresponding to all the fields
2.) A Cocoon action that reads in the POSTed data from the request
3.) A Product backend Java class (just a regular bean).
4.) A backend database that stores the product data.

With this in mind, my first question is: Where would you validate product data?

Currently, I validate all of the product fields within my backend Product class and simply use my Cocoon action as a conduit through which data flows (into the server and then into the Product class). I do this because I can easily unit test my Product class, but I have no idea how to unit test a Cocoon action. On the other hand, this approach means that all data read out of the database is validated *again*, even though it should be valid since it was allowed to be stored there in the first place.

So my next set of questions are:
1.) Is it possible to unit test a Cocoon action in any meaningful way?
2.) Assuming it is, do you think it's a good idea to write 1 action dedicated to validating the incoming data and another for just for manipulating the data?
3.) Has anybody come across affordable (or, better yet, free!) tools to automate testing from a browser, at least with forms? By this I mean I'd like to store several sets of form input data in some file and "replay" them by sending each in turn to the server and making sure I get the proper response.
4.) Do you think it's a good idea to validate data read out of the database? I validate it before storing it and assume that nobody is touching the db except my app, so it seems rather foolhardy to validate it again. But what do you think?


I think that's enough to discuss for now. :-) Any thoughts?

I appreciate all of your time and input,

Sonny



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to