Posts for category: railsconf

A Few Good Updates

  • For the rest of this week, I’m answering questions in the forums at Ruby Learning.org—stop by and ask a question if you’ve got one. Posters are eligible to win free copies of the book.
  • Unsurprisingly, RailsConf was something of a lost week in terms of writing on the book, so I’ve decided to skip a week in the update schedule. The next update will by May 25th, and it will include a new section on RSpec, a new section converting my RailsConf presentation back into text, and something else as time permits. I’m actually hoping to get another edit read on the entire text.
  • I forgot to mention one of my favorite sessions of RailsConf, the Teaching Rails BoF that was moderated by Ben Scofield. There was a lot of great energy in the room and a number of people working on related efforts. Checkout RailsBridge as well as the Rails Tutor project. Also keep an eye out for a Rails Mentoring program coming online soon.

A Testers Guide To RailsConf 2009

Testing was a popular topic at RailsConf this year, with a lot of sessions on various testing tools and a lot of prominent interest in testing process.

Here’s a quick look at the sessions that were interesting from a testing perspective. And also my session, which was from a testing perspective as well. Where applicable, links go to the presentation slides.

Testing, Design, and Refactoring, Jim Weirich and Joe O’Brien.

This was a tutorial session that I caught a tiny piece of. Weirich has a well-deserved reputation for running great training sessions, and this one seemed effective.

Don’t Mock Yourself Out, David Chelimsky

Saw this one. Chelimsky, who is the lead developer of RSpec, gave a nice overview of how to use mock objects, and even better, how to use them well.

He also introduced a couple of new tools. One was stub_chain, a new feature of the RSpec mock framework. The use case here is when you had to create a series of mock objects to cover a long chain of objects. In the old way, you needed to create a bunch of intermediate objects that you didn’t much care about:

  member = stub_model(User)
  friends = stub()
  friend = stub_model(User)
  User.stub(:find).and_return(member)
  member.stub(:friends).and_return(friends)
  friends.stub(:favorite).and_return(friend)

The new way, with stub_chain, is much more direct.

  friend = stub_model(User)
  User.stub_chain(:find, :friends, :favorite).and_return(friend)

In both cases User.find(1).friends.favorite will return friend.

Another new tool is Stubble, an API for easily mocking ActiveRecord objects. Right now it works with RSpec, but Chelimsky hopes that it will work with other frameworks soon. Within a stubbing block, the ActiveRecord class specified has find, save, and the like stubbed out so that it will not need to contact the database.

  stubbing(Registration) do
    post 'create'
    response.should redirect_to(registrations_path)
  end

These tools, along with some other comments at the conference, lead me to think I need to give RSpec another serious try.

In Praise of Non-Fixtured Data, Kevin Barnes

Missed this one.

JavaScript Testing In Rails: Fast, Headless, In-Browser. Pick Any Three. Larry Karnowski, Jason Rudolph

Only caught the tail end of this one. The tool being discussed here is Blue Ridge, which seems to be a composite tool making it easy to use some JavaScript test frameworks together.

Below and Beneath TDD: Test Last Development and Other Real-World Test Patterns Presentation, by Me

This was my talk. It was pretty process heavy and code-light. I’m going to try to work the substance of it into the book sometime over the next few weeks. Anyway, people came, they said nice things, and overall I was pleased with how it went.

Quality Code With Cucumber, Aslak Hellesøy

I didn’t make it to this session, although I heard very good things about it from other attendees (though I did get to briefly meet Aslak during the conference). Cucumber was all over RailsConf, mentioned in several different sessions, it clearly has a lot of momentum as a useful tool.

Using metric_fu to make your Rails Code Better, Jake Scruggs

I only realized when looking at the slides that this was a descendent of the talk that Scruggs gave at last years WindyCityRails conference. It’s a good talk, and metric_fu is a useful tool.

Working Effectively With Legacy Rails Code, Pat Maddox, BJ Clark

Very well done session that had some suggestions that went beyond what I currently have in the book, although they started with similar advice. A couple of their suggestions include:

  • Silo code by making it a webservice.
  • Refactor back to what Rails already does.
  • Make everything a framework. Write micro frameworks.
  • Use “nice” metaprogramming
  • Use existing frameworks, then maintenance is somebody else’s problem.
  • Look for ways to modify code behavior without changing API, like new parameters with default values
  • Use selenium recordings as a last-ditch way of testing.

Robert Martin

This link is to the video of the talk. This talk is included in the testing roundup because of Martin’s full-throated support of test-driven development as a professional duty. I very much enjoyed this talk, though I’ll freely admit that it was very much a preaching to the choir kind of a thing. (Not only did Martin strongly endorse TDD, but his diagnosis of what killed Smalltalk was very similar to rants I’ve been doing for years. You’ll just have to take my word for that.)

