You are on page 1of 10

Mod 5

OO Testing
Initially, we were following the traditional method of testing which consists of procedures
operating on data. But now, we are following the object-oriented testing method that focuses
on the objects that are instances of classes. This change from traditional to object-oriented
made us reconsider old strategies and software testing methods. There are many advantages
of using the OO paradigm including reliability, interoperability, reusability, and extendibility.
Levels of OO testing

1. At the algorithmic level, a single module of every class should be tested. As discussed
earlier, testing of classes is the main concern of the Object Oriented program. Every class
gets tested as an individual entity at the class level. Generally, programmers who are creating
the classes are involved in testing. Test cases for Object-Oriented Testing in Software Testing
can be constructed based on the requirement specifications, programming language, and
models.
2. Cluster-level testing is the integration of individual classes. The main purpose of doing
integration testing is to verify the interconnection between classes and how well they
perform interclass interactions. Thus, Cluster level testing can be viewed as integration
testing of classes.
3. In system testing, integration between clusters can be taken care of. Also, at each level
regression testing is a must after every new release.
OO Testing methods

1. Fault-based testing:
 Focuses on identifying all possible faults in consumer specifications or code.
 Test cases are designed to flush out defects, including incorrect
specifications and interface errors.
 Traditional testing models may rely on functional testing to detect these
errors.
2. Scenario-based testing:
 Detects issues arising from wrong specifications and improper class
interactions.
 Tests are based on detailed scenarios reflecting end-user tasks in specific
environments.
 Combines all classes involved in use cases to ensure thorough testing, often
using top-down or bottom-up integration approaches.
3. Class testing based on method testing:
 Each method of a class is tested individually to ensure proper functionality.
 A simple and common approach in object-oriented testing.
 Method testing involves testing methods once to minimize redundancy and
time consumption.
4. Partition Testing:
 Divides inputs and outputs into categories to minimize the number of test
cases.
 Aims to cover different partitions of input and output data to ensure
comprehensive testing.
 Helps identify potential errors or bugs in different segments of the system.
OO testing strategies
1. Class Testing:
 Focuses on testing individual classes to ensure their methods and attributes
function correctly.
 Tests are designed to verify the behavior and functionality of each class in
isolation.
2. Integration Testing:
 Tests the interactions between classes or modules to ensure they work
together as intended.
 Validates the communication and data flow between different parts of the
system.
3. Inheritance Testing:
 Focuses on testing the inheritance relationships between classes.
 Ensures that subclasses inherit and override methods and attributes correctly
from their parent classes.
4. Polymorphism Testing:
 Verifies the behavior of polymorphic methods and their ability to handle
objects of different types.
 Tests how objects of different subclasses respond to the same method calls.
5. State-based Testing:
 Tests the behavior of objects in different states.
 Ensures that objects transition between states correctly and perform the
appropriate actions in each state.
6. Message Passing Testing:
 Validates the communication between objects through message passing.
 Tests how objects send and receive messages and respond to them
accordingly.
7. Scenario-based Testing:
 Tests entire scenarios or use cases to ensure that multiple classes work
together to achieve specific functionalities.
 Focuses on testing real-world scenarios to verify the system's behavior from
end to end.
8. Mocking and Stubbing:
 Uses mock objects or stubs to simulate the behavior of dependencies during
testing.
 Helps isolate classes for testing and ensures that they behave as expected in
different contexts.
9. Regression Testing:
 Re-tests previously tested functionalities to ensure that recent changes or
updates have not introduced new defects.
 Ensures that modifications do not adversely affect the behavior of existing
classes or modules.
10. Usability Testing:
 Evaluates the usability of the software from a user's perspective.
 Tests how intuitive and easy to use the system is, including aspects like user
interfaces and interactions with objects.
What is a Test Case?
A test case is a defined format for software testing required to check if a particular
application/software is working or not. A test case consists of a certain set of conditions that
need to be checked to test an application or software i.e. in more simple terms when
conditions are checked it checks if the resultant output meets with the expected output or not.

When do we Write Test Cases?


 Before development: Test cases could be written before the actual coding as that
would help to identify the requirement of the product/software and carry out the test
later when the product/software gets developed.
 After development: Test cases are also written directly after coming up with a
product/software or after developing the feature but before the launching of a
product/software as needed to test the working of that particular feature.
 During development: Test cases are sometimes written during the development time,
