schedule

week date lecture practical class
1 2024-09-10 intro, software architecture, SDLC
2 2024-09-17 scrum, kanban
3 2024-09-24 requirement analysis, user story mapping project assignment
4 2024-10-01 UML, C4 project workshop
5 2024-10-08 design patterns project workshop
6 2024-10-15 interfaces, implementation planning project workshop
7 2024-10-22 wireframing, clean clode project workshop
8 2024-10-29 school holiday
9 2024-11-05 code quality, code review project workshop
10 2024-11-12 testing, legacy code project workshop
11 2024-11-19 CI, automatization, devops project workshop
12 2024-11-26 summary, course feedback project workshop
13 2024-12-03 midterm project demo
14 2024-12-10 no planned lecture

materials

tools

program vs. software

A computer program is a sequence or set of instructions in a programming language for a computer to execute. It is one component of software, which also includes documentation and other intangible components.

ISO/IEC 2382:2015 via Wikipedia (Wikipedia contributors, 2024a)

program is like a recipe

There is a metaphor saying that a program is like a recipe.

The computer follows the instructions of a program as the cook follows the instruction in a recipe.

Consequently programming is like creating a recipe.

for i in range(1, 101):
    if i % 15 == 0:
        print("" + "FizzBuzz")
    elif i % 3 == 0:
        print("" + "Fizz")
    elif i % 5 == 0:
        print("" + "Buzz")
    else:
        print(i)

It is easy to read this code snippet and figure out what it does, but constructing an algorithm might be more complicated.

It contains a loop going from 1 to 100 (ranges are not closed in Python, so 101 is excluded and the range step is 1 by default). If the loop variable is dividable by 15, “FizzBuzz” is printed to the screen. If it is only dividable by 3 “Fizz” is printed, if only by 5 “Buzz” is printed. In any other cases the number id printed.

Writing a computer program requires a nuanced understanding of the problem being solved by the computer program, pros and cons of various approaches, etc. It also requires the knowledge and expertise to describe those steps in a manner amenable to execution by a computer.

Jeff Rabinowitz

programming vs. software development

  • does that mean a program is not
    • planned
    • documented
    • tested
    • verified?
  • the main difference is the formality of the process
    • which correlates the complexity of the project

A program code is only a part of a software. Programming is more or less a synonym to coding.

As a software is more than just the code, software development is more than just coding/programming. The work is planned, documented, tested, verified, and framed by a process.

If programming is like creating a recipe, software development is more like running a restaurant. One should come up with recipes, cook the food, but the restaurant also needs constant ingredient logistics and preparation, food serving, marketing, cleaning etc.

software development is like building a house

  • the software development is often compared to house building
    • which is more like a sequential process
  • after the planning (including building permit, budget, etc.), the foundation is built first, then walls and the roof
    • these phases cannot be swapped
  • after the construction is finished, the contractor leaves the site
Wikimedia | public domain

maintenance?

software development not is like building a house

a software does not have to obey the laws of physics

  • in software development you can start with the door of the second floor bathroom
  • the size of a room can be changed during the construction – even several times

software development is like gardening

  • a garden needs to be taken care of constantly
  • without attention the garden will decay
  • maintenance is part of software development
  • software rots

based on Software Architecture Metaphors by Lisa Stähli (Stähli, 2021)

Another famous metaphor is the gardening. The most important aspect of the gardening is that a garden needs to be taken care of constantly. Without attention the garden will decay, which is also true for the software; the software can rot.

There are two types of software rot: dormant rot and active rot.

what is software rot?

Software rot (or software entropy) is the degradation, deterioration, or loss of the use or performance of software over time (Wikipedia contributors, 2024b).

dormant rot: the software in question is not changed, but as the environment evolves, it eventually becomes dysfunctional

Muni metro San Francisco photo by Albert CC BY-NC 2.0

Environment change can be either software or hardware. The operating system, a software framework or even a hardware can be outdated to

The photo shows the San Fransico Muni metro, which still uses floppy disks to load its Automatic Train Control System every morning. It is planned to replace by the end of the decade. The system works without any problems, but the risk of failure is getting higher. (Harding, 2024)

active rot

  • the software has undergone constant modifications but gradually loses its integrity
  • the constant updates / bug fixing can lead to an evolution process,
    • which makes the program deviate from its original design,
    • even introducing newer bugs
Randall Munroe | CC BY-NC 2.5

It is said that nothing is more permanent than a temporary fix. A quick fix often ignores the architectural design, not documented properly, thus contributes to the software rot.

A change in a production system should be properly planned in every possible details. For example, because it can have side effects, or can affect the architecture. Also, the documentation needs to be updated. Both documentations actually since there is a development documentation, that should contain information about the system for the developers and a user documentation (manual) for the operators of the system.

software development is like gardening - cont.

  • external factors like weather, pests, weeds can influence the garden
  • change in user requirements, and the external dependencies such as frameworks, libraries, etc. can affect the software

