[ros-users] [Discourse.ros.org] [Quality Assurance] Input validation as a metric for quality

fkromer ros.discourse at gmail.com
Tue Feb 13 20:33:53 UTC 2018



[quote="tyagikunal, post:9, topic:3732"]
I really like knowing that none of my nodes can seg fault or show undefined behavior, no matter what you throw at them.
[/quote]

To detect seg faults one usually runs the production code with a dynamic analysis tool (like e.g. [valgrind/memcheck](http://valgrind.org/info/tools.html#memcheck) or [AddressSanitizer (from googles sanitizer tool suite)](https://github.com/google/sanitizers).

To check against seg faults on the ROS level you would have to check if there is any response from the node (the test runner should not crash) after throwing some input at it. To generate as much as possible different input (for fuzzy testing) you would need some ROS level property based testing framework.

**pyros-dev** uses property based testing to get this done, look [here (hypothesis_example.py)](https://github.com/pyros-dev/pyros-schemas/blob/nested_merged/tests/test_pyros_schemas/hypothesis_example.py) and [here (test_basic_fields.py)](https://github.com/pyros-dev/pyros-schemas/blob/nested_merged/tests/test_pyros_schemas/test_basic_fields.py).





---
[Visit Topic](https://discourse.ros.org/t/input-validation-as-a-metric-for-quality/3732/11) or reply to this email to respond.




More information about the ros-users mailing list