7.unit 5
7.unit 5
7.unit 5
UNIT V TESTING
• Rumbaugh’s Methodology
• Booch Methodology
• Jacobson Methodology
• Patterns
• Framework
INTRODUCTION:
Many methodologies are available to choose from for the system development. Each
methodology is based on modelling the business problem and implementation in an object
oriented fashion. The Rumbaugh method has a strong method for producing object models.
Jacobson et al have a strong method for producing user-driven requirement and object
oriented analysis model. Booch has a strong method for producing detailed object oriented
design models.
• Rumbaugh’s describes a method for the analysis, design and implementation of a system
using an object oriented technique. OMT consists of four phases which can be performed
iteratively
i) Object model
• Object model describes the structure of objects in a system, their identity and
relationships to other objects, attributes, and operations.
• the object model is represented graphically with an object diagram.
• The object diagram contains classe4s interconnected by association lines.
• Each class represents a set of individual objects.
• The boxes in figure5.1 represents classes and the filled triangle represents associations
ii)Dynamic model
iii)Functional model
Functional Modelling gives the process perspective of the object-oriented analysis
model and an overview of what the system is supposed to do. It defines the function of
the internal processes in the system with the aid of Data Flow Diagrams (DFDs). It
depicts the functional derivation of the data values without indicating how they are
derived when they are computed, or why they need to be computed.
Functional Modelling is represented through a hierarchy of DFDs. The DFD is a
graphical representation of a system that shows the inputs to the system, the processing
upon the inputs, the outputs of the system as well as the internal data stores. DFDs
illustrate the series of transformations or computations performed on the objects or the
system, and the external controls and objects that affect the transformation. Data Flow
Diagrams use four primary symbols
1. The process is any function being performed
2.The data flow shows the direction of data element movement.
3. The data store is a location where data are stored.
Rumbaugh OMT methodology provides one of the strong tolls set for the analysis and design
of object-oriented system.
The macro process serves as a controlling frame work for the micro process and can take
weeks or months. The primary concern of macro process is technical management of the
system
Steps involved:
1.Conceptualization.
Establish the core requirements and develop a prototype.
2.Analysis and development of the model
Use the class diagram to describe the roles and responsibilities of objects. Use the
object diagram to describe the desired behaviour of the system.
Use the class diagram to decide what classes exist and how they relate to each other,
the object diagram to decide what mechanisms are used, the module diagram to map out
where each class and object should be declared, and the process diagram to determine to
which processor to allocate a process.
4.Evolution or implementation.
5.Maintenance.
Make localized changes to the system to add new requirements and eliminate bugs.
ii)Micro development process
Each macro development process has its own micro development process. The micro
development process is a description of the day-to-day activities. Steps involved here are
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. Use cases are described as one of the following
OOSE is also called Objectory is a method of object oriented development with the
specific aim to fit the development of large, real time systems. Development process is also
called as use case driven development. The system development method based on OOSE is a
process for the industrialized development of the software. Objectory is built around several
different models
✓ Use case model: The use-case model defines the outside and inside of the system
behaviour.
✓ Domain Object Model: The objects of the real worlds are mapped in to the
domain object model.
✓ Analysis Object Model: The analysis object model presents how the source code
should be carried out and written.
✓ Implementation model: The implementation model represents the
implementation of the System
✓ Test model: The test model constitutes the test plans, specification and reports.
❖ Analysis phase: The analysis phase defines the system to be built in terms of the
• problem-domain object model
• the requirements model
• analysis model
➢ Pattern
✓ Identifies a common structure that makes it useful for design.
✓ provide common vocabulary
✓ provide “shorthand” for effectively communicating complex
✓ principles
✓ help document software architecture
✓ capture essential parts of a design in compact form
✓ show more than one solution
✓ describe software abstractions
➢ Patterns do not...
✓ provide an exact solution
✓ solve all design problems
✓ only apply for object-oriented design
➢ Involves a general description of a solution to a recurring problem.
➢ Properties of a good pattern:
✓ 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 theory or
speculation
✓ Solution is not obvious: The best patterns generate a solution to a problem
indirectly
✓ Describes a relationship: Patterns do not just describes modules but describes
deeper system structures and mechanisms
✓ Has significant human component: All software serves human comfort or quality of
life
➢ Generative patterns – Tells us how to generate something.
o Observed in a system.
o Descriptive and passive.
➢ Non generative patterns –
o generate systems or pats of systems
o perspective and active
➢ Patterns templates.
✓ Name:
o A meaningful name allows us to use a single word or short phrase to refer to
the pattern and the knowledge and structure it describes.
o Some pattern forms also provide a classification of the pattern in addition to its
name.
✓ Problem:
o A statement of the problem that describes its intent: the goal and objectives it
wants to reach within the given context and forces.
o The forces oppose these objectives as well as each other.
✓ Context:
o The preconditions under which the problem and its solution seem to recur and
for which the solution is desirable.
o It can be thought of as the initial configuration of the system
before the pattern is applied to it.
✓ Forces:
o A description of the relevant forces and constraints and how they interact or
with one another and with the goals that the user wish to achieve.
o A concrete scenario that serves as the motivation for the pattern frequently is
employed.
✓ Solution: -
o Static relationships and dynamic rules describing how to realize the desired
outcome.
o It describes how to construct the necessary products.
o It encompasses the pictures, diagrams and prose that identify the pattern
structure, and their participants and collaborations to show how the problem is
solved.
✓ Examples: -
o One or more sample applications of the pattern that illustrate a specific initial
context; how the pattern is applied to and transforms that context.
✓ Resulting context:
o The state or configuration of the system after the pattern has been applied,
including the consequences of applying the pattern and other problems and
patterns that may arise from the new context.
✓ Rationale:
o Steps or rules in the pattern and also of the pattern as a whole in terms of how and
why it resolves it forces in a particular way to be in alignment with desired goals.
✓ Related patterns: The static and dynamic relationships between this pattern and others
within the same pattern language or system.
o Related pattern often shares common forces.
o They also frequently have an initial or resulting context that is compatible with the
resulting or initial context of another pattern.
✓ Known uses:
o The known occurrences of the pattern and its application within existing systems.
o This helps to validate a pattern by verifying that it indeed is a proven solution to the
recurring problem.
5.1.5 Frameworks:
Quality Assurance
• Plan
• Do
• Check
• Act
These above steps are repeated to ensure that processes followed in the organization are
evaluated and improved on a periodic basis. Let's look into the above steps in detail -
• Plan - Organization should plan and establish the process related objectives and
determine the processes that are required to deliver a high-Quality end product.
• Do - Development and testing of Processes and also "do" changes in the processes
• Check - Monitoring of processes, modify the processes, and check whether it meets
the predetermined objectives
• Act - Implement actions that are necessary to achieve improvements in the processes
An organization must use Quality Assurance to ensure that the product is designed and
implemented with correct procedures. This helps reduce problems and errors, in the final
product.
Quality Control
The main aim of Quality control is to check whether the products meet the
specifications and requirements of the customer. If an issue or problem is identified, it needs
to be fixed before delivery to the customer.
QC also evaluates people on their quality level skill sets and imparts training and
certifications. This evaluation is required for the service based organization and helps provide
"perfect" service to the customers.
Sometimes, QC is confused with the QA. Quality control is to examine the product or
service and check for the result. Quality assurance is to examine the processes and make
changes to the processes which led to the end-product.
One reason why quality assurance is needed is because computers are infamous for
doing what you tell them to do, not necessarily what you want them to do. To close this gap,
the code must be free of errors or bugs that cause unexpected results, a process called
debugging. Debugging is the process of finding out where something went wrong and
correcting the code to eliminate the errors or bugs that cause unexpected results. Let us take a
look at the kinds of errors you might encounter when you run your program:
• Logic errors occur when code does not perform the way you intended.
ii)Scenario-based testing.
i)Error-based testing techniques search a given class's method for particular clues of
interests, hen describe how these clues of interests, then describe how these clues should be
tested.
ii)Scenario-based testing, also called usage-based testing, concentrates on what the user
does, not what the product does, this means capturing use cases and the tasks users perform,
then performing them and their variants as tests.
In black box testing,you try various inputs and examine the resulting output;you can
learn what the box does but nothing about how this conversion is implemented.Black box
testing works very niecsly in testing objects in an object-oriented environment. The black box
testing technique also can be used for scenario-based tests,where the system's inside may not
be available for inspection but the input and output are defined through use cases or other
analysis information.
White box testing assumes that the specific logic is important and must be tested to
guarantee the system's proper functioning. The main use of the White box is in error-based
testing ,when you already have tested all objects of an application and all external or public
methods of an object that you believe to be of greater importance.
Two types of path testing are statement testing coverage and branch testing coverage:
• Branch testing coverage: The main idea behind branch testing coverage is to
perform enough tests to ensure that every branch alternative has been executed at least
once under some test.
Top down testing assumes that the main logic or object interactions and systems
messages of the application need more testing than an individual object's methods or
supporting logic. A top-down strategy can detect the serious design flaws early in the
implementation.
Bottom-up testing starts with the details of the system and proceeds to higher
levels by a progressive aggregation of details until they collectively fit the requirements for
the system. This approach is more appropriate for testing the individual objects in a system.
Additional testing included here are
When a company migrates data to a new software, it becomes vulnerable. Once the
transfer of information has begun, digital assets are quite literally hanging in the balance. Any
errors could cause massive file corruption or even data loss. That’s why extensive conversion
testing to confirm the compatibility between old and new systems is important.
These tests also check for functionality in the application and uncover hidden defects.
Data conversion testing should be performed before, during, and after the migration process.
This minimizes the risk of permanently lost data.
Unit Testing
Unit testing is a software testing method by which individual units of source code which are
sets of one or more computer program modules together with associated control data, usage
procedures, and operating procedures are tested to determine whether they are fit for use.
Regression Testing
• Regression testing is the process of retesting the modified part of the software and
ensuring that no new error have been introduced into previously tested code due to
these modifications as whenever we modify any software, we need to retest it.
• Thus, regression testing tests both the modified source code and other parts of the
source code that may be affected by the change.
Functional Testing :
• Functional Testing is a type of testing that can be used to assess the features and
functionality of the system or software product.
• Functional testing has a special feature with the help of which each and every function
of a software product so that it can be verified with requirement specifications.
Checking a software product for its functionalities is the prime objective of functional
testing. It mainly focuses on:
1. Basic Usability: It deals with basic usability testing of software product which
involves basic functionalities of user interface and navigation through pages.
2. Mainline Functions: Main functions and features are tested of the software
product.
Non-Functional Testing:
• Non-functional testing is the type of testing which can be used to assess the non-
functional requirements of the software product rather than the functional
requirements.
• The non-functional requirement can include the performance of the software product,
its scalability, or its usability.
• Some types of errors could become less plausible (not worth testing for).
• Some types of errors could become more plausible ( worth testing for now).
• Some types of errors might appear.
For example, when you invoke a method, it may be hard to tell exactly which method
gets executed. The method may belong to one of many classes.it can be hard to tell the exact
class of the method. When the code accesses it, it may get an unexpected value. In a non-
object-oriented system, when you looked at
X=ComputerPayroll();
Suppose you have this situation[12]:The base class contains methods inherited() and
redefined() and the derived class redefines the redefined() method.
redefined tests If you have to apply the base::redefined tests to objects of the class
"derived",the test inputs may be appropriate for both classes but the expected results might
differ in the derived class.
Test Case/s is a specific set of instructions which the tester is expected to follow to achieve a
specific output. Test cases are documented keeping in mind the requirements provided by the
client. Test case writing is an iterative process, which means you go through it one piece at a
time. Walk through the steps with one artifact (say, the use case diagram) and get the
information out of that. Then, go through the six steps again with another artifact (such as the
prototype) to uncover more test cases.
Test case consist many test attributes such as (id, name, conditions, environment, etc).
Single test case is a combination of multiple set of test data to form multiple test script. Test
scenarios are important when there is no time to write test cases. Good test condition provides
a bug-free system. To have a comprehensive testing scheme, the test must cover all methods
or a good majority of them. All the services of your system must be checked by at least one
test. To test a system, you must construct some test input cases, then describe how the output
will look. Next, perform the tests and compare the outcome with the expected output. The
good news is the use cases developed during analysis can be used to describe the usage test
cases.
• Testing is the process of executing a program with the intent of finding errors.
• A good case is the one that has a high probability of detecting an as-yet
undiscovered error.
• A successful test case is the one that detects an as yet undiscovered error.
• Let’s create a Test Case for the scenario: Check Login Functionality
Step 2) In order to execute the test case, you would need Test Data. Adding it below
Identifying test data can be time-consuming and may sometimes require creating test data
afresh. The reason it needs to be documented.
Step 3) In order to execute a test case, a tester needs to perform a specific set of actions on
the AUT. This is documented as below:
1 Check response when valid email and 1) Enter Email Email: guru99@email.
password is entered Address com
Many times the Test Steps are not simple as above, hence they need documentation. Also, the
author of the test case may leave the organization or go on a vacation or is sick and off duty
or is very busy with other critical tasks. A recently hire may be asked to execute the test case.
Documented steps will help him and also facilitate reviews by other stakeholders.
Step 4) The goal of test cases in software testing is to check behavior of the AUT for an
expected result. This needs to be documented as below
Case #
1 Check response when valid email and Email: [email protected] Login should be
password is entered Password: lNf9^Oti7^2h successful
During test execution time, the tester will check expected results against actual results and
assign a pass or fail status
Step 5) That apart your test case -may have a field like, Pre - Condition which specifies
things that must in place before the test can run. For our test case, a pre-condition would be to
have a browser installed to have access to the site under test. A test case may also include
Post - Conditions which specifies anything that applies after the test case completes
Create test cases that are as simple as possible. They must be clear and concise as the author
of the test case may not execute them.Use assertive language like go to the home page, enter
data, click on this and so on. This makes the understanding the test steps easy and tests
execution faster.
The ultimate goal of any software project is to create test cases that meet customer
requirements and is easy to use and operate. A tester must create test cases keeping in mind
the end user perspective
Do not repeat test cases. If a test case is needed for executing some other test case, call the
test case by its test case id in the pre-condition column
4. Do not Assume
Do not assume functionality and features of your software application while preparing test
case. Stick to the Specification Documents.
Make sure you write test cases to check all software requirements mentioned in the
specification document.
Name the test case id such that they are identified easily while tracking defects or identifying
a software requirement at a later stage.
It's not possible to check every possible condition in your software application. Software
Testing techniques help you select a few test cases with the maximum possibility of finding a
defect.
• Boundary Value Analysis (BVA): As the name suggests it's the technique that
defines the testing of boundaries for a specified range of values.
• Equivalence Partition (EP): This technique partitions the range into equal
parts/groups that tend to have the same behavior.
• State Transition Technique: This method is used when software behavior changes
from one state to another following particular action.
• Error Guessing Technique: This is guessing/anticipating the error that may arise
while doing manual testing. This is not a formal method and takes advantages of a
tester's experience with the application
8. Self-cleaning
The test case you create must return the test environment to the pre-test state and should not
render the test environment unusable. This is especially true for configuration testing.
The test case should generate the same results every time no matter who tests it
After creating test cases, get them reviewed by your colleagues. Your peers can uncover
defects in your test case design, which you may easily miss.
Test management tools are the automation tools that help to manage and maintain the Test
Cases. Main Features of a test case management tool are
1. For documenting Test Cases: With tools, you can expedite Test Case creation with
use of templates
2. Execute the Test Case and Record the results: Test Case can be executed through
the tools and results obtained can be easily recorded.
3. Automate the Defect Tracking: Failed tests are automatically linked to the bug
tracker, which in turn can be assigned to the developers and can be tracked by email
notifications.
4. Traceability: Requirements, Test cases, Execution of Test cases are all interlinked
through the tools, and each case can be traced to each other to check test coverage.
5. Protecting Test Cases: Test cases should be reusable and should be protected from
being lost or corrupted due to poor version control.
A test plan is a detailed document that describes the test strategy, objectives, schedule,
estimation and deliverables and resources required for testing. Test Plan helps us determine
the effort needed to validate the quality of the application under test. The test plan serves as a
blueprint to conduct software testing activities as a defined process which is minutely
monitored and controlled by the test manager. A test plan is developed to detect and identify
potential problems before delivering the software to its users. Your users might demand a test
plan as one item delivered with the program. In other cases, no test plan is required, but that
does not mean should not have one. A test plan offers a road map for testing activities,
whether usability, user satisfaction, or quality assurance tests. It should state the test
objectives and how to meet them. The test plan need not be very large; in fact, devoting too
much time to the plan can be counterproductive.
We cannot test a product without clear information about it. You must learn a
product thoroughly before testing it.
Test Strategy is a critical step in making a Test Plan. A Test Strategy document, is a high-
level document, which is usually developed by Test Manager. This document defines:
Before the start of any test activity, scope of the testing should be known. You must think
hard about it.
• The components of the system to be tested (hardware, software, middleware, etc.) are
defined as "in scope"
• The components of the system that will not be tested also need to be clearly defined as
being "out of scope."
A Testing Type is a standard test procedure that gives an expected test outcome. Each testing
type is formulated to identify a specific type of product bugs. But, all Testing Types are
aimed at achieving one common goal “Early detection of all the defects before releasing the
product to the customer”
Risk is future’s uncertain event with a probability of occurrence and a potential for loss.
When the risk actually happens, it becomes the ‘issue’.
In Test Logistics, the Test Manager should answer the following questions:
Test Objective is the overall goal and achievement of the test execution. The objective of the
testing is finding as many software defects as possible; ensure that the software under test
is bug free before release. To define the test objectives, you should do 2 following steps
1. List all the software features (functionality, performance, GUI…) which may need to
test.
2. Define the target or the goal of the test based on above features
Test Criteria is a standard or rule on which a test procedure or test judgment can be based.
Two types of criteria
Suspension Criteria
Specify the critical suspension criteria for a test. If the suspension criteria are met during
testing, the active test cycle will be suspended until the criteria are resolved.
Exit Criteria
It specifies the criteria that denote a successful completion of a test phase. The exit criteria
are the targeted results of the test and are necessary before proceeding to the next phase of
development.
Resource plan is a detailed summary of all types of resources required to complete project
task. Resource could be human, equipment and materials needed to complete a project. The
resource planning is important factor of the test planning because helps
in determining the number of resources (employee, equipment…) to be used for the project.
A testing environment is a setup of software and hardware on which the testing team is going
to execute test cases. The test environment consists of real business and user environment,
as well as physical environments, such as server, front end running environment.
Now you should include that estimation as well as the schedule to the Test Planning. To
create the project schedule, the Test Manager needs several types of input as below:
• Employee and project deadline: The working days, the project deadline, resource
availability are the factors which affected to the schedule
• Project estimation: Base on the estimation, the Test Manager knows how long it takes
to complete the project. So he can make the appropriate project schedule
• Project risk: Understanding the risk helps Test Manager add enough extra time to the
project schedule to deal with the risks
Test Deliverables is a list of all the documents, tools and other components that has to be
developed and maintained in support of the testing effort.
Class diagrams.
Object diagrams.
Module diagrams.
Process diagrams.
Interaction diagrams.
o Analysis and development of the model-Use the class diagram to describe the roles and
responsibilities of objects. Use the object diagram to describe the desired behaviour of the
system.
o Design or create the system architecture. -Use the class diagram to decide what classes exist
and how they relate to each other, the object diagram to decide what mechanisms are used,
the module diagram to map out where each class and object should be declared, and the
process diagram to determine to which processor to allocate a process.
o Maintenance-Make localized changes to the system to add new requirements and eliminate
bugs.
The micro process is a description of the day-to-day activities by a single or small group of
software developers. It consists of the following steps.
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. The use-case model employs extends and uses
relationships. The use cases are described as one of the following:
Use case-model.
Implementation model.
Test model.
9. Define proto-patterns.
A proto-pattern is the “pattern in waiting” which is not yet known to recur. It is the pattern
waiting to undergo some degree of peer scrutiny or review.
components are:
Name
Problem
Context
Forces
Solution
Examples
The process of looking for patterns to document is called pattern mining sometimes called
reverse architecting. The steps involved are:
Non anonymous review- Pattern submissions are shepherded rather than reviewed.
Writers’ workshops instead of presentations- Rather than being presented by the authors,
the patterns are discussed in the writers’ workshops.
A frame work is a way of presenting a generic solution to a problem that can be applied to all
levels in a development. Frameworks are a way of delivering application development
patterns. A framework provides architectural guidance, captures the design decisions that are
common to its application domain and thus emphasize design reuse over code reuse.
The major differences between design patterns and frameworks are as follows:
The main motivation for going to unified approach is to combine the best practices,
processes, methodologies, and guidelines along with UML (UnifiedModeling Language)
notations and diagrams for better understanding object oriented concepts and system
development.
The repository allows the maximum reuse of previous experience and previously defined
objects, patterns, frameworks, and user interfaces in an easily accessible manner with a
completely available and easily utilized format.
17.Define model.
Unit testing is a software testing method by which individual units of source code which are
sets of one or more computer program modules together with associated control data, usage
procedures, and operating procedures are tested to determine whether they are fit for use.
PART B QUESTIONS
PART C QUESTIONS
References
2. Ali Bahrami – Object Oriented Systems Development – McGraw Hill International Edition
– 1999
3.Erich Gamma, a n d Richard Helm, Ralph Johnson, John Vlissides, ―Design patterns:
Elements of Reusable Object-Oriented Software‖, Addison-Wesley, 1995.
4. Martin Fowler, ―UML Distilled: A Brief Guide to the Standard Object Modeling
Language‖, Third edition, Addison Wesley, 2003
PART-A
PART-B
11. a) i) Outline the steps to be followed to identify actors and use cases.
ii) What is inception? Outline the tasks that a project team performs during inception.
(OR)
b) Let’s say you own a small baking company, where you make and design custom cakes
for different occasions. You now wish to take your business online, so that you could cater to
a large customer base. You hire a web development company to build an online cake store for
you. This software product is built on the basis of the Unified Process Model(UPM).
Define and explain UPM with its phases for developing the above online banking company.
(OR)
13. a) What is the purpose, how to draw and where to use UML component diagrams?
Illustrate with an example.
(OR)
b) Why to use an activity diagrams? Outline the steps in modelling an activity diagram
with an example.
(OR)
b) What are GoF patterns? Outline the application of GoF design patterns with suitable
example.
(OR)
b) What is a test case? Describe in detail the test case design for OO software with
relevant examples.
PART-C
16. a) Develop a use case model for activities involved in ordering food in a restaurant from
the point when the customer enters a restaurant to the point when he leaves the restaurant.
(OR)
b) Model a class diagram for a “Library Management System”. State the functional
requirements you are considering.