I am making mug cake in a pot using steaming method and I will use normal tea cup. I want to know what precautions I must take so that the cup doesn't break after baking 
I think your process is pretty close.  Add more water to your pan.  If necessary, add more salt.  At the boil, drop in your spaghetti.  I like to use tongs, but a spoon or fork will work.  Gently stir and press down the softening bottom part of the spaghetti.  It should only take a minute or so for you to submerge all of it.  Give it a stir.  Turn the heat down so it doesn't boil over.  Keep an eye on it.  It still may want to boil over.  After a few minutes give it another stir, paying attention to any sticking.  Stirring occasionally during cooking will help.  You don't say what condiments you are using, but it is almost always better to cook for a minute or two less than the directions on the package, and finish the cooking in a pan with the condiments.  I remove the cooked spaghetti from the water with tongs, and place it in the condiment pan.  Then I have the starchy pasta water to use in my condiment so I ultimately get the right consistency of the completed dish. 