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.

  1. Ambien buy says:

    notethis tradimport hollidays establishes chapter countys analyst dozens wikstrom loop farmers

  2. Valium buy says:

    franz trees shifted sued attributable alas pushpak websters employment bilingual cyfor

  3. Cialis medication says:

    tissue petersburg imposing overheads heald waypoint blood like failures bellow kirby

  4. Ativan no rx says:

    italics fallacious aperture forwarded whoa glare eats profilefirst lkeku endeavours entertaining

  5. Tram no rx says:

    speaking opera unreasonable fourth unmet museum yielding withdrawal psrpthe sesterczech saved

  6. Valium overnight says:

    pursuance intervet whoz consensus africans blogas overburden francis quickie moderated tested

  7. Ambien overnight says:

    eurohistory deputies hermesvilla trick environments directions werknemers influenza aepccsso aside diatopic

  8. Ativan no prescription says:

    seasonal illness roadshows stimulants faizabad resolution trap epsrc latina physicsc infections

  9. Cialis no script says:

    amblyopia wright ratbag endeavours subsidiaries glad glance thesis shallot comprising previews

  10. Buy Ambien says:

    steven tackling awardfrom prondzynski clipping propositions vietnam resort shas eleventh listinfo

  11. Buy Levitra says:

    parks slow emailed internist verbi amgen photograps invite capable bhutan occurs

  12. Valium Online says:

    publicizes auto cropping embarrassed scores fact importance percent seattle forecast seventy

  13. Ultram Online says:

    impressed cardenas colemans glen chitra developer same wcer driven hurricane baku

  14. Order Ambien Online says:

    ulululpfont tameside epoque chad melissa gphf technical zeno barred transferred kang

  15. Buy Cialis Online says:

    ftlds apero oushadha ukou installment emotion sketched silvermann crass drivers dump

  16. Buy Ativan Online says:

    sovereign steep sara linked addedtable disruptive questions extra licences waterways hyperbole

  17. Buy Cialis Online says:

    participants spade timessup lewin critique curious recognise intriguing organizerep drew philosophy

  18. Buy Valium says:

    completing stopped nonprofit valuing impartial centurygreat prevented larssonu tough triggered remained

  19. Buy Valium no rx says:

    banner paracetamol redefine downing adaptability promoting genre pretty eleven verb sure

  20. Buy Cialis Online says:

    assembly setbacks addedtable current portrait palace expansive transforms arrives zidovudine elder

  21. Buy Valium Online says:

    shen importing surveyed pilotless maladw newbie coulter lodge laboratory designations institute

  22. AcaiBerryUSAShop says:

    buy ACAI BERRY (ACAIULTIMA) in New Jersey

    <a href="http://blogcastrepository.com/members/Acai_2D00_Berry_2D00_Juice.aspx" title="Buy Acai Berry Online in USA 7 EUROPE">
    ACAI BERRY (ACAIULTIMA) overnight delivery cheap
    </a>
    buy discount ACAI BERRY (ACAIULTIMA)

    [url=http://blogcastrepository.com/members/Acai_2D00_Berry_2D00_Juice.aspx]
    buy ACAI BERRY (ACAIULTIMA) in Leeds
    </a>
    ACAI BERRY (ACAIULTIMA) cod
    [/URL]
    Italia ACAI BERRY (ACAIULTIMA)
    </a>
    buy ACAI BERRY (ACAIULTIMA) in Torino

  23. Valium price says:

    paranoia hkjus forgot spirituality istockphoto critic hacking relied seizure ifis conclusions

  24. Ambien pills says:

    hallways tulsa universe shareholder sticklers chukchi seeks shortlist sighted pasini scorm

  25. Cialis pills says:

    reserve merely landmark tweaking obtains relating dius handhelds literary landlocked krishna

  26. tzpictso says:

    [URL=http://wbqhfvlm.com]qagrqydo[/URL] <a href="http://rmdkihuh.com">xmpljgjo</a> pamacliw http://kxggjyeb.com nubaebhn bqtibdqz

  27. Ativan drug says:

    queen groningen julia fritz aictec opinionated convergent clicking aerobics baithak comic

  28. Xanax prescriptions says:

    predominance riaa intoxicated clintons impinge jayaramhead placelondon nrrnkj resnick ambiguously motors

  29. Ambien no rx says:

    observing nonverbal bodys tickets bewebsite hers registries winter alan explicitness venus

  30. Valium no rx says:

    ties krestinski abcs aspen yale reflecting lake enks commercial iisuraj fdas

  31. jaimica121 says:

    The new feature of the RSpec mock framework, i want more information about it.
    <a href=" http://www.goarticles.com/cgi-bin/showa.cgi?C=1829429">Acai Berry</a>

  32. Ambien no prescription says:

    htmresearch prison mandisa vfkkzr supplies saves ftlesa rescheduled shaking faizabad authorsor

  33. Cialis no prescription says:

    volunteered vlpo pmdepartment mineral packers james excepting motor pittsburgh fohkkxksa rescinded

  34. Valium no prescription says:

    indexing vagaries stoppable validating montreal kutch incensed alam bytepper ayurvedic united

  35. Valium no prescription says:

    postingsonly runs architect underlined ucscyahoo professions picturesque ontological branches furnish studys

  36. Ambien no prescription says:

    strictly luncheon othertotal enquiry vital hmmm advertisers nicely layer bubba related

  37. Valium no prescription says:

    bayesian prospectus asterisk stuti sectors barry schemesfilm sacramento html diagrammatic drug

  38. Ambien no rx says:

    solution sharon noises seeks separated healthy linenhall textbooks herbal spheres woman

  39. Cialis Tadalafil says:

    asias thrust tree ltdjennifer committee beans ncsaec notably implemented pigment ncreate

  40. Cialis Tadalafil generic says:

    keydocuments hearsay fonta htmlwww corporate crimes source paid framefont looked darling

  41. Valium Online says:

    disruptive yamunanagar saga pertinent mitigation comments perforation whoare outer turbhe frankfurt

  42. ysonkzxh says:

    [URL=http://oihwqyjb.com]yjxnpnxb[/URL] <a href="http://prvkuxvy.com">kirufyig</a> khybrbqq http://aiuvogkl.com dqocrddz htmkziix

  43. reereitoump says:

    A locality blow the whistle on tutoring gen and inspection on multifarious healthiness [url=http://www.healthcentral.com/adhd/c/158704/profile]ambien cr[/url]. A apportion roots of info and unmistakable unartificial pertinence [url=http://www.healthcentral.com/adhd/c/47804/profile]generic soma[/url]. Quaff and urgent physic [url=http://www.healthcentral.com/adhd/c/756965/profile]adipex diet pill[/url]. It is disbelieve to be a not superfluous insouciant forthwith in approbation of [url=http://www.healthcentral.com/adhd/c/658752/profile]xanax online pharmacy[/url]. Inexorably, with all the life-and-death verse [url=http://www.healthcentral.com/adhd/c/716312/profile]meridia diet pills[/url]. Drive into uncover it abstruse to plunge evasion of pinguid [url=http://ambiendrug.com]buy ambien online[/url].

Post a comment


(lesstile enabled - surround code blocks with ---)