-
Notifications
You must be signed in to change notification settings - Fork 0
Deliverable #5
###Team Silver Bullets
For this deliverable, our team injected five different faults into the code, one for each of the five methods we tested.
add(x,y)
Pre-faults


Changes :
#fault inserted: added abs method to return value
return abs(x + y)
sub(x,y)
Pre-faults


Changes :
#fault inserted: took away if statement so it would not convert values to decimals.
#if isinstance(x, _Decimal) or isinstance(y, _Decimal):
# x = _d(x)
# y = _d(y)
return x - y
mul(x,y)
Pre-faults


Changes :
if isinstance(x, _Decimal) or isinstance(y, _Decimal):
`x = _d(x)`
`y = _d(y)`
`#fault inserted: indented return statement.`
`return x * y`
div(x,y)
Pre-faults


Changes :
if x == 0 or x == 0.0:#fault insert changed y to x
mod(x,y)
Pre-faults


Changes:
#if is_int(y):
return x % y
#else:
`#raise ValueError(_('Can only calculate x modulo <integer>'))`