3 ms·
Do we even have to read skepticism of tests, is it like a religion or some god you can see? Don’t believe in jeotests witnesses? Do you go back to retest the wh
by lnxg33k1 3y ago
Do we even have to read skepticism of tests, is it like a religion or some god you can see? Don’t believe in jeotests witnesses? Do you go back to retest the whole application manually on each deploy? Do you manually retests all past bugs in each deploy? What kind of cowboys are getting into software development
Trust us, tests exist and they have a plan
- whstl 3y agoSkepticism doesn't mean throwing the baby out with the bathwater. Just because someone is skeptical of extreme points of view doesn't automatically put them in the other extreme. Quite the opposite, actually.
- lnxg33k1 3y agoOne should test all functionalities, happy paths unhappy paths and bugs, is that an extreme view? What should not be tested? What functionality has been naughty and doesn’t deserve test? What does it mean extreme view? How do you ensure correctness of naughty testless parts on deploy?
- whstl 3y agoThe answer to a lot of those is "it depends". Also the article isn't talking about "testing functionalities", it briefly talks about code that is redundant to test in certain ways (eg: unit testing), not "functionalities". There's way more nuance to that. An example: you could even have 100% coverage via integration or end-to-end tests, but still have zero unit tests (EDIT: or the inverse, you could have zero integration tests). The discussion is not just about the what but also about the how.
- lnxg33k1 3y agounit tests also work to ensure maintainability, decoupling, cohesion and cleanliness, other than correctness, so it's not redundant, I'd suggest to read something from Bob C. Martin or Martin Fowler instead of randomers through the internet to see what are the unredundant role of different kind of tests it is more likely to easily write a unit test for a piece of code that is well architected and written using TDD and also to safely modify it, than to modify or write test for a 50 lines of code beast self-contained, undecoupled method Writing unit tests should not take time, should be part of the time needed to write the method, if it's hard to write unit tests for a unit of code, then it's most likely that the code needs refactoring So let me ask then, if there's 0% unit tests, how do you ensure maintainability, cleanliness, decoupling and cohesion of code? By indenting the assignment columns? :D
- whstl 3y agoI don't think anyone in this discussion is claiming that unit tests are redundant. Nor is anyone arguing that we should have 0% unit tests. Please don't interpret examples of extreme hypothetical scenarios as suggestions or recommendations. EDIT: I guess the broader point of my comments is that you shouldn't assume that others are taking extreme positions. Again, as an example, it is also possible to have 100% coverage with only unit tests! But that's just an example of what's possible, not a recommendation or prescription. And I wouldn't recommend extremism in either direction. As always, "it depends".
- deleted 3y ago[deleted]
- lnxg33k1 3y agoI don't understand this idea of considering opinions extremist is coming from. I'd say, it's about needs, I think it's either needed and make sense to adopt a kind of tests or not, otherwise I stand by my past questions, if a unit test ensure maintainability etc. of a piece of code, what is the rationale for which it's not needed for a piece of code, if functional tests ensure correctness of behaviours, what's the rationale for which we don't need a functionality / piece of code ensured for correctness? I cover by unit / functional my code bases completely, because I value what they add to an application, and can't think of a piece of code that I don't need to be maintainable or a piece of functionality that doesn't need to be ensured to be functional, is that extremist? It depends on what, in your opinion? EDIT: I can only think of reasons beyond technical, in case of limited time to market or tight deadlines, but in that case it's tech debt tracked by tickets and docs, still going to be subject to test-writing
- whstl 3y agoEven in ideal conditions, it depends on the project, the language, the methodology, the architecture, on the stance on mocking, on the engineering philosophy used. It depends even on what a person considers a "unit test". For all I know, by "unit test" you might also mean what people call "integration test".