Chapter 2. Writing Modifiable and Readable Code

In the first chapter, we discussed the various aspects of software architecture and covered some definitions of the terms involved. We looked at the different aspects of software architecture that an architect should be concerned with. Toward the end of the chapter, we discussed the various architectural quality attributes that an architect should focus on when building a system. We went in some detail into each of these attributes and looked at some definitions and various concerns that should be kept in mind when architecting a system for achieving these attributes.

From this chapter onward, we will focus on each of these quality attributes one by one, and discuss them in detail, per chapter. We will delve deep into an attribute—such as its various factors, techniques to achieve it, aspects to keep in mind when programming toward it, and so on. Since our focus in this book is on Python and its ecosystem, we will also look at various code examples and third-party software support that Python provides for achieving and maintaining these quality attributes.

The focus of this chapter is on the quality attribute of modifiability.

This chapter will cover the following topics:

  • What is modifiability?
  • Aspects related to modifiability
  • Understanding readability
  • Fundamentals of modifiability—cohesion and coupling
  • Exploring strategies for modifiability
  • Metrics—tools for static analysis
  • Refactoring code

What is modifiability?

The architectural quality attribute of modifiability can be defined as follows:

Modifiability is the degree of ease with which changes can be made to a system, and the flexibility with which the system adapts to such changes.

We discussed various aspects of modifiability in the first chapter, such as cohesion, coupling, and others. We will dig a little bit deeper into these aspects in this chapter with some examples. However, before we dig deeper, it might be a good idea to take a look at the big picture of how modifiability fits in with the other quality attributes that are related to it.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.82.21