Quantcast
Channel: Roommate App Development Blog
Viewing all articles
Browse latest Browse all 10

Testing Roommate App

$
0
0

It’s been over a month now since launching Roommate App, and for not advertising and not having any kind of marketing website, it’s doing pretty well. I’ve been getting a lot of good feedback/requests as well. I kind of burnt myself out a little on the project getting it launched, so I took some time off, but I will get to everything eventually. Before I get too deep into new features though, I need to develop the test suite.

Coming from a PHP background, testing is new ground for me (not that testing isn’t done in PHP, but it’s not nearly as prevalent as in the Rails community). When I say “test” in this context, I don’t mean clicking around through the app in your web browser and making sure all the links work, etc. I mean writing more code that makes sure the code you’ve written works (sounds like an endless cycle doesn’t it?). The benefit of doing this is that you can make changes to your application, then run all your tests to make sure what you just changed didn’t break something somewhere else. I’m probably not explaining it very well. Judging by the Wikipedia article, I guess you would call this “Regression Testing”.

Anyway, at this point Roommate App has very low test coverage. The goal would be to reach 100% test coverage, and it’s probably under 5% right now. So I’ve got some work to do. The testing guide at rubyonrails.org was a good starting place for me. It gave me a good overview of the basics and the reasoning behind it. If anyone knows additional resources feel free to suggest them.

While the guide was a good start, Sevenwire (my company) actually uses a lot of modifications to the default Rails app test suite. These include:

  • Factory Girl — A library for creating test data.
  • Shoulda — A library for writing more understandable tests.
  • Forgery — A fake/random data generator (and a Sevenwire original).

So I have a lot of different elements to learn, but that’s half the fun of this project.


Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles





Latest Images