There are three main times of question tag:
1 The sarcastic response or one showing surprise or disbelief where both are postive as in:
A I've worked really hard today
B You have, have you?
2 The response where you hope that the answer will be no from the speaker:
A I have lost all my money at the casino
B You haven't, have you?
3 The response where you hope the answer will be yes from the speaker:
A I think I locked the door
B You did, didn't you?