0% found this document useful (0 votes)
12 views22 pages

Group 4

The document provides an overview of Interaction Diagrams in software engineering, detailing their types (Sequence and Collaboration Diagrams), purposes, and notations. It also covers the implementation of these diagrams using tools like Rational Rose, as well as the process of mapping design to code and software testing fundamentals. Additionally, it discusses design patterns, software testing and quality assurance, and the importance of software evolution in maintaining and updating software systems.

Uploaded by

g47522128
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views22 pages

Group 4

The document provides an overview of Interaction Diagrams in software engineering, detailing their types (Sequence and Collaboration Diagrams), purposes, and notations. It also covers the implementation of these diagrams using tools like Rational Rose, as well as the process of mapping design to code and software testing fundamentals. Additionally, it discusses design patterns, software testing and quality assurance, and the importance of software evolution in maintaining and updating software systems.

Uploaded by

g47522128
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SOFTWARE ENGINEERING

Interaction Diagram

An Interaction Diagram is a type of UML (Unified Modeling Language) diagram that shows the interactions
between objects in a system.

q Types of Interaction Diagram


There are two main types of interaction diagrams
• Sequence Diagram
Sequence diagram shows the sequence of messages exchanged between objects in a system,
emphasizing the timing and order of events.

• Collaboration Diagram
Collaboration diagram shows the interactions between objects in a system, emphasizing the
relationships and roles of the objects involved.

These diagrams help software engineers design, analyze, and communicate the behavior of
complex systems.
q Purpose of Interaction Diagrams
The purpose of Interaction Diagrams is to:
§ Model system behavior: Show the dynamic behavior of a system.
§ Design system interactions: Design the interactions between objects in a system.
§ Analyze system performance: Analyze the performance of a system.

q Message
Communication between participant objects.
q Types of Messages
§ Synchronous messages
Represented by solid arrowheads, synchronous messages show that the sender
waits for a response.
§ Asynchronous messages
Represented by open arrowheads, asynchronous messages show that the
sender does not wait for a response.
q Interaction Diagram Notation
§ Rectangle: Represents an object.
§ Vertical line: Represents a lifeline.
§ Arrow: Represents a message.
§ Solid arrowhead: Represents a synchronous message.
§ Open arrowhead: Represents an asynchronous message.

q Where to Use Interaction Diagrams?


Interaction diagram is used to capture the dynamic behavior of a system. However, the specific
purpose is more important to clarify and understand. A single diagram is not sufficient to describe the
dynamic aspect of an entire system, so a set of diagrams are used to capture it as a whole.
Interaction diagrams are used when we want to understand the message flow and the structural
organization. Message flow means the sequence of control flow from one object to another.
Structural organization means the visual organization of the elements in a system.

Interaction diagrams can be used


• To model the flow of control by time sequence.
• To model the flow of control by structural organizations.
• For forward engineering.
• For reverse engineering.
Sequence Diagram

A sequence diagram is a type of interaction diagram that shows the sequence of events and
intractions between objects in a system. It is a graphical representation of the flow of messages,
events, or actions between objects over time.

Key Elements
• Objects: Represented by rectangles or boxes.
• Lifelines:Vertical dashed lines representing the objects' existence over time.
• Messages: Arrows showing the interactions between objects, labeled with message names and
parameters.
• Activation Bars: Rectangular bars on lifelines indicating when an object is active.

Purpose
• Visualize system behavior: Show the sequence of events and interactions between objects.
• Model complex systems: Break down complex systems into manageable parts.
• Improve communication: Enhance understanding among stakeholders.
Benefits
• Clarity: Provides a clear understanding of system behavior.
• Improved design: Helps identify potential issues and improve system design.
• Easier maintenance: Facilitates system evolution and updates.

Example
Collaboration Diagram

Collaboration diagram also known as a communication diagram. It is the type of interaction diagram that
shows the interactions between objects or components in a system.

Key Elements
• Objects: Represented by rectangles or boxes.
• Relationships: Shown as lines or arrows between objects.
• Interactions: Represented by messages or method calls between objects.

Purpose
• Model complex systems: Break down complex systems into manageable parts.
• Show object interactions: illustrate how objects collaborate to achieve a common goal.
• Improve system design: Enhance understanding of system behavior and interactions.
Benefits
• Clarity: Provides a clear understanding of system behavior and interactions.
• Improved design: Helps identify potential issues and improve system design.
• Easier maintenance: Facilitates system evolution and updates.
Example
Implementation of Sequence Diagram

