Pivotal Labs

Main menu

Skip to primary content
Skip to secondary content
  • About
  • Case Studies
  • Team
    • Executives
    • Locations
      • San Francisco (HQ)
      • Boston
      • Boulder
      • Denver
      • London
      • Los Angeles
      • New York
  • Community
    • Blogs
    • Tech Talks
    • Events
  • Careers
    • Lifestyle
    • Principles & Practices
    • Benefits
    • FAQ
    • Apply
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker

Monthly Archives: February 2009

Parker Thompson

Split testing with Rails

Parker Thompson
Wednesday, February 11, 2009

At Pivotal we are all about rapid iteration and continual feedback for our code, and try to get our clients to get excited about this same mode of thinking with respect to their products. To make that a bit easier, I’ve been working on a simple ruby wrapper for the Google Website Optimizer that allows you to perform split tests with just a few lines of code.

To get my feet wet I’ve set up a simple experiment on this blog — http://pivotallabs.com/blabs — and need a few more participants to get interesting data. If you get this is an RSS feed (you know who you are) and haven’t been to the site in a while c’mon by and check it out. In addition to a silly split test, we’ve been working on the site in general and there are some cool new updates.

I hope to follow up with the code and results of this test in another post. Meanwhile, I’m interested in experiences other folks have had with split testing. What kinds of tests have you done? What tools did you use, or did you roll your own? What kinds of patterns did you discover for managing multiple tests from a development and deployment perspective?

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Pivotal Labs

Standup – 2/11/09 – Fitter, happier, more productive.

Pivotal Labs
Wednesday, February 11, 2009

Help

“I am getting spam from working with rails site about once a week asking me if I am looking for work. I’m not, how do I make it stop?”

Besides the obvious, check the “I don’t want email” box, nothing comes to mind.

Interesting things

  • If you are running your site on Engine Yard and you want your site’s “heartbeat” monitored, install the fitter_happier plugin. See EY’s notes here.

  • Be careful when calling #id on an object that’s a Fixnum (especially if you think it’s something other than a Fixnum, like say a user object). It will return (value * 2) + 1. Most likely this will go away in the next major revision of ruby given the “warning: Object#id will be deprecated; use Object#object_id”.

  • Josh Susser is giving a talk at Ruby Meetup tonight. Topic, Iterations and Blocks.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Pivotal Labs

Standup – 2/10/09 – Speeding up RSpec tests and fixtures

Pivotal Labs
Wednesday, February 11, 2009

Interesting things

  • After making some changes to our RSpec suite (namely moving to fixture scenarios), we realized almost a 50% improvement on our local dev boxes (generally iMacs with 4G of ram). However the CI box (a Mac Mini) remained at about the same duration. Increasing the InnoDB MySQL settings to the following caused a significant performance boost on our CI box (about 200 seconds down from 350 seconds):
[mysqld]

innodb_buffer_pool_size = 64M
innodb_log_buffer_size = 8M
table_cache = 512

query_cache_size = 8M

The theory is that our local dev boxes have so much ram that the disk reads are cached while the CI box is swapping out to disk often.

  • Fixtures in RSpec can be slow due to nested describe blocks. Each time a new describe block is opened, the fixtures have to load. Therefore, if your test suite has many nested describe blocks with only a few tests in each describe, this will cause lots of fixture loading.

One possible solution is to use the underlying database (e.g.. MySQL SAVEPOINT and ROLLBACK TO SAVEPOINT) to save and reload the fixtures. Another possibility is to group your tests in a less-nested fashion.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Consistent and Effective CSS

Monday, February 9, 2009 | Run time: 1:11:37

Pivots Ryan Dy, Chris Tong, and Corey Innis lay out the current conventions and standards for CSS and introduce some organizational techniques and recipies for common tasks. See code examples at http://pivotallabs.com/labs/css.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Making a Case for Cucumber

Monday, February 9, 2009 | Run time: 58:17

Pivot Jeff Dean describes the technical and process benefits offered by the functional testing framework Cucumber, a replacement for Story Runner.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Pivotal Labs

Standup 2/9/09 – chaining associatons, use_rails_error_handling! and eager_load_paths

Pivotal Labs
Monday, February 9, 2009

Interesting things

  • People seem to think it would be useful to chain associations in the same way that named scopes work. E.g., post.comments.authors. We might look at providing a patch to do so.

  • Rspec and Rails 2.2 modifies rails to not rescue exceptions as it normally does. To fix that, add the following to your tests:

describe ThingsController do
   before(:each) do
     controller.use_rails_error_handling!
   end
end
  • A project was running into a problem on non dev/test environments with rails 2.2 where if we did a db:drop and a subsequent db:create, the migrations were blowing up with an exception on the Rails::Initializer.run line in environment.rb. The models were being loaded before any of the migrations had run, thus failing because the tables didn’t exist. To work around this, add config.eager_load_paths = [] in your Rails::Initializer. It was suggested this was either a bug in 2.2.2 and/or a bad interaction with desert.
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Adam Milligan

Milligan's Law

Adam Milligan
Sunday, February 8, 2009

I’m not sure a person can name a law after himself, but if I had a law I would want it to be this:

