Uploaded by Mahmud Jaman

Software Engineering Assignment: Analysis & CRC Models

advertisement
Final Term Assignment
Assignment No: 02
Assignment Name: Final Term Assignment
Course Code: CSE 321
Course Title: Software Engineering
Date Of Submission: 08.01.2025
Trimester : Fall 2024
SUBMITTED TO:
Shafayet Nur
Lecturer
Department of CSE
Port City International University
SUBMITTED BY:
Mahmud-Uj-Jaman
CSE028 07541(28th A)
B.Sc in CSE
Port City International University
1|Page
1. Describe the process of identifying and modeling analysis classes during
requirements modeling. Include in your response the various manifestations of
analysis classes, and provide examples of external entities, occurrences, and
structures that may be modeled as classes.
Answer:
Identifying and Modeling Analysis Classes
Identification and modeling of the analysis classes early in the development process are very
important activities. This is a shift from the understanding of what the system needs to do-that is,
the requirements-to the how it might be structured using object-oriented principles. Explanation
Process:
Understanding Requirements: Very important, and just the very beginning. Study the system
requirements documents, user stories, and other sources for understanding functionalities, data,
and interactions of systems. Pay close attention to the nouns because those very often suggest
possible classes.
Identify Candidate Classes: Extract candidate classes from the requirements. Keep an eye on the
following
Examples may include things from the real world that the system is supposed to represent and/or
manipulate, such as customer, product, and order; abstractions, such as sensor.
Abstraction, an abstract concept, or role - relevant to the system's domain, for instance: account,
transaction, user session. Events: something happens that initiates the performance of some
action or leads to some state change in a system-just use verb and noun combination here, such
as, message received, timer expired, and alert triggered, for instance.
Roles: collections of the various types of activities or responsibilities assigned to someone/thing
- perhaps even lists in administrator versus user.
Places: Locations where something exists or occurs, such as a server, network device, or
database.
Class Refinement: Once the candidate classes have been obtained, then it is time to refine these
classes through reviewing the following:
Remove Duplicate Classes: Remove or combine classes that depict the same thing.
Define Class Responsibilities: What does each class do? What data does it store?
2|Page
Identify Attributes: What data fields or characteristics does the class possess?
Identify Operations: What activities or procedures can a class perform?
Define Relationships: How are these classes associated with each other, for example, by
association, aggregation and inheritance?
Draw an Initial Model: It is the time to map the classes and relationships by drawing an initial
model. In this regard, UML class diagrams are always used.
Manifestations of Analysis Classes:
Analysis classes can take many forms depending upon their role with respect to the external
environment in which the system will operate. Some examples of such classes are being
described below.
External Entities: Classes that represent things outside the system with which the system
communicates.
Example Data Communication Context:
Sender: A device or system which transmits data.
Receiver: A device or system that receives data.
Network: This is the structure on which data is transmitted.
Database: This shows where the information shall be stored.
Occurrences: Classes that represent events, transitions or things that happen within the system.
Example Data Communication Context:
DataPacket: A discrete unit of data in transit.
ConnectionRequest: A request to initiate a data connection.
TransmissionError: An error that has occurred during the transmission of data.
TimeoutEvent: Event that occurred when a transmission is taking too long
Structures: Classes of things representing collections of data or the way data is organized.
Example - Data Communication Context:
MessageQueue: Data structure that holds messages for processing in first-in-first-out order.
RoutingTable: A data structure that maintains routes through a network.
ProtocolHeader: The first part of a network message containing the control information.
3|Page
DataBuffer: An area of storage used to temporarily hold data.
Classes for Examples of Entities, Occurrences and Structures : Data Communications
External Entity Example: In messaging, one may envision a Client as the external entity that
could send and also receive messages via the system. The Client Class may have such variables
as client_ID and networkaddress_P through methods such as send(message), receive(message),.
Example for occurrence: Typical of this would be PacketLoss. The ensuing attributes could have
a Time Stamp and packetID which would permit the system to search out such loss and
sometimes correct the same.
Example for Structural: Structural Example shall be FramBuffer. This would be typified with the
constituent Attributes as buffer-size and data and its Operations: writing the data; and read.
2.Discuss the role of CRC models in object-oriented analysis. What are the
key elements of a CRC model, and how does it help in organizing classes and
defining their responsibilities and collaborations in a system? Provide an
example to illustrate your answer.
Answer:
Role of CRC Models in Object-Oriented Analysis
CRC, or Class-Responsibility-Collaborator cards, is one of the easy but powerful techniques for
object-oriented analysis, mainly utilized during the initial design phase of the project.
Role:
Class Responsibilities: CRC cards help the developers brainstorm and define the responsibilities
each class should bear in the system.
Identification of Collaboration: They also help identify how classes interact with each other to
fulfill the system requirements.
4|Page
Facilitate Team Collaboration: They are a very good way that designers communicate to each
other and refine their understanding of the class structure.
Early Design Validation: They uncover flaws in a design and problems that are likely to arise in
the development of a system, which is cheaper to fix at these stages.
Key Elements of a CRC Model:
Class Name: The name of the class being modeled.
Responsibilities: Things that the class is responsible for doing. The responsibilities should be
highlevel and not describe how only what.
Collaborators: The other classes this class will interact with to fulfil its responsibilities.
How CRC Helps Organize Classes and Define Responsibilities/ Collaborations:
Create a Card Using each of the potential classes that was identified during analysis, create a
CRC card.
Brainstorm Responsibilities Take note on the card of what this class needs to do as a team.
Identify Collaborators As you are brainstorming, think about what other classes this class would
need to collaborate with in order to accomplish its responsibilities. Mark these on the card as
collaborators.
Role-Playing and Simulation: Act out scenarios to play out the interactions between objects. The
result of this may be to highlight missing responsibilities or collaborators thus helping further to
refine the class model.
Iteration: Based on the results of the simulation, refine the CRC cards.
Example: Data Packet Transmission System CRC Card
Suppose we are modelling a simplified data communication system. Following is an example
CRC card for a class DataPacket:
Class Name DataPacket
Responsibilities
Store payload(data) -Store sequence number -Store destination address
-Provide access to stored information
Collaborators
Sender, Receiver
Following is the CRC card for Sender class
Class Name
Sender
5|Page
Responsibilities
- Create DataPacket objects - Send the data packet via network handle transmission errors
Collaborators
DataPacket, Network
Following is CRC card for Receiver class
Class Name
RECEIVER
Responsibilities
Collaborators
- Receives the data packet - extracts payload -handle corrupted packet
DataPacket, Network
How This Example Helps
DataPacket: We have already decided that the role of DataPacket is to carry the actual data along
with addressing information. The limit above said bounds its responsibility to just carrying the
data.
Sender: It creates a data packet and sends it.
Receiver: 'Receiver' class will get the packet of data transmitted and it looks for the information.
Collaborations: We feel that DataPacket class used by both sender and receiver classes, and
Sender and Receiver both interact with network to send or receive data.
Benefits of Using CRC Cards
Simplicity: Easy to understand and handle even for a nontechnical stakeholder also.
Collaborative: It creates communication and allows brainstorming amongst the members.
Early Validation: The earlier the problems are detected, the more robustness in design.
Iterative: Refinement and adjustments can be made in the light of growing insight into the
system.
Download