Topic: Help me understand...

I am new to development using RoR, and encountered something I have not had exposure to before while learning it, Testing. During the tutorials, I spent 70% of the time scratching my eyeballs out trying to get tests to pass that three clicks of the mouse told me should be passing. I eventually gave up and have since been ignoring testing altogether. Why is this such a big thing? I want to be a good developer, aspiring to be a professional developer truly. I just don't see how taking so much time writing tests gets me anywhere. I am not saying I know everything and therefore tests are pointless... I am just looking to perspective. Thanks in advance.

Re: Help me understand...

It's annoying but great.

I don't like writing tests either, but it's nice to be able to refactor code and easily see if you've broken anything.

Re: Help me understand...

acooper86:

Testing will become easier once you are more experienced with Ruby and the Rails framework.  Then you won't be second guessing yourself on if you're calling test methods appropriately.

Testing also becomes your friend more when other people are depending on your code.  When its just you on a small project it can be harder to see the benefits, but say you're developing an API or an application that other applications and devices interact with, it is critical to ensure you don't break compatibility to the other people.  So tests are a great way to do that.

Re: Help me understand...

As mentioned before, the purpose of tests becomes more apparent when you are working with a group.

When you are by yourself, they are great for when you add code. For instance, you start out with a test that passes, then add a ton of stuff. The test will tell you what you might have broken along the way. For huge, complex apps, tests are good to run often to keep you on the right path.