Hello, I recently inherited a Rails 1.2.5 application, which was profitable for the customer, but hadn't been maintained for at least 5 years. Upgrading it to a current version of Rails it was rough. Once I got familiar with Sumo, I got this idea. I have an application with production logs going back years, and no tests. What if I used Sumo to query the log files, and auto generate tests, based on what parts of the site are visited most frequently? While I know that this isn't an ideal solution, the point of the tests is to ensure that the site's most-used functionality has at least some tests against it, and to have something to run during the upgrade process, to trigger deprecation messages. Also, when starting work on an application with no tests, it's really hard to write that first test, so this is a good way to get over that initial resistance. My question: does anyone think a tool like this would be useful for people who have inherited untested legacy applications? If not, are there any suggestions on how to make it useful? Also, is there something like this already out there in the world? I have a gem (not published on rubygems.org yet, but viewable on github) mostly built that uses a sumologic search query to identify the most-used links on the site, and builds tests for those links. Once they are generated, I can just tweak them a little bit, to make them actually work, by creating any required fixtures, or ensuring that any setup is completed. I can generate tests as either standard tests, or as private methods, which allows me to link them together. For example, if visiting a particular link first requires that a user be logged in, I can call the 'login' method at the beginning of that particular test. Here's the link (warning: it's not done!); https://github.com/tnordloh/your_legacy_tests I still need to document how to turn these raw tests into something useful, but I let my free account expire, so I'm currently in the process of asking for a temporary extension, to allow me to document how to properly use the gem. If that doesn't end up happening, I'll probably just parse log files myself, but that would be a real pain :) Thanks for any response.
Please sign in to leave a comment.