Suppose you start with an automatically generated method
public void setKey(Key key) {
this.key = key;
}
And write a test for him
@Test
public void testSetKey()
Then after 3 months you decide what will be the more suitable name for the method changeKeyTo. You will reorganize your production code and as a result:
public void changeKeyTo(Key key) {
this.key = key;
}
Life is good, however your test name has not changed
@Test
public void testSetKey()
How do you deal with something like that? Can you reuse test code with your production code? Does eclipse resolve this?
source
share