14 ms·
It is useful to be able to refactor the code behind that interface, or 1 or more levels down the call stack, while testing via that public interface. Contract
by SideburnsOfDoom 3y ago
It is useful to be able to refactor the code behind that interface, or 1 or more levels down the call stack, while testing via that public interface.
Contract changes is one reason for such a code change, but there are many others - including bug fixes, error handling, handling input cases that were not well supported before, performance or readability improvement, changing to use a new version of an internal library with a new contract, and pure refactoring to e.g. extract common code, with no other logical change.
it is useful to do such incremental changes supported by tests on a "publicly exposed interface" that does not change frequently, instead of tests coupled to classes that are not not part of a "publicly exposed interface".
- deleted 3y ago[deleted]
- strogonoff 3y agoAbsolutely. If there is no logical change to a public interface, then your e2e tests (irrespective of whether they are unit tests, where units are strictly public members or classes or modules, or some other kind of tests) should not change either.