Implementation of Sequence Diagram in Rational Rose:


§ Rational Rose is a software modeling tool that supports UML diagrams, including Sequence and
Collaboration Diagrams.
§ Creating Sequence Diagrams: In Rational Rose, you can create a Sequence Diagram by adding objects
and defining the sequence of messages between them, using lifelines and activation bars to represent the
flow.

q Steps for Creating a Sequence diagram


§ Open Rational Rose and select the project. Go to "Diagrams" > "Sequence Diagram" and click on "New
Sequence Diagram".
§ Add objects: Drag and drop objects (e.g., classes, actors) from the "Model Explorer" to the diagram.
§ Create messages: Right-click on an object and select "Create Message". Specify the message
name, type, and parameters.
§ Arrange messages: Drag and drop messages to arrange them in chronological order.
§ Add constraints and loops: Use the "Constraint" and "Loop" tools to add additional details.
Implementation of Collaboration Diagram
Following are the steps for creating a collaboration diagram
• Determine Behavior: Determine the behavior for which the realization and implementation are specified.
• Discover Structural Elements: Discover the structural elements that are class roles, objects, and
subsystems for performing the functionality of collaboration.
• Choose Interaction Context: Choose the context of an interaction: system, subsystem, use case, and
operation.
• Consider Alternative Situations: Think through alternative situations that may be involved.
• Implement Collaboration Diagram: Implementation of a collaboration diagram at an instance level,
if needed.
• Create Specification Level Diagram: A specification level diagram may be made in the instance
level sequence diagram for summarizing alternative situations.
q Steps for Creating a Collaboration diagram
§ Go to "Diagrams" > "Collaboration Diagram" and click on "New Collaboration Diagram".
§ Add objects: Drag and drop objects (e.g., classes, actors) from the "Model Explorer" to the diagram.
§ Create links: Right-click on an object and select "Create Link". Specify the link type and name.
§ Add messages: Right-click on a link and select “Create Message”. Specify the message name,
type, and parameters.
§ Arrange objects and links: Drag and drop objects and links to arrange them in a logical and
clear manner.
Design Class Diagram
A Design Class Diagram is a detailed and refined version of a Class Diagram, focusing on the design
aspects of the classes, including their structure, relationships, and interactions, with the purpose of guiding
the implementation of the system.
q Steps to Design a Class Diagram
• Identify the main classes in the system, including their attributes and operations.
• Define the attributes of each class, including their data types and relationships.
• Define the operations of each class, including their parameters and return types.
• Identify the relationships between classes, including inheritance.
Elements of a Class Diagram
• Class: A class represents a concept or an object in the system.
• Attribute: An attribute represents a characteristic or property of a class.
• Operation: An operation represents a method or function that can be performed on a class.
• Inheritance: Inheritance represents a relationship between two classes where one class inherits the
attributes and operations of another class.
• Association: Association represents a relationship between two classes where one class uses or
depends on another class.
• Composition: Composition represents a relationship between two classes where one class
contains or is composed of another class.
Example
Mapping design to code
Once the design class diagram complete, the next step is to map the design to actual code. Mapping design to
code is the process of translating software design models and diagrams into actual code, using programming
languages and development tools.

q Key Activities
• Translating Diagram: Convert class diagram into code structures by defining classes, attributes, and methods
as depicted in the diagrams.
• Establishing Connections: Implement relationship between classes as show in the design, such as
association, aggression, and inheritance.
• Encapsulation: Encapsulate properties and methods within classes, controlling access using access
modifiers( e.g: public, private etc).
• Inheritance: If the design includes inheritance relationships between classes, implement this using
inheritance in the programming language.
• Composition: If the design involves composition( i.e one class depend on another class) represent this
realtionship in the code by creating member variables of the appropriate type within the containing class.
• Interfaces abstract classes: Use interfaces and abstract classes to define common behavior shared
by multiple classes, enforcing consistency, enforced polymorphism.
q Techniques for Mapping classes to code
• Identify classes: Begin by identifying the classes from the design. Classes typically corresppond to
nouns in the problem domain.
• Define properties: For each class, define its properties or attributes and map them to data types in the
choosen programming language.
• Define Methods: Determine the behaviors of each class and define method signatured based on the
cllass’s reponsibility.
• Use of Collections: Implement one-to-many realtionships using collection classes (e.g: ArrayList in
Java) to manage groups of related objects.
• Code Generation Tools: Utilize tools that automate the code generation process from design models,
breducing manual effort and minimizing discrepancies.

