How to upgrade Rails 2.3 to 3.2(or 4.X) without test suite?

214 Views Asked by At

We have Rails 2.3.4(ruby 1.8.7) app which is big?(300 Models with 21,000 LOC and 75 controllers with 35,000 LOC) with moderate complexity and we are planning to upgrade this app to Rails 3.2(or Rails 4.X)

Now the biggest hurdle is we don't have a single test case!

I searched around the web, stackoverflow and I did find some usefull links but all of them assume that app will have good test coverage But in our case its not true so considering all that in mind, I have following questions ?

  • which version should I upgrade Rails 3.X(with ruby 1.9.3 or 2 ?) or Rails 4.X & ruby 2 ?
  • Everybody is suggesting to go with incremental way(first to rails 3,then ruby 1.9 then rails 3.2 then Rails 4) will this really help In our case because
    • Since we don't have test suite
    • Since its a big app there will be a lot of manual testing that will happen after each upgrade, so repeated testing after every small incremental change over one time upgrade(though changes are large testing can be done only once) is the right approach ?
  • Lets assume even if we write test cases now(for rails 2.3) will those tests run smoothly on updated version ? or do we need to write fresh test cases on upgraded Rails version ?

  • I know estimating is bit hard but still does anyone tried upgrading
    your bigs apps and how much time it took ?

considering all the above what are the best strategies we should follow ?

Any pointer to relevant blogs and suggestion are welcome.

Thanks in Advance.

2

There are 2 best solutions below

1
Philip Hallstrom On

If it were me, I'd bite the bullet and write tests for 2.3 now. A lot of it will transfer over, some of it won't. Once written, upgrade the app to 4.x and see what breaks. Then figure out if it's the code or your tests and adjust accordingly.

Without tests... I have no advice :/

0
Bharani On

First, you will definitely upgrade to Rails 3 with Ruby 1.9. In our case, we had a large application, and moving from Ruby 1.8.7 to 1.9 was far less work than moving from Rails 2.3 to 3.0. It took us a couple months to get on 1.9, but over a year to get on Rails 3.0

Then you upgrade to Rails 4 with Ruby 2.0. Its not easy way to upgrade,but will definitely improve application performance.