class: center, middle
Helge Pfeiffer, Associate Professor,
Research Center for Government IT,
IT University of Copenhagen, Denmark
ropf@itu.dk
class: center, middle
- Teachers: Helge, Mircea
- TAs: David, Patrick, and Rasmus
--
- Via Teams
<iframe src="./map.html" width="50%" height=350 scrolling="auto"></iframe>
- Dipl-Inf. in Software Engineering from Friedrich-Schiller Universität Jena
- PhD in Software Engineering from ITU
- Software engineer at DMI
- Lecturer at Cphbusiness
- Since January 2019 back to ITU in the Center for Government IT
Currently: Associate Professor at ITU
Before:
- U. Lugano (CH)
- IBM TJ Watson (US)
- U. Bern (CH)
- U. Groningen (NL)
Research Interests:
- Software Evolution
- Tools for Software Maintenance
- HCI & Tools for Personalized Learning
<iframe width="800" height="500" src="menti_results.pdf" frameborder="0" allowfullscreen ></iframe>
- Having fun with our work.
- Hopefully, presenting relevant aspects of software engineering that are representative for your future professional tasks.
--
M2. Maintenance typically consumes about 40 to 80 percent (60 percent average) of software costs. Therefore, it is probably the most important life cycle phase.
...
M5. Most software development tasks and software maintenance tasks are the same—except for the additional maintenance task of "understanding the existing product." This task is the dominant maintenance activity, consuming roughly 30 percent of maintenance time. So, you could claim that maintenance is more difficult than development.
Robert L. Glass "Frequently Forgotten Fundamental Facts about Software Engineering"
- That we learn from your experiences and knowledge. (We are not smarter than you are when it comes to the topics of this course, we only have a good idea on what we shall do together)
- That you support each other when working in groups. The entire course and your projects are a team endeavor.
- That you work continuously (as we do) on this course.
- That you work for the about 10-12 hours per week on this course that you should have allocated for it according to ECTS.
- That you work collaboratively in public repositories on GitHub.
- That you read carefully our or other's documentation.
--
Note, be prepared for quite a bit of work and many moments of despair :(
This is unfortunately how learning works. At the moment it hurts but once you know how to solve your problems, solutions appear to be easy and straight forward.
- Focus on your learning.
--
Mircea and I grade your exams according to the meaning of the grades, i.e., good means good!- This year: The exam is a pass/fail exam, i.e., no grades
- We hope that that does not diminish your activity in this course
- Schedule: https://github.com/itu-devops/lecture_notes#schedule
- Course repository: https://github.com/itu-devops/lecture_notes
No book as such. We will link you to relevant material. In a few weeks, we will read parts of "The DevOps Handbook" on which this course is loosely based.
Find on LearnIT (BSc/MSc) the:
- official course description,
- intended learning outcomes, and
- exam description
Check the GitHub student developers pack, https://education.github.com/pack.
You can get credits for some of the platforms we are going to use throughout this course.
For every week do from left to right what is specified in the course's schedule.
That is, prepare for the next session with the given material, join the respective session, and afterwards work on the project (see next slide).
You will run through this course in groups. All project groups have preferably five members (BSc./MSc. students respectively). These groups realize the projects together.
The project work forms the basis of this course. That is, you cannot expect to come to lectures listen and read a bit and then pass the exam. This is a hands-on course and you will have to perform "DevOps, software evolution and software maintenance activities [...] directly on [your] systems" (Course Description on LearnIT)
- Experience shows, that lectures are watched to a way lower degree than people believe.
- Video recordings of lectures are likely not beneficial, see Edwards et al. "A study exploring the impact of lecture capture availability and lecture capture usage on student attendance and attainment"
- Come to the lecture and exercise sessions.
- Take notes!
- Either with pen and paper (best for your brain and retention, see e.g., Mueller et al. "The Pen Is Mightier Than the Keyboard: Advantages of Longhand Over Laptop Note Taking ") or some other technology.
- Share your notes with each other.
- If you want to, we can establish a note sharing channel, either on Teams, in a Git repository, physically, etc.
--
According to Stack Overflow's 2023 Developer Survey survey, more than 50% of the respondents use a *nix OS professionally.
--
Depending on the statistics, up to 98.3% of servers on the internet run some kind of Linux or Unix. Source: https://en.wikipedia.org/wiki/Usage_share_of_operating_systems#Public_servers_on_the_Internet
Source: https://en.wikipedia.org/wiki/Usage_share_of_operating_systems#Supercomputers
Since this is a hands-on course, we provide a lot of code and examples using various technologies.
Unfortunately, we do not have resources to do that consistently over various versions of Windows, Linux, and MacOS.
- Each group should have five members.
- We will form them today!
- In this spreadsheet
Find and establish a communication channel for you and your group members and support them in downloading the code from the remote server (see slides below).
SCP the program flag_tool
from the remote server, run it on your computer. What happens? Describe to your group mates after the session what you did and why running the program on your computer either works or does not work.
DO NOT disturb other people by doing smart stuff on the server!
class: center, middle
This is fiction, but it is the story for this course :)
More than ten years ago in 2012 some unknown young developers at ITU decided to build a small micro-blogging platform ITU-MiniTwit to take over the market from Twitter, which was only six years old at that point.
They programed in a mix of hot technologies of the time directly on a server with Ubuntu 12.04 (released 26 Apr. 2012, EOL 28 April 2017.).
--
Now some years later, we decide to resurrect their work and we will continue development from where they left.
class: center, middle
During the time of this lecture it is running on the machine with the IP 104.248.24.1
.
- Point your browser to: http://104.248.24.1:5000/public.
- You should see an application like this:
- Play around with the system
- Sign-up
- Thereafter, create some tweets
The developers back in 2012 did not have a repository on GitHub with all the artifacts of their application. GitHub was first launched in 2008 and our developers did not hear about it yet...
So you have to do what really many people still do today. You copy the files over from the remote machine.
- How do you do this?
$ scp -r student@104.248.24.1:/home/student/itu-minitwit ~/Desktop/
To secure copy from the remote machine, you need the password uiuiui
.
$ cd ~/Desktop/itu-minitwit
$ ls -la
total 68
drwxr-xr-x 4 ropf ropf 4096 Jan 31 12:42 .
drwxr-xr-x 3 ropf ropf 4096 Jan 31 12:42 ..
-rwxr-xr-x 1 ropf ropf 590 Jan 31 12:42 control.sh
-rwxr-xr-x 1 ropf ropf 13032 Jan 31 12:42 flag_tool
-rw-r--r-- 1 ropf ropf 1895 Jan 31 12:42 flag_tool.c
-rw-r--r-- 1 ropf ropf 129 Jan 31 12:42 Makefile
-rwxr-xr-x 1 ropf ropf 8575 Jan 31 12:42 minitwit.py
-rwxr-xr-x 1 ropf ropf 5078 Jan 31 12:42 minitwit_tests.py
-rw-r--r-- 1 ropf ropf 466 Jan 31 12:42 schema.sql
drwxr-xr-x 2 ropf ropf 4096 Jan 31 12:42 static
drwxr-xr-x 2 ropf ropf 4096 Jan 31 12:42 templates
You can check that with the file
command:
$ file minitwit.py
minitwit.py: Python script text executable, ASCII text
$ file flag_tool
flag_tool: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.24, BuildID[sha1]=ac3ffde74553ce2d7d0551bfa4bd684f14978e43, not stripped
$ file control.sh
control.sh: ASCII text
Use the less
command to inspect the files minitwit.py
, flag_tool
, and control.sh
.
- What do you see?
$ python minitwit.py
$ python minitwit.py
File "/home/ropf/Desktop/itu-minitwit/minitwit.py", line 97
print "We got a visitor from: " + str(request.remote_addr)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
$ ./flag_tool -h
--
Depending on your host operating system it may either run (you are on a corresponding Linux):
ITU-Minitwit Tweet Flagging Tool
Usage:
flag_tool <tweet_id>...
flag_tool -i
flag_tool -h
Options:
-h Show this screen.
-i Dump all tweets and authors to STDOUT.
--
or it may look like in the following (in case you are on a MacOS):
$ ./flag_tool -h
-bash: ./flag_tool: cannot execute binary file
- What does that mean?
- Where does the error come from?
$ ./flag_tool 42
SQL error: no such table: message
- What does that mean?
Note, in the listings $
denotes the prompt on your local machine, which might look different in your case.
student@webserver:~$
is the prompt on the server machine.
To SSH to the remote machine, you need the password uiuiui
.
$ ssh student@104.248.24.1
student@webserver:~$ cd itu-minitwit/
student@webserver:~/itu-minitwit$ ls
Makefile control.sh flag_tool flag_tool.c minitwit.py minitwit_tests.py schema.sql static templates
student@webserver:~$ ./control.sh inspectdb
- What do you see?
- How can you navigate through the database?
- How can you search for a string?
- How do you find its next/previous occurrence?
Look into the control script. For example with the less
command:
student@webserver:~$ less -N ./control.sh
- What do lines 15 and 16 do?
- What is the meaning of
|
on line 16? - What are
-N
and./control.sh
in the above command? - What is the meaning of
./
in it?
if [ $1 = "init" ]; then
if [ -f "/tmp/minitwit.db" ]; then
echo "Database already exists."
exit 1
fi
echo "Putting a database to /tmp/minitwit.db..."
python -c"from minitwit import init_db;init_db()"
- What is the
[ $1 = "init" ]
in the above code? - What does
type test
tell you? - What does
man [
tell you?
https://www.linuxjournal.com/content/understanding-bash-elements-programming
student@webserver:~$ ./flag_tool
It will not do anything. So try to read its help text
student@webserver:~$ ./flag_tool -h
Afterwards run:
student@webserver:~$ ./flag_tool -i
What happens?
You may want to use the grep
command:
student@webserver:~$ ./flag_tool -i | grep "idiot"
student@webserver:~$ ./flag_tool -i | grep "dumb"
- What does again the
|
do? - What does
grep
do? - What are
"idiot"
and"dumb"
in the above command?
student@webserver:~$ ./flag_tool <tweet_id>
- How does that flagging functionality look like in the control script
control.sh
?
In case you are in doubt, usually a command's manual is quite conclusive:
student@webserver:~$ man grep
Since the knowledge of the previous developers is likely lost, you could inspect the list of all running processes and grep
for the name of the command:
student@webserver:~/itu-minitwit$ ps aux | grep minitwit
student 6081 0.0 4.2 55448 21364 ? S 10:40 0:00 /usr/bin/python minitwit.py
student 6083 0.3 4.9 131776 24556 ? Sl 10:40 0:03 /usr/bin/python minitwit.py
student 6199 0.0 0.1 12912 936 pts/0 S+ 10:54 0:00 grep --color=auto minitwit
Whenever you run ./control.sh stop
all processes with corresponding names are pkill
ed and thereby the application is shutdown.
- Which files/artifacts are missing in what you have?
And just to also collect all of your tweets, let's copy the most current database:
$ scp student@104.248.24.1:/tmp/minitwit.db ~/Desktop/itu-minitwit
--
Now, you have everything that you need for your task until next week.
- Do the project work until the end of the week
- And prepare for the next session