When does a Refactoring Induce Bugs? An Empirical Study