I have heard that writing (coding) unit tests for your application effectively doubles the development time required for projects. Is this true, particularly for beginners?
Also some follow-up questions (brownie points): If you were doing a client project that you hand off when finished, is it worth the time and effort to do unit testing?
Unit testing results in quality software This ensures a reliable engineering environment where quality is paramount. Over the course of the product development life cycle, unit testing saves time and money, and helps developers write better code, more efficiently.
Typical time budgeted on writing unit tests is about 1 day for every feature that takes 3-4 days of heads down coding. But that can vary with a lot of factors.
Timely: A unit test shouldn't take a disproportionately long time to write compared to the code being tested. If you find testing the code taking a large amount of time compared to writing the code, consider a design that is more testable.
Still, it seems as though a 10 second short-term attention span is more or less hard-wired into the human brain. Thus, a unit test suite used for TDD should run in less than 10 seconds. If it's slower, you'll be less productive because you'll constantly lose focus.
If youre serious about unit testing I would recommend the book The art of unit testing by Roy Osherove.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With