Suppose you start with an auto-generated method
public void setKey(Key key) {
this.key = key;
}
And write a test for it
@Test
public void testSetKey()
Then 3 month from now you decide that a more appropriate name for the method would be changeKeyTo
. You refactor your production code and end up with:
public void changeKeyTo(Key key) {
this.key = key;
}
Life is good, however, your test name remained unchanged
@Test
public void testSetKey()
How do you deal with something like this? Can you refactor test code automatically with your production code? Does eclipse allow this?