Any non-additive change to non-test code that causes no test failures is a valid change and does not reduce the correctness of the code.

By extension, the first corollary would have to be this:

The full definition of correct behavior of code exists in the tests for that code.

Think about it.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Davis W. Frank

Agile tips & tricks presentation at RailsConf

Davis W. Frank
Sunday, February 8, 2009

Warning: a bit of Shameless Self-Promotion follows

Sitting in more than one session at RailsConf 2008, I noticed speakers that were advocating, directly or indirectly, Agile practices. But, aside from Kent Beck’s great keynote, there wasn’t a lot of ‘pure Agile’ on the program.

I left the conference inspired to write a presentation that would help those in the Rails community get better at their jobs.

I had some ideas, but last summer I asked you what helped you be Agile day-to-day. I took your comments, the tips from fellow Pivots, and my own hacks and made them blend. The result is a presentation called “I Rock, I Suck, I Am” that was accepted for the program at RailsConf 2009.

So thanks to you for your thoughts & comments – they all helped shaped my presentation. And if you’re at RailsConf, come on by with your curious and/or reluctant peers and have a listen.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Adam Milligan

Silly gents, it is doing a good job (7)

Adam Milligan
Saturday, February 7, 2009

I recently published the article There is no Agile, in which I stated that the principles of ‘Agile’ are nothing more than “a collection of good ideas, based on years of collective experience, for improving how we do our jobs.” As an example, consider testing. Thorough testing is a ubiquitous principle of ‘Agile;’ thus, by logical extension, writing tests is a fundamentally important part of writing software well.

In short, if you write software, and you’re not writing tests, then you’re not doing your job.

I don’t mean not doing your job like a waiter who doesn’t take your order quickly enough; I mean not doing your job like a surgeon who operates without washing his or her hands. As in completely unacceptable performance.

As a corollary, if you’re not writing high quality tests, then you’re doing your job poorly. If you don’t achieve appropriate test coverage then you’re doing your job poorly. If you focus excessively on verification, and ignore the other benefits that tests can provide, then you’re doing your job poorly.

Several authors and accomplished software writers have cataloged the ways that thorough testing will lead to better design, the ability to refactor, improved resilience in the face of changing requirements, fewer defects, etc. In order to justify not writing tests the costs would have to overshadow these advantages.

I can’t think of a valid argument for not writing tests, although I’ve heard many attempts:

  • “It takes too long.” Consider that around 75% of the time spent on average software projects is bug-fixing and maintenance.
  • “This code won’t change.” It will. And it should.
  • “I know my code works.” Will it work with my code? With the code you write six months from now? When the functionality changes? (see above)
  • “It’s a prototype.” Fine. Throw it out when you’re done and use what you learned to write tested code.
  • “It’s not testable.” Unlikely. Far more likely you simply haven’t though of a way to test it.
  • “That’s what QA is for.” This statement shows so little respect for the people you presumably work with it warrants no response.
  • “I can’t be bothered.” McDonald’s is hiring.

In my experience, people who denounce the value of tests are nearly always people with little experience writing tested code. It’s time we stop allowing ourselves to determine how we do our job based on who has the biggest ego, who can shout the loudest, or who is the most resistant to change.

All this leads to the question that every single person reading this should be asking: writing high quality tests can be very difficult; how do we teach that?

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Pivotal Labs

Nice post on the development of the new Google button.

Pivotal Labs
Friday, February 6, 2009

http://stopdesign.com/archive/2009/02/04/recreating-the-button.html

Please move quickly to the chamberlock as the effects of prolonged exposure to the button are not part of this test.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Topics

  • agile (778)
  • rails (113)
  • testing (87)
  • ruby (83)
  • ruby on rails (70)
  • jobs (62)
  • javascript (54)
  • techtalk (44)
  • rspec (38)
  • activerecord (29)
  • productivity (29)
  • gogaruco (29)
  • ironblogger (29)
  • git (28)
  • nyc (27)
  • rubymine (25)
  • bloggerdome (22)
  • mobile (22)
  • cucumber (20)
  • process (19)
  • pivotal tracker (19)
  • jasmine (19)
  • design (18)
  • ios (18)
  • webos (17)
  • objective-c (17)
  • android (16)
  • palm (16)
  • "soft" ware (16)
  • fun (15)
  • tracker ecosystem (15)
  • ci (15)
  • cedar (15)
  • rails3 (14)
  • performance (14)
  • bdd (14)
  • gem (13)
  • tdd (13)
  • selenium (12)
  • css (12)
  • goruco (12)
  • bundler (12)
  • meetup (11)
  • railsconf (11)
  • nyc-standup (11)
  • capybara (10)
  • mac (10)
  • mojo (10)
  • chef (10)
  • api (10)
Subscribe to Community Feed
  1. ←
  2. 1
  3. 2
  4. 3
  5. →
  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • Contact
  • Labs
  • Events

Contact Us

contact@pivotallabs.com
+1 415-77-PIVOT
TwitterLinkedInFacebook

Pivotal Tracker

Tracker is the award-winning agile project management tool that enables real-time collaboration around a shared, prioritized backlog.
Visit pivotaltracker.com >