Chapter 4 – Requirements Engineering Lecture 2 1Chapter 4 Requirements engineering.
analysis and design Requirements engineering, Blockchain ...
Transcript of analysis and design Requirements engineering, Blockchain ...
![Page 1: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/1.jpg)
Blockchain-based parking app (dApp)
Requirements engineering, analysis and design
![Page 2: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/2.jpg)
2
![Page 3: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/3.jpg)
3
![Page 4: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/4.jpg)
4
![Page 5: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/5.jpg)
5
![Page 6: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/6.jpg)
6
![Page 7: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/7.jpg)
● Owner○ Owner of the parking spot
■ Register parking spot and specify its availability● Renter
○ User of the parking spot■ Search and reserver parking spot■ Start/end parking session■ Extend parking session■ Payment
7
Stakeholders and their dependencies
![Page 8: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/8.jpg)
● Owner○ Owner of the parking spot
■ Register parking spot and specify its availability● Renter
○ User of the parking spot■ Search and reserver parking spot■ Start/end parking session■ Extend parking session
8
Stakeholders and their dependencies
![Page 9: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/9.jpg)
9
Stakeholders and their dependencies
![Page 10: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/10.jpg)
● Goal #1: Register parking spot● Goal #2: Parking session started● Goal #3: Parking session ended● Goal #4: Payment handled
10
Stakeholders goals
![Page 11: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/11.jpg)
11
Goal #1: Register parking spot
![Page 12: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/12.jpg)
12
Goal #2: Parking session started
![Page 13: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/13.jpg)
13
Goal #3: Parking session ended
![Page 14: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/14.jpg)
14
Goal #4: Payment handled
![Page 15: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/15.jpg)
Use case diagram
15
![Page 16: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/16.jpg)
UC
1: S
ave
Par
king
Spo
tUse case ID: name: UC#1: Save Parking Spot
Date created: 15.09.2021
Actors: Owner
Description: The owner creates the parking spots, enters its information and availability.
Trigger: Owner wants to create and save a parking spot for renting out in the parking dApp
Precondition: Physical parking spot is ready for the use. Owner has log in to Parking dApp.
Postcondition: Information about parking spot and its availability is entered to the Parking dApp.
Main flow: 1. Owner provides information about parking spot.2. Parking dApp registers parking spot.3. Owner provides information about parking spot availability.4. Parking dApp specifies parking spot availability.5. Owner confirms the entered information.
Alternative flow: None
Priority: Must
Assumptions: Owner should have access to Parking dApp 16
![Page 17: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/17.jpg)
UC
2: S
tart
Par
king
Ses
sion Use case ID:
name:UC#2: Start Parking Session
Date created: 15.09.2021
Actors: Renter
Description: Renter arrives to the place and intends to park the car. He used the parking dApp to reserve the parking spot.
Trigger: Renter wants to park the car.
Precondition: Renter has arrived to the place and wants to park his car.
Postcondition: Renter’s car is parked and parking session has started
Main flow: 1. Renter queries for parking spot.2. Parking dApp reserves parking spot.3. Renter confirms the received parking spot.
Alternative flow: None
Priority: Must
Assumptions: Renter should have access to Parking dApp17
![Page 18: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/18.jpg)
UC
3: E
nd P
arki
ng S
essi
on Use case ID: name:
UC#3: End Parking Session
Date created: 15.09.2021
Actors: Renter
Description: Renter finishes using the parking spot.
Trigger: Renter wants to finish the parking.
Precondition: Renter wants to finish the parking.
Postcondition: Parking session has ended.
Main flow: 1. Renter requests to end parking.2. Parking dApp ends parking session.3. Renter receives notification about session end.
Alternative flow: None
Priority: Must
Assumptions: Renter should have access to Parking dApp.
18
![Page 19: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/19.jpg)
Ext
end
Par
king
Ses
sion
Use case ID: name: UC#3.1: Extend Parking Session
Date created: 15.09.2021
Actors: Renter
Description: Renter has finished using the parking spot. If the parking spot is available, user can extend the parking time.
Trigger: Renter wants to extend the parking.
Precondition: Renter wants to extend the parking.
Postcondition: Parking session has ended.
Main flow: 1. Renter requests to extend the parking.2. Parking dApp checks availability of parking spotIf not available: 3. Parking dApp ends parking session. 4. Renter receives notification about session end.else Alternative 1
Alternative flow: Alternative 1:
Priority: Must
Assumptions: Renter should have access to Parking dApp.Renter control by himself the parking session length (no automatic check about expiration of the parking session) 19
![Page 20: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/20.jpg)
Ext
end
Par
king
Ses
sion
Use case ID: name: UC#3.1: Extend Parking Session
Date created: 15.09.2021
Actors: Renter
Description: Renter has finished using the parking spot. If the parking spot is available, user can extend the parking time.
Trigger: Renter wants to extend the parking.
Precondition: Renter wants to extend the parking.
Postcondition: Parking session has ended.
Main flow: 1. Renter requests to extend the parking2. Parking dApp checks availability of parking spotIf not available: 3. Parking dApp ends parking session. 4. Renter receives notification about session end.else Alternative 1
Alternative flow: Alternative 1:
Priority: Must
Assumptions: Renter should have access to Parking dApp.Renter control by himself the parking session length (no automatic check about expiration of the parking session)
Alternative 1: a3. Parking dApp extends parking session. a4. Parking dApp sends notification to Renter. a5. Renter receives notification about extension.
20
![Page 21: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/21.jpg)
UC
4: P
aym
ent h
andl
edUse case ID: name: UC#4: Payment handled
Date created: 16.09.2021
Actors:
Description:
Trigger:
Precondition:
Postcondition:
Main flow:
Alternative flow:
Priority:
Assumptions:21
![Page 22: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/22.jpg)
UC
4: P
aym
ent h
andl
edUse case ID: name: UC#4: Payment handled
Date created: 16.09.2021
Actors: Owner, Renter
Description: Once the renter has finished using the parking spot he pays to the owner.
Trigger: Renter has finished the parking and want to leave, but first he has to pay for parking.
Precondition: Parking session has ended.
Postcondition: Payment handled.
Main flow: 1. Parking dApp calculates the total cost.2. Parking dApp processes payment from Renter.3. Renter pays for parking (spot).4. Parking dApp processes payment to Owner.5. Owner receives payment.
Alternative flow: none
Priority: Must
Assumptions: Owner has banking account.
22
![Page 23: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/23.jpg)
Solution oriented requirements - Data model
23
![Page 24: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/24.jpg)
Solution oriented requirements - Data model
24
![Page 25: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/25.jpg)
Solution oriented requirements - Data model
25
![Page 26: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/26.jpg)
Idle
Unpaid
Paid
Reserved
Renter.StartParkingSession()
Renter.EndParkingSession()
User.HandlePayment()
Owner.SaveParkingSpot()
Solution oriented requirements - State model
26
![Page 27: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/27.jpg)
Idle
Unpaid
Paid
Reserved
Renter.StartParkingSession()
Renter.EndParkingSession()
User.HandlePayment()
Owner.SaveParkingSpot()
Creates the ParkingSpot object• ID, Name, Location, CostPerMinute
Instantiate ParkingSpotLocation object• X, Y and GeoHash
Instantiate CurrentAmount object• Amount and CurrencyRate
Assigns ParkingTime object• ID and ParkingSpot
Solution oriented requirements - State model
27
![Page 28: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/28.jpg)
Idle
Unpaid
Paid
Reserved
Renter.StartParkingSession()
Renter.EndParkingSession()
User.HandlePayment()
Owner.SaveParkingSpot()
Updates ParkingTime object
• ParkingStart
Solution oriented requirements - State model
28
![Page 29: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/29.jpg)
Idle
Unpaid
Paid
Reserved
Renter.StartParkingSession()
Renter.EndParkingSession()
User.HandlePayment()
Owner.SaveParkingSpot()
Updates ParkingTime object
• ParkingEnd
Solution oriented requirements - State model
29
![Page 30: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/30.jpg)
Idle
Unpaid
Paid
Reserved
Renter.StartParkingSession()
Renter.EndParkingSession()
User.HandlePayment()
Owner.SaveParkingSpot() Updates ParkingTime object
• Cost – is estimates using ParkingStart, ParkingEnd and CostPerMinute
Update User objects
• Renter.Balance – deduced by the ParkingTime.Cost
• Owner.Balance – increased by the ParkingTime.Cost
Solution oriented requirements - State model
30
![Page 31: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/31.jpg)
Save parking slot
Solution oriented requirements - Behavior model
31
![Page 32: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/32.jpg)
Start parking session
Solution oriented requirements - Behavior model
32
![Page 33: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/33.jpg)
End parking session
Solution oriented requirements - Behavior model
33
![Page 34: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/34.jpg)
Solution oriented requirements - Behavior modelHandle payment
34
![Page 35: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/35.jpg)
Non-functional requirements: Access control model
35
![Page 36: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/36.jpg)
Access control model
36
![Page 37: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/37.jpg)
AccReq#1: Only Owner should be able to insert ParkingSpotAccReq#2: Only Renter should be able to update ParkingTime.ParkingStartAccReq#3: Only Renter should be able to update ParkingTime.ParkingEndAccReq#4: Only User should be able to update Balance.Amount
Access control model
37
![Page 38: analysis and design Requirements engineering, Blockchain ...](https://reader036.fdocuments.in/reader036/viewer/2022071612/615701a0a097e25c76500124/html5/thumbnails/38.jpg)
Lecture goals● Do you need a Blockchain?
○ Coin management system○ Medical data preservation system○ Sharing a parking spot
● Parking dApp scenario○ Stakeholders analysis and goals○ Use cases○ Solution-oriented requirements
■ Data model■ State model ■ Behavior model
○ Non-functional requirements■ Access control model
38