4 ms·
Hmm, maybe some sort of introduction of why one might try to unit test their code structure would help some people like me. I don't think I've ever had the thou
by ThalesX 8y ago
Hmm, maybe some sort of introduction of why one might try to unit test their code structure would help some people like me. I don't think I've ever had the though of unit testing my code structure.
What might I use it for?
- maxxxxx 8y agoI could imagine this making sense in a dynamic language like PHP. I don't know enough JavaScript to know if it's applicable there. But it seems one of the things that if used extensively make the test suite a major obstacle to refactoring because it tests way too many internal details.
- Gibbon1 8y agoEven worse because refactoring and bug fixing will always break unit tests coders will get in the habit of reflexively updating unit tests when they fail.
- adrianratnapala 8y agoI assume people fall into doing it without realising. Unit tests are supposed to hermetically test individual components of a system. In object-orient environments, those components are often classes. But classes are typically quite small, very often a particular class exists to some implementation detail of your overall system -- this is especially true of the various Vistors, Factories, Adaptors etc. promoted by OOP theory. When you combine "unit test every class" and "express your code structure through classes" you accidentally end up with "unit test your structure".
- projektir 8y agoThis inevitably happens if your process insists on high test coverage.
- deleted 8y ago[deleted]