|
Requirements Examples
[Previous]  [Next] 
|
![]() |
User Manual [Previous]  [Next] Requirements ExamplesExamples of requirements documents in Umple that can be used to generate code This page provides some examples of Umple requirements specified using plain text. They show possible styles for specifying requirements. They can be used to guide you to specify requirements in Umple before manually creating a model, or to use UmpleOnline AI capabilities to generate actual Umple code. Hotel booking requirements for creating class diagrams or state machines
// The following is a (partial) set of requirements for
// a hotel booking that can be used to experiment
// with generating class diagrams and state machines in Umple // using AI,
// or merely as an example of how requirements can be
// specified in Umple.=
// Req H008 was used in the following thesis by Parva Pathak
// https://ruor.uottawa.ca/items/b3679a91-5445-45ce-b289-bfddba3010f6
req H001 {
The hotel chain keeps a list of hotels in the system, each
with their address and set of rooms
}
req H002 {
There can be various types of rooms, characterized by
quality of the view (Number of guests allowed, Excellent,
good, poor), Number of Queen beds, Number of King beds,
Number of Single beds., whether there is a safe, whether
there is a pullout couch, and whether it is a suite such
that the bedroom is behind a separate door)
}
req H003 {
Each type of room is given a price that will be advertised
for it for each day. Prices are set up 9 months in
advanced, but can be changed dynamically.
}
req H004 {
Each room has a type.
}
req H005 {
On any given day (overnight from one night to the following
morning), each room can be either available, allocated to a
guest, or unavailable due to maintenance.
}
req H006 {
When a room is booked, the price each day for the booking
is confirmed (it will be the room-type price, or less if
discounts are given).
}
req H007 {
A booking has a start date, an end date, a number of adults and a number of children.
}
req H008 {
The hotel runs a system that allows users to book rooms online, providing the following operations:
{
The user can optionally login to the hotel website
The user can choose a location
The user can choose a hotel
The user can choose the number of guests
The user can choose the date range of the visit
The user can choose a room type
The user can pay for the hotel
The user can cancel the booking
}
}
Load the above code into UmpleOnline Drivers license system requirements for creating class diagrams or state machines
// The following is a (partial) set of requirements for
// the process of getting a driver's license in Ontario,
// Canada.
// It can be used for generating state machines in Umple
// using AI,
// or merely as an example of how requirements can be
// specified in Umple.=
// Requirements 1-8 were used in the following thesis by
// Parva Pathak
// https://ruor.uottawa.ca/items/b3679a91-5445-45ce-b289-bfddba3010f6
// It has been extended to also add knowledge for generating
// a class diagram
req L01-LicenseTypes {
The user can have no license, a G1 license, a G2 license or
a G license
}
req L02-G1Test {
To get a G1, a test must be complete
}
req L03-G2Test {
To get a G2, the user must have a G1 and a test must be
completed
}
req L04-GTest {
To get a G, the user must have a G2 and a test must be
completed
}
req L05-Expiry {
Each type of license can expire.
}
req L06-nonrenewG1orG2 {
If a G1 or G2 expires then the license is lost
}
req L07-renewG {
If a G expires it can be renewed
}
req L08-suspension {
Each type of license can be suspended
}
req L09-licensedata {
A license has a licences number and an issued date
}
req L11-holderdata-{
The system will keep the following information about the
holder of a license: Name, Date of Birth, Address
}
req L12-testdata {
The system will keep track of the tests of each license
holder or applicant (who has not yet passed a test), along
with the score on each test.
}
Load the above code into UmpleOnline Blackjack game requirements for state machine generation
// The following is a (partial) set of requirements for
// the card game Blackjack, that can be used to experiment
// with generating state machines in Umple using AI,
// or merely as an example of how requirements can be
// specified in Umple.
// It was used in the following thesis by Parva Pathak
// https://ruor.uottawa.ca/items/b3679a91-5445-45ce-b289-bfddba3010f6
req 001dealing {The player and dealer will be dealt cards}
req 002playerchoice {The player can choose to hit or stand}
req 003dealerchoice {The dealer can choose to hit or stand}
req 004dealerwin {If dealer gets a blackjack the dealer wins}
req 005playermaywin {If the player stands and the dealer has
a lower score the player wins}
req 006dealermaywin {If the player stands and the dealer has
a higher score the dealer wins}
req 007samescoremore {If the dealer and player have the same
score the game will push}
Load the above code into UmpleOnline Very simple credit card approval partial requirements
// The following is a (partial) set of requirements for
// a credit card approval system that can be used to
// experiment
// with generating state machines in Umple using AI,
// or merely as an example of how requirements can be
// specified in Umple.=
// It was used in the following thesis by Parva Pathak
// https://ruor.uottawa.ca/items/b3679a91-5445-45ce-b289-bfddba3010f6
req CC1 {
The different stages of the approval process must be
included (Pre Approval, Cancelled, Complete, Failed)
}
req CC2 {
The status of the account must be included
(On Hold, Not On Hold)
}
req CC3 {
The transaction can be successful or fail
}
Load the above code into UmpleOnline |