This evening, I gave my first presentation of Unit Testing J2EE from JRuby to the Northern Virginia Java User’s Group. It was a very interesting experience. The audience asked some interesting questions — but it was also an insightful reminder of my origins as an engineer. Out of approxiately a 30 member audience, perhaps 4 had done any TDD and only a single one had ever used mock objects. While mocks have their origins largely in Java (at least their initial implementations), it is interesting to see that they have been far more readily adopted in the Ruby community than Java.
Also, Mocha suddenly jumped from v0.5.6 to v0.9?!

So jrsplenda broke when I tried to demo it on my wife’s spiffy new Macbook Air — as I was foolish enough to just ’sudo gem install mocha’.
Who the hell has a public release at 0.5.6 and then another at 0.9? I am so integrating FlexMock into jrsplenda in the next release. I can’t see Jim Weirich doing anything like that.
I’m halfway tempted to redo and give my BDD with RSpec talk to NoVaJUG as a JRuby-Java BDD talk. More people should be doing BDD and not merely those of us working in dynamic languages. Were it so, I imagine that I would encounter far more testable and maintainable code in the Java community.
Slides from the presentation are available here



3 comments ↓
What a pompous presenter. Plus his demonstration did not work.
@AC: I’m sorry that you read that into my post. However, I wasn’t implying that the lack of TDD and mocking in the Java world was a reflection on Java. Mocking may have come out of Java but, in my experience, it just never took hold. It was an observation.
As for the examples, when an external depedency suddenly jumps multiple revisions and you’re working on new hardware, shit happens.
FWIW, I did a re-release of jrsplenda that evening to accomodate the Mocha changes.
Sorry. I was in a bad mood and should not have been so rude. Thanks for taking the high road.
In my experience proper testing requires the right team. I have worked on Java EE projects where there were good unit/functional tests (including mocks), code coverage tools and continuous integration. I have also worked on Java EE projects where testing was minimal, if not altogether ignored. Shockingly I have worked on different Rails projects that similarly span the testing gamut. I think it boils down to having a few people on the team who just “get it” and are given the power to implement such important infrastructure.
For what it’s worth, anyone who’s ever given a presentation has at some point had something unexpectedly go wrong. But it’s a little unfair to beat up on Mocha for the revision jump… it is just as much your fault for not freezing the version dependency or checking ahead of time.
In the end, I think the work you’re doing with jrsplenda is great. Providing tools to make it easier to mock and test does help out a lot of developers.
Leave a Comment