Kiddinglife C/C++/PYTHON ENGINEER

How to apply tdd

2017-03-02

Always think about implementation before you click keyboard.

The steps to use tdd is like this:

a. write down “real code” class and methods signatures based on the design

b. write down some comments about the initial implementations.

c. write down one unit test in the order of the implementation comments

d. write down one piece of implementation

e. do simply desktop review of the lines of codes when you think it finishes

f. test it until it gets green

g. refactor the codes and the unit tests

h. repeat steps c – g until finishing the whole function.


Comments