Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

Q1.

What other formal specification methods are mentioned in this research


paper in addition to Z Language.

Ans. The research paper mentions several other formal specification methods in
addition to Z Language. The mentioned formal specification methods are as
follows:

1. Z Language: The primary focus of the paper is on Z Language. It is


highlighted as a formal specification language used for describing and
modeling computing systems.

2. B Method: B Method is one of the formal specification methods compared


in the paper. The comparison is done by designing a particular part of the
ABM system using each method.

3. UML (Unified Modeling Language): UML is a graphical modeling language


often used in software engineering for visualizing, specifying, constructing,
and documenting software systems. The paper mentions UML in the
context of presenting the scenario of the inventory system through use
case and class diagrams.

4. LOTOS (Language Of Temporal Ordering Specification): LOTOS is another


formal specification method discussed in the paper. The comparison
includes designing a part of the ABM system using LOTOS.

5. SDL (Specification and Description Language): SDL is also considered in the


comparison of formal specification methods. The paper discusses
similarities and differences among the formal specification methods,
including SDL.

Q2. Name all the classes defined for the inventory system?

1. User: This class handles user-related operations such as login, update


account information, and potentially granting access to different
functionality based on user roles.
2. Order: This class manages all aspects of customer orders, including placing
new orders, updating existing orders, generating invoices, and calculating
total order amount.

3. Product: This class deals with information about the items stocked in the
inventory system, including updating stock levels, checking stock
availability, and providing details like product name, price, and quantity.

Q3. Name all the functions defined for each class?

Here are the functions defined for each class in the inventory system, as
described in the research paper:

User Class:

 Login: Authenticates a user based on entered username and password.

 UpdateAcc: Updates existing user account information, such as password.

Order Class:

 NewOrder: Places a new customer order, creating a new order record.

 UpdateOrder: Modifies details of an existing customer order.

 GenerateInvoice: Creates an invoice for a specific order.

 CalculateTotal: Determines the total cost of an order, likely based on


quantity and price of items.

Product Class:

 UpdateStock: Adjusts the quantity of a product in stock, reflecting changes


due to sales or replenishment.
 CheckStock: Verifies the availability of a product based on its current stock

quantity.

Q4. Name all the attributes defined in each class?

User Class:

 Username: Unique identifier for each user.


 Password: Securely stored credentials for authentication.

Order Class:

 OrderID: Unique identifier for each order.


 OrderDetails: Specific items and quantities included in the order.
 CustName: Name of the customer who placed the order.
 Qtty: Total quantity of items in the order.
 OrderDate: Date and time the order was placed.
 ProductID: Reference to the product or products associated with the order.

Product Class:

 ProdID: Unique identifier for each product.


 ProdName: Name of the product.
 StockQtty: Current quantity of the product available in stock.
 Price: Price per unit of the product.

Q5. Define/create state schema for class “User” using Z word Tool?
Creating a complete state schema for the "User" class using a Z tool typically
involves specifying the state variables, the initial state, and the operations that
can change the state. In this case, the "User" class is associated with the
attributes Username and Password, and there are two operations: Login and
UpdateAcc.
Q6. Which operation schemas are defined for class “User”?

For the "User" class, two operation schemas are defined based on the information
provided in the research paper:

1. Login Operation Schema:

 Schema Name: Login

 Input Parameters: username?, password?

 Output Parameters: Response!

 Preconditions:

 username? is not in the domain of the current usernames.

 username? is not an empty string.

 password? is not an empty string.

 Postconditions:

 If the login is successful (Response! = Success), update the


state with the new username and password.

 If the login fails (Response! = Failed), maintain the current


state.

2. UpdateAcc Operation Schema:

 Schema Name: UpdateAcc

 Input Parameters: username?, password?

 Output Parameters: Response!

 Preconditions:

 username? is in the domain of the current usernames.


 username? is not an empty string.

 password? is not an empty string.

 Postconditions:

 If the update is successful (Response! = Success), update the


state with the new password.

 If the update fails (Response! = Failed), maintain the current


state.

These operation schemas define the behavior of the corresponding operations


associated with the "User" class. They include preconditions that must be satisfied
before the operation can be executed and postconditions that describe the
expected state changes based on the success or failure of the operation.

Q7. Which input variables are used in all schemas?

Based on the provided information and the example Z schemas for the "User"
class, the following input variables are used in the operation schemas:

1. Login Operation Schema:

 Input Variables:

 username?

 password?

2. UpdateAcc Operation Schema:

 Input Variables:

 username?

 password?
Q8. Which output variables are used in all schemas?

Based on the provided information and the example Z schemas for the "User"
class, the following output variables are used in the operation schemas:

1. Login Operation Schema:

 Output Variable:

 Response!

2. UpdateAcc Operation Schema:

 Output Variable:

 Response!

These output variables represent the values that are produced as output by the
respective operations. In both schemas, the operations produce a response
indicating whether the operation was successful or not. The output variable
Response! is used to capture this information. The postconditions in the schemas
describe how the response variable is updated based on the success or failure of
the operations.

Q9. Which schema represent query operation and what is it used for?

In the provided information and Z schemas for the "User" class, there isn't a
specific schema identified as a query operation. Query operations in formal
specifications are typically used to retrieve information from the system without
causing any state changes. Queries are read-only operations that provide insight
into the current state of the system.
However, in the provided Z schemas, the operations such as "Login" and
"UpdateAcc" are more indicative of actions that may cause state changes,
particularly when dealing with user authentication and account updates.

If you are looking to represent a query operation for the "User" class, you might
consider introducing a schema that retrieves information without modifying the
state. For example, a query operation to retrieve user details might look like:

Q10. Write in a paragraph in your own words , what is the purpose of this
research paper? What does author want to do?

The purpose of this research paper is to explore the application of formal


methods, particularly the Z language, in specifying and designing an inventory
system. The authors aim to address the inherent ambiguity in natural language
specifications by employing mathematical notations for precise requirements
expression. By focusing on formal specification, the paper seeks to enhance
software reliability in the development process. The research presents a case
study of an inventory system, introducing Unified Modeling Language (UML)
diagrams to represent the system's scenario. The authors then transition from
UML to Z language, offering formal specifications and Z schemas based on the
UML representations. Through this process, they emphasize the consistency
between UML and Z specifications, highlighting how the Z schema can contribute
to improving system reliability and reducing defects during development. Overall,
the research aims to showcase the effectiveness of formal methods, specifically
the Z language, in providing a rigorous and unambiguous foundation for the
design and development of reliable software systems.
Part B
: Q 1: Convert Following Finite State Machine into its equivalent Transition Table

INPUT CURRENT STATE NEXT STATE


a S1 S2
a S2 S2
c S2 S4
d S4 S3
b S3 S4
d S4 S3
a S3 S1

You might also like