Entries from May 2008 ↓

The agony of Java unit testing

Java unit testing sucks!!!

There, I said it.

Come on, it does. I know, 8 years ago, JUnit was the bees knees. But let’s face it: when you’re working on a project, you’re behind schedule for whatever reason, and you have a deadline looming, where’s the first place that you cut corners?

Unit tests. Always.

Why?

  1. Lack of perceived value of testing (in other words: I see the happy path works so what’s your big problem?)
  2. No one is going to ever touch this code again after this release
  3. Java is just difficult to test

Let’s talk about these….

Continue reading →

Avanced Ruby Studio, Day 3

Notes after the jump.

Aside: They brew insanely strong coffee at the Sheraton…

Continue reading →

Advanced Ruby Studio, Day 2

This morning session rocked my world. The afternoon session was better than yesterday but, for me, dragged a lot toward the end of the day.

I suspect that my less enthusiastic response to this class vice the Rails class has more to do with my significantly greater experience with Ruby the language than Rails the framework.

That said, I am still finding this class worthwhile to fill in the gaps in my understanding of Ruby to date.

Notes after the jump.

Continue reading →

Advanced Ruby Studio, Day One

Notes after the jump (as I write them)

Review of the day: Morning session was excellent and intense. This afternoon has been theory. As of 3:45pm, it hasn’t felt so “advanced”.

Continue reading →

Advanced Rails Studio Day 3 (Live Blogging)

The day starts with a list of potential topics. The class body votes on the topics that they want to cover. All of my votes went to ‘file uploads’ for work reasons — and fortunately this pushed it over the top! :D

And the results in order are:

  1. AJAX
  2. File Uploads
  3. Perf & Scalability
  4. Deployment
  5. AR with unsupported DBs
  6. Debugging

Notes after the jump:

Continue reading →

Advanced Rails Studio Day 2 (Live-blogging)

Notes follow after the jump.

Continue reading →

Advanced Rails Studio Notes: Day 1

Lovely start to the day. 2 miles from the hotel, my Prius breaks down and won’t start. WTF?! FAIL! Oddly, 30 minutes later (after perusing the sample app that we’re going to discuss during the class), the car starts again with a warning light. During the class, I’m fucking Grand Central Station: my cell phone rang 4 times before lunch. Again, WTF? I’m not a popular guy. Yeesh!

Hehehe… and Twitter went down just before lunch. Sometimes it’s nice to remember that I’m not the only one who is living in interesting times.

Regarding my notes, it’s worth mentioning that I’ve done a bit of Rails 1.2.x development but haven’t touched Rails 2.x until today. That said, as of this morning, I was comfortable with the theory of REST but not the Rails implementation.

Anyhoo, my notes from Day 1 of the class follow after the jump.

Continue reading →

Mocking core Java classes with jmockit

I know, I know. Java. Blech!

But if you have to work in Java, instead of something more elegant like Ruby, wouldn’t you like some of the same awesome mocking power that you have come to know and love in Java? Yeah, me too.

Toby DiPasquale turned me on to jmockit. It’s a little framework that provide RSpec-like mocking in Java. To those familiar with RSpec: jmockit allows developers to mock constructors as well as individual method on live objects. It accomplishes this courtesy of the java.lang.instrument package that was added in Java 1.5.

I was curious to see if it is possible to mock boot classloader loaded classes (i.e., java.lang.Integer, etc.). After a few minutes of tinkering, I found a way but it’s none to pleasant…

Continue reading →