equal
deleted
inserted
replaced
|
1 ====================================== |
|
2 Lab Workbook - Test Driven Development |
|
3 ====================================== |
|
4 |
|
5 The notation that follows every question denotes the level on the |
|
6 Revised Bloom's Taxonomy. |
|
7 |
|
8 Lab - 1 |
|
9 ======= |
|
10 |
|
11 1. Write a stub function for calculating the LCM of two numbers. |
|
12 2. Write the tests for the LCM function, place the tests in if |
|
13 __name__ == '__main__': part of the Python file. Demonstrate that |
|
14 the tests fail. |
|
15 3. Implement the code for the LCM function, using the gcd function |
|
16 provided in the examples in the chapter. Demonstrate the tests |
|
17 pass. (For the algorithm refer to Wikipedia - [0]) |
|
18 4. Alternatively, build a set of test cases, preferably a large |
|
19 number of cases, place it in a text file and use these test cases |
|
20 to test your LCM function. Demonstrate that tests still continue |
|
21 to pass. |
|
22 |
|
23 [0] - http://en.wikipedia.org/wiki/Least_common_multiple#Reduction_by_the_greatest_common_divisor |
|
24 |
|
25 Lab - 2 |
|
26 ======= |
|
27 |
|
28 1. |
|
29 |
|
30 |
|
31 Lab -3 |
|
32 ====== |
|
33 |
|
34 1. |