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

Better Tests #47

Open
mikepurvis opened this issue Oct 31, 2013 · 1 comment
Open

Better Tests #47

mikepurvis opened this issue Oct 31, 2013 · 1 comment

Comments

@mikepurvis
Copy link
Contributor

The current tests are very basic. Given that a major feature of this library is timing control, there could be tests which set specific timeout configurations of the read and write timeouts and feed bytes in particular ways to trigger or not-trigger those timeouts. Each one could run nnn trials, to increase the likelihood of hitting weird bugs with timer wraparounds, etc.

Also, since we're talking a lot about what's efficient or not efficient, there could also be some tests which mimic real-world usages, things like "read 10000 bytes of data which arrive one byte at a time", "read 12-byte chunks of data which arrives 24 bytes every 10ms", "read \n-terminated ascii strings at 5Hz", etc. These tests could use clock() to measure approximate CPU usage, and be checked against set ceilings to catch regressions (or improvements) when changes are made.

@wjwwood
Copy link
Owner

wjwwood commented Nov 1, 2013

Yeah, more comprehensive tests would be good. Performance tests tend to be tricky, especially with asynchronous activities like this, but they would definitely be useful.

There is also some lower hanging fruit in the form of unit tests for parts of the code which can be decoupled from the read, write, and ioctl calls.

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