I have been working on this site for nearly an year, doing something on it most weeks, but because it has a lot of components I have not touched large chunks of it. The existing code is far too complex for the functionality it delivers and hard to understand. I can go into more details if it will help, but its unnecessarily complicated and on top of that obsolete files have not been removed. The functionality is mostly heavily customised - a purpose built booking system, for example.
The client is a nice guy and there is a lot of work there so I would not like to give up the work, but he wants more accurate estimates of completion dates and time/cost. At the moment I charge by the hour (which I do for most clients). I find it hard to explain the difficulties of accurate estimates for software development - he has said things like "if I need my car repaired I can get an accurate estimate".
The client gave up on the original developer because of high cost - when he realised that most of the work was being done off-shore he hired an off shore shop directly and they were slow to deliver. He eventually gave up on them and I got the work.
He says he is happy with my work but wants accurate completion dates and time/cost. I am struggling with this. It is more difficult than it is with a site I did from the start because I never know when I will run into an unexpected difficulty with the existing code. Just last week I thought I was nearly done with a major block of functionality and then found some form processing code that worked in a way I never expected and had to be rewritten to work with my changes.
If I take the time to look at what it would take to do a particular bit of work, I then find that I have spent so much time checking everything will work as expected that I am half way through the work required to do it.
Are there better alternatives? I cannot find a way of estimating time required that is not a time sink itself. It also does not help doing the work on the basis of the client adding issues to a ticket tracker (which is better than what many clients do), that fall well short of being an requirements specification.