Top Banner
Software Testing Software Testing W.C.Uduwela Dept. of Mathematics & Computer Science
81

Software Testing - ac

Dec 02, 2021

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Software Testing - ac

Software TestingSoftware Testing

W.C.Uduwela

Dept. of Mathematics & Computer Science

Page 2: Software Testing - ac

Topics coveredThe image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been cor rup ted. Restart you r computer, and then open the file again. If the red x still appears, you may have to delete the image and then insert it again.

Two fundamental testing activities• Component Testing

• Interface Testing• System Testing

• Integration Testing• Release Testing

Goal of Testing process•Validation testing•Defect testing

To demonstrate to the developer and the customer that the software meets its

requirements.

Testing

• Release Testing• Performance Testing

To discover faults or defects in the software where the behavior of the software is incorrect, undesirable or does not conform to its specification

Page 3: Software Testing - ac

The Testing ProcessThe Testing Process

• Component testing

– Testing of individual program components;

– Identifying defects in components

Functions, Objects, Reusable Components

– Usually the responsibility of the component developer (except sometimes for critical systems);

– Tests are derived from the developer’s experience.

Page 4: Software Testing - ac

ContCont……

• System testing

– Testing of groups of components integrated to create a system or sub-system;

– The responsibility of an independent testing team;– The responsibility of an independent testing team;

– Tests are based on a system specification (Functional and non functional requirement).

– Sometimes defects missed in components testing can be found in here

Page 5: Software Testing - ac

Testing phasesTesting phases

Component SystemComponent

testingSystem

testing

Software developer Independent testing team

Page 6: Software Testing - ac

Software testing process has two distinct goalsSoftware testing process has two distinct goals

• Validation testing– To demonstrate to the developer and the system customer

that the software meets its requirements;

– A successful test shows that the system operates as intended.

"Are we building the right product”.The software should do what the user really requires.

intended.

• Defect testing– To discover faults or defects in the software where its

behavior is incorrect or not in conformance with its specification;

– A successful test is a test that makes the system perform incorrectly and so exposes a defect in the system.

Page 7: Software Testing - ac

S/W Testing….???S/W Testing….???

• Testing can only show the presence of error not their absence

• Testing is a process intended to build confidence in the software

Page 8: Software Testing - ac

System testingSystem testing

• Involves integrating components to create a system or sub-system.

• May involve testing an increment to be delivered to the customer (Iterative development)

• Two phases:• Two phases:– Integration testing - the test team have access to the

system source code. The system is tested as components are integrated.

– Release testing - the test team test the complete system to be delivered as a black-box. Acceptance testing

Page 9: Software Testing - ac

Integration testingIntegration testing

• Involves building a system from its components and testing it for problems that arise from component interactions (testing checks that these component actually work together are called correctly and transfer the right data at the right time across the interface)

• There are 02 ways:• There are 02 ways:

– Top-down integration testing

Develop the skeleton of the system and populate it with components.

– Bottom-up integration testing

Integrate infrastructure components then add functional components.

• To simplify error localisation, systems should be incrementally

integrated.

Page 10: Software Testing - ac

http://sce.uhcl.edu/whiteta/sdp/subSystemIntegrationTesting.html#Top-Down_vs_Bottom-Up_Integration

Page 11: Software Testing - ac

Incremental integration testingIncremental integration testing

T2

T1A

BT2

T1A

T1

A

T3

T4

T5

C

D

T2

T3

T4

B

C

T2

T3

B

Test sequence 1 Test sequence 2 Test sequence 3

Page 12: Software Testing - ac

ContCont……

• Reality is different.

• The implementation of system features may be spread across a number of components

• To test a new feature you may have to integrate several • To test a new feature you may have to integrate several different components

• Therefore repairing an error also difficult

• Further integrating and testing a new component can change the pattern of already tested component integrations

Page 13: Software Testing - ac

Regression TestingRegression Testing

• When a new increment is integrate it is important to return the tests for previous increments as well as the new tests that are required to verify the new system function.

• This is regression testing

• Expensive process

• Impractical without some automation support

