Recommended Gems, Plugins and various notes on what’s hot in the ruby on rails world

Performance Optimization
————————

  • optimization doesn’t end with speeding up my Ruby code (or Rails itself).

The performance of production application heavily depends on its environment – server filesystems, databases, load balancing solutions.

Testing
——-

  • use gems like UnitRecord or dust to cut off the database for unit testing. Mock all unit tests out to speed things up drastically.
  • to scale large tests you can offload them to remote BAMs(Bad Ass Machines), or send tests to multiple processors. Deep Test allows you to spawn multiple remote threads to run functional tests
  • to benchmark a specific url you can use the ab (Apache HTTP server benchmarking tool) command:  ab -n 100 http://localhost:3000/quick_reply/list
  • Errorlytics web service detects 404 errors via JS & redirects user based on rules that you define at errorlytics.com – http://www.errorlytics.com/
  • Using factories instead of fixtures.
  • Fixtures are more brittle & they seperate the data from the test, creating a assumption that the data already exists & is correct to begin with.
  • Factories …. Fixjour, Factory Girl, Object_daddy and Machinist are plugins that aim at creating factories.
  • Cucumber tips: http://media.railscasts.com/videos/159_more_on_cucumber.mov

Cucumber
——–

  • Write tests first, the run cucumber. To run a specific feature run: cucumber features/name.feature
  • Use output of cucumber to create stub step definitions.
  • Make each test pass, from the top down.

Feature: title
In Order To [business value]
As a [role]
I want to [action] some feature

Scenatio: title
When [context]
And [more contect]
When I do [action]
And [other action]
Then I should see [outcome]
But I should not see [outcome]

Database
——–

Video / Screen / Pod casts
————————–
http://railscasts.com/episodes
http://peepcode.com
http://pivotallabs.com/talks/
http://www.railsenvy.com/podcast
http://confreaks.com/events

Advertisements