t9Lovelace

advertisement
Revised PROBE Estimate
Note: signatures of modules are indicated by bullet on the left of its name and underlining
Revised Module Driver (415 LOC)
get-input-file-as-str - I/O: S (10)
input – text file
output – string of characters from text file
get-specification-as-str - I/O: M (20)
input - string from input text file
output - first line of input text file
get-team-size - I/O: M (20)
input - string of specifications, input text
file string
output - list of numbers corresponding to
team sizes (5 5 5 4 4)
get-list-of-weights - I/O: L (35)
input - string of specifications
output - list of numbers corresponding to
weights (1 2 3 (5 6))
get-list-of-students-as-strs - I/O: L (35)
input - input text file as string
output - list of strings corresponding to
each student
get-students-as-data - calc: VL (45)
input - list of strings corresponding to each
student
output - list of ints/strings that represent a
student and his/her schedule
(1 "Matt" "A" "M" (1 0 0 1 0 0 1) (1 0 1) (0 0 1) )
get-student-as-data - I/O : VL (50)
input - a single string representing one
student
output - a list of ints/stings that represent a
student
get-initial-seed - I/O: VL (50)
input - text file of large primes
output - pseudo-random number
write-specifications - I/O: M (20)
input – best avl tree
output – specifications of avl tree
write-group - I/O: L (35)
input – best avl tree
output – all the elements of a group
write-member - I/O: M (20)
input – group
output – member of that group
team-creator - I/O: L (35)
input - input text file, output text file
output - output text file with teams in it
check-expect – Input ((“”)) Output(())
property – Length of input should equal list of
output
Length caddddr (The ints
representing schedule) should be equal to 48
(30-min chunks of the day)
Revised Module AVL Tree (493 LOC)
check-to-stop-switching - calc: L (30)
input - member lists of two teams
output - t or false
switch-member-between-teams - calc: VL (45)
input - avltree, current score, team number
worst, team number not worst
output - new improved avl tree.
check-expect - Input (avltree, 0, 0, nil) Output - avl
check-expect - Input (avl, !0, !0, !nil) Output - avl
property - team always has different
- team selected always higher score
compare-scores-between-team-sets - calc: L (30)
input - avl tree of teams
output - better avl tree of teams
check-expect - Input (avltree) Output - better
(avltree)
Modified AVL Tree
from Teachpacks
NA
358 LOC
form-initial-tree - calc L (30)
input - list of students, list of
specificiations, seed
output - avl tree with finished groups
property - always return a better avl tree with
higher scores
check-expect - Input (nil nil 0) Output - empty avl
Input ((students) (spec) (seed))
Output - full AVL tree
property - always build complete avl tree
- always different avl with new seed
Revised Module Formulas (390 LOC)
get-total-weight - calc: M (15)
input - list of weights
output - sum of the weights
get-grade-weight - calc: M (15)
input - list of weights
output - number corresponding to grade
weight
get-weights-of-skill-sets - calc: L (30)
input - list of weights
output - list of skill weights
check-expect - Input - () Output - 0
check-expect - Input - (!empty) Output - Sum
property - always return correct sum of weights
check-expect - Input - () Output - 0
check-expect - Input - (!empty) Output - grade
weight
property – Should be positive
check-expect - Input - () Output - 0
check-expect - Input - (!empty) Output - list
weights
property – Length should equal 4 (grade,
schedule, gender, skills)
get-schedule-weight - calc: M (15)
input - list of weights
output - number corresponding to schedule
weight
get-gender-weight - calc : M (15)
input - list of weights
output - number corresponding to gender
weight
calculate-team-schedule g- calc: VL (45)
input - avl of one team, schedule weight
output - cons of team number with
schedule score
check-expect - Input - () Output - 0
check-expect - Input - (!empty) Output - schedule
weight
property – Should be positive
check-expect - Input - () Output - 0
check-expect - Input - (!empty) Output - gender
weight
property – Should be positive
check-expect - Input - () Output - 0
check-expect - Input - (!empty, !0) Output -list
property - always return appropriate team
number with the right schedule score
calculate-team-grades - calc: VL (45)
input - avl of one team, grade weight
output - cons of team number with score
check-expect - Input - () Output - 0
check-expect - Input - (!empty, !0) Output - list
calculate-team-gender - calc: VL (45)
input - avl of one team, gender weight
output - cons of team number with gender
score
calculate-team-skillset - calc: VL (45)
input - avl of one team, skillset weight
output - cons of team number with skillset
score
calculate-team-skillsets - calc: VL (45)
input - avl of one team, skillsets weight
output - cons of team number with skillsets
score
find-worst-team-and-score - calc: VL (45)
input - avl tree with current groups, list of
weights
output - cons of worst team number and
that team's score
calculate-team-score - calc: L (30)
input - avl tree, team number, list of
weights
output - cons team number and that team's
score
check-expect - Input - () Output - 0
check-expect - Input - (!empty, !0) Output - list
property - always return appropriate team
number with the right grade score.
property - always return appropriate team
number with the right gender score.
check-expect - Input - () Output - 0
check-expect - Input - (!empty, !0) Output - list
property - always return appropriate team
number with the right skillset score
check-expect - Input - () Output - 0
check-expect - Input - (!empty, !0) Output - list
property - returns skillset scores, where scores
are never
check-expect - Input - (empty-tree, 0, ()) Output (0,0)
property - always returns the lowest scoring
team
check-expect - Input - (empty-tree, 0, ()) Output (0 0)
property - output should calculate correct
values,
Module RNG (75 LOC)
get-random-number - calc: VL (45)
input - seed
output - random number
get-random-number-mod-max - calc: L (30)
input - seed, maximum
output - number less than maximum
check-expect – Input (0) Output (12345)
Input (-1) Output (3191464396)
property – Shouldn’t return repeated values
Shouldn’t return negative values
check-expect – Input(0, 1) Output(0)
Input(0, 2) Output(1)
Property – Output should be less than
maximum
Output should not be negative
Download