Page 14: Software Testing - ac

Release testing

• The process of testing a release of a system that will be distributed to customers.

• Primary goal is to increase the supplier’s confidence that the system meets its requirements.

Need to show it delivers the specified functionality, performance and dependability and that it does not fail during normal use.

that the system meets its requirements.

• Release testing is usually black-box or functional testing

– Based on the system specification only;

– Testers do not have knowledge of the system implementation.

Page 15: Software Testing - ac

BlackBlack--box testingbox testing

IeInput test da ta

Inputs causing

anomalous

beha viour

OeOutput test r esults

System

Outputs w hich r eveal

the pr esence of

defects

Page 16: Software Testing - ac

Testing guidelinesTesting guidelines

• Testing guidelines are hints for the testing team to help them choose tests that will reveal defects in the system

– Choose inputs that force the system to generate all error messages;messages;

– Design inputs that cause buffers to overflow;

– Repeat the same input or input series several times;

– Force invalid outputs to be generated;

– Force computation results to be too large or too small.

Page 17: Software Testing - ac

Testing scenarioTesting scenario

A student in Scotland is studying American History and has been asked to write a paperon ŌFrontier mentality in the American West from 1840 to 1880Õ. To do this, she needs tofind sources from a range of libraries. She logs on to the LIBSYS system and uses thesearch facility to discover if she can acce ss original documents from that time. Shesearch facility to discover if she can acce ss original documents from that time. Shediscovers sources in various US university libraries and down loads copies of some ofthese. However, for one document, she needs to have confirmation from her universitythat she is a genuine student and that use is for non-commercial purposes. The s tudentthen uses the facility in LIBSYS that can request such permission and registers herrequest. If granted, the document will be downloaded to the registered libraryÕs serverand printed for her. She receives a message from LIBSYS telling her that she will receivean e-mail message when th e printed document is available for collection.

Page 18: Software Testing - ac

System testsSystem tests

1. Test the login mechanism using correct and incorrect logins to checkthat valid users are accepted and invalid users are rejected.

2. Test the search facility using different queries against known sources tocheck that the search mechanism is actually finding documents.

3. Test the system presentation facility to check that information aboutdocuments is displayed properly.

4. Test the mechanism to request permission for downloading.

5. Test the e-mail response indicating that the downloaded document isavailable.

Page 19: Software Testing - ac

Use casesUse cases

• Use cases can be a basis for deriving the tests for a system. They help identify operations to be tested and help design the required test cases.cases.

• From an associated sequence diagram, the inputs and outputs to be created for the tests can be identified.

Page 20: Software Testing - ac

Collect weather data sequence chartCollect weather data sequence chart

:CommsController

request (repor t)

acknowledge ()repor t ()

:WeatherStation :WeatherData

summarise ()

reply (repor t)

acknowledge ()

send (repor t)

Page 21: Software Testing - ac

Performance testingPerformance testing

• Part of release testing may involve testing the emergent properties of a system, such as performance and reliability.

• Performance tests usually involve planning a • Performance tests usually involve planning a series of tests where the load is steadily increased until the system performance becomes unacceptable.

Page 22: Software Testing - ac

Stress testingStress testing

• Exercises the system beyond its maximum design load. Stressing the system often causes defects to come to light.

• Stressing the system test failure behaviour.. Systems • Stressing the system test failure behaviour.. Systems should not fail catastrophically. Stress testing checks for unacceptable loss of service or data.

• Stress testing is particularly relevant to distributed systems that can exhibit severe degradation as a network becomes overloaded.

Page 23: Software Testing - ac

Component testingComponent testing

• Component or unit testing is the process of testing individual components in isolation.

• It is a defect testing process.

• Components may be:• Components may be:

– Individual functions or methods within an object;

– Object classes with several attributes and methods;

– Composite components with defined interfaces used to access their functionality.

Page 24: Software Testing - ac

Object class testingObject class testing

• Complete test coverage of a class involves

– Testing all operations associated with an object;

– Setting and interrogating all object attributes;

– Exercising the object in all possible states.

