Date post: | 21-Jan-2016 |
Category: |
Documents |
Upload: | allan-harmon |
View: | 213 times |
Download: | 0 times |
Datavetenskap
Rogardt Heldal Introduction and pre-study - 1 -
Lecture 1
Introduction to the course Model Driven Software Development (MDSD)
Rogardt Heldal
Datavetenskap
Rogardt Heldal Introduction and pre-study - 2 -
From Idea to system (small)
Idea Binary
Platform specific (PSM)Platform Independent (PIM)
C att
Datavetenskap
Rogardt Heldal Introduction and pre-study - 3 -
What if the system is a bit larger?
Datavetenskap
Rogardt Heldal Introduction and pre-study - 4 -
From Idea to system (small)
Idea BinaryC attReqs.
t
Datavetenskap
Rogardt Heldal Introduction and pre-study - 5 -
From Idea to system
Idea Reqs. BinaryCatt t
Datavetenskap
Rogardt Heldal Introduction and pre-study - 6 -
What if the textual reqs. are hard to understand
Datavetenskap
Rogardt Heldal Introduction and pre-study - 7 -
Analysis models
Idea Reqs. C BinaryUML+ At t at
Datavetenskap
Rogardt Heldal Introduction and pre-study - 8 -
Models for Communication• To make models readable is important: permit
communication. For example, to be able to discuss a new software system with the customer.
• Important that one don’t make the models too detailed.
• The contents of the models in the requirement/analysis phase are so far from code that there is need for humans refining the contents to obtain more precise models or code.
Datavetenskap
Rogardt Heldal Introduction and pre-study - 9 -
Analysis
Use Cases Diagram
Activity Diagram
Domain Model
Purpose: understand and describe the system
Descriptive Models
Datavetenskap
Rogardt Heldal Introduction and pre-study - 10 -
UML for Design
Idea Reqs. C BinaryUML+ A UMLDt t t
t
at
Datavetenskap
Rogardt Heldal Introduction and pre-study - 11 -
From Code Skeleton to Code
Code skeleton
Reqs. UML+ A
Code
Class Diagram
UMLD
Datavetenskap
Rogardt Heldal Introduction and pre-study - 12 -
Not using UML for Design
Idea Reqs. C BinaryUML+ A UMLDt t t
t
at
Datavetenskap
Rogardt Heldal Introduction and pre-study - 13 -
Productivity
Assembly
Fortran, C Productivity gain (factor of roughly 4)
C++, C# A small productivity gain (factor of roughly 1)
Models?
UML
Datavetenskap
Rogardt Heldal Introduction and pre-study - 14 -
Executable models• In this course we will also consider executable
models• As the name indicate, executable models are
models which can be executed • This require precise modeling• A subset of UML is used • Need to insert action language statements into the
models• Action language more abstract than higher
languages such as C++ and Java• Executable models can be translated to languages
such as C++, Java etc.
Datavetenskap
Rogardt Heldal Introduction and pre-study - 15 -
Executable Models
Idea Reqs. C Binary
Platform specific (PSM)Platform Independent (PIM)
UML+ A xtUMLt t at at
Datavetenskap
Rogardt Heldal Introduction and pre-study - 16 -
Executable Model Hierarchy
Prescriptive models
Datavetenskap
Rogardt Heldal Introduction and pre-study - 17 -
CxtUML at
Transformation
Java
C#
Platform1
Platform2
Platform2
mapTo
Datavetenskap
Rogardt Heldal Introduction and pre-study - 18 -
Domain-Specific Models• Work for a particular domain.• Can increase productivity a lot. • Often, relative easy to translate a domain-
specific model to code, because one knows what to produce.
• But: Very restricted language.
Datavetenskap
Rogardt Heldal Introduction and pre-study - 19 -
Domain Specific language
Idea Reqs. C Binary
Platform specific (PSM)Platform Independent (PIM)
UML+ A DSLt t at at
Datavetenskap
Rogardt Heldal Introduction and pre-study - 20 -
Domain Specific language
Idea Reqs. C Binary
Platform specific (PSM)Platform Independent (PIM)
DSL+ DSLt t at at
DSLDSL
Datavetenskap
Rogardt Heldal Introduction and pre-study - 21 -
What about xtUML?
Datavetenskap
Rogardt Heldal Introduction and pre-study - 22 -
Map to Hardware
Idea Reqs. C Binary
Platform specific (PSM)Platform Independent (PIM)
UML+ A xtUMLt t at at
Hardware
m
Datavetenskap
Rogardt Heldal Introduction and pre-study - 23 -
Mapping Component to Nodes
Some areas more than100 small computer and1000s of components.
Datavetenskap
Rogardt Heldal Introduction and pre-study - 24 -
MethodA method consists of:
• Modeling language (for example UML)
• Process (for example XP, RUP)
Datavetenskap
Rogardt Heldal Introduction and pre-study - 25 -
Course process
Analysis
Design
Requirement
Test
Water modelLearn topic by topic, so that force a bit of waterfall process,but try to be as agile aspossible within the project.
If you find mistakes, fix itwherever you find it!
Datavetenskap
Rogardt Heldal Introduction and pre-study - 26 -
Who am I (working)?• Teaching about object oriented system development for
13-14 years. For the last 10-11 years been the main instructor.
• Particular interested in modeling, the main focus of this course.
• Collaborate a lot with the industry, Ericsson, Volvo Car, Volvo Truck …
• Active in the modeling research community and have several papers in this area.
• Enjoy collaborating with industry via PhD students and master students. In particular when there are some research issues involved.
Datavetenskap
Rogardt Heldal Introduction and pre-study - 27 -
Course assistants
• Håkan Burden– Research area within Model Driven Engineering and
Natural Language Processing.
• Grischa Liebel– Research within Model-based requirements
engineering, took course in 2010.
Datavetenskap
Rogardt Heldal Introduction and pre-study - 28 -
Course structure• Two lectures a week
– Tuesday 13.15 – 15.00 – Thursday 13.15 – 15.00
• 4 voluntary exams– Will be done in combination with lectures
• Group work– Mandatory meetings every week with a supervisor
• support the development of the project
• Oral exam on the project work and course material– Time and place will be given later
Datavetenskap
Rogardt Heldal Introduction and pre-study - 29 -
Reading material • There will be no course book, but you are
responsible to find reading material on the topics covered in this course.
• Two books strongly related to this course:– Applying UML and Patterns (Craig Larman) (An
Introduction to Object-Oriented Analysis and Design)– Executable UML (Stephen J. Mellor and March J. Balcer)
(A Foundation to Model-Driven Architecture)
• We will add other recommended readings on the course home page during the course.
Datavetenskap
Rogardt Heldal Introduction and pre-study - 30 -
Course Home Page• The course home page can be found at:
– http://www.cse.chalmers.se/edu/course/TDA593/Year2013/start.html
• In this lecture we will highlight important issues considering the course, but all of you should also read the course home page carefully. There will be more details.
• The course home page will be updated during the course.• Changes done to the course home page will be indicated
as news in the beginning of the course home page, with the exception of lecture notes, project assignments which will be added without notification.
Datavetenskap
Rogardt Heldal Introduction and pre-study - 31 -
Work packages• Project work
– Weekly assignments– Contribution and time report– Final report – Oral examination
• 4 Voluntary written Examination• Oral examination on the project and course
material– Will be done two at a time– This will be in the examination week (week 8)
Datavetenskap
Rogardt Heldal Introduction and pre-study - 32 -
Project work• Done in groups of 10 students. Groups will be
formed today. • New assignment every week, see course home
page.• Mandatory meetings with supervisor every week,
but you should have more meetings yourself to discuss and solve the week’s assignment.
• Examination of project and course material:– Final report together with an oral examination– Contribution and time report
• For more details see the course home page.
Datavetenskap
Rogardt Heldal Introduction and pre-study - 33 -
Name SSNr Project
1 2 3 4 5 6 7
Voluntary exams1 2 3 4
pass
sum
Grade
Contribution
Grade
Gra
de
Group Nr:_______
Time:__________________________ Place: ______________________Supervisor: _____________________________
Contact person: _____________ email:____________telephone:___________Reserve: ___________ ___ email: ______________ telephone:____________
Executable
Datavetenskap
Rogardt Heldal Introduction and pre-study - 34 -
Examinations• To pass the course with the lowest mark
(3 or G) a student has to have: participated in writing a report on the group work – attended at least 6 of 7 group meetings – contributed a time report with stating the personal
contribution to the project – passed an oral examination on the project and course
work
• In border cases the voluntary examinations can help, if the student has obtained at least 24 points in total on 3 written examinations.
Datavetenskap
Rogardt Heldal Introduction and pre-study - 35 -
Examinations• To pass the course with a higher mark (4,5
or VG) a student has to have: – fulfilled all the commitments above and – obtained at least 36 points on 3 written examinations
for grade 4 and at least 48 points on 3 written examinations for the grade 5 (VG).
– Some extra points can be given for the project: a good solution, extra functionality, etc.
Datavetenskap
Rogardt Heldal Introduction and pre-study - 36 -
Contribution among members• You need to rank the contribution among the
group members• Indicate what mark the other group members
deserve
Datavetenskap
Rogardt Heldal Introduction and pre-study - 37 -
Groups • Groups:
– Tuesday 08.00 – 09.45 (2 groups)– Tuesday 10.00 - 11.45 (4 groups)– Tuesday 15.15 - 17.00 (2 groups)– Thursday 08.00 – 09.45 (2 groups)– Thursday 10.00 – 11.45 (2 groups)– Thursday 15.15 – 17.00 (2 groups)– Friday 08.00 – 09.45 (2 groups)
Datavetenskap
Rogardt Heldal Introduction and pre-study - 38 -
What should you do first week?
• A text description of your system. • Functional requirements • Non-functional requirements that will be
important.• A discussion or motivation of your
requirements.• Include documents that makes your report
stronger, like mind-maps, interviews and activity diagrams
Datavetenskap
Rogardt Heldal Introduction and pre-study - 39 -
Why hotel domain?
Datavetenskap
Rogardt Heldal Introduction and pre-study - 40 -
Modelling
• The first week there are focus on textual descriptions and textual requirements.
• But, we want to start to use models even at this stage, activity models.
• We will use simplified (subset) activity diagrams.
Datavetenskap
Rogardt Heldal Introduction and pre-study - 41 -
Example: Taxi company
Per
Kari
Lise
Datavetenskap
Rogardt Heldal Introduction and pre-study - 42 -
Mind Maps
Taxi
order
customer
regularTime
Start address
end address
Bus-taxi
Datavetenskap
Rogardt Heldal Introduction and pre-study - 43 -
Activity diagrams
• Part of UML• Can be useful for business modelling• Can be used to:
• Describe sequences of activities • Both sequential and parallel
Datavetenskap
Rogardt Heldal Introduction and pre-study - 44 -
Work flow/processes
Analysis
Design
Requirement
Test
Implementing
Start point
End point
Water model
Activity
Call actionnode
Datavetenskap
Rogardt Heldal Introduction and pre-study - 45 -
Action nodes
Some action
Signal name
Accept Event
Time expression
Call action node
Send signal
Accept event action node
Accept time event action node
Datavetenskap
Rogardt Heldal Introduction and pre-study - 46 -
Example
ProcessOrder
Request Payment
Paymentconfirmed
ProcessOrder
Cancelorder
Contactcustomer
Endof month
Pay outsalary
Datavetenskap
Rogardt Heldal Introduction and pre-study - 47 -
Control nodes
Decision node or Merge node
Fork node, join node
Initial node
Activity final
Flow final
Datavetenskap
Rogardt Heldal Introduction and pre-study - 48 -
Work flow/processes
Analysis
Design
Requirement
Test
Implementing
Start point
End point
Water model
Datavetenskap
Rogardt Heldal Introduction and pre-study - 49 -
Decision node• The output edge whose guard condition is true
is traversed.
[Condition 1]
[Condition 2]
Datavetenskap
Rogardt Heldal Introduction and pre-study - 50 -
Insert coins inthe machine
Test if machinehas received the right
amount of money.
Indicate that beveragecan be selected.
Select beverage.
Dispense beverage.
Indicate that beverageis not available.
[beverage not available]
[beverage available]
Example: Conditions and Iteration
Coffee machine
Datavetenskap
Rogardt Heldal Introduction and pre-study - 51 -
Decision input
[true]
[false]
<<decisionInput>>age > 25
Datavetenskap
Rogardt Heldal Introduction and pre-study - 52 -
Pre and Post-condition
Write grantapplication
Address grantapplication
Post grantapplication
<<localPrecondition>>address is know
<<localPostcondition>>Grant application is addressed
Send grant applicationPrecondition: known research areaPostcondition: grant application sent to address
Datavetenskap
Rogardt Heldal Introduction and pre-study - 53 -
Activity A. Activity B.
Concurrent fork
Concurrent join
Parallel activities
Datavetenskap
Rogardt Heldal Introduction and pre-study - 54 -
”Swimlanes”
Order productHandle order
Obtain materials
Package order
BillReceive product
Finish order
Pay
Customer Order Processing Store
Product process
Datavetenskap
Rogardt Heldal Introduction and pre-study - 55 -
Object nodes
InvoiceSendinvoice
Make Payment
Sendinvoice
Make Payment
Using pins:
Invoice
One can send objects:
Datavetenskap
Rogardt Heldal Introduction and pre-study - 56 -
Object in State
Create taxiorder
Order[new]
Assign taxi
Order[Assign]
Datavetenskap
Rogardt Heldal Introduction and pre-study - 57 -
Activity parameters
Order Order[Delivered]
Acceptpayment
Manufactureproduct
Deliverproduct
Order[Paid]
marketing Manufacturing Delivery
Handle order
department
Datavetenskap
Rogardt Heldal Introduction and pre-study - 58 -
Activity Diagram
Give card ValidateCard
Enter amount
Wrong pin less than 3 times
Wrong pin more than 3 times
Not enoughmoney on accountTake money
and card
Withdraw Money
Cancel
Enoughmoney onaccount
Correct pinCardDetails
Datavetenskap
Rogardt Heldal Introduction and pre-study - 59 -
Multicast and multireceiveRequest for Proposals process
Technical Group Member
Identify need
Request for Proposal RFP Create Proposal
Proposal[Candidate]
AssessProposals
Proposal[Accepted]
<<multicast>>
<<multireceive>>
Datavetenskap
Rogardt Heldal Introduction and pre-study - 60 -
Semantics• Action nodes execute when
– There is a token simultaneously on each of the input edges AND
– The input tokens satisfy all of the local action node precondition
Action node Action node
Action node
Action nodeDoes not execute
Action nodeexecutes
Datavetenskap
Rogardt Heldal Introduction and pre-study - 61 -
Summary• Introduced the course• Shown why models are important• Introduced the project • Shown activity diagrams
• By searching for Activity diagram on Google you will obtain many matches: introductions, tutorials etc.
• For more in depth information you can look at the UML specification. There is link from the course home page.
• Spend some time to understand activity diagrams before the first project meeting.