Marko Anastasov wrote this on July 19, 2011

Test now

A common statement among the people who don’t do TDD or BDD goes something like this:

We don’t write tests in this project because we don’t have time, but if we’d start a new project we’d write tests.

Obviously “we don’t have time” is another way of saying “we’re not good at writing tests”. Time-wise, there is no real difference in being at the beginning and in the middle of a project - you’re equally inexperienced. So practice! It’s the only way you’ll get there, and your workplace is not where you should be doing it. Learn more about code katas, or find coding buddies and do some coding dojos.

Some people think that their code is too complicated to even begin writing tests. Anyone doing BDD will tell you that only good code is easily testable, but to those who find it difficult, start small. When a bug is reported, write a test case first. Define the behaviour, mock external services if that’s an issue. Then refactor, write smaller methods, repeat.

Developers in some companies do not write tests because there is a “QA team” doing all the testing. It’s a shame that in this day and age, when RSpec and Cucumber can do the entire QA of a complex web application in a couple of minutes, there are beaurocracies of people clicking around for hours as per instructions in a handbook.

Do not be afraid to acknowledge that you need to learn something new and improve your skills. In fact, we should all find great pleasure in that. And few things feel better in our job than automation.

comments powered by Disqus

About Marko Anastasov

Rendered Text co-founder. Started with code, currently more focused on people and words. Foosball striker and entry-level cyclist.

Suggested Reads

Rails Testing Handbook

A new ebook on building test-driven Rails apps with RSpec and Cucumber.

At Rendered Text, we have a long history with Ruby on Rails. Checking the blog archive reminds me that we published first posts about working with Rails way back in 2009.

———

Rendered Text is a software company. For questions regarding Semaphore, please visit semaphoreci.com. Otherwise, feel free to get in touch any time by sending us an email.