Skip to content

Testing

Roo edited this page Apr 15, 2019 · 3 revisions

Software

Documentation

Installation


Included within the Glassify repository are a series of Unit Tests. These unit tests cover the following:

  • Camera Class Functionality
  • Classifier Class Functionality
  • Display Class Functionality
  • Servo Class Functionality
  • State Class Functionality

These different tests cover a large range of functionalities of the Glassify software. These can all be run from the build directory within the Glassify folder with the following command for enhanced feedback in case of error generation:

sudo make test ARGS="-V"

Camera Class

In the camera class tests, the operation of the camera is tested. This consists of assessing the dimensions of the image acquired, the number of frames per second that the camera acquires images at, or the brightness of the image resulting from capture.

It should be noted that this test also involves the opening of the camera on the raspberry Pi, and, as such, if you execute the test it is guaranteed to fail if you do not have a camera connected.

Classifier Test

The classifier test assessed whether the classifier class is capable of performing classification. To this end, the ability of the classifier to detect the magnitudes of differences between images and hence clear bottles is assessed. Furthermore, the ability of the classifier module to classify green or brown colours is tested.

Display Test

In display tests, simply whether the display is initialised with the correct settings is queried.

Servo Test The servo test consists of a large battery of tests which test the ability of the servo class to retrieve stored angles from a nearby file "calibration_values", and whether it can write to this file. Furthermore, the tests check whether the servo is initialised with the correct variables, and whether the logic of the angles to which outputs are sent based on these default settings are suitable.

State Test As the state class is intrinsic to the functioning of the 'Glassify' program, this is tested with the state test. The state class handles access from multiple different threads and, therefore, the ability of the class to deal with this without producing a segmentation fault - through the use of 'Mutex' variables - is checked. To do this, multiple threads are generated and the state class is 'barraged' with read and write requests.

Summary These tests encompass a full battery of tests which ensure the correct functioning of the Glassify software. Please feel free to get in touch with us if you feel there may be any useful addition.


Software

Documentation

Installation

Clone this wiki locally