If you miss your estimates it means you failed to decompose issue.
I fail a lot. To prevent this I try to follow these simple rules to decompose issue into subtasks:
- Every subtask should be implemented via 1 small Pull or Merge requests with only one commit in it.
- This PR/MR should be small enough so half of the team (at least) will be able to review it the same day.
- Every subtask should be covered with 1 positive and 1 negative test case.
That's gave you an idea of how small these tasks should be and what should be inside. But how to separate them from initial issue?
- Map this issue to functional and non-functional requirements and split based on them.
- If issue cover several modules - than you have an additional dimension to split it.
- Different actors also a good motivation to split issue.
So having Issue with two actors, two functions and two modules will result in 8 tasks. Now you can estimate each task and sum result up to receive accurate estimation of the issue as a whole.