The question of robot emotions and how you know if emotions are real is something that has appeared in many stories. Perhaps in some ways it is the logical movement from the Frankenstein myth and we question if we are able to create life or just an image of life. The master of this question is Isaac Asimov who has written many stories in this, and few are better than "A boy's best friend".
A boy's best friend first appeared in "The Complete Robot" a compilation if Isaac Asimov's Robot stories. This is the story of a young boy and his romutt, a robotic dog which he owns because he lives on the moon and there are no dog's there, but his father is wealthy and he buys his son the first real dog bringing it to the moon to replace the romutt.
The boy is horrified at the idea that he will have to give up his pet, but his father explains they can't keep both. There will be no need anyway, once you have a real pet you will see that it loves you truly and it isn't just an act. The boy though, recognizes the flaw in this logic immediately. They do not know the motivations or true feelings of the dog. We assume it loves us because it acts as if it loves us but is it not possible that it acts that way simply out of self preservation?
The question of love is a complex one and has become more complex not less as we have grown to understand it better. Humans emotions are physical in many ways. The feeling of love can be hormones, but there appears to be more. And this question in many ways becomes even more complex when you begin to think about animals. Do dogs actually love us, or have we bred them to act in a specific fashion because it makes us feel good? Are they really as smart as we think or have we anthropomorphized them into something far more than they are?
One of the things that makes "A boy's best friend" such an interesting story is that it brings up these questions well but it doesn't attempt to explain them. This is because the explanation isn't the interesting part, the interesting part is the question. How do we know anything loves us? Is it a human need that we impart onto others because it makes us feel good? More to the point in this story, if we created robots who acted like they loved us would it matter that we had programmed them that way? If not then what about people? If they are programmed to love, created through genetics we a need to connect then is that connection real or simply a biological need, and does the difference even matter?