Unit 5 Ooad 2020
Unit 5 Ooad 2020
Unit 5 Ooad 2020
SUBJECT CODE: CS8592 SUBJECT NAME: OBJECT ORIENTED ANALYSIS AND DESIGN
UNIT V - TESTING
Object Oriented Methodologies – Software Quality Assurance – Impact of object orientation on Testing –
Develop Test Cases and Test Plans
PART – A
4) What are the phases of Rumbaugh OMT? Briefly explain each one of them. (May 2008) (May 2012)
The different phases of OMT are: LJ\
a) Analysis: This results in the object and dynamic and functional models. The object model describes the structure of
objects in a system and is represented by means of an object diagram.
The dynamic model is going to be a detailed state transition diagram. The diagram is going to be a set of states
receiving events so as to make transitions. The functional model is a representation of flow of data between different
processes in a business. The process is any function being performed, data flow shows the direction of data element
movement, data store is location of the data storage; an external entity is a source or destination of data element.
b) System Design: The results are a structure of the basic architecture of the system along with high-level strategy
decisions.
c) Object Design: The phase produces a detailed design document of all the models.
d) Implementation: This phase produces a comprehensive code for the problem.
6). briefly describe the Booch system development process. .[May 2016].[Dec 2015]
It helps us design the system using the object paradigm. It covers the analysis and design phases of
a system. It includes a macro and a micro development process. Macro development process is concerned
with the technical management of the system. It includes
a) Conceptualization where the core requirements of the system are outlined
b) Analysis and the development model which focuses on the class diagrams,
c) Design or creation of the computer architecture to establish relationships between the' classes
d) Evolution or implementation to produce a code and
e) Maintenance to add new requirements and to eliminate the bugs.
Each macro development process has its own micro development process which aims at
a) Identifying class and objects
b) Identifying class and object semantics.
c) Identifying class and object relationships
d) Identifying class and object interfaces and implementation
7) What is a use case? What are some of the ways that use cases can be described? (Nov 2007)
Use Case is a scenario depicting a user system interaction. It begins with the user of the system issuing a sequence
of interrelated events. Use cases are described as:
a) Nonformal text with no clear flow of events.
b) Text, easy to read but with a clear flow of events.
c) Formal style using pseudo code.
9) What do you mean by difference between patterns and frameworks? (May 2007) (May 2010) (Nov 2010)
A pattern is instructive information that captures the essential structure and insight of a successfully family of
proven solutions to a recurring problem that arises within certain context and system of forces. Pattern solves a
problem, is a proven concept, describes relationships, and has significant human component.
A framework is a way of presenting a generic solution to a problem that can be applied to all levels in a
development. It represents a set of classes that make up a reusable design for a specific class of software. It partitions the
design into abstract classes and also defines relationships between them. They emphasize design reuse over code reuse.
15) What are the kinds of errors you might encounter when you run your program?
1. Language Errors:
It results from incorrectly constructed code, such as an incorrectly typed keyword or some necessary punctuation
omitted. These are easiest types of errors.
2. Run time errors:
They occur and are detected as the program is running, when a statement attempts an operation that is
impossible to carry out.
3. Logic errors:
When codes do not perform the way you intended. The code might be syntactically valid and run without
performing any invalid operations and yet produce incorrect results.
23) List the guidelines for developing quality assurance test cases.
Freedman and Thomas have developed guidelines that have been adopted for the UA:
Describe which feature or service your test attempts to cover.
If the test case is based on a use case, it is good idea to refer to the use-case name.
Specify what you are testing and which particular feature.
Test the normal use of the object methods.
Test the abnormal but reasonable use of the objects methods.
Test the boundary conditions.
Test objects interactions and the messages sent among them.
Attempting to reach agreement on answers generally will raise other what-if questions.
The internal quality of the software, such as its reusability and extensibility, should be assessed as
well.
28) What are the kinds of errors you might encounter when you run your program?
1. Language Errors:
2. Run time errors:
3. Logic errors:
29) Define Error based testing
Error based testing techniques search a given class’s method for particular clues of interests, and then
describe how these clues should be tested.
1. Analysis. The results are objects and dynamic and functional models.
2. System design. The results are a structure of the basic architecture of the system along
with high-level strategy decisions.
3. Object design. This phase produces a design document, consisting of detailed objects
static, dynamic, and functional models.
4. Implementation. This activity produces reusable, extendible, and robust code. OMT
separates modeling into three different parts:
1. An object model, presented by the object model and the data dictionary.
2. A dynamic model, presented by the state diagrams and event flow diagrams.
3. A functional model, presented by data flow and constraints.
2. Give detailed notes about the Booch Methodology? (May 2007) (Nov 2007) (Nov 2010) (Nov
2013)[Dec 2015]
The Booch methodology is a widely used object-oriented method that helps you design your system
using the object paradigm. It covers the analysis and design phases of an object oriented system. Booch
sometimes is criticized for his large set of symbols. Even though Booch defines a lot of symbols to
document almost every design decision, if you work with his method, you will notice that you never use
all these symbols and diagrams. You start with class and object diagrams in the analysis phase and refine
these diagrams in various steps. Only when you are ready to generate code, do you add design
symbols and this is where the Booch method shines, you can document your object-oriented code. The
Booch method consists of the following diagrams:
Class diagrams
Object diagrams
State transition diagrams
Module diagrams
Process diagrams
Interaction diagrams
The Booch methodology prescribes a macro development process and a micro
Development process.
1. Conceptualization. During conceptualization, you establish the core requirements of the system. You
establish a set of goals and develop a prototype to prove the concept.
2. Analysis and development of the model. In this step, you use the class diagram to describe the roles and
responsibilities objects are to carry out in performing the desired behavior of the system. Then, you
use the object diagram to describe the desired behavior of the system in terms of scenarios or,
alternatively, use the interaction diagram to describe behavior of the system in terms of scenarios.
3. Design or create the system architecture. In the design phase, you use the class diagram to
decide what classes exist and how they relate to each other. Next, you use the object diagram to decide
what mechanisms are used to regulate how objects collaborate. Then, you use the module diagram
to map out where each class and object should be declared. Finally, you use the process
diagram to determine to which processor to allocate a process. Also, determine the schedules for
multiple processes on each relevant processor.
4. Evolution or implementation. Successively refine the system through many iterations. Produce a stream
of software implementations (or executable releases), each of which is a refinement of the prior one.
5. Maintenance. Make localized changes to the system to add new requirements and eliminate
bugs.
3. Give a detailed account of Jacobson methodology? (May 2013) (Nov 2013)[Dec 2015]
The Jacobson et al. methodologies (e.g., object-oriented Business Engineering (OOBE), object-
oriented Software Engineering (OOSE), and Objectory cover the entire life cycle and stress traceability
between the different phases, both forward and backward. This traceability enables reuse of analysis
and design work, possibly much bigger factors in the reduction of development time than reuse of code.
(1) Use Cases
Use cases are scenarios for understanding system requirements. A use case is an interaction between
users and a system. The use-case model captures the goal of the user and the responsibility of the system to its
users. In the requirements analysis, the use cases are described as one of the following :
Non formal text with no clear flow of events.
Text, easy to read but with a clear flow of events to follow (this is a recommended style).
Formal style using pseudo code - The use case description must contain
How and when the use case begins and ends.
The interaction between the use case and its actors, including when the interaction occurs
and what is exchanged.
How and when the use case will need data stored in the system or will store data in the
system.
Exceptions to the flow of events.
How and when concepts of the problem domain are handled.
Use cases could be viewed as concrete or abstract. An abstract use case is not complete and has no actors
that initiate it but is used by another use case. This inheritance could be used in several levels. Abstract use
cases also are the ones that have uses or extends relationships.
The main idea behind using patterns is to provide documentation to help categorize and
communicate about solutions to recurring problems. The pattern has a name to facilitate discussion and
the information it represents.
A pattern involves a general description of a solution to a recurring problem bundle with various
goals and constraints. a good pattern will do the following:
It solves a problem - Patterns capture solutions, not just abstract principles or strategies.
It is a proven concept - Patterns capture solutions with a track record, not theories or
speculation.
The solution is not obvious - The best patterns generate a solution to a problem indirectly-a necessary
approach for the most difficult problems of design.
It describes a relationship - Patterns do not just describe modules, but describe deeper
system structures and mechanisms.
The pattern has a significant human component - All software serves human comfort or
quality of life; the best patterns explicitly appeal to aesthetics and utility.
Patterns Template –
Every pattern must be expressed "in the form of a rule [template] which establishes a
relationship between a context, a system of forces which arises in that context, and a configuration,
which allows these forces to resolve themselves in that context" .
Name - A meaningful name. This allows us to use a single word or short phrase to refer to the pattern and the
knowledge and structure it describes. Good pattern names form a vocabulary for discussing conceptual
abstractions. Sometimes, a pattern may have more than one commonly used or recognizable name in the
literature.
Problem - A statement of the problem that describes its intent: the goals and objectives it wants to reach
within the given context and forces.
Forces - A description of the relevant forces and constraints and how they interact or conflict with
one another and with the goals we wish to achieve (perhaps with some indication of their priorities).
A concrete scenario that serves as the motivation for the pattern frequently is employed.
Solution - Static relationships and dynamic rules describing how to realize the desired outcome. This
often is equivalent to giving instructions that describe how to construct the necessary products. The
description may encompass pictures, diagrams, and prose that identify the pattern's structure, its
participants, and their collaborations, to show how the problem is solved.
Examples - One or more sample applications of the pattern that illustrate a specific initial context; how the
pattern is applied to and transforms that context; and the resulting context left in its wake. Examples
help the reader understand the pattern's use and applicability.
Resulting context - It describes the post conditions and side effects of the pattern. This is sometimes
called a resolution of forces because it describes which forces have been resolved, which ones remain
unresolved, and which patterns may now be applicable.
Related patterns - The static and dynamic relationships between this pattern and others within the same pattern
language or system. Related patterns often share common forces. They also frequently have an initial or
resulting context that is compatible with the resulting or initial context of another pattern.
Antipatterns
A pattern represents a "best practice," whereas an antipattern represents "worst practice" or a "lesson
learned." Anti patterns come in two varieties:
Anti patterns are valuable because often it is just as important to see and understand bad solutions as to see and
understand good ones.
Frameworks - A framework is a way of presenting a generic solution to a problem that can be applied to all
levels in a development . However, design and software frameworks are the most popular. A framework is a set
of cooperating classes that make up a reusable design for a specific class of software. A framework provides
architectural guidance by partitioning the design into abstract classes and defining their responsibilities
and collaborations. the major differences between design patterns and frameworks as
follows:
Design patterns are more abstract than frameworks - Frameworks can be embodied in code, but only
examples of patterns can be embodied in code. A strength of frameworks is that they can be written down
in programming languages and not only studied but executed and reused directly. In contrast, design
patterns have to be implemented each time they are used. Design patterns also explain the intent, trade-offs,
and consequences of a design.
Design patterns are smaller architectural elements than frameworks - A typical framework contains
several design patterns but the reverse is never true.
Design patterns are less specialized than frameworks - Frameworks always have a particular
application domain. In contrast, design patterns can be used in nearly any kind of application. While more
specialized design patterns are certainly possible, even these would not dictate an application architecture.
The Business Layer - The business layer contains all the objects that represent the business (both data and
behavior). This is where the real objects such as Order, Customer, Line item, Inventory, and Invoice exist.
Most modem object oriented analysis and design methodologies are generated toward identifying these kinds of
objects.
The Data access details - Business objects also should have no special knowledge of "where they come
from." It does not matter to the business model whether the data are stored and retrieved via SQL or file
I/O.
The User Interface (View) Layer - The user interface layer consists of objects with which the user
interacts as well as the objects needed to manage or control the interface. The user interface layer also
is called the view layer. The responsibilities are
Responding to user interaction
Displaying business objects
Software Quality is the "Conformance to explicit stated functional and performance requirements,
explicitly documented development standards, and implicit characteristics• that are expected of all
professionally developed software".
Software Quality is a complex mix of factors that will vary across different applications and the customers who
request them.
The degree to which a system, component or process specified requirements and meet customer or user needs or
expectations.
The quality of software is assessed by a number of variables. These variables can be divided into two criteria:
1) External Quality Criteria: External quality is what a user experiences when running the software in its
operational mode. Some of external qualities are:
Features
Space
Speed
Network Usage
Robustness
Determinism
Security
Stability
Ease-of-Use
Back-Compatibility
Power Consumption
2) Internal Quality Criteria: Internal quality refers to aspects that are code-dependent, and that are not visible
to the end-user. External quality is critical to the user, while internal quality is meaningful to the developer only.
Some of internal quality are:
i) Test Coverage ii) Testability
iii) Portability . iv) Thread-Safeness
v) Conciseness vi) Maintainability
vii) Documentation viii) Legibility
ix) Scalability
1) Increasing Criticality' of Software: The final customer or user is naturally anxious about the general
quality of software, especially its reliability. This is increasingly the case as organizations become more
dependent on their computer systems and software is used more and more in areas which are safety critical.
2). Intangibility of Software: This makes it difficult to know whether a particular task in a project has been
completed satisfactorily. The results of these tasks can be made tangible by demanding that the developers
produce 'deliverables' that can be examined for quality.
For these reasons quality management is an essential part of, effective overall project management.
2) Process Metrics: Process metrics can be used to improve software development and maintenance.
Examples include the effectiveness of defect removal during development, the pattern of testing defect arrival,
and the response time of the fix process.
3) Project Metrics: Project metrics describe the project characteristics and execution. Examples
include the number of software developers, the staffing pattern over the life cycle of the software, cost,
schedule, and productivity. - Some metrics belong to multiple categories. For example, the in-process quality
metrics of a project are both process metrics and project metrics.
Software quality metrics are a subset of software metrics that focus on the quality aspects of the product;
process, and project. In general, software quality metrics are more closely associated with process and product
Software quality metrics can be divided further into end-product quality metrics and in a process quality
metrics. The essence of software quality engineering is to investigate the relationships among in-process
metrics, project characteristics, and end-product quality, and; based on the findings, to engineer improvements
in both process and product quality.
Quality Assurance
Quality assurance consists of a set of auditing and reporting functions that assess the effectiveness and
completeness of quality control activities.
The goal of quality assurance is to provide management with the data necessary to be informed about
product quality, thereby gaining insight and confidence that product quality is meeting its goals.
If the data provided through quality assurance identify problems, it is management's responsibility to
address the problems and apply the necessary resources to resolve quality issues.
The two types of standards that may be established as part of the quality assurance process are:
i) Product Standards: A product is simply what a company offers to its customers. A product is designed
keeping in mind the perceived needs of customers. The main objective of a product is to make the customer feel
satisfied or benefited once the product once the product is purchased.
Product standards apply to the software product being developed. They include document standards, such as a
the structure of requirements documents; documentation standards.
ii) Process Standards: These standards define the processes that should be followed during software
development. They may include definition of specification, design and validation processes and a description of
the documents that should be written in the course of these processes.
SQA Activities
Software quality assurance is composed of a variety of tasks associated with two different constituencies:
1) The software engineers who do technical work, and
2) An SQA group that has responsibility for quality assurance planning, oversight, record keeping,
analysis, and reporting.
TESTING
Introduction
Software testing is the process of testing the software product. Effective software testing will contribute
to the delivery of higher quality software products, more satisfied users, lower maintenance costs, more
accurate, and reliable results.
It is a very expensive process and consumes one-third to one-half of the cost of a typical development
project. It is partly intuitive abut largely systematic. Good testing involves much more than just running
the program a few times to see whether it works.
"Software testing is a critical element of software quality assurance and represents the ultimate review of
specification, design, and code generation"
The .aim of the testing process is to identify all defects existing in a software product. To identify, a set
of test cases are designed and documented to exercise both internal logic and external requirements.
Expected results are defined and actual results are recorded.
Testing a program consists of subjecting the program to a set of test inputs (or test cases) and observing
if the program behaves as expected, then the Conditions under which failure occurs are noted for later
debugging and correction.
The following are some commonly used terms associated with testing:
1) Error: The term error is used in two different ways. it refers to the discrepancy between a computed,
observed, or measured value and the true, specified., or theoretically correct value. That is, error refers to the
difference between the actual output of software and the correct output.
Error is also used to refer to human actions that result in software containing a defect or fault. This definition is
quite general and encompasses all the phases
ii) Fault: Fault is a condition that causes a system to fail in performing its required function. A fault is the basic
reason for software malfunction.
It is incorrect step, process or data definition in a computer program? Which causes the program to behave in an
unintended or unanticipated manner? It is the result of the error
iii) Failure: Failure is the inability of a system or component to perform ea required function according to its
specifications. A software failure occurs if the behavior of the software is different from the specified behavior.
Failures may be caused due to functional or performance reasons.
A failure is produced only when there is a fault in the system. However, presence of a fault does not guarantee a
failure. In other words, faults have the potential to cause, failures and their presence' is a necessary but not a
sufficient condition for failure to occur.
PREPARED BY: Mrs.E.LAVANYA, Asso.Prof./CSE 17
CS8592 OBJECT ORIENTED ANALYSIS AND DESIGN
Testing Strategies
Two basic strategies of testing can be referred as structural and functional:
1) Structural Testing (also called white box testing)
2) Functional Testing (also called black box testing)
10. Explain in detail about the Top-Down Testing and Bottom-Up Testing.
Top-Down Testing
Top down testing is basically an approach where modules are developed and tested starting at the top level of
the programming hierarchy and continuing with the lower levels.
It is an incremental approach because we precede one level at a time. It can be done in either. "depth' or
"breadth" manner.
1) Depth: its means we precede from the top level all the way down to the lowest-level.
2) Breadth: It's means that we start at the top of the hierarchy: and then go to the next level. We
develop and test all modules at this level before *continuing with another level. Either way, this testing
procedure allows us to establish a complete skeleton of the system or product.
Bottom-up testing g has the lowest Level modules built and tested first on individual basis and in cluster
using test drivers. This ensures each module is fully tested before it's utilized by its calling module.
This method has .a great advantage in uncovering errors in critical modules early.
Bottom-up approach, as the name suggests, is the opposite of the top down method.
This process starts with building and testing the low level modules first, working its way up the
hierarchy. Because the modules at the low levels are very specific, we may need to combine several of
them into what is sometimes called a cluster or build in order to test them properly. Then to test these
build, a test driver has to be written and put in place.
The Full-lifecycle Object-oriented Testing (FLOOT) methodology is a collection. of testing techniques to verify
and validate object-oriented software. The FLOOT lifecycle is depicted in figure 5.4, indicating a wide variety
of techniques:
1) Initiation: User logs in for Internet connection. Enters website URL. Clicks on application form.
2) Starting Condition: Screen shows 'Application Format’
3) User enters the application field by field:
i) Cursor moves to next logical field.
ii) Name and address is entered — Free format.
iii) Telephone Number is an optional field.
iv) Qualification: Options shown in drop down window. On making a choice,
the qualification is posted in the field.
v) Date of Birth: DD MM YY.
vi) Course Applied for: Options shown in drop down window for selection.
vii) Choice of Test Centre: Mumbai, London, Singapore, New York.
viii)On submission of the application form and if valid in all respects, the form is
registered, and applicant gets test centre entry card and ID no.
4) Attributes
i)Cursor moves to the next logical field.
ii)Telephone no. is blank, cursor should move to field qualification.
iii)Date should be always DD MM YY.
iv)Entry of qualification by the applicant not permissible.
v)Course applied for is through drop down window. Clicking on button should show the
course options.
vi)Choice of test centre other than the four suggested should show error message.
vii)On submission, 'Thank You & Welcome' should be displayed with application ID No.
5) Test Cases
TC1: Expected: Cursor is seen on name when form displayed. On entering name, cursor should move to
address and so on till end of the form.
Expected Failure: Cursor is stuck
Cursor jumps skipping one field
TC2:Blank telephone number field; yet the application is accepted for registration.
TC3:Qualifications
Expected: On clicking window drops down.
On clicking each option of the course is restored in the window.
TC4:Expected Failure: Window does not drop.
```````````````````````````````Course is not restored.
TC5:Choice of Test Centre
Expected: Choice should appear and cursor moves to next field.
Choice other than four mentioned should show error message.
Incorrect choice.
Choose on centre location from
MUMBAI, LONDON, SINGAPORE, NEW YORK.
TC6:Acceptance and Registration, Issue of ID No.
Expected: On submission of form:
i) Welcome message should appear and ID number should be displayed.
ii) ID number should not be duplicated.
Even for a simple data entry, a unit test process generates six or more test cases. On data entry, six tests are
applied to declare the application valid for registration.
Test cases are to be designed on these lines for attributes at each level in the system hierarchy structure, i.e.,init,
application, module, system integration and so on.
Not all classes are likely to be finished. at the same time, so the programmer usually writes stubs for the
unfinished classes to enable the classes around them to be tested. A stub is a placeholder for a class that usually
displays a simple test message on the screen or returns some hardcoded value when it is selected.