Ir para o conteúdo principal

← todas as notas

Four Rules of Simple Design

Kent Beck formulated four rules of simple design while developing Extreme Programming in the late 1990s. A design is simple, in priority order, when it:

  1. Passes the tests — the software works as intended. Testing is a first-class activity, not an afterthought.
  2. Reveals intention — the code is easy to understand. Readers can grasp the purpose behind each decision.
  3. No duplication — every piece of knowledge has a single, unambiguous representation.
  4. Fewest elements — minimize the number of classes, methods, and moving parts. Remove anything that doesn’t serve the first three rules.

The order matters: passing tests comes first, then clarity, then removing duplication, and finally minimizing structure. Each rule only applies after the ones above it are satisfied.