Skip to content

Deliverable 5

Zack edited this page Nov 19, 2015 · 10 revisions

Deliverable 5

For deliverable 5, team IsntThisFun designed and injected five faults into Beets’ source code, which we planned to cause at least five tests to fail, but not all, following the deliverable specifications. We decided to inject one fault into each of our five methods.

The test cases that we planned would fail were 1d, 2a-c, 2e, 3a-b, 3e, 4c-d,5a-c.


For the first fault, our team changed code within the method, human_bytes. Within this function, we changed the string which indicates the memory size unit from 'iB' to 'iBytes'.

This change affects all tests cases with a memory unit value above 1023. Therefore test case 1d fails, as shown below, because the expected value '1.9 GiB' is not equal to the new value of '1.9 GiBytes'.

Original Result

Result After Fault


For the second fault, our team changed code within the method, human_seconds. Within this function, we changed it to increment units of time incorrectly.

This change affects all tests cases with a number output value. Therefore test case 2a, 2b, 2c, and 2,e fail. Instead of outputting the next highest unit of time, it will only now designate it as seconds. This causes all test cases to fail that were previously passing.

Original Result

Result After Fault


For the third fault, our team changed code within the method, human_seconds_short. Within this function, we add a line which truncates the interval to create an hour field. We then added the hour field to the return value by adding it the the string formatting.

This change affects all tests cases which output a value in the M:SS format specified. Therefore test cases 3a, 3b, and 3e fail because the expected values in M:SS format are not equal to the new format of H:MM.SS.

Original Result

Result After Fault


For the fourth fault, our team changed code within the method, _bool_fallback. Within this function, we swapped the return values within the if and else test.

This change affects all tests cases which return a value instead of an error. Therefore test case 1d fails because the expected value '1.9 GiB' is not equal to the new value of '1.9 GiBytes'.

Original Result

Result After Fault


For the fifth fault, our team changed code within the method, string_dist_basic. Within this function, we added an illegal cast from float to int.

This change affects all tests cases that return a float, such as 5a, 5b, and 5c. Entering ints or nulls will still result in a pass.

Original Result

Result After Fault

Clone this wiki locally