On the Dilemma of Software Complexity

Core Challenge of Software Architecture Is the Growing Complexity

Image source: https://divante.com/blog/10-companies-that-implemented-the-microservice-architecture-and-paved-the-way-for-others/
Source: http://themetapicture.com/the-life-of-a-software-engineer/

Why Does Software Complexity Grow Rapidly?

1. Software Is Not Built, It Grows

2. The Core Challenge of Large Software Is Understanding and Maintenance Costs in Its Growth Process

Two Dimensions of Software Complexity: Cognitive Load and Collaboration Costs

Factors Affecting Cognitive Load

1. Cognitive Costs Caused by Improper Logic

response = server.Call(request)if response.GetStatus() == RPC.OK:
if response.GetAuthorizedUser():
if response.GetEnc() == 'utf-8':
if response.GetRows():
vals = [ParseRow(r) for r in
response.GetRows()]
avg = sum(vals) / len(vals)
return avg, vals
else:
raise EmptyError()
else:
raise AuthError('unauthorized')
else:
raise ValueError('wrong encoding')
else:
raise RpcError(response.GetStatus())
response = server.Call(request)if response.GetStatus() != RPC.OK:
raise RpcError(response.GetStatus())
if not response.GetAuthorizedUser():
raise ValueError('wrong encoding')
if response.GetEnc() != 'utf-8':
raise AuthError('unauthorized')
if not response.GetRows():
raise EmptyError()
vals = [ParseRow(r) for r in
response.GetRows()]
avg = sum(vals) / len(vals)
return avg, vals

2. Model Mismatch Brings High Cognitive Load

3. Improper API Design

class BufferBadDesign {  explicit Buffer(int size);// Create a buffer with given sized slots
void AddSlots(int num);// Expand the slots by `num`
// Add a value to the end of stack, and the caller need to
// ensure that there is at least one empty slot in the stack before
// calling insert
void Insert(int value);
int getNumberOfEmptySlots(); // return the number of empty slots
}
class Buffer {  
explicit Buffer(int size); // Create a buffer with given sized slots
// Add a value to the end of buffer. New slots are added
// if necessary.
void Insert(int value);
}

4. A Simple Modification to Be Updated in Multiple Places

5. Naming

6. Not Knowing What Modifications Need to be Made to a Simple Feature or Impacts of a Simple Change

7. Low Cognitive Costs Mean No Mistakes Rather Than Blind Simplification

// Time period in seconds.
void someFunction(int timePeriod);
// time period using Duration.
void someFunction(Duration timePeriod);

Factors Affecting Collaboration Costs

1. System Module Splitting and Team Boundaries

2. Dependencies between Services — Composition vs Inheritance/Plugin

3. Collaboration Costs Caused by Insufficient Testability

4. Documentation

Software Complexity Lifecycle

Good Enough vs. Perfect

Countermeasures for Growing Complexity

Reference

Original Source:

--

--

--

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Let’s talk about Python

Dynamically Generating DB Credentials via Vault

ATTRIBUTE STORE CONFIGURATION — WSO2 IDENTITY SERVER

Pipenv and Poetry: Benchmarks & Ergonomics II

Google Play IAP verification using Cloud Functions

A Small Victory — Acceleration of BITFIELD Commands for ApsaraDB for Redis

Advance Deep Learning with Alibaba Open-Source and Pluggable Scheduling Tool for GPU Sharing

Project Week or “Hell”

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

More from Medium

Dependencies: Here Be Monsters

Carta Marina by Olaus Magnus, 1539

Introduction to Monolithic Architecture and MicroServices ArchitectureMonolithic Architecture

Breaking Down the Cloud-native and Microservice Architecture

Software Systems at Mizu