views:

41

answers:

2

I am writing a web application with ruby on rails. It uses mongo db as well.

I have a few questions:

Firstly, what are the available testing tools (preferrably, free/open-source) for testing web-apps written in ruby on rails.

Secondly, what are the testing areas that should and can be generally covered with the above tools (unit, functionality, usability, compatibility, performance, load, stress)

Also, how is WATIR in this regard?

A: 

Rails, is by default a Test Driven/ Behaviour Driven framework. There are various tools available for doing testing within rails

  • Ruby's very own Test Unit
  • rSpec ( BDD )
  • Cucumber ( BDD )

Above can be used for unit, functional and integration testing. They integrate well with Selenium and Watir. So both should work

I think you can get a general idea about performance testing here

http://guides.rubyonrails.org/performance_testing.html

Hope this helps

Rishav Rastogi
+1  A: 

Hi

There are many tools for testing rails and other webapps from many different aspects. But if you are new to testing I highly recommend you start with learning Rails own testing framework before start using other tools.

Learning, and later mastering, one testing framework makes it easier in the future to understand pros/cons with other framework and make them work in unison.

You could start with testing the following things:

  • Unit Testing your Models
  • Functional Tests for Your Controllers
  • Learning about Fixtures and how to load test data

I have seen many failed testing efforts, but I never saw them fail because they choose the wrong tool/framework. They fail because they don't know how to master the tools they use, and learn enough about the basics about testing.

Read more about Rails testing here.
http://guides.rubyonrails.org/testing.html

Manual Exploratory Testing
As much as I love automated testing it is, IMHO, not a substitute for manual testing. The main reason being that an automated can only do what it is told and only verify what it has been informed to view as pass/fail. A human can use it's intelligence to find faults and raise questions that appear while testing something else.
Read more about mixing Automated and Manual Testing in another of my answers here:
http://stackoverflow.com/questions/2260332/what-test-methods-do-you-use-for-developing-websites/2264499#2264499

Jonas Söderström