Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unit Testing - how much more time does it really add? [closed]

Tags:

unit-testing

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?

like image 592
jimiyash Avatar asked Sep 20 '09 05:09

jimiyash


People also ask

Does unit testing save time?

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.

How much time does unit testing take?

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.

What does the timely rule of unit testing mean?

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.

How long is too long for a unit test?

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.


1 Answers

If youre serious about unit testing I would recommend the book The art of unit testing by Roy Osherove.

like image 93
Leroy Jenkins Avatar answered Sep 24 '22 05:09

Leroy Jenkins