Move Functionality to Product
2 minute read
The Change
After your stick-figure test passes, extract the product code parts of it into your product library.
The Value Proposition
Code design is hard. One thing that makes it harder is that we always do code design at the same time as we are doing something else. With product-first development, developers have to think about design at the same time as they are writing the solution. They define the methods, classes, and argument lists as they create the product code. TDD only improves this slightly; developers think about design at the same time as they are writing the requirements. They define the classes and methods as they write the test, then fill in the solution later.
Stick-figure testing allows us to do design last. We think about problem and solution iteratively with no design at all. Only after we have fully elaborated the problem and built a solution that solves it do we define the methods, classes, and parameters we will need. The same refactoring that defines the design also makes the solution available as part of the product.
This gives the following benefits:
- Focuses your mind on product code with your working memory no longer distracted by design.
- Iterates easily on problem and solution since the code design doesn’t lock anything in.
- Creates a simpler design that only does what is needed for the solution you built.
- Creates a better design by starting with complete, working code.
- Reduces small errors because you never re-create working code, you just refactor it.
Please log in
This content is only available to students. Please log in to access it.