Skip to content

Test package information

nconlon edited this page May 1, 2013 · 2 revisions

Purpose:

AutoAdvisor takes advantage of the automated testing mechanism built into Ruby on Rails. Blank test files are automatically generated during development and are organized in the app/test/ folder. Unit tests cover models, functional tests cover controllers, integration and performance tests cover the combination of models, views, and controllers.

Commands

  • Print out a code:test ratio matrix: 'rake stats'
  • Run all unit, functional, performance, and integration tests: 'rake test'
  • Run all unit tests (tests models): 'rake test:units'
  • Run all functional tests (tests controllers): 'rake test:functionals'

Testing:

Testing should be done as often as possible, but at a minimum, tests should be done before a push to github, as well as before a push to the production server. All developers on the AutoAdvisor project are responsible for creating tests for their specific components.

Goals:

  • At least 1 unit test per controller function.
  • At least 1 unit test per model.
  • At least 1 integration test per view.

A few things to keep in mind:

  • As requirements evolve, tests should too.
  • Look back on use case scenarios from the SDS document when writing tests for client side components.
  • Tests that are written/generated in a standard form should be kept in the autoadvisor/tests/ folder.
  • Lines of code/tests and code:test ratio can be seen with 'rake stats'. We should strive for a ratio above 1:1
  • A Guide to Testing Rails Applications has a lot of good information (see resources).

Most recent results

  • Tests passing as of 05/01/2012
  • Unit tests: 16/16
  • Functional tests: 7/8
  • Integration/performance tests: 2/2

Documentation:

To report an issue associated with testing, please use the GitHub issue tracker (see resources).

Resources:

Clone this wiki locally