20
Is it okay to leave tests in your code?
(programming.dev)
This is a place where you can ask any programming / topic related to the instance questions you want!
For a more general version of this concept check out [email protected]
Icon base by Lorc under CC BY 3.0 with modifications to add a gradient
It's my opinion that typically all published apps should employ automated testing, in the form of unit tests, integration tests, and so forth.
As far as logs and print statements go, it probably depends on the context. Like, useful feedback and debug logs are usually good. But step by step test logs not so much, especially if the end user will be inundated by them.
This is pretty good ^
The idea that println has a a good way to test a s incorrect. It requires a testing interaction which should be avoided. Test behaviour at the exposed interface primarily, use logging/telemetry to discover dynamics.
The exceptions are reserved for scripty things (bash has poor logging,) ones offs (1x migration) or personal tooling.