3 ms·
My view now is that tests are mostly there as additional documentation and a form of cross cutting type checks. You have two functions with various parameters a
by Nathanba 3y ago
My view now is that tests are mostly there as additional documentation and a form of cross cutting type checks. You have two functions with various parameters and then you write a unit test to document how these two functions interact with each other and you make sure that a certain beaten path remains working. It generally won't catch any bugs whatsoever but it's like having it documented that this is in fact a path and it is supposed to be there and it should remain maintained. Almost like a map of streets and thanks to the map you know that these paths are there and they need to be snowplowed even though maybe you don't remember why exactly there is a street here. It just is and you want it to remain in functioning order anyway. Even in teams I've not really seen unit tests catch any bugs but that may be because once you've written the code with tests it's so well documented and the purpose is so clear that people aren't going to forget how things work anymore. At that point most people won't "run into a wall" anymore because they can see the wall now.