Suppose we have estimated 5 user stories to complete in a sprint and completed all of them with testing, buffer time and for expected bugs.
Still we have 2-3 days left for one of the developer. Can we pull a future user story in current sprint knowing that only development or part of development can be completed in current sprint?
Certainly, you should be able to pull in whatever is at the top of the product backlog.
But be careful.
Make sure that pulling in the new story will not interfere with the delivery of the stories you have actually committed to. You really should make sure they are wrapped up and ready to go (deployed even). At the very least you need to make sure that the new probably-unfinished code does not get mixed up with the finished deliverable code.
1
Scrum exists to serve your needs, not vice versa. Do whatever makes sense to you. Monitor how to works. Adjust.
Does it make sense to give this developer a vacation? Does your developer have some piece of trivial cleanup that they would like to do and didn’t get to? Is there a particular story that the developer can get a head start on, and then set aside? We’re not there, we don’t know the situation. You are, make something reasonable up.
Remember, Scrum came out of the Agile movement. Go read the Agile Manifesto at http://agilemanifesto.org/. It is short, 4 bullet points. Half of them apply directly to this case, and agree that if an “official Scrum procedure” gets in your way, you should be doing what makes sense to you rather than following ritual.
1
If you feel that you can completely finish another story, then have a chat with your product owner to select the right one. (a small ad-hoc re-planning meeting)
Otherwise, spend that time well to prepare for the next sprint planning meeting. It will make a very pleasant planning.
Or, do some maintenance on your development and building tools.
Or, … I am sure there’s always something useful to do.
Make sure the product owner knows about it.
Of course you can, as long as the team agrees.
Actually if you ran out of work you’re supposed to either pull in something or close the sprint.
We never had that situation as right on planning we included some “tentative” items that are not formally part of commitment but are first candidates if scope is rearranged or risks work out our way.
OTOH if the project has technological debt, you can use the time to work some of that down finally.