Agile Software Development# 07 What is Agile Design?

7.What is Agile Design?

📌What is "The Design"?

UML diagram "The Design"

Source code = "The Design"

The design of a software is abstract. You CAN'T list every details of the software. Therefore, the source code is "The Design". You can only understand fully and truly by reading source codes.

 

 

📌Design Smell - The Odors of Rotting Software🤮

You can smell the following odors when software rotting...

  • 1️⃣Rigidity - the system is hard to change since every change forces other changes as well
  • 2️⃣Fragility - changes cause the system to break in places
  • 3️⃣Immobility - it is hard to disentangle1 the system into components that can be reused in other systems
  • 4️⃣Viscosity2 - Doing things right is harder than doing things wrong
  • 5️⃣Needless Complexity - The design contains infrastructure that adds no direct benefits
  • 6️⃣Needless Repetition3 - the design contains repeating structures that could be unified under a single abstraction
  • 7️⃣Opacity - it is hard to read and understand. it does not express its intent well

 

📌What Stimulates the Software to Rot?

image-20220131005946416

The answer is "CHANGES"! Bit by bit, as the changes continue, these violations accumulate, and the design begins to smell.

 

📌We Can't Blame on Changes!

Why? Because the requirements are the most volatile elements in the project.

So? We should make our designs resilient to such changes and employ practices that protect them from rotting.

 

📌Story 1 - Regular Developers Encounter Changes

Customer Requirement Ver_1:

Write a program that copies characters from the keyboard.

Code Designed Ver_1:

The program can be divided into 3 modules:

  • 1️⃣ the ReadKeyboard module
  • 2️⃣ the Copy program which fetches char from ReadKeyboard and routes them to the WritePrinter module
  • 3️⃣ the WritePrinter module

 

image-20220131120317181

Customer Requirement Ver_2:

The program reads characters from the paper tape reader from time to time...

Code Designed Ver_2:

You use bool to encounter such changes.

 

Customer Requirement Ver_3:

The Copy program needs output to the paper tape punch.

Code Designed Ver_3:

You continue the last modification philosophy and make a bool for the output as well.

 

Summary

During this whole process, you complained again and again...😡 You almost want to leave the job...

 

 

📌Story 2 - Agile Developers Encounter Changes

The difference begins at the first incoming modification when the agile developers were asked to make the program read from the paper tape reader:

Code Design Ver_2:

The team has followed the Open–Closed Principle (OCP). This principle helps the program can be extended without modification. In the future, you can add more Reader.

From the Copy program perspective, you can use select different Reader

 

Why no similar implementation on the ouput?

The reason is simple. Because the change has not been encountered! You only modify your code once needed, otherwise the code would be Needless Complexity.

 

📌How Did the Agile Developers Know What to Do?

1️⃣They detected the problem by following agile practices

2️⃣They diagnosed the problem by applying design principles

3️⃣They solved the problem by applying the appropriate design pattern.

 

The interplay between these 3 aspects of software development is the act of design.

 

📌Conclusion

Agile design is a process, not an event.

 

 

 

 


1 disentangle: 解开,解耦, to separate something from the things that are twisted around it
2 viscosity: 粘性
3 It happens a lot in team programming. Ralph copied a block of codes which were copied by Lily which turns out to be created by Todd... and on and on... Therefore, the original idea of that code lost and hard to be maintained... Plus, if one got bugs and many places need to be fixed
Previous
Previous

Agile Software Development# 8.SRP: The Single-Responsibility Principle

Next
Next

C# 04 Study Notes Decision Statement