Please send questions to
st10@humboldt.edu .
**********************
INDICATE DIRECTORY - DONE
**********************
last modified: 12-12-11
User can indicate a "current directory" (or folder), where the user's
functions will be stored (or sought)
STATUS: DONE
FIRST PASSED: 11-29-11 (they completed earlier, though -- took
me a while to get to completing acceptance test for
this)
acceptance tests last attempted: 12-12-11
acceptance tests last passed: 12-12-11
-------------------
acceptance test 1
-------------------
see if a new function is saved in the specified directory
(if necessary -- close theGui.pyw via the Python menu)
1. run pre-5 script
...this empties the contents in:
/Users/smtuttle/480xp-tests/dir-test1
and removes abs_val from
/Users/smtuttle/480xp-tests/dir-test3
2. run:
python3 theGUI.pyw
(if necessary:
* Click "Change directory" and navigate to the following
directory:
/Users/smtuttle/480xp-tests/dir-test1
...and click "Choose".
)
3. try to create a new function circ_area:
* Click new, and enter the following design recipe steps:
circ_area
circ_area: double -> double
expects the radius of a circle, and
produces its area
double circ_area(double radius)
const double PI = 3.14159;
circ_area(10) == 314.159
circ_area(1) == 3.14159
{
return PI * (radius * radius);
}
* click "Compile, Test, and Save"? make sure it compiles;
Are tests run, and do they pass?
5. Look in directory:
/Users/smtuttle/480xp-tests/dir-test1
...are circ_area.h, circ_area.cpp, circ_area.o there?
LAST TESTED: 12-12-11
LAST PASSED: 12-12-11
-------------------
acceptance test 2
-------------------
see if you can run a function already in an entered directory
1. make sure that a directory:
/Users/smtuttle/480xp-tests/dir-test2/
...exists, and has circ_area.h, circ_area.cpp, and circ_area.o in it
(but NOT any ring_area files, yet...)
(if necessary, exit theGui.pyw via the Python menu)
2. run:
python3 theGui.pyw
3. Click "Change directory" and navigate to the following
directory:
/Users/smtuttle/480xp-tests/dir-test2
...and click "Choose".
4. Verify that circ_area shows up as an available function in the right-hand
area, and able to be checked
5. check it, and try to enter the expression:
circ_area(10)
...and click Execute
6. See if you get the value (approximately) 314.159.
LAST TESTED: 12-12-11
LAST PASSED: 12-12-11
-------------------
acceptance test 3
-------------------
see if, when you change directories, that changes what functions are
available; and if you then add a new function, it is saved in the
current directory at that time
1. make sure that a directory:
/Users/smtuttle/480xp-tests/dir-test2
...exists, and has circ_area.h, circ_area.cpp,
and circ_area.o in it; (but not ring_area, yet)
2. make sure that a directory:
/Users/smtuttle/480xp-tests/dir-test3
...exists, and has triple.h, triple.cpp, and triple.o in it.
(if necessary, exit theGui.pyw via the Python menu)
3. run:
python3 theGUI.pyw
* Click "Change directory" and navigate to the following
directory:
/Users/smtuttle/480xp-tests/dir-test2
...and click "Choose".
4. Verify that circ_area shows up as an available function in the right-hand
area, and able to be checked
5. check it, and try to enter the expression:
circ_area(10)
...and click Execute
6. See if you get the value (approximately) 314.159.
7. Now click "Change directory" and navigate to the following
directory:
/Users/smtuttle/480xp-tests/dir-test3
...and click "Choose".
8. Verify that circ_area no longer shows up as an available function
in the right-hand area, and that triple now shows up as an available
feature in the right-hand area, and able to be checked
9. check it, and try to enter the expression:
triple(10)
...and click Execute.
10. See if you get the value 30.
11. try to create a new function abs_val:
click New button, and enter:
abs_val
abs_val: int -> int
expects an integer, and produces its
absolute value
int abs_val(int value)
abs_val(0) == 0
abs_val(-3) == 3
abs_val(45) == 45
{
if (value < 0)
return -1 * value;
else
return value;
}
...and click "Compile, Test, and Save"; does it?
...do its tests succeed?
12. Look in directory:
/Users/smtuttle/480xp-tests/dir-test3
...are abs_val.h, abs_val.cpp, and abs_val.o there, along
with triple?
13. exit theGui.pyw via the Python menu;
14. run:
python3 theGUI.pyw
* Click "Change directory" and navigate to the following
directory:
/Users/smtuttle/480xp-tests/dir-test3
...and click "Choose".
15. Verify that triple and abs_val show up as available functions in
the right-hand area, and able to be checked
16. check both, enter the expression:
triple(-3) + abs_val(-5)
...and click Execute
17. See if you get the value -4
LAST TESTED: 12-12-11
LAST PASSED: 12-12-11
-------------------
acceptance test 4
-------------------
see what happens if user puts in a non-existent
directory name
...this is no longer possible, since "Change directory"
only lets you browse! You can't browse to a non-existent
directory, and that's the only way to change the directory --
so their design has now prevented this
from being an issue. 8-)
LAST TESTED: 12-12-11
LAST PASSED: 12-12-11