If the owner, I tip if they've gone out of their way to do the work, make an improvement that wasn't covered in the initial discussion, went out of their way to correct a problem that wasn't included in the initial bid or part of the negotiated job, etc. I.e., the guy who owns a marina my boat was at worked through his lunch break to get me back on the water sooner - at the beginning of a vacation, dropping a boat off in the morning that isn't running right, and having it back by 1 in the afternoon the same day, because he knows how important people's vacations are to them? Thank you thank you thank you! When I picked up the boat, I had a case of his favorite beer for him.
I don't run into this with contractors working on my house myself, since I don't hire contractors for anything. But, my sister recently had work done to put in a new exterior spigot so she could have a hose closer to her back yard. When the water was turned back on, water hammer or something caused a burst somewhere else under her house - it was probably a ticking time bomb waiting to happen. The plumber said that since it happened during his job, he would consider it something that was potentially caused by him, even though he was never within 10 feet of where the fitting burst. He fixed it for free. That was definitely deserving of a large tip, imho. Even my sister knew it wasn't his fault and would have happened if she turned the water to the whole house off and on; but the guy did it simply to protect his reputation.