# Ruby articles

Published articles for Ruby articles.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Test-Commit-Revert: A useful workflow for testing legacy code in Ruby

DevFeed: [Test-Commit-Revert: A useful workflow for testing legacy code in Ruby](<https://devfeed.tech/articles/test-commit-revert-a-useful-workflow-for-testing-legacy-code-in-ruby-20055.md>)

Original publisher: [Read original article](<https://www.honeybadger.io/blog/ruby-tcr-test-commit-revert/>)

Author: José M. Gilgado

Published: 2020-10-06T00:00:00Z

Content type: tutorial

Language: en

Sources: [Honeybadger](<https://devfeed.tech/sources/honeybadger.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [bridgetown](<https://devfeed.tech/topics/bridgetown.md>), [Test coverage](<https://devfeed.tech/topics/coverage.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>), [Refactoring](<https://devfeed.tech/topics/refactoring.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [code](<https://devfeed.tech/tags/code.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [legacy](<https://devfeed.tech/tags/legacy.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [ruby-articles](<https://devfeed.tech/tags/ruby-articles.md>), [tdd](<https://devfeed.tech/tags/tdd.md>), [techniques](<https://devfeed.tech/tags/techniques.md>), [test-coverage](<https://devfeed.tech/tags/test-coverage.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tests](<https://devfeed.tech/tags/tests.md>), [unit-test](<https://devfeed.tech/tags/unit-test.md>)

### AI overview

This article explains test-commit-revert (TCR), a workflow for adding tests to legacy Ruby code. Tests run automatically when files are saved: passing changes are committed, while failing changes are reverted. The technique aims to improve understanding, increase test coverage, and enable refactoring while keeping the code in a passing state.

### Source excerpt

When you inherit a legacy app with no tests, your first step should be to add them. But that can be a huge task! How do you even start? In this article, José will introduce us to a testing workflow called test-commit-revert (TCR) that is particularly useful for adding tests to legacy systems. Read to see practical examples and how to set up your tooling for minimal friction.