Maintaining Unit Tests During Refactoring
Harrie J. M. Passier, A. Bijlsma, Christoph M. Bockisch · 2016
The meaning of source code is often described by unit tests, as is for example the case in Test-Driven Software Development. Test-driven development is a principle in software engineering that requires developers to write tests for each method before implementing the method itself. This ensures that for (at least) all public methods tests exist. When performing a refactoring, existing code is changed or restructured according to a predefined scheme. After a refactoring is applied, the alignment between the structure of source code and corresponding unit tests can be broken.