Emergence¶
Getting Clean via Emergent Design
According to Kent, a design is “simple” if it follows these rules:
The rules are given in order of importance.
Simple Design Rule 1: Runs All the Tests¶
Simple Design Rules 2–4: Refactoring¶
The fact that we have these tests eliminates the fear that cleaning up the code will break it!
During the refactoring ,We can increase cohesion, decrease coupling, separate concerns, modularize system concerns, shrink our functions and classes, choose better names, and so on.
the final three rules of simple design: Eliminate duplication, ensure expressiveness, and minimize the number of classes and methods.