

Do we need 100% code coverage when it comes to unit testing?  - Sange

We are trying to do more TDD but I&#x27;ve come across a stumbling block. We are using PHPUnit+FuelPHP and I need&#x2F;should write a unit test for image uploads.<p>However, mocking anything dealing with the FILESYSTEM is notoriously difficult and time consuming.<p>So I am wondering: Does it make sense to write a unit test when writing testing code (i.e. mocking and stubbing and writing a bunch of wrappers) is more involved than writing actual production code?<p>Do we need 100% test coverage? Or am I approaching TDD incorrectly?
======
Sange
I also asked this questions over on programmers.stackexchange.com "
[http://programmers.stackexchange.com/questions/221536/when-n...](http://programmers.stackexchange.com/questions/221536/when-
not-to-unit-test/221537#221537)

------
bobfirestone
I would say 100% test coverage is actually a maintenance nightmare in the
making. 100% coverage would require fixing broken tests ant time you change
things in your code. If you are testing the right things 25-35% coverage is
probably all most projects need.