parallelly. so, whenever a part of the module/software gets developed it gets tested as
well.
1. Class Level Testing:
 Focuses on testing the behavior and functionality of individual classes in
isolation.
 Tests methods, attributes, and internal logic of each class to ensure they meet
specifications and requirements.
 Mocking and stubbing may be used to simulate dependencies and isolate the
class under test.
2. Interclass Level Testing:
 Tests interactions and collaborations between multiple classes or objects.
 Ensures that classes work together correctly to achieve desired
functionalities.
 Validates communication, data exchange, and dependencies between classes.
 Integration testing techniques, such as scenario-based testing or message
passing testing, may be employed to test interclass interactions.
STD Software Te s t Doc ume nt
1. INTRODUCTION

1.1 System Overview

1.2 Test Approach

2. TEST PLAN

2.1 Features to be tested

2.2 Features not to be tested

2.3 Testing Tools and Environment

3. TEST CASES

3.n Case-n

3.n.1 Purpose

3.n.2 Inputs

3.n.3 Expected Outputs & Pass /Fail Criteria

3.n.4 Test Procedure

4. TEST LOGS

4.n Log for test-n

5. TEST RESULTS

Software Maintenance
Software maintenance is a part of the Software Development Life Cycle. Its primary goal is to modify and
update software application after delivery to correct errors and to improve performance. Software is a model
of the real world. When the real world changes, the software require alteration wherever possible.
Software maintenance aims to ensure that a software system remains functional, efficient, and secure over
time by fixing bugs, adding features, and adapting to changes. It involves testing, version control, and
communication with stakeholders. Maintenance can be costly, so planning and a clear maintenance plan are
essential to manage complexity and expenses effectively.

Types of Software Maintenance


1. Corrective Maintenance: Corrective maintenance aims to correct any remaining errors
regardless of where they may cause specifications, design, coding, testing, and
documentation, etc.
2. Adaptive Maintenance: It contains modifying the software to match changes in the ever-
changing environment.
3. Preventive Maintenance: It is the process by which we prevent our system from being
obsolete. It involves the concept of reengineering & reverse engineering in which an old
system with old technology is re-engineered using new technology. This maintenance
prevents the system from dying out.
4. Perfective Maintenance: It defines improving processing efficiency or performance or
restricting the software to enhance changeability. This may contain enhancement of existing
system functionality, improvement in computational efficiency, etc.

What is Reverse Engineering?


Reverse engineering can extract design information from source code, but the abstraction
level, the completeness of the documentation, the degree to which tools and a human analyst
work together, and the directionality of the process are highly variable.
Steps of Software Reverse Engineering
1. Collection Information: This step focuses
on collecting all possible information (i.e.,
source design documents, etc.) about the
software.
2. Examining the Information: The
information collected in step-1 is studied so
as to get familiar with the system.
3. Extracting the Structure: This step
concerns identifying program structure in the
form of a structure chart where each node
corresponds to some routine.
4. Recording the Functionality: During this step processing details of each module of
the structure, charts are recorded using structured language like decision table, etc.
5. Recording Data Flow: From the information extracted in step-3 and step-4, a set of
data flow diagrams is derived to show the flow of data among the processes.
6. Recording Control Flow: The high-level control structure of the software is
recorded.
7. Review Extracted Design: The design document extracted is reviewed several times
to ensure consistency and correctness. It also ensures that the design represents the
program.
8. Generate Documentation: Finally, in this step, the complete documentation including
SRS, design document, history, overview, etc. is recorded for future use.
What is Re-engineering?
Re-engineering, also known as software re-engineering, is the process of analyzing,
designing, and modifying existing software systems to improve their quality, performance,
and maintainability.
 This can include updating the software to work with new hardware or software
platforms, adding new features, or improving the software’s overall design and
architecture.
 Software re-engineering, also known as software restructuring or software renovation,
refers to the process of improving or upgrading existing software systems to improve
their quality, maintainability, or functionality.
 It involves reusing the existing software artifacts, such as code, design, and
documentation, and transforming them to meet new or updated requirements.
Objective of Re-engineering
 To improve the quality and maintainability of the software system
 To describe a cost-effective option for system evolution.
 To describe the activities involved in the software maintenance process.
 To distinguish between software and data re-engineering and to explain the problems
of data re-engineering.

You might also like