phys : Probabilistic Physical Unit Assignment and Inconsistency Detection

Sayali Kate, John-Paul Ore, Xiangyu Zhang, Sebastian Elbaum, Zhaogui Xu --- FSE18 Artifact

For ROS Programs

Getting started is easy! QuickStart

phys is a tool to detect physical unit inconsistencies in C++ that builds against the Robot Operating System. phys is a command-line tool that can be used with Docker.


For example, assume a developer is building a robot and wants to calculate the length of the hypotenuse of a triangle with sides x_err and y_err, but the developer accidently uses a multiply symbol (*) instead of an addition symbol (+), and ends up adding x_err * x_err (meter-squared) to err_y (meter):

err_d = sqrt( err_x * err_x + err_y + err_y); (source)

This code compiles and can be difficult to detect. Yikes! This kind of error is called a physical unit inconsistency, and phys can detect it without developer annotations.

Quick Start + Examples

Install Docker, build phys, and run phys examples.

Requires Docker. Tested on Ubuntu 16.04.4.


C++ files that build against the Robot Operation System (randomly selected from github data) used to test and evaluate phys.

License, Credits, & Funding

Yes, phys is open source. See the license, credits to existing tools, and details about funding support.