Microsoft interview question

Write a program to reverse a string, how would you test the program, how would you test the functionality in microsoft programs(word, excel, etc.). How would you test a coffee mug? Implement and analyze a sort function of your choice.