why I need testings in rails?

Test driven development is the next big fad in development
methodologies (Waterfall, Extreme, Agile, etc...) It's definitly one
way of doing things, but it isn't a comprehensive justification for
unit testing.

Programming is about getting results and results are measured in Time
to Production, Quality of Application and Cost to Produce. Every bug
that makes it into production costs much more than a bug that is caught
in code (especially for a well used application).

All forms of testing are an attempt to verify that things are working
correctly before users actually hit the app. For a new application
testing is less necessary, but as an application becomes more widely
used, every change has the potential of messing something up (maybe
something completely unrelated to the change itself).

So for a short "once and done" project unit testing may be overkill,
although it might also help to ease nerves.

For a long term application that will be maintained over years and have
a large user base, test now and test often. The more automated that
testing is, the less time you'll have to spend poking through long
forgotten features to make sure everything is still hunky dory.

Aaron wrote:

So for a short "once and done" project unit testing may be overkill,
although it might also help to ease nerves.

If you use a system like Lotus Notes, where automated tests are nearly
impossible, then that formula applies.

In a test-rich system like Rails, TDD devolves into simply writing
everything twice, once as a test case and again as production code.
It's usually only a bit more typing.

When it isn't - when you must research how to test something - _then_
your formula takes effect. Untested features can rely on "herd
immunity" to resist bugs.

Saying some Rails projects don't need TDD is like telling an accountant
that some small business don't need double-entry bookkeeping.