Skip to content
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

Figure out an appropriate way to test this #3

Open
chrisuehlinger opened this issue Jan 24, 2018 · 1 comment
Open

Figure out an appropriate way to test this #3

chrisuehlinger opened this issue Jan 24, 2018 · 1 comment

Comments

@chrisuehlinger
Copy link

In a project this complicated (i.e. one which relies on hardware, real-world lighting, browser features hidden behind flags, etc.) I imagine it's difficult to write useful unit tests in any conventional way. However, I also think it's really important that developers have a couple smoke tests to validate that they aren't breaking things when they check in code. I can think of a few steps that would help make the code more testable:

  1. Break the call to navigator.mediaDevices.getUserMedia() out of CameraVideo and instead pass a stream as a prop.
  2. In general, divorce the openCV-related stuff from the React components and just pass the components the minimal state they need to render. That state could be managed by something like Redux, although in my experience Redux itself is not always a good fit for apps whose state includes "blobby" things like MediaStreams.
  3. I haven't dug too deep into the server side, but if we could find a way to mock the DB (or just the calls to the DB) it would make it easier to test changes to the API.

Given that Paper Programs is still young, there might be other higher priorities right now. I just wanted to throw this out there as something to think about while moving forward or designing new parts of the system.

@janpaul123
Copy link
Owner

Good ideas! Smoke tests would be nice indeed. But yeah some things are just way too experimental maybe? For example, I would imagine that a good calibration routine could eliminate all manual steps, in which case it would be a bit pointless to test those things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants