Do You Want TDD for Your Ruby on Rails-Based Web App?

QArea Expert by QArea Expert on July 30, 2015

Do You Want TDD for Your Ruby on Rails-Based Web App?
Reading Time: 2 minutes


Test-Driven Development is now practically everywhere. Agile is marching with miles-wide steps through development and only the lazy have not tried it yet (although, I believe, even the lazy have some clues as for now). How were things back in the day? Developers were writing code and it was tested at some point before the release by QA. And what is in trend now? Writing test cases before even a sample of a code’s logic is written, but does it work? Is the approach good enough for large-scale project and, more importantly, how will it cooperate with RoR (Ruby on Rails) and will you get all if you are a beginner with both?

Will RoR and TDD get along?

To tell you the truth RoR is great for Agile and TDD as it is really freeing developers from the necessity of writing repeated code as RoR emphasizes convention way over configuration. It is also great if combined with TDD due the fact RoR has rather short development routines.

How is TDD actually doing great with Ruby?

  • Phase of development is controlled and realistic
  • Developers are working on small pieces of code thus are saved from making many mistakes due early tests
  • TDD is great at assisting with building focus
  • Difficulties are avoided due careful analysis of what was done earlier

Are there downfalls?

Absolutely! There always are downfalls. TDD means every new feature is tested pretty much separately thus every new feature has the potential of injecting new bugs into the apps core code thus TDD may actually drain developers from any will to go on and resist defects as there are seemingly more and more of those. But, that’s pure theory. And thanks to the fact that TDD is actually about creating all the required tests of new features it reduces any design upfront dramatically.

As for me it is clear TDD and RoR are quite fit altogether, but only you may truly decide whether risks are worth the effort. There are supporting methodologies like Continuous Integration or even Continuous Delivery that can nullify downfalls of TDD, yet combining everything in one cycle is truly a subject for a different article.