Previous Lecture Complete and continue  

  Add Fractions in Java Part 1

This part will take you approximately 30 minutes.

Now you can take a look at how I approach test-driving the feature of adding fractions. Since this problem doesn't have too many design elements, it feels a lot more like test-first programming than test-driven development. In this case, writing the tests first does more to help me avoid making implementation mistakes than design mistakes. Sometimes it goes like that. Even so, I have a few design decisions to make, and building the feature up gradually lets me make those decisions slowly and evaluate them as I go.

The original video refers to "study notes" that came from an earlier incarnation of this course. Those notes are lost, but I have tried to collect some useful references below.

References

Ward Cunningham, "The CHECKS Pattern". One of the first papers I read about the Whole Value pattern and related ideas. It provided me my first understandings of Primitive Obsession.

Corey Haines, "J. B. Rainsberger: Primitive Obsession". A blog post and short interview in which Corey and I discuss Primitive Obsession in some detail.

Corey Haines, "J. B. Rainsberger: Value Objects". A blog post and short interview in which Corey and I discuss Value Objects, as a way to address Primitive Obsession.

Martin Fowler, Refactoring: Improving the Design of Existing Code. The classic text on evolutionary design, which includes a thorough discussion of code smells, including Primitive Obsession, which the Whole Value pattern seeks to address.

Eric Evans, Domain-Driven Design: Tackling Complexity in the Heart of Software. The classic text that introduced me to the concepts of Value, Entity, and Service, as ways of classifying objects/modules in a system. Value corresponds to what people generally call "Value Objects".

If you're having trouble running your test in IntelliJ IDEA with a single click, this very short video shows you how I do that.