based on Software Architecture Metaphors by Lisa Stähli (Stähli, 2021)

Another similarity to gardening is that external factors can influence the software.

  • gardeners has a set of tools, selected for the characteristics of the garden and the gardener
  • a beautiful garden is a piece of art
    • which can also serve a function, like producing vegetables / fruits
  • software developer also uses tools chosen according to the environment and type of software
  • software is a piece of art, e.g., the UI has to be not just functional, but aesthetic and ergonomic
    • software code/design is also a piece of art; see software craftmanship (later)

based on Software Architecture Metaphors by Lisa Stähli (Stähli, 2021)

software craftmanship

As aspiring Software Craftsmen we are raising the bar of professional software development by practicing it and helping others learn the craft. Through this work we have come to value:

  • Not only working software, but also well-crafted software
  • Not only responding to change, but also steadily adding value
  • Not only individuals and interactions, but also a community of professionals
  • Not only customer collaboration, but also productive partnerships

That is, in pursuit of the items on the left we have found the items on the right to be indispensable.

© 2009, the undersigned. This statement may be freely copied in any form, but only in its entirety through this notice.

software growth

24 million lines of code – operational and support – needed for the F-35 to be fully operational

the more, the better?

if we wish to count lines of code, we should not regard them as “lines produced” but as “lines spent”

E. W. Dijkstra EWD 1036

Every line of code written comes at a price: maintenance. To avoid paying for a lot of code, we build reusable software. The problem with code re-use is that it gets in the way of changing your mind later on.

tef - Write code that is easy to delete, not easy to extend

Some people may consider the code as the product. In this regard, more lines of code means more product. If you write more code you work better, which is not true. You should work smarter, not harder.

As Dijkstra said, lines should considered an expense, which you want to minimize, not maximize. More code means more plants in your garden to take care of. It requires more resources, but at the same time it also increases complexity.

keep it simple

A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away.

Antoine de Saint-Exupéry

  • KISS, an acronym for “Keep it simple, stupid!”
    • a variations: keep it stupidly simple
    • the term was popular in the 70s

The design, the code should be kept as simple as possible. When you want to simplify a design, keep only those parts that are absolutely necessary to get the job done.

Linux 5.8 – 800,000 new lines of code

Linux Torvalds: despite not really having any single thing that stands out… 5.8 looks to be one of our biggest releases of all time

  • how is it manageable?
    • process
    • version control
  • each change must do only one thing
    • proper documentation
  • changes cannot break the software
    • rigorous and automated testing

version control

  • version control (a.k.a. revision control) is system for recording and managing changes made in files
  • commonly used to manage source code
    • however, it can be used to tracking changes to any kind of files
  • people often employ their own version control system, without realising it
Simon Mutch | CC BY-SA 3.0

based on Simon Mutch’s Version Control materials

why you should use version control (for everything)

In practice, everything that has been created manually should be put in version control, including programs, original field observations, and the source files for papers.

– Best Practices for Scientific Computing; Wilson et al. 2012 (arXiv:1210.0530)

this presentation is under version control as well

Many services have some kind of version control built in. For example Google Docs or Microsoft Word also provides some level of version control.

project complexity

what is software architecture?

“Architecture” is a term that lots of people try to define, with little agreement. There are two common elements: One is the highest-level breakdown of a system into its parts; the other, decisions that are hard to change.

– Martin Fowler - Patterns of Enterprise Application Architecture

In most successful software projects, the expert developers working on that project have a shared understanding of the system design. This shared understanding is called ‘architecture’. This understanding includes how the system is divided into components and how the components interact through interfaces. These components are usually composed of smaller components, but the architecture only includes the components and interfaces that are understood by all the developers.

Ralph Johnson, XP mailing list

All architecture is design but not all design is architecture. Architecture represents the significant design decisions that shape a system, where significant is measured by cost of change.

– Grady Booch

topologies

Layered Architechture

message bus

  • shared communication channel that connects multiple components or services
  • simple, extensible

server/client architecture

  • consists of two parts
    • client and server
  • distributed
  • always the client initiates a connection to the server
  • while the server process always waits for requests from any client

references

Harding, S. (2024). San francisco’s train system still uses floppy disks—and will for years. In Ars Technica. https://www.wired.com/story/san-francisco-muni-trains-floppy-disks .

Stähli, L. (2021). Software Architecture Metaphors — medium.com. https://medium.com/decoding-tech/software-architecture-metaphors-90992e9be5f4 .

Wikipedia contributors. (2024a). Computer program — Wikipedia, the free encyclopedia. https://en.wikipedia.org/w/index.php?title=Computer_program&oldid=1233276268 .

Wikipedia contributors. (2024b). Software rot — Wikipedia, the free encyclopedia. https://en.wikipedia.org/w/index.php?title=Software_rot&oldid=1236668404 .