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?
A story should not be considered done 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 something 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 includes testing.
On the other hand, sometimes a defect escapes detection even when we've made every effort to test and confirm doneness. There might be one or more stories (product backlog items) which are part of a well-tested increment. This increment has met the definition of done, and has been shown in sprint review. If a defect is found later, fixing 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 A Definition Of Done.