Bookmark Topic Watch Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
You probably can't really have UnitTests for Web applications, per se. What you want are FunctionalTests, or AcceptanceTests as they're called in ExtremeProgramming. (The semantics of the difference between FunctionalTests and AcceptanceTests are beyond the scope of this instance of the universe.)

If you want to automate your FunctionalTests or AcceptanceTests, you have some options available:


  • HttpUnit
  • HTMLUnit
  • jWebUnit
  • JUnit
  • FitNesse
  • Selenium


  • Plus, of course, all the options not listed here ... (If you know of some, you should simply add them here, of course!)




    Discussion

    Actually I'd say that you very well can unit test web applications.

    First, the only thing that differs between web- and other applications is the GUI. So you can test your business classes, persistence classes etc. just as usual.

    Second, parts of the web-tier can be unit tested, too. It's not that hard to unit test servlet classes by using MockObjects, for example. There are also libraries for unit testing taglibs. My general advice, though, would be to make the web-tier as thin and dumb as possible, so that it doesn't need much unit testing.

    -- IljaPreuss
     
      Bookmark Topic Watch Topic
    • New Topic