• Inheritance makes it more difficult to design object class tests as the information to be tested is not localised.

Page 25: Software Testing - ac

Weather station object interfaceWeather station object interface

identifier

WeatherStation

repor tWeather ()calibrate (instruments)test ()star tup (instruments)shutdown (instruments)

Page 26: Software Testing - ac

Weather station testingWeather station testing

• Need to define test cases for reportWeather, calibrate, test, startup and shutdown.

• Using a state model, identify sequences of state transitions to be tested and the event state transitions to be tested and the event sequences to cause these transitions

• For example:

– Waiting -> Calibrating -> Testing -> Transmitting -> Waiting

Page 27: Software Testing - ac

• Objectives are to detect faults due to interface errors or invalid assumptions about interfaces.

• Particularly important for object-oriented development as objects are defined by their

Interface testingInterface testing

development as objects are defined by their interfaces.

Page 28: Software Testing - ac

Cont…

Test

cases

B

C

A

Page 29: Software Testing - ac

Interface typesInterface types

• Parameter interfaces– Data passed from one procedure to another.

• Shared memory interfaces– Block of memory is shared between procedures or

functions.functions.

• Procedural interfaces– Sub-system encapsulates a set of procedures to be called

by other sub-systems.

• Message passing interfaces– Sub-systems request services from other sub-system.s

Page 30: Software Testing - ac

Interface errorsInterface errors

• Interface misuse

– A calling component calls another component and makes an error in its use of its interface e.g. parameters in the wrong order.

• Interface misunderstanding• Interface misunderstanding

– A calling component embeds assumptions about the behaviour of the called component which are incorrect.

• Timing errors

– The called and the calling component operate at different speeds and out-of-date information is accessed.

Page 31: Software Testing - ac

Interface testing guidelinesInterface testing guidelines

• Design tests so that parameters to a called procedure are at the extreme ends of their ranges.

• Always test pointer parameters with null pointers.

• Design tests which cause the component to fail.• Design tests which cause the component to fail.

• Use stress testing in message passing systems.

• In shared memory systems, vary the order in which components are activated.

Page 32: Software Testing - ac

Software System ImplementationSoftware System Implementation

W.C.Uduwela

Department of Mathematics and Computer Science

Page 33: Software Testing - ac

IntroductionIntroduction

• Can be defines with major set of goalsassociated with it;

– Making new system available to prepared set of users (Deployment)users (Deployment)

– Positioning on-going support and maintenance of the system within the performing organization (Transition)

Page 34: Software Testing - ac

System DeploymentSystem Deployment

• It consists of;

– Executing all steps need to educate the consumer on the use of the new systemuse of the new system

– Placing the newly developed system in to production (in real time business environment)

– Confirming that all data required at the start of operations is available and accurate

– Validating that business system are functioning properly

Page 35: Software Testing - ac

System TransitionSystem Transition

• It support responsibilities involves changing from a system development to a system support and maintenance mode of operation.

• Ownership also move from project team to the performaing organization

Page 36: Software Testing - ac

System Implementation System Implementation vsvs Other phases Other phases of SDLCof SDLC

• Project issues in other phases that arise have little or no impact on day to day business

• Any misuse at the system implementation almost certainly translate into direct operational and/or certainly translate into direct operational and/or financial impact on the performing org.

Therefore careful planning, executing and management of system Implementation activities that the project team can minimize

the likelihood of these occurrence

Page 37: Software Testing - ac

Processes of System ImplementationProcesses of System Implementation

• Prepare for system Implementation (preparation

of production environment and consumer communities)

• Deploy Software System

• Transition to Performing Organization

Page 38: Software Testing - ac

Prepare for system ImplementationPrepare for system Implementation

• All the possible steps are taken to ensure that the upcoming system deployment and transition occurs smoothly, efficiently, and flawlessly

• Prepare the consumer by giving training to be positioned them to utilize the systemthem to utilize the system

• It is essential that everyone involved be absolutely synchronized with the deployment plan and with each other. Performance of the deployment efforts impact

• Ex:– Consumer may experience the new system

– Technical service and Technical support personnel

