Phase stability and martensitic transformation in metals and alloys