Search the web
Sign In
New User? Sign Up
TestFirstUserInterfaces
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

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
Re: [agile-testing] Unit Testing the Presentation Layer   Message List  
Reply | Forward Message #1043 of 1052 |
John Overbaugh wrote:

> One of the challenges we are facing at Medicity is implementing unit
> tests which validate the logic in various layers. Right now, for
> instance, a lot of logic is in stored procedures and our code just
> bubbles that data up. We're working on refactoring that logic into the
> business logic layer, where it'll be more easily unit tested. Another
> problem we face, however, is unit testing the work done in the
> presentation layer. We have implemented various versions of
> .NET/ASP/ASPX and Ajax, so our presentation layer is chock-full of
> session management, some data manipulation/event handling, view state
> management and other Ajax functionality. I've been digging around and I
> have found a lot of stuff on the Web proving a lot of companies are
> grappling with this issue, but no really solid suggestions.

Will ASP allow you to cook a web page without sending it over the wire?

If you Mock The Server, you can then test - even TDD - by writing assertions
that parse the HTML back and extract the inserted data.

You are not testing that the page renders correctly. (That's okay, because you
are not writing the web browser itself.) You are affirming that when you
refactor the page will continue to render the same way it did before.

> I haven't looked at our code yet, but apparently there was some
> investigation into integrating Webaii as a headless test running in
> Cruise Control. Right now, I'd be happy to just have tests running on
> developer machines prior to check-in!
>
> Does anyone have a good solution they can talk about? What are some
> directions I can take to develop either a headless or a low-impact unit
> test framework, which can validate the presentation layer when it's a
> very dynamic layer?

Some web stacks don't let you Mock The Server, because they don't want you to
replace >cough< IIS with some other server. These corporate games should never
hold projects hostile...

--
Phlip



Thu Jun 11, 2009 9:41 pm

phlipcpp
Offline Offline
Send Email Send Email

Forward
Message #1043 of 1052 |
Expand Messages Author Sort by Date

... Will ASP allow you to cook a web page without sending it over the wire? If you Mock The Server, you can then test - even TDD - by writing assertions that...
Phlip
phlipcpp
Offline Send Email
Jun 12, 2009
2:24 am

... Unit testing the presentation layer should treat the test targets the same as any other layer would test them. In web programming, a web page is a big...
Phlip
phlipcpp
Offline Send Email
Jun 12, 2009
3:48 am

Re: Can ASP render a page back as a string. Absolutely! Its call Response.Write, just pipe it out to whatever channel you like :) Regards, Miguel de Sousa ...
miguel de sousa
migdesousa
Offline Send Email
Jun 12, 2009
4:45 am

... Could anyone here who's familiar with both ASP's Response.Write, and with Rails's ActionController::TestCase's get() method, write a little pseudocode here...
Phlip
phlipcpp
Offline Send Email
Jun 12, 2009
4:49 am

... To add a new feature, you should generally add it at the business layer first. The goal will be that anything a user can do to the View, a unit test can...
Phlip
phlipcpp
Offline Send Email
Jun 12, 2009
2:25 pm

... Here's a metaphor - the Golden Spike at Promontory Point, Utah, where the Union Pacific and Central Pacific railways met for our first intercontinental...
Phlip
phlipcpp
Offline Send Email
Jun 16, 2009
7:05 pm
Advanced

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