Time Spent Coding vs. Testing Question

testing October 15, 2021

On Reddit’s r/java, user u/redikarus99 asked an interesting question, entitled “Time spent coding vs testing.” It’s an interesting question, and it’s had some interesting answers.

Here’s the question itself:

We run into a situation when we feel that maybe we spend too much time on testing. We do unit, integration and contract tests as well. I am interested in that for a single rest endpoint what is the average ratio of the testing effort vs the coding effort in your case? I know it depends, but an average would be a great help.

One response:

Check to see if you are falling under this antipattern http://blog.codepipes.com/testing/software-testing-antipatterns.html#anti-pattern-5---testing-internal-implementation

Another response:

Definitely more time spent on coding, somewhere around 1:3-1:5. Do you follow the testing pyramid? More tests on low level, less tests on higher level?

Yet another response, that people are downvoting - remember, these are offered without comment here:

the ratio should be small enough that it’s not measured, like 1:100. it would be easier to understand if you explained why the test took so much time. maybe there’s a good reason in your case.

in testing

Reading time: 1 minute.