Testing, Design, and Refactoring

Jim Weirich (Neo Innovation), Joe O'Brien (EdgeCase, LLC)
Tutorial
Location: Ballroom A
Average rating: ***..
(3.69, 52 ratings)

Everyone seems to be on the TDD/BDD bandwagon these days. We have gotten very good at the first two phases of the Red/Green/Refactor cycle. But in our push toward releasing new code and functionality, sometimes the Refactor phase gets the short end of the stick. Sadly, without refactoring, our code base can quickly become a nightmare of highly coupled, highly redundant code.

This half day lab will focus on improving our refactoring skills by actually practicing the process of refactoring. We will supply a working code base (complete with tests). The problem is that the code is poorly written and rife with code smells. During the lab, the participants will learn to identify various code smells, and how to transform ugly code into beautiful code by applying standard refactorings.

The lab will start off with a discussion of the code smells and basic refactorings. The rest of the time will be a self paced, open ended lab time. We will wrap up at the end with a review and summary of the process. Participants should bring their laptops.

Photo of Jim Weirich

Jim Weirich

Neo Innovation

Jim Weirich is the Chief Scientist for EdgeCase LLC, a Rails development firm located in Columbus Ohio. Jim has over twenty-five years of experience in software development. He has worked with real-time data systems for testing jet engines, networking software for information systems, and image processing software for the financial industry. Jim is active in the Ruby community and has contributed to several Ruby projects, including the Rake build system and the RubyGems package software.

Photo of Joe O'Brien

Joe O'Brien

EdgeCase, LLC

Joe is a father, speaker, author and developer. Before helping found EdgeCase, LLC, Joe was a developer with ThoughtWorks and spent much of his time working with large J2EE and .NET systems for Fortune 500 companies. He has spent his career as a developer, project manager, and everything in between. Joe is a passionate member of the open source community. He co-founded the Columbus Ruby Brigade and helped organize the Chicago Area Ruby Users Group. His passions are Agile Development in the Enterprise, Ruby, and demonstrating to the Fortune 500 the elegance and power of this incredible language.

Comments on this page are now closed.

Comments

Picture of Charles Max Wood
Charles Max Wood
05/07/2009 3:32pm PDT

The examples were spot on. The points were all clearly made. The challenge of refactoring is well broken down.

Picture of John Parker
John Parker
05/06/2009 1:45pm PDT

Presentation was very interesting. Refactoring exercise was a nice and useful touch. Among the most enjoyable, helpful tutorials I’ve attended. At 30+ MB, it might have been nice to be able to download the code ahead of time.

Jeff LaBarge
05/06/2009 11:31am PDT

Spent too much time on obvious stuff like, “you shouldn’t have long methods”. I assume that people attending this session know this stuff. I would have preferred more specific examples of refactoring ruby and rails code. For example, best practices related to moving functionality to Model and Lib classes. Or things that you can only do in ruby for people who need to refactor ruby code that looks like Java.

Scott Robidoux
05/05/2009 10:49am PDT

While I enjoyed the first half of the tutorial of the refactoring overview, I think they should have made some prerequisites for the course as, after I got Greed up and running and the tests successful, I had no idea (nor did anyone around me) of where to start when presented with the challenge. It would have been nice to have a walk-through of where to start with the refactoring than just being thrown in. If I had known there were things that needed to be known ahead of time (cucumber, etc…), I probably would have chosen a different Tutorial.

The presenters were clear and entertaining in the first half of the session.

Picture of Brian Hughes
Brian Hughes
05/04/2009 4:52pm PDT

Always a huge fan of the Joe and Jim brand of tutorials! This is one that could easily be 2 or 3 days worth of sessions, which could be fun, if a bit heavy on the cerebral side.

Unfortunately, there’s no way, in a half-day session to make sure everyone’s laptop is up to snuff, so that we can all dive into the code at the same time.

And, of course, the obligatory 1-star off for lack of sufficient power in the room. Hilton should have done a better job and the RailConf staff should have been all over the Hilton folks, days ago, to make sure there was ample power for a conference filled with almost entirely laptop-toting, power users…

-Brian (aka. @Mac_Zealot)

Picture of Justin Beck
Justin Beck
05/04/2009 4:07pm PDT

Good talk… Major power issues (left side of room had NO power, right side had intermittent power). Also disappointed that the app wont run (a gem issue)...

Otherwise, a pair of very knowledgeable guys who were informative and entertaining to watch.

Picture of Todd Sedano
Todd Sedano
05/04/2009 2:56pm PDT

The presenters assumed that the audience did not know how to refactor and spent most of their first 90 minutes on this subject. I personally was hoping for more emphasis on going though the TDD cycle, looking at tests and explicit refactors in Ruby. I find refactoring in Ruby on Rails challenging since I haven’t found great IDE support with respect to this. In spite of this, I found the presenters interesting and entertaining.

Picture of Jim Weirich
Jim Weirich
05/01/2009 1:49pm PDT

Make sure you have a working copy of Ruby and any development tools you plan on using. We will be providing a basic rails app for refactoring. The app should be self contained with most everything you need frozen in the app. We will distribute the app at the tutorial via a download as well as memory sticks (and perhaps other other media).

Brent Miller
05/01/2009 1:36pm PDT

Hi Jim, Joe: Do we need to have anything installed before we show up for your session? I’m looking forward to it…

News and Coverage
co-presented by Ruby Central, Inc. O'Reilly
  • Engine Yard
  • Heroku
  • Sun Microsystems
  • Blue Box Group
  • New Relic

Sponsorship Opportunities

For information on exhibition and sponsorship opportunities at RailsConf, contact Yvonne Romaine at yromaine@oreilly.com.

Download the RailsConf Sponsor/Exhibitor Prospectus

Media Partner Opportunities

Download the Media & Promotional Partner Brochure (PDF) for information on trade opportunities with O'Reilly conferences or contact mediapartners@ oreilly.com

Program Ideas

Post your suggestions for speakers, topics, and activities on the RailsConf wiki or send an email to rails-idea@oreilly.com.

Press and Media

For media-related inquiries, contact Maureen Jennings at maureen@oreilly.com.

Contact Us

View a complete list of RailsConf 2009 contacts.