The developers on our scrum team are done with a story (product backlog item). Then defects are found during QA testing. Do we count it done? What about the defects?
My general advice is that a story should not be considered done in the sprint if there are defects, or if the testing isn’t complete. If you know there is more work to do before the story would be acceptably complete then it’s not done. This is where the definition of done comes in.
A key part of scrum is the definition of done. The idea is that when a scrum team says a story is done, then the business can recognize the value anytime they choose. For software products, this means the story is ready to release. This is why a scrum team should have all of the skill areas needed to get something all the way done. This usually includes testing.
On the other hand, sometimes a defect escapes detection even when we’ve made every effort to test and confirm that the story is complete. If a story is tested, declared done, shown in the sprint review, and some time later a defect is found, that defect becomes a new product backlog item. Of course, the team may want to revise their definition of done, or at least their testing procedures, in order to prevent any similar defects in the future.
If you need help creating a good definition of done, have a look at How To Create Your Team’s Definition Of Done.