Sunteți pe pagina 1din 25

Chapter-7 Object-Oriented Testing

OO testing Activities
Review OOA and OOD models
Class testing after code is written
Integration testing within subsystems
Integration testing as subsystems are added to the
system
Validation testing based on OOA use-cases
Cont’d…
Correctness of OOA/OOA Models
Syntactic correctness
judged by making sure proper modeling
conventions and symbolism were used
Semantic correctness
Does the model reflect the real world
problem?
Cont’d…
Consistency of OOA/OOD Models
Assess the class-responsibility-collaborator (CRC)
model and object-relationship diagram
Review system design
examine the object-behavior model to check
mapping of system behavior to subsystems
review concurrency and task allocation
examine the use-case scenarios and exercise the
user interface design
Cont’d
Test object model against the object relationship
network to ensure that all design object contain
necessary attributes and operations needed to
implement the collaborations defined for each
CRC card
Class Model Assessment
1. Revisit the Use Cases, CRC cards and UML
class model. Check that all collaborations are
properly represented.
Inspect the description of each CRC index card
to make sure a delegated responsibility is part of
the collaborator’s definition.
Cont’d…
 Example: in a point of sale system.
 A read credit card responsibility of a credit sale
class is accomplished if satisfied by a credit
card collaborator
2. Invert connections to ensure that each
collaborator asked for a service is receiving requests
from a reasonable source
 Example: a credit card being asked for a
purchase amount
Cont’d
3. Using the inverted connections from step 3, determine
whether
 other classes might be required
 responsibilities are properly grouped among classes
Object-oriented Testing Strategies
1) Unit Testing
Smallest testable unit is the encapsulated class or
object.
Approach:
Test each method within a class
Test the attributes of the class between
methods
Cont’d
2) Integration Testing
Focuses on groups of classes that collaborate in
some manner
Integration of operations one at a time into a
class is often meaningless
Because of direct and indirect interaction of
components
Cont’d…
Thread-based testing
testing all classes required to respond to one
system input or event
Use-based testing
test independent classes first
test dependent classes making use of them next
Cluster testing
groups of collaborating classes are tested for
interaction errors.
Cont’d….
3)Validation Testing
Are we building the right product?
Validation succeeds when software functions in
a manner that can be reasonably expected by the
customer.
Focuses on visible user actions and user
recognizable outputs
Validation tests are based on the use-case
scenarios
Apply:
Black-box testing to create a deficiency list
Acceptance tests through alpha (at developer’s site) and
beta (at customer’s site) testing with actual customers
Cont’d…
4) System Testing
Types of System Testing:
Recovery testing: how well and quickly does
the system recover from faults
Security testing: verify that protection
mechanisms built into the system will protect
from unauthorized access (hackers, disgruntled
employees, fraudsters)
Stress testing: place abnormal load on the
system
Performance testing: investigate the run-time
performance within the context of an integrated
system
Notice

Software may be part of a larger system. This


often leads to “finger pointing” by other system
developer Teams.
Finger pointing defense:
1.Design error-handling paths that test external
information
2.Conduct a series of tests that simulate bad
data
3.Record the results of tests to use as evidence
Chapter 8: The Software Process
Chapter 8• The Software Process
Key points
What is a Software Process:
Set of activities, methods, practices, and
transformations that people use to develop and
maintain software and the associated products (e.g.,
project plans, design documents, code, test cases,
and user manuals).
Software Engineering:
Is the establishment and use of sound engineering
principles in order to obtain economically software
that is reliable and works efficiently on real machines.
Cont’d…..
Requirements engineering the process of
developing a software specification.
Design and implementation processes are
concerned with transforming a requirements
specification into an executable software system.
Software validation: the process of checking
that the system conforms to its specification and
that it meets the real needs of the users of the
system.
Cont’d…..
Software evolution takes place when you change
existing software systems to meet new requirements. The
software must evolve to remain useful.
Software Life Cycle
The phases necessary to develop and maintain a
software system:
Requirements (Specification)
Design
Implementation (Coding)
Testing (Validation)
Maintenance (Evolution)
A software process model is an abstract
representation of how these phases can be
addressed.
Cont’d…
Requirements: The process of establishing what
services are required of the system
Design: The process of converting the system
specification (requirements) into a software
structure that realizes that specification
Implementation: Translating a design into a
program and removing errors from that program
N.B The activities of design and implementation are
closely related and may be interleaved.
Cont’d…
Testing: Verification and validation is intended to
show that a system conforms to its specification
and meets the requirements of the system
customer.
System Maintenance: Software is inherently
flexible and can change (as opposed to hardware).
Software engineering should be thought of as an
evolutionary process where software is continually
changed over its lifetime in response to customer
needs.
Software process models
The 2 main Software process models
• The waterfall development model
–Separate and distinct phases of specification and
development.
• Incremental development model
–Specification, development and validation are
interleaved
N.B In practice, most large systems are
developed using a process that incorporates
elements from all of these models.
Waterfall development Model

Requirements

Design

Implementation

Testing

Maintenance
Drawback of the waterfall model
It is the difficult to accommodate changes after the
process is underway. In principle, a phase has to be
complete before moving onto the next phase.
Inflexible partitioning of the project into distinct
stages makes it difficult to respond to changing customer
requirements.
–Therefore, this model is only appropriate when the
requirements are well-understood and changes will
be fairly limited during the design process.
–Few business systems have stable requirements.
Incremental Model
Incremental development model benefits
• The cost of accommodating changing customer
requirements is reduced.
–The amount of analysis and documentation that has to
be redone is much less than is required with the waterfall
model.
• It is easier to get customer feedback on the development
work that has been done.
• More rapid delivery and deployment of useful software to
the customer is possible.
–Customers are able to use and gain value from the
software earlier than is possible with a waterfall process.
Incremental development model problems
• The process is not visible.
–Managers need regular deliverables to measure
progress. If systems are developed quickly, it is
not cost-effective to produce documents that
reflect every version of the system.
• System structure tends to degrade as new
increments are added.
–Unless time and money is spent on refactoring
to improve the software, regular change tends
to corrupt its structure.
25

S-ar putea să vă placă și