Showing posts with label JMeter. Show all posts
Showing posts with label JMeter. Show all posts

Tuesday, April 10, 2012

NOW I See: The Realized Benefits of Unit Testing

We all know the things that we are supposed to do, but don't as much as we should: eat fiber, cut down on sugar, don't be sedentary, exercise, eat fruit, unit test.  Blegh!

Not my exact point, but pictures about
unit testing are hard to find!
(Image from Reportnet)
For the last part at least, I came across some actual useful results.  Before, whenever I wanted to unit test a class, I didn't write a test for it before and usually had to ramp up on another technology to boot (JUnit3 vs JUnit4, HttpUnit, DBUnit, Mocking) or realize that I really wanted an integration test (jMeter, Selenium).

This time however, I spotted what looked like incorrect code and there was already a unit test for the class!  I was able to write a short test that verified the bug (i.e. wrote a failing test), fixed it and reran the test successfully!  All this in less time it would take to run mvn verify (including deployment to WebLogic)!

I'll be a bit less loathe to write tests in the future now, since I actually SAW that "it's better in the future" thing they say about testing.


Wednesday, December 14, 2011

My Technology Fail: Using JMeter for Integration Testing

Engineering Fail from MemeHumor.com
Please don't do what I did: I made my Maven build run JMeter, record all data retrieved (JMeter option) and then verified the data after as my integration test.

Please, just use HtmlUnit since it's designed for this to begin with.

Note that JMeter is great to use what it's made for: load testing.  Thanks to Manfred Reim for writing his blog post about HtmlUnit, it's what made me realize my mistake.