Refactoring legacy code

Recently I’m trying to upgrade one big project from Ruby 1.8.7 to 1.9.3.
It is bumpy road but here are some thoughts gathered during this time:

1. Make small steps – especially when pushing those changes to production. You’ll never know what are going to break.
2. When changing API endpoint find every call to that endpoint. Record HTTP requests & responses and test them.
3. Improve test coverage. The more good specs you have, the better.
4. Update only necessary gems to get your code working on Ruby 1.9.3.
5. Set up Continuous Integration server to run specs on both Ruby versions: 1.8.7 & 1.9.3.
6. Analyze & understand business logic in code. Use metric_fu, simplecov to know more about code.
7. Delete unused code.

Posted on 08/11/2013, in Inne. Bookmark the permalink. Dodaj komentarz.

Skomentuj

Wprowadź swoje dane lub kliknij jedną z tych ikon, aby się zalogować:

Logo WordPress.com

Komentujesz korzystając z konta WordPress.com. Log Out / Zmień )

Zdjęcie z Twittera

Komentujesz korzystając z konta Twitter. Log Out / Zmień )

Facebook photo

Komentujesz korzystając z konta Facebook. Log Out / Zmień )

Google+ photo

Komentujesz korzystając z konta Google+. Log Out / Zmień )

Connecting to %s

%d bloggers like this: