0% found this document useful (0 votes)
29 views

Rails Rescue Checklist

The document provides guidance on rescuing failing Rails applications by outlining several areas of focus including strategic planning, database rescues, opening investigations, testing rescues, refactoring rescues, digging into quality, and improving performance. Key steps include consulting with clients, isolating seed data, refactoring migrations, installing gems, surveying code, drawing diagrams, choosing testing tools, upgrading Rails cautiously, extracting code, installing metrics and monitoring tools, analyzing logs, and eliminating N+1 queries. The overall document serves as a checklist for evaluating and improving troubled Rails applications.

Uploaded by

SatyenVats
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Rails Rescue Checklist

The document provides guidance on rescuing failing Rails applications by outlining several areas of focus including strategic planning, database rescues, opening investigations, testing rescues, refactoring rescues, digging into quality, and improving performance. Key steps include consulting with clients, isolating seed data, refactoring migrations, installing gems, surveying code, drawing diagrams, choosing testing tools, upgrading Rails cautiously, extracting code, installing metrics and monitoring tools, analyzing logs, and eliminating N+1 queries. The overall document serves as a checklist for evaluating and improving troubled Rails applications.

Uploaded by

SatyenVats
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Rails Rescue Checklist

Strategic Planning
Consult with client on pain points Set expectations Keep track of work to be done

http://railsrescuebook.com

Database Rescues
Isolate seed data Refactor procedural migrations Collapse migrations Check for database mismatch

The Opening Investigation


Connect to or establish SCM Read any documentation Freeze Rails Install existing database, or run migrations, or load schema Load any seed data Install gems via rake gem:install or manually Check plugin README les Survey the models, controllers, views, and helpers Draw or generate an entity-relation diagram Run rake stats to see test coverage Determine which testing libraries are in use Read the existing deployment recipe to verify you have the pieces you need

Testing Rescues
Check the test coverage Find out if the tests still run Get rid of scaolded tests Delete completely muddled tests Comment out failing but salvageable tests Choose and install your testing tools Test new code as it's written Add acceptance tests Extend test coverage

Refactoring Rescues
Upgrade to current Rails, but cautiously Locate fat controller methods Move excess controller code to models Move to RESTful controllers Extract subsidiary models Move model code to modules Factor out raw SQL in models Remove SQL from views Extract partials from views Extract helpers from views Evaluate and replace plugins as needed

Digging Into Quality


Install metric_fu Use rcov to see test coverage Use saikuro to see cyclomatic complexity Use flay to locate excess use of cut and paste Use flog to see code complexity hot spots Use reek to detect common code smells Use roodi to see potential errors Read existing logs to nd mass-protection errors, hidden errors, and excess SQL Hook up some form of exception notication Run a log le analysis Install rack::bug, FiveRuns TuneUp, railsfootnotes, or Palmist to track activity in the running application

Performance Rescues
Test or analyze to locate problems Run Google Page Speed to locate slow pages Implement caching: page, action, fragment Use memcached to avoid excess database hits Eliminate N+1 query issues with eager loading Add missing indices

You might also like