Striving for Quality: The AttributesReading Only
Software engineers strive to build quality software. Many attributes may help determine quality, and at times, they can even conflict with each other. It's up to us engineers to balance their tradeoffs. Two of the most vital quality indicators are reliability and modularity.
Reliability
The software should work without breaking.
Simple enough, but let's break that down:
The software should work...
, we're talking about the correctness of our system. Does the software meet the requirements? This attribute helps us understand whether or not the software is consistent with the requirements. If this attribute is missing, nothing else matters.
... without breaking
, we're talking about robustness. Software should handle abnormal conditions not explicitly mentioned in the requirements. It's the scenario we didn't plan for during the design. Think about large data loads, handling blank field values, etc. It's the software's ability to handle unexpected situations with grace.
We can verify the correctness and robustness of our software by writing and executing tests. To really take advantage of OO, we can be more proactive and design by contract. We'll talk about this soon.
Modularity
Modularity separates a small collection of related data & behavior from the rest of the system. Unlike reliability, it's not visible to the end user; it impacts developers. Modularity refers to how extensible and reusable our code is and how easy it is to change.
Modularity will be huge when we need to add new features, accommodate changing requirements, or adapt our software to different use cases without extensively modifying the existing codebase. We'll see how interfaces and abstract classes can help by limiting direct & indirect coupling between classes and hiding implementation details.
The Four Principles of OOP
The OOP paradigm is a way to help us improve the modularity and reliability of our system. We can use the four core OOP principles: abstraction, encapsulation, inheritance, and polymorphism to get there.