3 ms·
> Refactoring the sumArray method to use map instead of a for loop shouldn't break tests. What kind of test could you possibly write that would break because o
by johncolanduoni 10y ago
> Refactoring the sumArray method to use map instead of a for loop shouldn't break tests.
What kind of test could you possibly write that would break because of this? Something that measures time or memory usage, or uses reflection?
If you have clearly defined interfaces between significant internal components (which you should), why not test that they do what you ask? Public vs. internal is often more about what is exactly the client of the code, not the code's function or structure itself.
- goldenkek 10y agoA stub on the iterator interface would do it..but like I said..terrible use of testing