Domanda di colloquio di DWS

When I have a legacy method and need to change it, how would I do that? How do I make sure that I don't break anything?

Risposta di colloquio

Anonimo

8 ott 2012

Write unit tests that represent all possible input-output relations of the method; the change must not break the tests. To find all possible inputs and outputs, try to search in the entire source, where is this method used, what inputs/outputs can be there. Real world: If we find a legacy method, and it is even encapsulated well enough, and we know all possible input-output relationships, we are extremely lucky.