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