Past experience and historical data often work best for providing estimates. If you've dealt with similar code/issues before use the historical data to predict future tasks. Of course if you're dealing with something new or entirely unknown, then it's harder to provide accurate estimates. Of course they are 'estimates' which is an educated guess as to when things will be done.