Page 39: Software Testing - ac

Deploy Software SystemDeploy Software System

• All activities required are performed to successfully install the new system and make it available to the consumers

• This is the culmination of the all prior efforts• This is the culmination of the all prior efforts

• It may impact the technical, operational and cultural aspects of the organization

• User training familiarize themselves with the system and will help to establish their expectation regarding what the system will and will not do

Page 40: Software Testing - ac

ContCont……

• During deployment, project team members may often be required to work extra hours to meet aggressive timeframes or additional staff may be brought in temporarily to assist with large data entry efforteffort

• As the system enabled and the project team validates that the application is the performing to expectations there may be times certain system functions seem suspect.

Page 41: Software Testing - ac

Transition to Performing OrganizationTransition to Performing Organization

• Successfully prepare the performing organization to assume responsibility for maintaining and supporting the implemented software system

• There should be two team that supporting an operational system and for the new development separatelysystem and for the new development separately

• To enable this project team should provide support to the performing organization with a combination of technical documentation, training, and hands-on assistance to enable them t provide an acceptable level of operational support to the consumers

Page 42: Software Testing - ac

Software MaintenanceSoftware Maintenance

W.C.Uduwela

Department of Mathematics and Computer Science

Page 43: Software Testing - ac

IntroductionIntroduction

• General process of changing a system it has been delivered

• Change may be

– Simple change to correct cording errors– Simple change to correct cording errors

– Correct design error

– Correct Specification

– Accommodate new requirements

• Changes are implemented by

– Modifying existing system component

– Adding new component

Page 44: Software Testing - ac

Three types of S/W maintenanceThree types of S/W maintenance

• Maintenance to repair s/w faults (corrective maintenance)– Coding error Cheap to correct

– Design error more expensive

– Requirement error most expensive– Requirement error most expensive

• Maintenance to adapt the s/w to a different operating environment (adaptive maintenance)– H/W, operating system or support s/w changes

– Application system able to cope with these environment changes

Page 45: Software Testing - ac

• Maintenance to add to or modify the system’s functionality (perfective maintenance)

– This need when the system requirements change in response to organization or business change. Require more

ContCont……

response to organization or business change. Require more effort than others

• Preventive maintenance

– Maintenance to increase the software maintainability or reliability to prevent problems in the future

Page 46: Software Testing - ac

ContCont……

• There is not a clear-cut distinction between those types of maintenance in practice

• Maintenance cost as a proportion of development cost • Maintenance cost as a proportion of development cost vary from one application domain to another– Embedded real time system maintenance cost = 4 * ( development cost of

it)

• Cost effective to invest effort in designing and implementing a system to reduce maintenance costs

Page 47: Software Testing - ac

Nature of the Maintenance PhaseNature of the Maintenance Phase

• S/W maintenance cost > ½ (the total s/w development cost)

• without software maintenance, it is impossible to • without software maintenance, it is impossible to change the problems within the product after its release

• Understanding the characteristics (size, age, structure) of software will facilitate maintaining the software more efficiently

Page 48: Software Testing - ac

Maintenance Process ModelsMaintenance Process Models

• Different models are required that recognizes the requirement to build maintainability into the system

• There are four models

1. Boehm’s model

2. Obstron’s model

3. Iterative enhancement model

4. Reuse oriented model

Page 49: Software Testing - ac

Osborne’s modelOsborne’s model

• It is concerned with the reality of the maintenance environment

• Technical problems that arise during maintenance are due to poor communication and control between management

• It recommends four strategies to address these issues

1. Maintenance requirements need to be included in the 1. Maintenance requirements need to be included in the change specification.

2. A quality assurance program is required to establish quality assurance requirements.

3. A metrics needs to be developed in order to verify that the maintenance goals have been met.

4. Managers need to be provided with feedback through performance reviews.

Page 50: Software Testing - ac

Iterative Enhancement ModelIterative Enhancement Model

• considers that changes made to the system during the software lifetime make up an iterative process

• This model was adapted from development to maintenance

• The model has three stages. – First, the system has to be analyzed. – Next, proposed modifications are classified. – Finally the changes are implemented.

