In the movie "Yo robot", don't know its English name, maybe "I robot", they speak about that. one interesting thing is about the "lost" code in such a huge code for the AI in robots that makes them actuate ramdomly that noboy may predict, what we can name as its own personality its conscience.