Testing BoF session

After some dancing back and forth over room assignments, I settled in with a couple of dozen other people for a discussion of testing that largely centered around the best way to get started and the best way to get unstuck. I had fun, but then I got to shoot my mouth off for an hour, so that may largely be redundant.

Webrat: Rails Acceptance Testing Evolved, Bryan Helmkamp

Solid session on Webrat that went far enough beyond beginner material that I felt that I learned some useful stuff about using Webrat in either Cucumber or Rails integration tests.

Overall, a very strong and helpful conference, even with just testing sessions counted. I’ll try and get another post up with more personal comments later this week.

Rails Test Prescriptions update version 4

Quick notes before I finish getting ready to go to RailsConf:

Rails Test Prescriptions version 4 is now available both at Lulu and at the http://www.railsprescriptions.com/products product download page. If you have purchased the book and are not a registered user, please register at http://www.railsprescriptions.com/users/new.

NOTE: The login button on this page isn’t working, and I won’t be able to fix it for a few hours. Go to the main home page at http://www.railsprescriptions.com and login from there.

New in this version

  • Complete chapter on Shoulda
  • Section on working with a legacy project
  • New cover

Couple of notes

  • You may notice the file size has dropped quite a bit from the past version, don’t worry, that’s just the new and smaller cover image.
  • The Lulu front page hasn’t changed (yet), but the cover of the actual PDF has.

Meantime, see you all at RailsConf, I hope that some of you will come to my talk on Tuesday and the Testing BoF on Wednesday, or at least say hi.

Next Update and RailsConf

News and notes

  • The next book update will probably be released on Sunday before I head off for RailsConf. Definitely in there will be a longish chapter on Shoulda and a bit on how to handle legacy code. Hopefully one other chapter as yet to be determined.
  • Speaking of RailsConf, I’ve also gotten a Birds of a Feather session on the schedule. The title is “Testing In Rails, What’s New, What’s Now, and What’s Missing”, and it’ll be at 9 PM Wednesday night in Pavilion 9 – 10. Come by for what I hope will be an interesting discussion of everything new in Rails Testing land.
  • Also speaking of RailsConf, follow @railsrx or @noelrap on Twitter for news about giveaways. There will be at least two sets, one of which will be based on attendance at my talk, one of which will not. Free books, and some kind of merch for potential winners who already have a license for the book.
  • Finally, speaking of RailsConf, I’d love to meet anybody who is reading the book or this blog. I’m probably the worst networker in the known universe, but please do come up and say hi if you see me around.

Sales, Status, and Talks

Important sales milestone over the weekend and the Lulu revenue nosed past my monetary start up costs for putting the book and the web site together. So, thanks to those of you that have bought the book so far—I appreciate it. If you’re enjoying it so far, let me know, tell a friend, say nice things online, you know, that kind of thing. If you aren’t enjoying it so far, let me know so that I can work on making the book better over time.

I think the ongoing release schedule will go like this: next Monday, then every other Monday until I feel sufficiently done. Next week’s release will have a long Cucumber section, a shorter autotest section, and I’m not sure what else. However, I’m trying to get on a more agile-like iteration schedule, so I’ll release on the 6th no matter what else is done or not done.

In the meantime, looks like there’s kind of an arms race in my RailsConf time slot. I’m at the same Tuesday 2:50 PM time slot. I’m now ten percent more scared that I’ll be speaking to an empty room. Actually, I’m hoping to have some promotional stuff of some kind—turns out I have a book to promote. But I don’t know if I’ll be able to get that done or not. I’ll have more to say about RailsConf closer to the date, but the short version is, come to my talk, say hi.

Prognosis: February 26, 2009

What’s up, what’s down.

  • Pure status report: The section on mock objects is almost done, I hope to finish it today. I have what I hope will be a small amount of work on the site itself to take orders—essentially, if it turns into a large amount of work, I’m farming it out to lulu.com or something. I also need to clean up the text a little bit. Hoping that it’s a matter of days before sales begin.
  • I had a post on the Pathfinder Agile Ajax Blog with more on recent arguments about test-driven development. I try to make an argument for TDD without making a claim about program correctness or validity.
  • I’m going to be speaking at RailsConf. The current title of the talk is Below and Beneath TDD. It’ll explore what makes TDD work by looking at broken test-like process and showing what they lack. If it happens to make fun of silly arguments against doing testing, well that’s just a side benefit. More details as I get them—I’m really looking forward to this, and I hope to meet many of you there.