3 ms·
Completely agree with this. I've wanted to test type A logs, and often heard people saying that "you should never test logs" No - you should never test most typ
by geewee 6y ago
Completely agree with this. I've wanted to test type A logs, and often heard people saying that "you should never test logs"
No - you should never test most types of logs - sometimes logs, particularly in error situations, are part of the output of a function.
- parhamn 6y agoThis sounds like a nomenclature thing. I’m sure any reasonable developer would agree it makes sense to test expected output of a program that isn’t strictly for debugging purposes (type A mentioned above), it’s just that is usually called output not “logs”.
- zoomablemind 6y ago> ...and often heard people saying that "you should never test logs" It's surprising that it gets labeled as "logs". Don't we test the expected behavior of the _code_ under test? Be it a business or an auxilliary code like logging, it's still code, some function/class/facility...well, any purpose added code. Thus, I would test such logging facility for correctness; otherwise, the next time its output is needed, I want to be sure that it can be trusted. Of course, using ready-made logging frameworks may help shift such burden of testing onto the framework's developer.