Generally I think that the tracking of development time is useful to improve future estimates and to optimize processes. Of course I am assuming that the data is actually analyzed and discussed in retrospectives.
However I am afraid that often the reported times mainly reflect what the developer thinks others (team members, managers) are expecting and not what actually has been done. I have seen extreme cases where the reported time was always identical to the estimated time for that task.
Even if you want to do it right as a developer, it is often difficult to decide what amount of the time spent at work is actually dedicated to a specific task. Here are some typical examples where some developers would report a full hour while others won't report anything at all:
One of the API functions you are using is buggy and does not work in your context. It takes you 30 minutes to find this out and another 30 minutes to implement a workaround.
You find that it makes sense to use a specific technique you are not familiar with to accomplish your task. So you spend an hour going through a tutorial.
You spend an hour debugging just to find out you made a silly mistake that should have been obvious in the first place.
After installing some new software, your build does not work anymore. It takes you an hour to get it working again.
You get some weird linker errors. After an hour of playing around with compiler and linker options, it works but you don't know why.
You try to work on your task for a bit more than an hour. During that time you are interrupted by three phone calls and two colleagues asking you for some advice. The interruptions only take a few minutes in total but require you to switch context each time.
When getting up in the morning, you find a good solution for an issue related to your task. You elaborate it during breakfast and on your way to the office. You actually have no idea about how much time you have really spent.
Your disk crashes or you accidentally delete a folder and your last hour of work is lost.
From my experience, roughly 80% of development time is spent on these types of activities.
Are there recommendations on how to make time tracking more reliable and thus more useful? Is it possible to create a simple and more or less unambiguous set of rules for deciding if a certain activity is related to a given development task?