Beruflich Dokumente
Kultur Dokumente
Role of Decomposition
• Divide and rule: Only a few parts need to be taken care of at a time.
• Ways of decomposing - Algorithmic and Object Oriented o Algorithmic Decomposition:
Process and steps are considered. Functional components are structurally designed
with their relationships. It mostly deal with “how” not “what”.
o Object Oriented Decomposition: Carries out the key abstraction in problem
domain by identifying objects from the vocabulary of the domain. It concerns
mainly with “what”; and all “how”s found in the vocabulary become operations of
related objects.
Role of Abstraction
• Multiple levels of abstraction exist. Also, different abstractions are possible from
several dimensions.
• When a higher level abstraction fails to succeed, we ignore inessential details and focus
on more generalised parts.
Role of Hierarchy
• By recognising the class and object hierarchies, the study of collaboration / interaction
in and among levels are made simpler.
• Discovery of common or dissimilar patterns of many objects are simplified once the
hierarchy is exposed and thus the identification of object behaviours too.
Software Complexity
• Software might be referred to as simple or complex - depending upon their
functionality and behaviour. Generally, industrial-strength software are more complex
than those developed individually or by amateur developers.
• Time and space are considered to be general complexities. Additionally, maintaining
integrity of hundreds of thousands of records while allowing concurrent updates and
queries; or managing command and control of real-world entities like air traffic are also
examples of complex systems.
Definition
In general, analysis emphasizes an investigation of the problem and requirements of the
domain, rather than a solution. Whereas, design emphasizes a conceptual solution that
fulfils the requirements, rather than its implementation.
In OO analysis, emphasis is given on finding and describing the objects or concepts in the
problem domain. But in OO design, emphasis is given on defining software objects and
their collaboration for fulfilling the requirements.
Attributes
• Description of classes and objects are attributes.
• Real life entities are described with words that indicate stable features (e.g. shape,
weight, colour, date or birth, name etc.) [Here, features = values of domain] Operations,
Methods, and Services
• Algorithms encapsulated in classes or objects, which process the data, are called
operations or methods or services, which are termed in conventional sense as
modules.
• Each operation represents one of the behaviours of a class or an object.
• Objects are designed in such a way to be able to get a stimulus (often called message)
upon receiving which they start to behave through operations.
Messages
• Objects interact through messages.
• A message has i) destination, ii) operation and iii) parameters.
• Messages tie an object-oriented system together.
case of graphtype:
If graphtype = linegraph then DrawLineGraph (data);
If graphtype = piegraph then DrawPieGraph (data);
If graphtype = xygraph then DrawXyGraph (data); If graphtype =
bargraph then DrawBarGraph (data); end case;
can be reduced to
graphtype draw
The OO Paradigm
It shows clear transition from design Not so clear transition from design
to implementation. to implementation.
DFD & E-R diagram model the data. Class diagram, sequence diagram,
state chart diagram, and use cases
all contribute.
What is Object Oriented Design? Explain the characteristics of object oriented design.
Object Oriented Design is the concept that forces programmers to plan out their code in order to
have a better flowing program. The origins of object oriented design is debated, but the first
languages that supported it included Simula and SmallTalk. The term did not become popular until
Grady Booch wrote the first paper titled Object-Oriented Design, in 1982.
Object Oriented Design is defined as a programming language that has 5 conceptual tools to aid
the programmer. These programs are often more readable than non-object oriented programs,
and debugging becomes easier with locality.
The 5 Basic Concepts of Object Oriented Design are the implementation level features that are
built into the programming language. These features are often referred to by these common
names:
Encapsulation
A tight coupling or association of data structures with the methods or functions that act on the
data. This is called a class, or object (an object is often the implementation of a class).
Data Protection
The ability to protect some components of the object from external entities. This is realized by
language keywords to enable a variable to be declared as private or protected to the owning class.
Inheritance
The ability for a class to extend or override functionality of another class. The so called child class
has a whole section that is the parent class and then it has it's own set of functions and data.
Interface
A definition of functions or methods, and their signatures that are available for use to manipulate
a given instance of an object.
Polymorphism
The ability to define different functions or classes as having the same name but taking different
data types.
Programming Concepts
There are several concepts that were derived from the new languages once they became popular.
The new standards that came around pushed on three major things:
Re-usability
The ability to reuse code for multiple applications. If a programmer has already written a power
function, then it should be written that any program can make a call to that function and it should
work exactly the same.
Privacy
This is important for large programs and preventing loss of data.
Documentation
The commenting of a program in mark up that will not be converted to machine code. This mark
up can be as long as the programmer wants, and allows for comprehensive information to be
passed on to new programmers. This is important for both the re-usability and the maintainability
of programs.
Q06. OOA and OOD are parallel activities. Explain.
Object–Oriented Analysis (OOA) is the procedure of identifying software engineering
requirements and developing software specifications in terms of a software system’s object
model, which comprises of interacting objects.
Object–Oriented Design (OOD) involves implementation of the conceptual model produced during
object-oriented analysis. In OOD, concepts in the analysis model, which are
technology−independent are mapped onto implementing classes and constraints are identified.
Also, interfaces are designed which results in a model for the solution domain. In short, detailed
description of how the system is to be built on concrete technologies is what OOD states.
Basically, they are both strongly interrelated as we first need analysis before we design a new
model.
During Analysis, we try to determine which objects we need and how to organize them. We also
need to know what they contain and how they behave when they interact with other objects.
During design, we take the analyzed objects and add constraints to make them fit within the
software and hardware that we are developing for. Suffice it to say, we are trying to adjust the
object model to fit within the technology that we use.
Analysis is the investigation of real-world concepts (actual objects, physical and conceptual - as
well as tasks done on these) in and around what we are trying to make.
While design is the task of mapping their relations to one another on how we are going to make
the system know about objects. It states how the objects are related to one another, or linked to
each other.
We really cannot do the design before we do the analysis. This is not just limited to software
development but nearly everything. Analysis plays vital role in designing. The more amount of time
we give to analysis, better the design will be. Analysis will help us remind what the factors that
influence the design are and hence we can design in the best way. Hence OOA and OOD are parallel
activities. Both must run hand in hand and existence of only one factor impacts the other.
7. Explain Solid Principles for class identification.
There are five principles regarding SOLID principles for class identification:-
SOLID stands for
S= Single Responsibility.
O= Open- closed.
L= Liskov Substitution.
I= Interface Segregation
D=Dependency Inversion
1. Single Responsibility Principle:-
- The Single Responsibility Principle (SRP) states: A class should have only one
responsibility.
- Everything in the class should be related to that single purpose, i.e. be cohesive. It does
not mean that classes should only contain one method or property.
- There can be a lot of members as long as they relate to the single responsibility. It may
be that when the one reason to change occurs, multiple members of the class may
need modification. It may also be that multiple classes will require updates.
2. Open-Closed Principle:-
- The Open-Closed Principle (OCP) states that classes should be open for extension but
closed for modification. “Open to extension” means that you should design your
classes so that new functionality can be added as new requirements are generated.
“Closed for modification” means that once you have developed a class you should
never modify it, except to correct bugs.
- These two parts of the principle appear to be contradictory. However, if you correctly
structure your classes and their dependencies, you can add functionality without
editing existing source code.
- Generally you achieve this by referring to abstractions for dependencies, such as
interfaces or abstract classes, rather than using concrete classes. Functionality can be
added by creating new classes that implement the interfaces.
- Applying OCP to your projects limits the need to change source code once it has been
written, tested and debugged. This reduces the risk of introducing new bugs to existing
code, leading to more robust software.
- There are two methods by which you can apply the open-closed principle. You can
apply this principle either through inheritance or through composition
Q08 Define class and object. Explain different types of relationships exhibited by classes.
An object is a self-contained component that contains properties and methods needed to make a
certain type of data useful. Objects are abstractions of real-world or system entities and manage
themselves. An object refers to a particular instance of a class, where the object can be a
combination of variables, functions, and data structures.
1. Inheritance:
It refers to a type of relationship wherein one associated class is a child of another by virtue
of assuming the same functionalities of the parent class. In other words, the child class is
a specific type of the parent class. To show inheritance in a UML diagram, a solid line from
the child class to the parent class is drawn using an unfilled arrowhead.
2. Aggregation
It refers to the formation of a particular class as a result of one class being aggregated or
built as a collection. For example, the class “library” is made up of one or more books,
among other materials. In aggregation, the contained classes are not strongly dependent
on the lifecycle of the container. In the same example, books will remain so even when the
library is dissolved. To show aggregation in a diagram, a line is drawn from the parent class
to the child class with a diamond shape near the parent class.
3. Dependency
A dependency indicates that an element on one end of the relationship, in some manner,
depends on the element on the other end of the relationship. This alerts the designer that
if one of these elements changes, there could be an impact to the other. a Cart class
depends on a Product class because the Cart class uses the Product class as a parameter
for an add operation so a change to the Product class might require a change to the Cart
class.
It is represented in classes diagram as dotted line with open arrow tip
Q9. What is UML? Explain significance of UML in system analysis and design.
Answer: The Unified Modeling Language (UML) is the primary modeling language used to analyze,
specify, and design software systems. Unified Modeling Language is a standardized modeling
language consisting of an integrated set of diagrams, developed to help system and software
developers for specifying, visualizing, constructing, and documenting the artifacts of software
systems, as well as for business modeling and other non-software systems. The UML represents a
collection of best engineering practices that have proven successful in the modeling of large and
complex systems. The UML is a very important part of developing object oriented software and
the software development process. The UML uses mostly graphical notations to express the design
of software projects. Using the UML helps project teams communicate, explore potential designs,
and validate the architectural design of the software. The UML toolset includes diagrams that
allow you to visualize the construction of an object-oriented system. Each design iteration takes a
successively more detailed look at the design of the system until the things and relationships in
the system are clearly and precisely defined in UML documents. UML is a powerful tool that can
greatly improve the quality of your systems analysis and design, and thereby help create higher-
quality information systems.
There are three basics steps where OO concepts are significant, applied and implemented. The
steps can be defined as below:
During object oriented analysis the most important significance is to identify objects and
describing them in proper way. If these objects are identified efficiently then the next job
of design is easy. The objects should be identified with responsibilities. Responsibilities are
the functions performed by the object. Each and every object has some type of
responsibilities to be performed. When these responsibilities are collaborated the purpose
of the system is fulfilled.
The second phase is object oriented design. During this phase emphasis is given upon the
requirements and their fulfillment. In this stage the objects are collaborated according to
their intended association. After the association is complete the design is also complete.
The third phase is object oriented implementation. In this phase the design is
implemented using object oriented languages like Java, C++, etc.
is a piece of information that is associated Class diagram for the ATM system's Withdraw Money use case
with a class. For example, the Account class
contains three attributes: Account Number, PIN, and Balance. The last section contains the
operations of the class. An operation is some behavior that the class will provide. The
Account class contains four operations: Open, Withdraw Funds, Deduct Funds, and Verify
Funds.
The lines connecting classes show the communication relationships between the classes.
For instance, the Account class is connected with the ATM Screen class because the two
directly communicate with each other. The Card Reader is not connected to the Cash
Dispenser because the two do not communicate. Another point of interest is that some
attributes and operations have small padlocks to the left of them. The padlock indicates
a private attribute or operation. Private attributes and operations can only be accessed
from within the class that contains them. The Account Number, PIN, and Balance are all
private attributes of the Account class. In addition, the Deduct Funds and Verify Funds
operations are private to the Account class.
Developers use Class diagrams to actually develop the classes. Tools such as Rose
generate skeletal code for classes, then developers flesh out the details in the language
of their choice. Analysts use Class diagrams to show the details of the system. Architects
also look at Class diagrams to see the design of the system. If one class contains too much
functionality, an architect can see this in the Class diagram and split out the functionality
into multiple classes. Should no relationship exist between classes that communicate
with each other, an architect or developer can see this too. Class diagrams should be
created to show the classes that work together in each use case, and comprehensive
diagrams containing whole systems or subsystems can be created as well.
Class diagram for the ATM system's Withdraw Money use case
The general domain analysis model can be structured into four main phases, each phase
constituted by different activities:
1. Domain Characterization and project planning: the first step of every domain analysis
method is a preparation activity, which aims to collect the minimum information
concerning the problem that allows to decide if it is worth to deal with it and try to solve
it, or if it is not feasible to go on with the process. The main activities that have to be
carried out during this phase are:
a. Business Analysis;
b. Feasibility Analysis;
c. Domain Description;
d. Project planning and resource allocation.
2. Data Analysis: the information necessary to the analysis are collected and organized,
then the analysis exploits domain commonalties and variations. The main activities
prescribed are:
a. Data Organization
b. Data Exploitation
3. Domain Modeling: the purpose of the modeling phase is to complete the previous
analysis step building suitable domain models of the domain, specifically:
a. Modeling commonalties aspects in the domain;
b. Refining domain models encapsulating variations possibilities;
c. Defining frameworks and general architecture for the domain;
d. Describing the rationale beneath domain models and tracing technical issue and
relative decisions made in the analysis and modeling process.
This phase can be considered the core activity aiming to produce reusable assets, such as
components, framework and architectures. The difference between domain modeling
and system modeling lies in the target chosen: for system modeling it is the specific
software system that has to be built, while for domain analysis it is a class of similar
systems in a specific application domain.
4. Evaluation: its purpose is to verify the results of each step of the domain analysis process,
identifying possible errors done in building the model, and to validate the results against
requirements and user expectations.
Class-Based Modeling
Class-based modeling identifies classes, attributes and relationships that the system will use. In
the airline application example, the traveler/user and the boarding pass represent classes. The
traveler's first and last name, and travel document type represent attributes, characteristics that
describe the traveler class. The relationship between traveler and boarding pass classes is that the
traveler must enter these details into the application in order to get the boarding pass, and that
the boarding pass contains this information along with other details like the flight departure gate,
seat number etc.
Class based modeling represents the object. The system manipulates the operations. The elements
of the class based model consist of classes and object, attributes, operations, class – responsibility
- collaborator (CRS) models.
The generic process described begins with guidelines for identifying potential analysis classes,
suggestions for defining attributes and operations for those classes, and a discussion of the Class-
Responsibility-Collaborator (CRC) model. The CRC card is used as the basis for developing a
network of objects that comprise the object-relationship model.
Explain scenario based modeling in domain analysis.
Ans: Scenario is a textual description of how a system behaves under a specific set of
circumstances. It also provides a basis for developing test cases and acceptance-level test plan.
Although the success of a computer-based system or product measured in many ways, user
satisfaction resides at the top of the list. If you understand how end user want to interact with a
system, your software team will be better able to properly characteristics requirements and build
meaningful analysis and design models. Hence requirement modeling with UML begins with the
creation of scenarios in the form of use case, activity diagram.
Scenario-based modeling
Use case
Activity diagrams
Use-case diagrams:
A use-case diagram is usually simple diagram which only summarize some of the relationship
between use-case, actor and systems. It does not show the detail of the use-case.
Scenario based modeling.
1. Creating a preliminary use case.
2. Refining a preliminary use case.
3. Writing a formal use case.
It is effective to use the first person "I" to describe how the actor interacts with the software
format of the text part of a use case.
Use-case title:
Actor:
Description:
Example: use-case diagram.
Activity Diagrams:
An activity diagram is essentially a flowchart that shows activities performed by a system. Or it
shows the graphical representation of the flow of interaction within a specific scenario.
Uses flowchart-like symbols
As in class diagram, the top part represents identifier which identifies each agent in multi-agent
system. Next is role which defines the behavior of an agent into the society (e.g. Seller/buyer).
Organization defines the relationships between the roles. Beside these agent composes of
capability which specifies what an agent is able to do and under what conditions. Service which
describes an activity that an agent can perform and is provided to other agent.
Capability can be further broken down into following parts:
Input: What the agent must receive in input to achieve it task
Output: What the capability generates as a result of the work
Input constraints: Constraints that are expected to hold in the situation before the action
specified by the capability can be performed.
Output constraints: Constraints that are expected to hold in the situation after the action
specified by the capability has been preformed
Input-output constraints: Constraints that must hold across input and output situations
Description: A description in natural language of the capability
Maintainability Correctness
Software should be maintainable. If some area Correctness is the degree to which software
of software get defect, working of other ports performs its specified function.
should not be distributed too much. It should
have good fault tolerance.
Flexibility Usability
allows required modifications at the - It should be easy and comfort to
appropriate locations to be made without operate or use
undesirable side effects
Portability Efficiency
A software system can be said to be portable if It is an ability of a software system to fulfill its
the effort required for porting it proves purpose with the best possible utilization of
significantly less than the effort necessary for a all necessary resources like time, storage,
new implementation. transmission channels, and peripherals.
Reusability Reliability
All or part of the software should be reusable in software should be able to maintain its
other development too. performance level under given conditions.
Testability: Integrity
It is the degree to which a software artifact Unauthorized access to the components of
supports testing in a given test context software should be controlled.
Understandability Adaptability
Source code should be understandable to the Functions should be normal in any
developers because it may influence the cost, environment
reusability and maintainability of the software.
Readability Accuracy
Non-understandable software has poor Output should be errorless.
consistency and good design makes a software
understandable.
Concision : Robustness:
Any exception raised during execution in
Source code should not be suffered from initial state should be caught by some
duplication exception handler
<<agent>> sum <<capability>> addition
Role
Input
addition, subtraction
x,y:Integer
rd 1
Organization Output
calculator s:Integer
Protocol Description
enter-society, exit-society This capability makes the sum of two
compute integers and returns an integer
<<capability>> subtraction
<<service>> computation
Input
Description x,y:Integer
This service makes an addition when
Output
requested by the request addition
d:Integer
protocol and makes a subtraction when
requested by the request-subtraction Input Constraint
protocol x>=0, y>=0
Type Input-Output Constraint
computation x-y >=0
Description
Protocol
This capability makes the difference
request-addition
of two integers and returns an
request-subtraction
integer
WMC ci
Depth of the Inheritance Tree (DIT): The maximum length from a leaf to the root
of the tree. Large DIT leads to greater design complexity but promotes reuse
Number of Children (NOC): Total number of children for each class. Large NOC
may dilute abstraction and increase testing
OO Metrics
Coupling:
Coupling between Object Classes (COB): Total number of collaborations listed for
each class in CRC cards. Keep COB low because high values complicate
modification and testing
Response For a Class (RFC): Set of methods potentially executed in response to a
message received by a class. High RFC implies test and design complexity
Cohesion:
Lack of Cohesion in Methods (LCOM): Number of methods in a class that access
one or more of the same attributes. High LCOM means tightly coupled methods
Inheritance:
AIF- Attribute Inheritance Factor:
– Ratio of the sum of inherited attributes in all classes of the system to the total number
of attributes for all classes.
TC= total number of classes , Ad (Ci) = number of attribute declared in a class, Ai (Ci) =
number of attribute inherited in a class
MIF- Method Inheritance Factor:
– Ratio of the sum of inherited methods in all classes of the system to the total number
of methods for all classes.
TC= total number of classes, Md(Ci)= the number of methods declared in a class, Mi(Ci)=
the number of methods inherited in a class
The user has a valid ATM card. The user has accessed the ATM by placing his ATM card in the
machine
Post Condition
Prototype is a working model of software with some limited functionality. The prototype does
not always hold the exact logic used in the actual software application and is an extra effort to be
considered under effort estimation.
Prototyping is used to allow the users evaluate developer proposals and try them out before
implementation. It also helps understand the requirements which are user specific and may not
have been considered by the developer during product design.
Evolutionary Prototyping
Evolutionary prototyping also called as breadboard prototyping is based on building actual
functional prototypes with minimal functionality in the beginning. The prototype developed
forms the heart of the future prototypes on top of which the entire system is built. By using
evolutionary prototyping, the well-understood requirements are included in the prototype and
the requirements are added as and when they are understood.
Incremental Prototyping
Incremental prototyping refers to building multiple functional prototypes of the various sub-
systems and then integrating all the available prototypes to form a complete system.
Extreme Prototyping
Extreme prototyping is used in the web development domain. It consists of three sequential
phases. First, a basic prototype with all the existing pages is presented in the HTML format. Then
the data processing is simulated using a prototype services layer. Finally, the services are
implemented and integrated to the final prototype. This process is called Extreme Prototyping
used to draw attention to the second phase of the process, where a fully functional UI is
developed with very little regard to the actual services.
State of the
artdemonstrations
It’s useful for exploratory programming, such as Artificial Intelligence applications, where it is
difficult to frame specifications.
If big problems are anticipated, developers can stop development after several iterations.
This model is very suitable for research projects. For example, in order to develop software for
automatic speech recognition, it is possible to take a small vocabulary and develop a system.
After successful, you can gradually increase your vocabulary. This approach is superior to starting
the development of an unlimited vocabulary speech recognition system directly (I recognize it is
very difficult in two years).
Disadvantages of Evolutionary Development Model
Verification Validation
It can catch errors that validation cannot It can catch errors that verification
catch. It is low level exercise. cannot catch. It is High Level Exercise.
2. Model-based testing strategy: This strategy tests the functionality of the software according
to the real world scenario (like software functioning in an organization). It recognizes the
domain of data and selects suitable test cases according to the probability of errors in that
domain.
3. Methodical testing strategy: It tests the functions and status of software according to the
checklist, which is based on user requirements. This strategy is also used to test the
functionality, reliability, usability, and performance of the software.
5. Dynamic testing strategy: This tests the software after having a collective decision of the
testing team. Along with testing, this strategy provides information about the software
such as test cases used for testing the errors present in it.
6. Philosophical testing strategy: It tests the software assuming that any component of the
software can stop functioning anytime. It takes help from software developers, users and
systems analysts to test the software.