Skip to content

Test if a trace was emitted in one of the preceding steps #268

Discussion options

You must be logged in to vote

I've been thinking about this issue a lot lately. My case is likely an example of the XY problem. I think I have to solve Y (the test of the emission of a trace), because I am ignoring a root problem X which got me in this situation in the first place. As Ian Cooper preached in his talk on TDD: Don't test implementation details, test your API. The root problem X in this case is me trying to test an implementation detail. Emitting a certain trace in a certain scenario is a feature I want my library to do, but I shall not test it because that is an implementation detail. It is not part of my public API. The library I'm writing does not communicate with its callers via traces. Rather it prov…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ilslv
Comment options

@mateuszkj
Comment options

@fleetingbytes
Comment options

@mateuszkj
Comment options

Answer selected by ilslv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested k::logging Related to library and user logs
3 participants