Formal Methods Assignment PDF
Formal Methods Assignment PDF
Formal Methods Assignment PDF
COVER SHEET
Student Name & ID 1. Nur Asfia Binti Jamaluddin (B02170024)
2. Nusrah Nafi’ah Binti Headir (B02170027)
3. Adla Fikriyah Binti Ibrahim (B02170029)
DECLARATION
No part of this work has been copied from any other source or person except where due
acknowledgement is made, and no part of the work has been previously submitted for assessment
at this or any other institution. I have read the Student Academic Integrity Policy and understand its
implications. For the purposes of assessment and standards, I give the University permission to
retain this assignment; provide a copy to other assessors; and evaluate its academic integrity
through the use of a plagiarism checking service (which may store a copy of the assignment on its
database for future plagiarism checks).
Student’s Signature
(representative)
Date
To be filled by Lecturer
Marks
Comments
Date Received
TEAM
Abbreviations
The table below shows the abbreviations that are going to be used in this document.
Abbreviation Explanation
The use case that will be chosen in this Z-specification is taken from the Global Personal Marketplace
System Requirements Specification (SRS). The chosen use case is Read Buyer Guidelines, Review
Personal History and Register Feedback About Seller.
Figure 1.0 shows the partial Use Case Diagram for Buyer actor in GPM, including the use cases
that are chosen and will be explained and specified in this document. Buyer is the role that is
played by any user who uses the GPM to purchase one or more items being sold by a Seller by
using the GPM.
2. UCD01 : Reads Buyer Guidelines
This use case enables buyers to read buyer guidelines from the GPM. This use case is activated
by the Buyer and communicates with the GPM to request for the GPM to display the Buyer
Guidelines for the Buyer to read. This use case is important in allowing Buyers to learn how to
buy before deciding if they want to buy at a sale.
Flow of events 1. Buyer sends request to the GPM to display buyer guidelines
2. GPM displays buyer guidelines on the screen
3. After Buyer has completed reading the buyer guidelines,
Buyer signals completion to the GPM by clicking exit.
Entry condition ● Buyer is already on the webpage on the browser where
he/she can request the display of buyer guidelines
Quality Requirements ● The buyer guidelines will be displayed on the screen within 10
seconds after the request has been done, depending on the
Buyer’s machine’s internet connection.
2.2. Z-Specification
To specify the Read Buyer Guidelines use case, we first note down the properties of the actors
that are involved in this case. The actors involved are the Buyers and the GPM.
The type Request have values of either mpage or bguide. These values are given by the Buyer
that indicates which display that they would like to see from the GPM. The type Display have
values of either mainpage or buyerguidelines. The Display type denotes the display that should be
shown to the user based on the user’s request.
The Buyer actor has one parameter which is request, which is of type Request. This indicator is
used to inform GPM on which display the Buyer would like to see. The request parameter should
not be null.
The GPMDisplay actor has only one parameter which is display. This display parameter defines
the display that is to be shown on screen, and depends on the request that is given by the Buyer.
The GPMDisplay is the Main Page by default.
The DisplayBuyerGuidelines method involves the GPMDisplay and the Buyer actor. When the
Buyer requests for the buyer guidelines, the GPMDisplay will then display this to the Buyer.
This use case enables winning buyer to leave reviews about the seller regarding their experience
throughout the whole buying process. The purpose of this use case is to trace and report those
sellers who does not deliver purchased items or do not fulfill the item descriptions at the auction.
Exit Condition ● GPM stores the buyer’s feedback about the seller in the
seller’s feedback history
To specify the ‘Buyer Registers Feedback about Seller’ use case, we first identify the actors that
are involved in this case. The actors involved are the Buyers and the GPM.
This first GPM Schema states the database that stores the seller’s feedback histories. This
database is the main component in this use case. This database stores all the reviews that buyers
have left for the seller.
The Buyer actor has one parameter which is request, which is of type Request. This indicator is
used to inform GPM on which display the Buyer would like to see. The request parameter should
not be null.
The GPMDisplay method enables user to choose certain actions from the GPM main page. Only
winning buyers from the bidding are allowed to submit feedback to the sellers that they have
purchased items from. Only if the buyer has bought an item with the seller, only then the
‘Register Seller Feedback’ will be available for the buyer. Once buyers have selected the
‘Register Seller Feedback’ they will be redirected to the feedback form.
This schema describes the feedback form that the buyer will receive in order to leave reviews for
the sellers. The form displays the buyer alias, comment date and time, seller alias, sale identifier
and item title. There will be 2 inputs section which buyers can fill in, which are ; comment type,
and the comment they wish to provide. Once the buyer has submit the form, the comments will be
stored in the seller feedback history database.
This use case enables buyer to communicate with GPM to display a history of buyer’s personal
transactions such as bids, sealed offers, and purchases. There are two use case paths which
consists of Normal path (Bid History displayed) and Exceptional path (No Bid History). This use
case allows buyer to view all transactions history in GPM.
4.1. Use Case Description
Flow of events 1. Buyer sends request his/her bid history in GPM webpage
2. GPM responds by displaying the following information on the
browser:
● The auction status (open, closed, cancelled)
● The type of auction (regular, reserve, Dutch)
● The item number
● The current high bid
● The current high buyer
● The type of bid (single bid, automatic proxy bid)
● The bid amount
● The desired quantity
● For automatic proxy bids:
○ The bid increment
○ The maximum bid
3. If the buyer has never bid, GPM responds by displaying the
‘No Bid History’ message.
Entry condition ● Buyer is already in the webpage to request his/her bid history
Exit Condition ● Buyer can navigate to either selected sale or return to the
previous page
Quality Requirements ● The personal history page will be displayed 10 seconds after
buyer requested from GPM.
4.2. Z-Specification
Mainpage and phistory are the values for type Request given by the Buyer to indicate which
display he/she would to access on the GPM. The Display type consists of main page and
personalhistory where Buyer can request to either of these displays to be displayed.
The GPMDisplay actor has only one parameter which is display. GPMDisplay is a parameter
used to display on screen based on the request by the Buyer. The GPMDisplay is the Main Page
by default.
The DisplayPersonalHistory method involves the GPMDisplay and the Buyer actor. When the
Buyer requests for the personal history, the GPMDisplay will then display this to the Buyer which
consists of previous auction and bid status.
INDIVIDUAL (ADLA FIKRIYAH)
The use case that have been chosen for this individual assignment is the Online Shopping Diagram.
Figure 1.1 shows the use case diagram for online shopping. There are 4 actors which consists of
Web Customers, Customer Authentication, Identity Provider, Credit Payment Service and
Payment Methods. Top level use cases are View Items, Make Purchase and Client Register.
Checkout use case is included use case which not available by itself. The reason is because
checkout is part of making purchase.
2. Use Case Description
Exit condition ● Web Customer is able to add and delete of the item in the
shopping cart or wish list
● Web Customer has proceed to payment to purchase
4. Z-Specification
The use case that have been chosen for this individual assignment is the Bank ATM UML Diagram.
Figure 3.1 shows the use case diagram of a bank ATM. There are 3 actors that are involved which
are the user, ATM technician and also the bank. There are 4 functions that the users are able to
perform which are check balance, withdraw cash, deposit and transfer funds. Meanwhile, the
ATM technician are only able to repair or perform maintenance on the machine. All actions from
both actors require communication with the bank.
2. Use Case Description (Check balance)
3. Class Diagram
Figure 3.2 : Class diagram for CheckBalance
The class diagram in figure 3.2 describes the components that are involved in this use case. User
is only able to perform the ‘Check Balance’ action once the system has verified it as one of the
bank’s customers. This is done by the system by checking the match between the user’s
credentials and the credentials available in the bank database. We can see from the class diagram
that when the customer chooses to check the balance of their account, they are required to choose
what type of bank they wish to check, as one bank account has a savings account and a current
account. The system then communicates with the bank to check from the database and display the
user’s chosen bank balance.
4. Z-Specification
The use case that will be chosen in this Z-specification is taken from the Ticket Vending Machine UML
Diagram. The chosen use case is Purchase Ticket.
Figure 4.0 shows the use case diagram for the Ticket Vending Machine. There are two actors in
this use case, which is the commuter who buys tickets from the ticket vending machine and the
bank that the vending machine communicates with when the commuter chooses to pay with either
a credit or debit card.
Flow of events 1. Commuter uses the ticket vending machine and starts the
session on the vending machine
2. The vending machine responds by showing the trip info to the
Commuter
3. Commuter will then define a trip information, such as the
number and type of tickets
4. Based on the provided information, the vending machine will
calculate the payment and request payment options from the
Commuter.
5. Commuter provides payment info. If the user decides to :
5.1. Pay by cash, continue with Step 6
5.2. Pay by card, the vending machine will connect with
Bank to authorize the card payment
6. The vending machine will process the payment and dispense
the ticket to the Commuter
7. Commuter will get ticket from the vending machine
7.1. If the Commuter chooses to pay by cash during
Step 5, the vending machine will dispense change to
the Commuter
7.2. Commuter will then get change from the vending
machine
8. The vending machine will show “Thank You” to the
Commuter
Quality Requirements ● The payment details will be displayed on the vending machine
within 5 seconds after it has been processed
● The vending machine will dispense the tickets within 5
seconds after payment has been completed
3. Class Diagram
Figure 4.2 shows the class diagram for PurchaseTickets where each actors that are involved is
noted down. The actors involved in the method are the Commuter who makes the purchase, the
Vending Machine where the Commuter makes the purchase and the Bank that the Vending
Machine communicates with to approve Commuter’s request to perform payment using credit or
debit card. After the Commuter has provided their trip information, the Vending Machine will use
the Trip Information to calculate the price of the ticket, and send this over to the Payment
Information. The Payment Information will then compile this information with the payment type
and inform it back to the Vending Machine.
4. Z-Specification for PurchaseTickets
In the Z-Specification for PuchaseTickets we first define the actors and objects that are involved
inside the system, this includes the Vending Machine, Commuter and Bank for the Actors and
Trip Information and Payment Information for the objects.
We also define the types of data and assumed examples to be used in this Z-Specification.
The type Location has values locA, locB and locC to assume the possible locations that the
Commuter can access using the ticket. The type TicketType refers to the type of the ticket, which
can be either a monthly pass, a one-way ticket or a round trip ticket. The type PaymentMethod
indicates the ticket payment method which is either by cash, credit card or debit card.
The Commuter actor has several parameters which includes the inputs that it gives to the Vending
Machine. These inputs include :
The VendingMachine actor has two parameters, the displaytext parameter which defines the text
that is displayed on the vending machine screen and the tickettext parameter which defines what
is printed on the dispensed ticket. This actor communicates with the Bank to get approval of
Commuter’s payment method when Commuter chooses to pay using a credit or debit card.
The Bank actor has one parameter that defines the approval status of the user’s payment method.
It can be either approved or rejected.
Trip Information defines the information needed to calculate the ticket price while Payment
Information defines the information needed to inform the user and complete the ticket purchase.
After all of this has been defined, we can then write the Z-Specification for the methods that are
involved in the Purchase Tickets use case.
The Calculate method calculates the price of the tickets based on the information that has been
given by the Commuter. The price is then informed to Payment Informations.
The ReturnDetails method returns the payment value and the payment method information to the
VendingMachine for it to communicate with the bank for approval and to display the payment
details to the Commuter.
The PurchaseTickets method will then use all this information to allow Commuter to purchase
tickets from the Vending Machine. After the payment has been completed, the Vending Machine
will then dispense the tickets that has been purchased by the Commuter.