Code refactoring is really faster when you have unit tests. A unit test also show you simple use of concrete function, so you have a little "howto" which can be really useful in big projects where programmers dont know exactly the whole code.
When you are Developing with TDD (test driven development) you dont have unnecessary getter/setters etc. You just create what you need.