q Basic Practices
• Maintain Consistency
• Follow design principles
• Testability
• Readability and Maintainaability
q Example

public class SaleLineItem


{
private int quantity;
private ProductDescription description;
public SaleLineItem(ProductDescription desc, int qty){.......}
public Money getSubtotal(){....}
}
Software Testing Fundamentals
Software Testing
Software testing is the process of evaluating a software product or system to identify defects, bugs,
and issues with the user experience, ensuring it meets the company's goals and user's needs.
q Technique’s of software testing
• Black-box testing
• White-box testing
q Black-box testing
Black-box testing in which the tester does not have the knowledge of coding. In this testing we only
check the functionality of the software that is input be pass and output the software produce.
q White-box testing
In white-box testing the tester has knowledge of coding and internal structure of exiting software
weather the internal structure is correct or not.

q Types of software testing


• Unit testing
Unit testing check independent or individual unit or module of the software.
• Integration testing
This testing will integrate all the modules one by one and check the
Compatibility issues (whether the module is compatible or not).
• System testing
In this testing we put the software in different environment and check whether the software is
compatible with new environment or not. Here the overall system testing will be performed by the tester.
• Regression testing
Regression testing is a type of software testing that ensures changes made to a software system have
not introduced new defects. It involves functional and non-functional tests to ensure that previously
developed and tested software still works after a change.
q Steps
• Identify the scope for testing.
• Create details to cover the required testing.
• Manage the data used for testing.
• Setting up the environment for testing including software, hardware and network.
• Running the test case and reporting the result.
• Reporting and tracking defects found during testing.
Design Patterns
Design patterns are reusable solutions to common problems in software design. They provide a proven
development paradigm to help developers create more maintainable, flexible, and scalable software
systems.

q Types of Design Patterns


1. Creational Patterns: Deal with object creation mechanisms.
2. Structural Patterns: Concerned with the composition of objects.
3. Behavioral Patterns: Focus on interactions between objects.

q Examples of Design Patterns


1. Singleton Pattern: Ensures a class has only one instance.
2. Factory Pattern: Provides a way to create objects without specifying the exact class.
3. Observer Pattern: Allows objects to notify other objects of changes.
q Benefits of Design Patterns
1. Improved Code Reusability: Reduces code duplication.
2. Increased Flexibility: Makes software more adaptable to change.
3. Enhanced Maintainability: Simplifies software maintenance and evolution.

q Common Design Patterns


1. MVC (Model-View-Controller): Separates concerns in user interfaces.
2. Repository Pattern: Abstracts data access and storage.
3. Decorator Pattern: Dynamically adds behavior to objects.

Software Testing and Quality Assurance (STQA)


Software Testing and Quality Assurance is the process of evaluating software to ensure it meets the
required standards, is free from defects, and satisfies user needs.

q Types of Software Testing


• Unit Testing: Testing individual units of code.
• Integration Testing: Testing interactions between units of code.
• System Testing: Testing the entire software system.
• Acceptance Testing: Testing to ensure the software meets user requirements.
q Quality Assurance (QA) Activities
• Test Planning: Defining the testing approach and scope.
• Test Case Development: Creating test cases to validate software functionality.
• Test Execution: Running tests and reporting defects.
• Defect Tracking: Managing and resolving defects found during testing.

q Benefits of STQA
• Improved Software Quality: Reduced defects and increased reliability.
• Reduced Maintenance Costs: Fewer defects mean less maintenance and support.
• Increased Customer Satisfaction: Software meets user needs and expectations.

q STQA Methodologies
• Agile Testing: Testing in an agile development environment.
• Test-Driven Development (TDD): Writing tests before writing code.
• Behavior-Driven Development (BDD): Focusing on software behavior and user experience.
Software Evolution

Software evolution refers to the process of modifying, updating, and maintaining existing software systems
to ensure they continue to meet the changing needs of users and stakeholders. It is used for Fixing bugs and
defects in the software. Modifying the software to adapt to changes in the requirements. Improving the
performance and efficiency of the software and take proactive measures to prevent future problems
q Software Evolution Activities
• Collecting and analyzing new requirements from stakeholders.
• Design and implement changes to the software.
• Testing and validating the changes to ensure they meet the requirements.
• Deploying the updated software and performing ongoing maintenance.

You might also like