Hi all, while i do selenium tests and i do prefer it for integration tests, i'm feeling obligated to point out one disadvantage, while being very easy and fun to write or record, they tend to take a lot more time to run in comparison to unit tests. My case is tons of selenium tests which takes about 45 minutes when run in paralel. But that's just my case which is very special, i test whole stories on many apps at the same time. On the pros side i have confidence that all my business processes are doing well.
Best greetings, Paweł Wielgus. 2009/7/17 Wes Wannemacher <w...@wantii.com>: > On Thursday 16 July 2009 07:14:30 pm Dave Newton wrote: >> >> IMO that's outside the purview of unit testing, though--by definition >> this describes integration testing: the testing of an action along with >> the framework. >> >> There's nothing *wrong* with doing that testing, I just don't think it's >> the same thing as unit testing: independently testing the smallest bits >> of functionality. >> >> JUnit can be used for that kind of testing too (and I do, sometimes), >> but once I'm at that point I generally figure I might as well just be >> doing client-focused testing and testing the output of my results. I >> also use Selenium, although I may switch back to using a layer I wrote >> on top of Watir. >> >> Dave >> > > Not to throw weight around, but it is sort of curious to me that the three > struts committers who chimed in all agreed that tip-to-tail integration > testing in JUnit is not worth the effort. I only bring it up because, IMO, > struts 2 is one of the best-unit-tested products I've ever worked on. I think > Dave, Musachy and myself are biased against tip-to-tail in JUnit because in > Struts 2, we have a guideline to unit test all bugfixes and new functionality. > That being so, all three of us have probably come across situations where > writing the unit test is 500x harder than writing the fix :) > > Dave does a good job of making the point I tried to make earlier, tip-to-tail > testing is better looked at as an integration test and it becomes much easier > to deal with as an integration test. If you are unfamiliar with selenium, it > is worth learning. One of the posters earlier mentioned that he didn't want to > learn another testing framework when he already knows JUnit. Selenium is nice > because it runs right in the browser (IE and Firefox) and runs though a set of > VB-like instructions... Things like - open this url, look for this text, click > this link and then make sure this text exists. IMO, if you want to make sure > that your action renders the appropriate result, this is way better than > trying to coax the framework by bootstrapping it with mocks then figuring out > a > way to retrieve the rendered result. As an added bonus, it is possible to get > maven to launch selenium tests, so you can get full unit and integration > testing out of your CI if you are willing to put forth the effort. > > To drive the point home further, I would add that the Dojo plugin probably > would have been more stable if we had taken the selenium approach (that is > being employed with the slowly moving jquery plugin). > > -Wes > > -- > Wes Wannemacher > Author - Struts 2 In Practice > Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more > http://www.manning.com/wannemacher > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org