We implemented finding minimum value from a sequence of integers. Finding maximum and average is very straightforward and similar to what we have done in my previous post. So I will just put the code here directly to keep us from being bored.
Continue reading
I am going to demonstrate how to complete Stats Calculator with Test Driven Development.
Before we start, let me introduce you the three laws of TDD by Robert Martin.
- You can’t write any production code until you have first written a failing unit test.
- You can’t write more of a unit test than is sufficient to fail, and not compiling is failing.
- You can’t write more production code than is sufficient to pass the currently failing unit test.
Continue reading
The Pain of Automated Testing
I’ve been writing code for a living for over a decade. I have seen some projects with good code
(clear responsibilities, high cohesion, low coupling, easy to change, and pleasant to read) and many with bad code
(nobody wants to touch).
Continue reading