Software Mange Ment Notes
Software Mange Ment Notes
Software Mange Ment Notes
[p35 - p58]
Quick intro
Use case
A use case describes functionality expected from the system under
development, it provides tangible benefit for one or more actors that
communicate with the use case. They are created using customer wishes,
the set of all use cases describes the functionality that a system shall
provide.
Actors
Actors interact with the system by using use cases (they initiate the
execution of the use cases), by being used by the use cases (the actors
provide functionality for the execution of the use cases).
Actors are not a part of the system, they are outside of the system
boundaries.
Usually data is also administered within the system, this data is modeled
within the system in the form of classes and objects,
Example:
The assistant interacts with the system (lab assignment) by using it, the
class assistant describes objects representing data.
❖ Human actors
➢ E.g. student, professor
❖ Non-human actors
➢ E.g. email servers
❖ Primary actors
➢ Has the main benefit of the use case outcome
❖ Secondary actors
➢ Has no direct benefit of use case outcome
❖ Active actors
➢ Initiates the execution of the use case
❖ Passive actors
➢ Provides functionality for the execution of a use case
Actors are connected with use cases via solid lines, each of these actors
must communicate with at least one use case, an association is always
binary(meaning that it is always specified between one use case and one
actor.), Multiplicities may be specified.
The behaviour of one use case (included use case) is integrated in the
behaviour of another use case (base use case)
For example:
The behaviour of one use case(extending use case) may be integrated in
the behaviour of another use case(base use case) but does not have to,
Both use cases may also be executed independently of one another.
Sort of like creating two classes and one of them extends the other class.
One is a superclass.
In summary
❖ The base use case can decide if the included use case is executed
❖ Extension points define at which point the behaviour is integrated.
❖ Conditions define under which circumstances the behaviour is
integrated.
❖ Extension points are written directly within the use case.
❖ Specification of multiple extension points is possible.
Example:
If use case A includes use case B, the behaviour of B is integrated into A. A
being the base use case and B being the included use case. For example
When A is executed B must also be executed. But B can be executed
independently of A.
A is again the base use case, and B being the extending use case. Both
use cases can be executed independently of one and other, when A is
called it is possible but not mandatory to execute B.
By using extension points you can define a point at which the behaviour of
the extending use case must be inserted into the base use case.
Example:
Objects
A system contains many objects
The relationship between the objects are referred to as “links”.
Classes
A class is a construction plan (As you know it as the blueprint) for a set of
similar objects that appear in the system.
The property {readOnly} means that the value cannot be changed once
initialised.
The forward slash before an attribute name indicates that the value of this
attribute is derived. For example the age can be derived from the DOB
The multiplicities
This indicates how many values an attribute can contain. This enables you
to define arrays, just like in programming languages.
Brackets in the form [minimum, maximum] indicate the lower and upper
limits
You already know this stuff so the new things are…
[5] means the attribute can have exactly five attributes
[*] is equivalent to [0…*]
If you do not specify a multiplicity it is assumed the value of 1
If an attribute can adopt multiple values it only makes sense to put down
how they are stored:
❖ As a set(no fixed order with no duplicates)
❖ A multi set(no fixed order of elements with duplicates possible)
❖ A ordered set(fixed order with no duplicates)
❖ A list(fixed order with duplicates possible)
You specify this by putting curly braces and {unique/not unique,
ordered/unordered}
Operations
Same thing as methods in a class.
Visibility markers
Associations
Associations between classes model possible relationships, known as
links.
Binary associations
A binary association allows us to associate the instances of two classes
with one another. The arrow merely indicates in which direction the reader
of the diagram should read the association name.
Navigability: an object knows its partner objects and can therefore access
their visible attributes and operations, normally indicated by an open arrow
head. Non - navigability is indicated by a cross.
The above example all mean the same thing, many students have many
professors, however (a) is preferred. This is because as here the
relationship between the classes is visualised explicitly, it is easier to know
and visualise what is going on.
If more than two partners are involved in a relationship, you can model this
using n-ary association. An n-ary association is represented using a hollow
diamond in the centre. The diamond connected to all the partners of the
relationship. No navigation on n-ary associations.
If you had tried to express the above model in a binary association, you
would have a model with a completely different meaning, look at the
following what is wrong with the following? Look at p75 for answers.
Association Classes
https://stackoverflow.com/questions/62094457/i-dont-understand-association-
class-uml-class-diagram
An association can also be associated with other classes, you'll see this in the
diagram later, look at the exam and certificate.
enrollments for one and the same study program, which is not the in-
tention. In contrast, in Figure 4.19(a), a student can enroll for a specific
study program only once.
This shows the fact that, when it is not specified to be {non-unique} it is {unique}
in 4.20(a) each student can only have one exam meeting for each exam
In 4.20(b) each student can have multiple exam meetings per exam.
Aggregations
There are two types of aggregation, shared and composite. They are both
transitive and asymmetric associations.
Transitive meaning, If B is a part of A then C is also a part of A.
Asymmetric meaning It is not possible for B to be a part of A and A to be a
part of B.
Shared aggregations
In principle, a shared aggregation expresses a weak belong-
ing of the parts to a whole, meaning that parts also exist indepen-
dents the whole. The multiplicity at the aggregating end may be
greater than 1, meaning that an element can be part of multiple other
elements simultaneously. Shared aggregations can therefore span a di-
directed acyclic graph.
Composite aggregation
The use of a composition expresses that a specific part can only be
contained in at most one composite object at one specific point in time.
This results in a maximum multiplicity of 1 at the aggregating end. if
the composite object is deleted or copied, its parts are also deleted or
copied when a composition is used.
Figure 4.22 shows examples of compositions. A lecture hall is part of a
building. Due to the multiplicity 1, there is an existence dependency
between elements of these two classes. The lecture hall cannot exist
without the building.
If the building no longer exists, the lecture hall also does not exist any-
more. The situation is different for a beamer which is also associated
with a lecture hall by a composition. However, the multiplicity 0..1 is
specified at the aggregating end. This means that the beamer can exist
without the lecture hall, that is, it can be removed from the lecture hall.
If the beamer is located in the lecture hall and the lecture hall ceases to
exist—for example, because the building is torn down—the beamer
also ceases to exist. However, if it was removed from the lecture hall
beforehand, it continues to exist.
exist, however with shared it just tells the user that this is a part of this,
however without one part the other can still exist.
For example a lab can exist without students attending it
However how can a lecture hall exist without a building
Generalizations
Figure 4.23, we use the generalization to avoid having to copy the char-
acteristics of the class ResearchAssociate to the class Professor.
ABSTRACT
UML allows multiple inheritance, meaning that a class may have
multiple superclasses. For example, a tutor is both an employee of the
university and a student (see Fig. 4.25). Due to the transitivity of in-
heritance, single inheritance creates an inheritance hierarchy, whereas
multiple inheritance creates a (directed acyclic) inheritance graph.
You straight away see you can add an employee abstract class.
There is a distinction between research and administrative personnel,
some research associates hold courses, then they are called lecturers.
“Some research associates hold courses. Then they are called lecturers.”
This leaves us with the following diagram:
Code generation
Class diagrams are often used to create code, it is also suitable for
documenting existing program code, with the advantage that relationships
and classes are represented graphically.
Example:
This models the inter object behaviour, that is the interactions between the
objects in a system. This leads to the question, what's interaction?
An interaction specifies how messages and data are exchanged between
two interaction partners.
Interaction Partners
In a sequence diagram interaction partners are depicted as lifelines.
Example of a life line:
In a sequence diagram, remember the use of the role concept allows more
modelling flexibility than simple instances or classes, An object that is an
instance of a class can take over many roles over its lifetime.
Messages
Asynchronous - the sender can continue on with the program and can
receive a response message at any time.
var=m1:value, var is the the variable the message is assigned to, m is the
name of the message and value is the actual message it self.
The following is the syntax for a message:
Look at this example, why might announcement be lost and spam email be
found?
Up until this point we have decided that messages are transmitted without
loss of time. Of course this is not always the case:
Full Name  Email Address  I agree to the terms & conditions, cookies,
and privacy policies.
Combined Fragments
When a student wants to register for an exam, the following cases occur:
(1) There are still places available and the student and the student can
register
(2)There is a place available on the waiting list. Then the student has to
decide whether to go on the waiting list.
(3) If there is no place available for the exam or on the waiting list for the
exam, the student receives an error message and is not registered for
the course.
(a)If there is a place available on the waiting list, when registering
for an assignment the student can decide whether to take the
place on the waiting list. If the student wants to be on the
waiting list,the student has to register for it.
Break fragment has the same structure as the opt fragment, if the guard is
true, the interaction within the operand are executed. the remaining
operations of the surrounding fragment are omitted and the interaction
continues to the next fragment.
Understand this example:
The password must be entered at least once and at most three times, as
reflected by the arguments of loop. After the first attempt, the system
checks whether the password can be validated. If it can, that is, if the
condition Password incorrect is no longer true, execution of the interactions
within the loop ceases. The system also exits the loop if the student enters
the password incorrectly three times. This case is then handled further in
the subsequent break fragment.
means that if the password is entered incorrectly three times, the condition
of the incorrect password is true. Thus the content of the break fragment is
executed, meaning that an error message is sent to the student and the
students are not allowed to register for the assignment. The remainder of
the interaction after the end of the break fragment is skipped. After exit
ing the break operator, we are in the outermost fragment of the sequence
diagram and therefore the execution of this sequence diagram is ended.
If we were not in the outermost fragment, the sequence diagram would
continue in the fragment at the next higher level.
Seq fragment: expresses default order, it has at least one operand and
expresses weak sequencing, meaning:
We can use seq fragments with break, if the condition of the break
becomes true, the rest of the seq fragments are skipped, and the execution
continues on the surrounding fragment.
A student wants to register for an exam, if there are no places they can try
to reserve an exam for next week(which is the break fragment), if you look
at it closely, no matter what even if the student does the exam or not they
still receive the info from the lecturer.
Figure 6.13 shows another sequence diagram together with all possible
traces.
As this diagram shows a weak order, the message c is not connected
chronologically to messages a and b and can be interleaved
with these messages.
As b is sent by interaction partner B and d is also received by B, there is a
chronological order between these two messages. In any case, this is the
last message.
Strict fragments
The order of occurrences even on different lifelines are significant, meaning
that even if two messages aren't even connected, there is only one order
and that is the chronological order.
In the example in Figure 6.14, a lecturer only prints an exam when a
student has registered for it. If the strict fragment were not specified, it
would also be possible for the lecturer to print the exam before a student
registers.
Par fragment,
▪ To set aside chronological order between messages in different operands
▪ Execution paths of different operands can be interleaved
▪ Restrictions of each operand need to be respected
▪ Order of the different operands is irrelevant
▪ Concurrency, no true parallelism
So in short, its basically the same thing as seq, but only in each operand.
So i can complete the second operand before the first so long as I use the
seq order in each operands.
At the beginning
of a course, the lecturer has to complete certain activities. The lecturer
must answer queries from students, announce exam dates, and reserve
Lecture halls. To do all of this, the lecturer has to communicate with dif-
ferent persons and systems. A par fragment is used to express that the
order in which these activities are completed is irrelevant.
What is important is that the default order between messages within an
operand is adhered to, meaning that according to this sequence diagram, a
student will never register for a course first and then send a query to the
lecturer.
Coregions:
❖ These are used to model concurrent events of a single lifeline.
❖ The order of events within the coregion is not restricted
❖ Area of the lifeline to be covered by the coregion is marked by square
brackets rotated by 90 degrees
(i) which messages may occur but are not relevant for the description of the
system
(ii) which messages must occur
(iii) which messages must not occur.
Irrelevant messages are shown with the ignore fragment which expresses
that these messages can occur at runtime but have no further significance.
Irrelevant messages in curly brackets after the keyword ignore
The assert fragment, the sequence specified is the sequence that you
must take, otherwise there is an error. (what must occur)
The neg fragment, lets you model an invalid interaction(what must not
occur). (remember this does not eliminate other undesirable situations).
(a)How can you receive a confirmation email before you register for an
exam? That's right you can't. You prick.
(b) When have you ever asked a lecturer to register you for an exam?
Thas right, you havent.cunt
Interaction References
These allow you too integrate one sequence diagram into another:
❖ Allows you to reuse interactions that you already made(modelled)
❖ Allows you to break down complex interactions
Gates
Allows you to send and receive messages beyond the boundaries of the
interaction fragment
Continuation Marker
❖ Modularizes the operands of an alt fragment
❖ Breaks down complex interactions into parts and connect them to
one another with markers
❖ Start marker points to target marker
❖ No return to the start marker (in contrast to an interaction reference)
These specify the time of which the event occurs, or a time period between
two events.
You can have either absolute times(at 12:00, {12:00}), relative times(time it
is not + 5 minutes,{after(5min)}), or time intervals.
State Invariants
A state invariant asserts a certain condition must be fulfilled at a
certain time. It is always assigned to a specific lifeline. The evaluation
of whether the invariant is true takes place before the subsequent
event occurs. If the state invariant is not true, either the model or the
implementation is incorrect.
Notation
The State Machine Diagram
Using a state diagram you can model the possible states for the object in
question, how state transitions occur as a consequence of occurring
events, and what behaviour the system or object exhibits in each
state.
A state is in a round rectangle with round corners, all internal activities are
executed however if internal activities must be specified it is divided into
two compartments.
Types of transition
speaks for it self really
A and B show the same thing, however C and D are different. Look closely,
in C b is always incremented by 1 but in D B is only incremented if the
guards are met.
one transition goes into two ore more states
Composite States
Only one substrate can by active at one time, if you want concurrency you
use orthogonal states.
SubMachines
It is analogous to subroutines
Example:
the external view of S1. The entry and exit points are visible as inter-
faces to S1 but the detailed structure of S1 remains invisible for external
Transitions.
History State
History states are used when you enter a composite substrate and wish to
return to the state it was at before it entered the substrate.
It can have any number of incoming transitions but only one out going, it
must have no events or guards on its transition. Also if it entered the
substrate and there was no last active state it continues as normal.
There are two types of history states, shallow history state and deep history
state. (each composite state can have a maximum of one of each of the
history states present!), the shallow history state restores the state that is
on the same level of the composite states as the shallow state itself, the
deep history state can restore the last active substate.
Figure 5.19 shows the states that a student takes during a study pro-
gram. Initially, a study program is inactive. If the tuition fees have been
paid (and thus the student has registered for the study program), the
study program becomes active. Tuition fees must be paid at the begin-
ning of every semester. If this does not happen, the study program be-
comes inactive again. During the course of an active study program, the
Create code fast, show user, discard it, make changes, do it again until
user is satisfied.
Risk is severely reduced as the user is seeing what they're going t get as it
evolves, they aren't going to get one whole system in 6 months, you don't
want this(cough cough waterfall)
Extreme programming
Practices in XP
Sit Together
Communication is one of the 5 values, sitting together allows for better
communication
Whole Team
A cross-functional group of people with the necessary roles for a product
form a single team.
Informative Workspace
The code is OUR code not MY code, transparency in work, give private
time when needed.
Energised Work
Keep productive, stay healthy, don't overwork yourself(don't over work
other team members), when you work it should be productive.
Pair Programming
Pair Programming means all production software is developed by two
people sitting at the same machine. The idea behind this practice is that
two brains and four eyes are better than one brain and two eyes. You
effectively get a continuous code review and quicker response to nagging
problems that may stop one person dead in their tracks.
Stories
Describe what the product should do in terms meaningful to customers and
users, stories should be short and concise.
Weekly Cycle
The Weekly Cycle is synonymous with an iteration. In the case of XP, the
team meets on the first day of the week to reflect on progress to date, the
customer picks the stories they would like delivered in that week, and the
team determines how they will approach those stories. The goal by the end
of the week is to have running tested features that realise the selected
stories.
Intent is that customers have something to give feedback on(one of the
values)
Quarterly Cycle
Plan what you want to achieve by the end of the cycle, give customer
details of each weekly cycle.
Slack
Low priority user stories, can be dropped if team is swamped.
Ten-Minute Build
Make sure testing and build of a system takes 10 minutes, encouraging
testing to take place more often(if its longer than 10 minutes you are not
likely to do it frequently, the more tests the merrier)
Continuous Integration
Test code as soon as it added to a larger code base, to ensure code is
robust and works well with all other code.
Test-First Programming
Write failing automated test -> Run failing test -> develop code to make test
pass -> run test -> repeat
Incremental Design
The practice of Incremental Design suggests that you do a little bit of work
upfront to understand the proper breadth-wise perspective of the system
design, and then dive into the details of a particular aspect of that design
when you deliver specific features. This approach reduces the cost of
changes and allows you to make design decisions when necessary based
on the most current information available.
Roles in XP
The Customer
The customer makes all the business decision regarding the project
including: What should the system do? How do we know when the system
is done? What is our budget? What should we do next?
Assumed to be a single person involved and engaged in the project.
The Developer
The Tracker
This is often one of the developers who spend part of their time each
week filling this extra role. The main purpose of this role is to keep track
of relevant metrics that the team feels are necessary to track their progress
and to identify areas for improvement. Key metrics that your team may
track include velocity, reasons for changes to velocity, amount of overtime
worked, and passing and failing tests.
The Coach
The main value of the coach is that they have gone through it before and
can help your team avoid mistakes that most new teams make.