I offer a Workshop on Testrecorder at XP-Days 2017. Everyone that visits the session, will be presented a refactoring of selected “Legacy Code”-projects following the method:
- Record (Capture some Tests)
- Refactor (Simplify the Code)
- Replay (Execute the Tests)
After Presenting at Karlsruher Entwicklertag it is time to write a few words about the future of Testrecorder …
Testrecorder is a Java tool vor recording runtime situations. Recording means, that we intercept method invocation and capture the state before and after the invocation. From this captured state we generate JUnit-tests.
This posting is about accessing private fields and methods, by adopting a foreign interface to a given java class (not already implementing the given interface). Why? Yet, in my former posting about Repairing Legacy Code I mentioned the challenge of accessing hidden state (private fields) before and after method invocations.
There must be another cure against legacy code than writing tests … Sounds like “There must be another cure against chaos than tidying up”.
Yet for we all know the washing machine, the dishwasher, the hoover robot but not the code cleaner. Why?