-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(discuss) Make FastForward
an abstract class with default implementation
#12
Comments
Hi Claire, guys, my 2d (as a spotin00b FYI) is that this should be treated purely as a refactoring. It bears highlighting that refactoring is not making something better or improving its observed behavior. It's solely changing the hidden implementation and explicitly not changing the observable behavior. Hence if our unit tests have good coverage, and if we observe they pass, we should be pretty confident that the risk of this change exhibiting incorrect behavior is low. However 🙂 what about the code that links against ffwd-client-java?
Just my 2d. |
thanks for chiming in @sming ! Yeah, as I'm mostly familiar with FastForward via the semantic-metrics integration I wasn't sure how much of an impact something like this would have. On the plus side, the constructor for FastForward is private, so I would imagine libraries using it are only instantiating it via the static Agree that an interface might be better, but would require more code changes, and we would have to move the Anyway, let me know what you guys decide is best! |
btw, put up a simple branch with the proof of concept + a unit test to prove the default implementation still works correctly: https://github.com/spotify/ffwd-client-java/compare/claire/ffwd_abstract_class |
Prior discussion here: spotify/semantic-metrics#76
This is an extension of the discussion above ^ re: testability in the FastForwardReporter in
semantic-metrics
repo. Basically, in a production environment theFastForward
client would be already running within the container, but in a local unit testing environment this can be pretty cumbersome to set up. I think makingFastForward
an abstract class (with a default implementation) would be really helpful, because for simple unit tests we could plug in a stubbed implementation that doesn't require a datagram socket running and can easily verify the metrics being sent. I initially suggested making an abstraction layer for it insemantic-metrics
, but they suggested the change be more appropriate here.for example:
and a user could create their own stub implementation for unit testing, like:
wdyt? I'm happy to make the PR myself it sounds reasonable.
The text was updated successfully, but these errors were encountered: