WR Home      Topic Home      Chapter:  1  2  3  4 
<Previous Next>

Chapter 04

Reachability Test

Page 2

A program to test the function isReachable()

A reliable software needs a good amount of testing.
Considerations for exaustive testing:
In order to test the function [ reachabilityFlag ] = isReachable( dx, dy ) we need to pass different values of the parameters dx and dy to the function and observe/plot the return values.

The test values of dy will be taken from -300 to +300
The test values of dx will be taken from -300 to +300

The test values are considered in this range because: When the robotic arm is fully strached and rotated, the fartest points it can reach, lies on the circumfrance of the circle formed by the radius L1+L2. Let us assume that L1=110mm and L2=140mm then the farthest point it can reach is L1+L2 = 110+140 = 250mm. The diameter of this circle becomes 2x250 = 500mm. In order to form a test case, lets take 50points before and 50 points after this circle, this gives a total of 500+50+50 = 600points.

If the function is to be tested for 600 values of dx and 600 values of dt then the total function call would be 600x600 = 3,60,000 (or 360,000). For each value of dx, the dy changes 600 times, hence for 600 values of dx, the total number of cases becomes 600x600. Since the function will be called 3,60,000 times the test program need considerable amount of execution time (say 20 seconds).

The return value of the variable reachabilityFlag is either 1 or 0 for a particular set of input parameters (dx, dy). Since the function is called 3,60,000 times, there are 3,60,000 return values. The return values are stored in a two-dimesional array and shown as an image output illustrating the reachablity.
Output of test program

A simple MATLAB® code is provided below.
main_007.m is to be executed.

This code is easy to digest, please do not proceed further till you execute and understand this code.

Click here to download the code
Click here to view the code and its output.


WR Home      Topic Home      Chapter:  1  2  3  4 
<Previous Next>