sw testing

19
Copyright © 2012 Embedded Systems Committee SW Testing SW Testing

Upload: -

Post on 20-Jan-2015

200 views

Category:

Technology


3 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Sw testing

Copyright © 2012 Embedded Systems Committee

SW TestingSW Testing

Page 2: Sw testing

Copyright © 2012 Embedded Systems Committee

Testing for Quality

• What is Quality?– Functionality

– Reliability

– Usability

– Efficiency

– Maintainability

– Portability

Quality Target

Testing

System

Page 3: Sw testing

Copyright © 2012 Embedded Systems Committee

Source of failure

ErrorError

Bug/DefectBug/Defect

FailureFailure

• Humanity• Technology change• System interaction• Environmental conditions

– Radiation– Magnetism– Electronic fields– Pollution– Temperature

Page 4: Sw testing

Copyright © 2012 Embedded Systems Committee

Testing in Development Cycle

• Common types of V-Model uses four types of test levels:– Component (unit) testing

– Integration testing

– System testing

– Acceptance testing

Page 5: Sw testing

Copyright © 2012 Embedded Systems Committee

Risk vs. Testing

• More testing gives more trust in component under test.

Number of passed tests

So

ftw

are

risk

Page 6: Sw testing

Copyright © 2012 Embedded Systems Committee

Cost of error detection

• Early detection saves a lot of effort

Page 7: Sw testing

Copyright © 2012 Embedded Systems Committee

Seven Principles of testing1. Testing shows only the presence of defects

• But cannot prove that there is no defects

2. Exhaustive testing is impossible• Instead of exhaustive testing, risk analysis and priorities should be used to focus

testing efforts

3. Early testing• Early defect detection reduces the fixing cost

4. Defect clustering• Small number of modules usually contains most of the defects discovered during

pre-release testing

5. Pesticide paradox• SW becomes immune against test cases. Test cases needs to be revised regularly

and new ones should be written

6. Testing is context dependent• Testing website is different than safety critical system testing

7. Absence-of-error fallacy• Fixing defects does not help if the system built is unusable for the user

Page 8: Sw testing

Copyright © 2012 Embedded Systems Committee

Psychology of testing• The mindset to be used while testing is different than

that used for developing software

• With the right mindset, developers can test their own code

• A certain degree of independence (avoiding the author bias) often makes the tester more effective at finding defects and failures

• If error, defects or failures are communicated in a constructive way, bad feelings between the testers and analysts, designers and developers can be avoided

Page 9: Sw testing

Copyright © 2012 Embedded Systems Committee

Test Levels• Component (unit)• Integration• System• Acceptance

Page 10: Sw testing

Copyright © 2012 Embedded Systems Committee

Test Levels - Component• Also known as unit, module, or program testing• Verifies the functioning of SW modules, programs,

objects, classes, ..etc that are separately testable• It may be done in isolation from the rest of the system.

Stubs, drivers and simulators may be used• May include testing of functional or non-functional

characteristics (such as: searching for memory leaks, …)• Test cases are derived from work products such as a

specification of the component, software design or data model

• Component testing usually involves the programmer who wrote the code. Defects are fixed as soon as they are found, without formally managing these defects

Page 11: Sw testing

Copyright © 2012 Embedded Systems Committee

Test Levels - Integration• There may be more than one level of integration testing:

– Component integration testing: tests the interactions between software components and is done after the component testing

– System integration testing: tests the interaction between different systems or between hardware and software and maybe done after system testing

• The greater the scope of the integration, the more difficult it becomes to isolate defects to a specific component or system which may lead to increased risk and additional time for troubleshooting

• Testing of specific non-functional characteristics (e.g., performance) may be included in integration testing as well as functional testing

• Focus is mainly on the communication between modules not the functionality

Page 12: Sw testing

Copyright © 2012 Embedded Systems Committee

Test Levels - System• System testing is concerned with the behavior of

the whole system• System testing may include tests based on:

– Risks– Requirements specifications– Business processes– Use cases– High level text description or system behavior model– Interaction with the operating system– …

• An independent system team often carries out this type of testing

Page 13: Sw testing

Copyright © 2012 Embedded Systems Committee

Test Levels - Acceptance• Acceptance testing is often the responsibility of the

customers or users of a system; other stakeholders may be involved as well

• The goal is to establish confidence in the system. Finding defects is not the main focus in acceptance testing

• Typical forms of acceptance testing include:– User acceptance testing– Operational testing– Contract and regulation acceptance testing– Alpha and beta (or field) testing

Page 14: Sw testing

Copyright © 2012 Embedded Systems Committee

Test Types• A test type is focused on a particular test

objective, which could be:– A function to be performed by the software

– A non-functional quality characteristics, such as reliability or usability

– The structure or architecture of the software or system

– Change related (confirmation testing, regression testing)

Page 15: Sw testing

Copyright © 2012 Embedded Systems Committee

Test Types - Functional• Functional testing tests “What” the system does

• Functional testing is based on functions and features described in documents or understood by the tester

• Specification based techniques may be used to derive test conditions and test cases

• Functional testing considers the external behavior of the software (black-box testing)

• Security testing, is a type of functional testing related to detection of threats from malicious outsiders

• Another type of functional testing, interoperability testing, evaluates the capability of the software product to interact with one or more specified components or systems

Page 16: Sw testing

Copyright © 2012 Embedded Systems Committee

Test Types – Non-Functional• Non-functional testing tests “How” the system works• Non-functional testing can be performed on all test

levels• The term non-functional describes the tests required to

measure characteristics of system and software that can be quantified on a varying scale, such as response time for performance testing

• Non-functional testing considers the external behavior of the software and in most cases uses black-box test design techniques

Page 17: Sw testing

Copyright © 2012 Embedded Systems Committee

Test Types - Structural• Structural (white-box) testing may be performed at all

test levels• Structural techniques are best used after specification-

based techniques in order to help measure the thoroughness of testing through assessment of coverage of a type of structure

• At all test levels, but especially in component testing and component integration testing, tools can be used to measure the code coverage of elements such as statements or decisions

Page 18: Sw testing

Copyright © 2012 Embedded Systems Committee

Test Types - Changes• After a defect is detected and fixed, the software should be re-

tested to confirm that the original defect has been successfullyremoved. This is called confirmation

• Regression testing is the repeated testing of an already tested program, after modification, to discover any defects introduced or uncovered as a result of the change(s)– The extent of regression testing is based on the

risk of not finding defects in software that was working previously

– Regression testing may be performed at all testlevels, and includes functional, non-functional and structural testing

– Regression test suites are run many times and evolve slowly, so regression testing is a strong candidate for automation

Page 19: Sw testing

Copyright © 2012 Embedded Systems Committee

Test Types - Maintenance• Once deployed, the software system is often in service for

years or decades. During this time, the system, its configuration data, or its environment are often corrected

• Maintenance testing is done on an existing (released/deployed) operational system, and is triggered by modifications, migration, or retirement of the software or the system

• Maintenance testing for migration (e.g., from platform to another) should include operational tests of the new environment as well as of the changed software

• In addition to testing what has beenchanged, maintenance testing include regression testing to parts of the system that have not been changed

• Depending on the changes, maintenancetesting may be done at any or all test levels and for any or all test types