Agile development is a development methodology created to allow small groups of programmers to create high quality software in a minimal amount of time. Ruby on Rails uses agile development methodologies extensively, and work best when development teams using Rails also use Agile methodologies.
Agile Development Principles
- Iterative Development: Iterative development allows the clients to direct the development process in order to get the software features they want. Working software is delivered to the client at regular, short intervals. Client feedback is used to make changes to the software specifications at any stage in the development.
- Open Collaboration: The backbone of agile development is open, unrestricted communication between programmers and clients. In addition to working closely with the clients, the programming team must be able to communicate freely with each other. Face to face communication is preferred over specification documents, so working in an open office with no cubicles is ideal.
- Adaptability: Software must be written expecting for future change. Principles like Don't Repeat Yourself (DRY) are used to facilitate this. In agile development, changes to the software specifications are welcome even in late stages of development. As clients get more hands-on time with iterative builds of the software, they may be able to better communicate their needs. Also, changes in the market or company structure might dictate changes in the software specifications. Agile development is designed to accommodate these late changes.
Agile Development with Rails
Rails has many facilities to aid agile development of Rails applications.
- Test-driven Development: Rails provides an extensive unit and functional test framework. By writing tests before writing the features, you can be sure that they work in the intended manner. And, since changes are expected to be made in the future, running the tests after changes ensures that the change didn't break other features. In the absence of formal documentation and software specifications, unit tests are a way to implement iterative development without sacrificing assurances that the software works as intended.
- Don't Repeat Yourself (DRY): You'll often hear DRY used as an adjective, such as "Is this code DRY enough?" Rails gives you several facilities, such as the helpers and the libraries, to help implement DRY code. Repeating code as little as possible makes it easier to make changes later on in the development cycle. If the code only exists in one place, it only needs to be changed in one place.
- Partials: DRY is even applied to page-rendering in the form of partials. Instead of repeating HTML code to display elements of a page, a partial can be used. If changes must be made to the HTML code, then only the code in the partial needs to be changed. Any code that calls the partial will remain unchanged.
- Simple Deployment: Rails comes pre-configured to use either the Webrick or Mongrel HTTP servers. Changes can be made to a live site on a development machine and be seen immediately. This facilitates face-to-face communication with clients since the developers can make changes and the clients can see the results instantaneously. Along the same line, Rails also works well with Capistrano for automated deployment to production servers.