• Tips for Testing: Tip #7

    by Ben

    Tip 7: Be reasonable

    There are lots of reasons why tests are great, but if your practices aren't ultimately making your code better and you more productive, it's not worth it. You have to always think about the return on your time investment.

    There are domains in which automated testing is very difficult and doesn't provide a lot of value, like GUI testing. I would recommend writing tests for the interface that the GUI calls, but actually testing that things show up correctly is quite tricky and error prone.

    Also, 100% code coverage shouldn't necessarily be your goal. As you get better at writing tests, I think you'll find they provide a lot of value, but at some point, covering that last small percentage of code may require way more effort than it's worth.

    Devver Caliper: Hosted metric_fu for your Ruby project.
    Get set up in under a minute

    Posted on July 1st, 2008 by Ben in Testing.