I have a question regarding productivity, and it goes like this:

Time difference between developing with unit tests vs no tests

I'm a solo developer with a pretty time-constrained work environment where development time ranges usually from 1-4 weeks per project, depending on either requirements, urgency, or both. At any given time I handle around 3-4 projects, some having timelines that overlap with each other.

Expectedly, code quality suffers. A considerable amount of bugs escape to production, which I have to fix and in turn sets back my other projects.

This is where unit testing comes in. When done right, it should keep bugs, let alone those that escape to production, to a minimum. On the other hand, writing tests can take a considerable amount of time, which doesn't sound good with time-constrained projects such as mine.

Question is, how much of a time difference would writing unit-tested code over untested code, and if possible, how does that time difference scale as project scope widens?

As it is now, I suspect that this would be put off as subjective because it differs from person to person - someone can write unit-tested code as quick as someone else can do the same code but without tests. How can I improve this question so that it doesn't read as such?

Update: Question is now posted at the main site.

1 Answer 1


I don't believe this question is "primarily opinion based". Yes, the amount of time it takes to write X lines of code differs from person to person, but you aren't asking us to make such estimates.
Also, it is possible to give an indication of the value of (unit-)tests without going into a specific number of hours.

However, if posted in its current form, I would ask for additional details in another aspect: How are you currently making sure that your code does what it is supposed to be doing. Is the code completely untested, or are you testing the code on a different level than unit tests.

  • Thank you. As for the testing, it's at a different level, but informal, so I regarded it as untested.
    – Revenant
    Commented Jun 15, 2016 at 2:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .