This document discusses software complexity and managing complex systems. It begins by defining different types of complexity, such as adaptive systems with unpredictable behavior, socio-technical systems involving human relationships, and epistemic complexity from not fully understanding complicated systems. The document then discusses challenges like the flash crash example and ways to potentially reduce complexity, such as better understanding relationships between system components. It concludes by noting graduates may not encounter these issues but should be aware of them for their future industry work.
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Software complexity
1. University of St Andrews
School of Computer Science
Software Complexity
CS5031 - Advanced Software Engineering 2010/11
James Smith
jws7@cs.st-andrews.ac.uk
1
2. University of St Andrews
School of Computer Science
Why complexity?
• Software Engineers
• build systems
• Sometimes there are problems...
• And graduates are not sensitised
to the issues...
2
3. University of St Andrews
School of Computer Science
Greenfield development
3
4. University of St Andrews
School of Computer Science
Real world: Brownfield
4
5. University of St Andrews
School of Computer Science
Enterprise is changing
• Dr Alan Brown (IBM)
– “IBM spent most of their time trying to understand legacy
systems”
– Coding is outsourced
• Separated. How do you integrate?
– We have 20k contractors but we think we’re getting 3k people’s
work.
5
6. University of St Andrews
School of Computer Science
Thoughts on failure
• The world economy is losing over six trillion USD per year
to IT failures and the problem is getting worse.
• Software Engineers need to learn to fail
- the solution?
6
9. University of St Andrews
School of Computer Science
LSCITS
• Large Scale Complex IT systems
• I am part of this group
• Led by Prof Dave Cliff (Bristol), Prof Ian Sommerville (St.
Andrews) and others
• £5m Research proposal
• Emerged after Department of Trade and Industry report
“Complexity and Emergent Behaviour in ICT Systems”
9
10. University of St Andrews
School of Computer Science
ITS
• Information Technology Systems
• Or ICT?
• Communications technology is heavily
• So much of our lives is dominated by ICT. We are in fact
living in Information Systems.
• ITS in LSCITS covers all of this.
10
11. University of St Andrews
School of Computer Science
Complex
• Complex Adaptive Systems
• Dominated by emergent behaviour
• Conventionally engineered systems can also be complex
• functional and non functional behaviour cannot be
predicted
• likely when we create systems integrating different parts
(of other systems) which are independently developed and
managed
• impossible to predict how the characteristics of one
system will interfere with the characteristics of others
11
12. University of St Andrews
School of Computer Science
Large Scale
• Not dependent on physical size of spatial dispersion
• Rather the number of components or interactions
• Birthday Paradox
12
14. University of St Andrews
School of Computer Science
Complex & Complicated
• are not the same...
14
15. University of St Andrews
School of Computer Science
Complicated
• Difficult for a human to understand
• A system which can be understood in theory, but in
practice rarely is
• May be due to simply the sheer number of components or
interactions.
• Is this true? - Maybe that there is no difference between a
complicated system and a complex one.
15
16. University of St Andrews
School of Computer Science
Inherently Complex Systems
• Cannot deduce behaviour from examination of their
components
• Cannot predict the consequences of changes to these
systems
• Behaviour and properties are non-deterministic
16
17. University of St Andrews
School of Computer Science
Inherently Complex Systems (2)
Inherent complexity stems from dynamic, dependent
relationships between parts of the system
- relationships evolve in time and according to stimuli
from the system environment
- new relationships may be created & existing
relationships may change
- deterministic modelling techniques cannot be used to
make predictions about such systems
17
18. University of St Andrews
School of Computer Science
Adaptive Systems
• Inherent complexity in situations where we have adaptive
systems
– dynamic dependencies
– we cannot have enough knowledge about the system to make
accurate predications of its behaviour
– at best we can be probabilistic
18
19. University of St Andrews
School of Computer Science
Automated Agents
• If we have automated agents
– i.e. automated traders
• thousands of operations per seconds
• linked through unit prices
• cannot predict behaviour
• other factors effect prices
• we have no idea how the agents will interact
19
20. University of St Andrews
School of Computer Science
The Flash Crash
20
21. University of St Andrews
School of Computer Science
What happened?
• On the 6th of May 2010 at 2.45pm the Dow Jones Market
plundged over 900 points...
• Traders were selling the shirt of their backs to cut their
losses...
• Chaos reigned
21
22. University of St Andrews
School of Computer Science
What happened? (2)
• Within minutes... it recovered
– It was the second largest point swing (1,010.14 points) and the
biggest one day decline (998.5) in Dow Jones history
• In 5 minutes billions of dollars were wiped of the face of
the earth and then found again...
• Why?
22
23. University of St Andrews
School of Computer Science
Why?
• A trader initiated a sell program to sell 75,000 contracts...
– an unusually large number at a volatile time in the market
• High Frequency Traders (HTF) also started aggressively
selling...
• No buyers... so they kept selling to each other...
• “Hot-potato” effect.
– Between 2:45:13 and 2:45:27 HTFs traded 27,000 contracts
49% of the trading traffic
23
24. University of St Andrews
School of Computer Science
Solution?
• “The rout continued until an automatic stabilizer on the
futures exchange cut in and paused trading for five
seconds, after which the markets recovered."
24
25. University of St Andrews
School of Computer Science
Lessons
• When you have a large number of dynamic, dependent
relationships
– You can’t predict what’s going to happen
– Incredibly hard to engineer dependable systems of this type
• This is the challenge facing Software Engineers in today’s
world.
25
26. University of St Andrews
School of Computer Science
An analogy
• Complexity is analogous to heat and simplicity is
analogous to cold
– There is no such thing as cold, just absence of heat.
– That is why we have absolute zero - no heat left
– But no absolute heat - things can always get hotter
26
27. University of St Andrews
School of Computer Science
Simplicity
• So we can never add simplicity, only remove complexity
• required functionality places a lower limit on the
complexity required.
• Walking is simpler than a rocket ship… but doesn't solve
the same problem
27
28. University of St Andrews
School of Computer Science
Removing complexity
• So the idea is to remove unnecessary complexity
• Some complexity that is required does not excuse the
surfeit of complexity currently in IT systems.
– but does this imply the ability to measure complexity?
– how do we prove that we have removed complexity?
28
29. University of St Andrews
School of Computer Science
Adding people...
• If you consider people to be part of the system
– then you have dynamic, dependent relationships between
components
• so are all large, socio-technical systems complex
systems?
• We would argue that they are...
29
30. University of St Andrews
School of Computer Science
Epistemic Complexity
• (Epistemic: of or relating to knowledge and its validation)
• relates to the predictability of system properties when
changes are proposed
• if you don't have enough knowledge of the system and its
components - you cannot make predictions about it
• even if the system does NOT have dynamic, dependent
relationships between components
• therefore large complicated systems are also complex
systems when it is practically impossible to aquire the
necessary knowledge
30
31. University of St Andrews
School of Computer Science
System observer
• Complexity is not only a property of a system but also of
the system observer.
• If an expert has a knowledge of a system and can reliably
make changes
• but cannot articulate his knowledge
• then if he leaves, his replacement may never be able to
accrue the same level of understanding
• therfore a complicated system becomes a complex one
31
32. University of St Andrews
School of Computer Science
Recap: Types of Complexity
• Adaptive Systems
– systems of systems where behaviour cannot be predicted
• Socio-technical systems
– people form dynamic, dependent relationships
• Complicated systems
– Epistemic complexity
– Observer knowledge
32
33. University of St Andrews
School of Computer Science
Combat plan
• So how do we combat these?
• Really an open ended method
• For example, formal methods really don't help with
dynamic dependancies
• Epistemic complexity may allow us to state 'truths' about
the system.
– filling in our knowledge
33
34. University of St Andrews
School of Computer Science
Understand relationships
• Better understanding of dynamic, dependent relationships
may also be useful in helping manage complexity
• This means that Socio-technical analysis is required
– Organisational analysis
– Stakeholders
• May be able to change these relationships from dynamic
to static
– and therefore reduce complexity
34
35. University of St Andrews
School of Computer Science
but really...
• Graduates in Software Engineering will rarely face these
problems during their studies
• So be aware, be sensitised to the issues
• You WILL come across them in industry
• Be ready for your Kobayashi Maru...
35
36. University of St Andrews
School of Computer Science
but really...
• Graduates in Software Engineering will rarely face these
problems during their studies
• So be aware, be sensitised to the issues
• You WILL come across them in industry
• Be ready for your Kobayashi Maru...
but don’t cheat!
36
37. University of St Andrews
School of Computer Science
over to you...
37
38. University of St Andrews
School of Computer Science
Credits
• Slides by me - email jws7@cs.st-andrews.ac.uk for a
copy.s
• Images from Google Image Search.
• To learn more on LSCITS visit http://www.lscits.org
• Recommended reading:
– Clay Shirky: Here Comes Everybody
38