• not effective when the documentation of the system is not complete

Page 51: Software Testing - ac

Reuse Oriented ModelReuse Oriented Model

• It assumes that existing program components could be reused

• steps for the reuse model are

– identifying the parts of the old system which have – identifying the parts of the old system which have the potential for reuse,

– fully understanding the system parts,

– modifying the old system parts according to the new requirements,

– integrating the modified parts into the new system

Page 52: Software Testing - ac

Software Maintenance TasksSoftware Maintenance Tasks

• Tasks involved in the software maintenance can be grouped into five categories

1. analysis, 1. analysis,

2. design,

3. implementation,

4. testing,

5. documentation

Page 53: Software Testing - ac

AnalysisAnalysis

• consist of impact analysis, cost benefit analysis

• Impact analysis and cost benefit analysis consist of analyzing different implementation alternatives and comparing their effect on schedule, cost, and comparing their effect on schedule, cost, and operation

• Isolation refers to the time spent trying to understand the problem or the proposed enhancements to the system

Page 54: Software Testing - ac

DesignDesign

• consists of redesigning the system based on the understanding of the necessary changes.

Page 55: Software Testing - ac

ImplementationImplementation

• entails code and unit testing

• Unit testing is performed by the maintainer who has made the changes

Page 56: Software Testing - ac

TestingTesting

• consists of integration, acceptance and regression testing

• Integration testing refers to the time spent on the integration of the components

• acceptance testing entails verifying that the changed system adheres to the user requirements

• Regression testing refers to the time spent ensuring that the changes did not affect the functionality of the other parts of the software

Page 57: Software Testing - ac

DocumentationDocumentation

• consists of system, user and other documentation

• System documentation refers to the time spent writing or revising the system description document

• User documentation entails writing or revising the user’s guide and other formal documentation, excluding system documentation.

• Documentations are very important

Page 58: Software Testing - ac

Computer Aided Software Engineering Computer Aided Software Engineering ToolsTools

W.C.Uduwela

Dep. Mathematics & Computer Science

Page 59: Software Testing - ac

IntroductionIntroduction

• In software development organization, the technique used by each developer could vary

• Difficult to integrate system and data or to

Error ridden, over budget, late

• Difficult to integrate system and data or to quickly construct new system

Therefore Information System professional suggest to develop common technique standard methodology automated tools

CASECASE

Page 60: Software Testing - ac

CASE: Computer Aided Software CASE: Computer Aided Software Engineering Engineering

• Software Engineers view: Make the life easier

• Organization view:– Improve the quality of the systems developed– Increase the speed with which systems are designed and developed– Ease and improve the testing process through the use of automated – Ease and improve the testing process through the use of automated

checking Improve– the integration of development activities via common methodologies– Improve the quality and completeness of documentation– Help standardize the development process– Improve the management of the project– Simplify program maintenance– Promote reusability of modules and documentation– Improve software portability across environments

Page 61: Software Testing - ac

Purpose of Using CASEPurpose of Using CASE

• To make much easier to perform a single design philosophy within an organization with many projects, systems, and people

• Because it manage the complexities of Information System and helps assure the quality system are constructed on time and within budget

Page 62: Software Testing - ac

Factors Influencing CASE adaptionFactors Influencing CASE adaption

• Expensive technology. Therefore large scale system builders are capable of investing

• Return on Investment. (Big benefits in the late stage of the SDLC- construction to maintanance)of the SDLC- construction to maintanance)

• Although CASE supports to reduce the overall process, many users and managers are often discouraged by the long duration of planning, analysis, and design. So interest is low

Page 63: Software Testing - ac

ContCont……

• CASE tools Cannot easily share information between tools

There is a difficulty provide CASE tools that support all activities of SDLC

• Adaption of CASE is highly related to the use of a formal systems development process

• Long term prediction for CASE is very good (Functionality Cost )

• CASE tools helps for reengineering and reverse engineering process.

Page 64: Software Testing - ac

Why organizations reject CASE toolsWhy organizations reject CASE tools

• Organization does not have standard methodology for developing systems.

• The high cost of purchasing CASE

• The high cost of training people

• Low organizational confidence in the IS dept. to deliver • Low organizational confidence in the IS dept. to deliver high-quality systems on time and within budget

• Lack of methodology standards within the organization

• Viewing CASE as a threat to job security

• Lack of confidence in CASE products

Page 65: Software Testing - ac

Component of CASEComponent of CASE

Page 66: Software Testing - ac

General types of CASE toolsGeneral types of CASE tools

• Diagramming tools– Enable system process, data, and control structures to be

represented graphically

• Computer display – Help to prototype how system look and feel– Help to prototype how system look and feel

• Report generator– System analyst to identify data requirement and

relationships

• Analysis tools– Automatically check for incomplete, inconsistent or incorrect

specifications in diagrams forms and reports

Page 67: Software Testing - ac

ContCont……

• Central repository– Integrated storage of specification, diagrams, reports

and project management information

• Document generatorHelps to produce both technical and user – Helps to produce both technical and user documentation in standard format

• Code generator– Enables the automatic generation of program and DB

definition code directly from the design documents, diagrams, forms and reports

Page 68: Software Testing - ac

Summary of how CASE is commonly used Summary of how CASE is commonly used within each SDLC phasewithin each SDLC phase

Page 69: Software Testing - ac

Traditional Vs CASE base developmentTraditional Vs CASE base development

• Traditional

– Emphasis on coding and Testing

– Paper-based specification

– Manual coding of programs– Manual coding of programs

– Manual documenting

– Intensive software testing

– Maintain code and documentation

Page 70: Software Testing - ac

ContCont……

• CASE based

– Emphasis on analysis and design

– Rapid interactive prototyping

– Automated code generation– Automated code generation

– Automated documentation generation

– Automated design checking

– Maintain design specifications

Page 71: Software Testing - ac

CASE diagramming toolsCASE diagramming tools

Page 72: Software Testing - ac

ContCont……

Page 73: Software Testing - ac

CASE Form and Report Generator ToolsCASE Form and Report Generator Tools

• Two purposes:

1. To create, modify, and test prototypes of computer display forms and reports and

2. To identify which data items to display or 2. To identify which data items to display or collect for each form or report.

Page 74: Software Testing - ac

CASE Analysis ToolsCASE Analysis Tools

• Types of analyses vary depending upon the organization's development methodology and the features of the CASE environment in use

• CASE analysis functions focus primarily on • CASE analysis functions focus primarily on data structures and usage and on diagram completeness and consistency

Page 75: Software Testing - ac

CASE RepositoryCASE Repository

• integrated CASE tools have a common user interface and can share system representations without systems analysts having to convert between different formats used by different tools.tools.

• two primary segments: the information information repository and the data dictionaryrepository and the data dictionary.

• information repository combines information about an organization's business information and its application portfolio and provides automated tools to manage and control access to the repository

Page 76: Software Testing - ac

Cont..Cont..

• data dictionary is a computer software tool used to manage and control access to the information repository

• It provides facilities for recording, storing, and • It provides facilities for recording, storing, and processing descriptions of an organization's significant data and data processing resources

Page 77: Software Testing - ac

ContCont……

Page 78: Software Testing - ac

Advantages of a CASE RepositoryAdvantages of a CASE Repository

• two additional advantages of using a comprehensive CASE repository that relate to project management and reusability

Page 79: Software Testing - ac

CASE Documentation Generator ToolsCASE Documentation Generator Tools

• SDLC documentation includes textual descriptions of needs, solution trade-offs, diagrams of data and processes, prototype forms and reports, program specifications, and user documentation including application and user documentation including application and reference materials

• Provide a method for managing the vast amounts of documentation created during SDLC

Page 80: Software Testing - ac

CASE code generation toolsCASE code generation tools

• Produce high-level program source code from diagrams and forms used to represent the system

Page 81: Software Testing - ac

Emerging Development ToolsEmerging Development Tools

• Object-Oriented Development Tools

• Evolution and Future of Development Tools