51
Chapter 9 Software Testing This chapter is extracted from Sommerville’s slides. Text book chapter 23 1 1

Chapter 9 Software Testing

  • Upload
    maddox

  • View
    89

  • Download
    2

Embed Size (px)

DESCRIPTION

Chapter 9 Software Testing. This chapter is extracted from Sommerville’s slides. Text book chapter 23. 1. Objectives. 2. To discuss the distinctions between validation testing and defect testing To describe the principles of system and component testing - PowerPoint PPT Presentation

Citation preview

Chapter 10 Software Testing

Chapter 9Software TestingThis chapter is extracted from Sommervilles slides.Text book chapter 2311112ObjectivesTo discuss the distinctions between validation testing and defect testingTo describe the principles of system and component testingTo describe strategies for generating system test casesTo understand the essential characteristics of tool used for test automation

222The Jigsaw ActivityJoin with students who have your same expertise (same topic/colour)Discuss the topic for 5 minutes, ask for clarifications, confirm your understanding.Go back to your original team.Take turns in teaching the other team members (20 minutes)3

The Tournament20 questions will be displayed.As a team, you need to come up with the correct answers.Using a marker, legibly write your teams answer on a piece of paper for each question.Show your answer to the instructor without other teams seeing it.4Tournament RulesIf you get the answer right on the first time you get 5 points.If you get it wrong, you have another chance of getting it right, but you get 3 points.Second chance applies to non true-false questions.5The testing processComponent testing Testing of individual program components;Usually the responsibility of the component developer;Tests are derived from the developers experience.System testingTesting of groups of components integrated to create a system or sub-system;The responsibility of an independent testing team;Tests are based on a system specification.

6Testing GoalsValidation testingTo demonstrate to the developer and the system customer that the software meets its requirements;A successful test shows that the system operates as intended.Defect testingTo 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.

7The SW testing process

8Testing policyTesting policies define the approach to be used in selecting system tests:All functions accessed through menus should be tested;Combinations of functions accessed through the same menu should be tested;Where user input is required, all functions must be tested with correct and incorrect input.

9System testingInvolves integrating components to create a system or sub-system.May involve testing an increment to be delivered to the customer.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.

10Integration testingInvolves building a system from its components and testing it for problems that arise from component interactions.Top-down integrationDevelop the skeleton of the system and populate it with components.Bottom-up integrationIntegrate infrastructure components then add functional components.To simplify error localisation, systems should be incrementally integrated.

11Top-downDefine control hierarchyMain control module, modules sub-ordinate to and ultimately sub-ordinate to the main control block are integrated to some bigger structure.There are two types:Breadth firstDepth first12Top-Down*In depth first, sequence of integration:(M1, M2, M3), M4, M5, M6, M7, and M8

In breadth first, sequence of integration:(M1, M2, M8), (M3, M6), M4, M7, andM513

* Source: http://www.freetutes.com/systemanalysis/sa9-bottom-up-integration.htmlBottom-up* Low-level modules are combined into clusters that perform a specific software sub-function. These clusters are sometimes called builds.A driver (a control program for testing) is written to coordinate test case input and output.The build is tested.Drivers are removed and clusters are combined moving upward in the program structure.

14* Source: http://www.freetutes.com/systemanalysis/sa9-bottom-up-integration.html15

Source: http://www.freetutes.com/systemanalysis/sa9-bottom-up-integration.html

Incremental integration testing

16Regression testing*Whenever a new module is added to as a part of integration testing, the program structure changes. These changes may cause problems with functions in the tested modules, which were working fine previously.To detect these errors regression testing is done.

17* Source: http://www.freetutes.com/systemanalysis/sa9-bottom-up-integration.htmlRegression testing*Regression testing is: The re-execution of some subset of tests that have already been conducted to ensure that changes have not propagated unintended side effects in the programs. 18* Source: http://www.freetutes.com/systemanalysis/sa9-bottom-up-integration.htmlRelease testingThe process of testing a release of a system that will be distributed to customers.Primary goal is to increase the suppliers confidence that the system meets its requirements.Release testing is usually black-box or functional testingBased on the system specification only;Testers do not have knowledge of the system implementation.19Black-box testing

20Testing guidelines Testing guidelines are hints for the testing team to help them choose tests that will reveal defects in the systemChoose inputs that force the system to generate all error 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.

21Testing ScenarioReferring to our LIBSYS case study, what possible tests can you think of for the system?22LIBSYS testsTest the login mechanism with correct and incorrect logins to check that valid users are accepted and invalid users are rejected.Test the search facility using different queries against known sources to check that the search mechanism is actually finding documents.Test the system presentation facility to check that information about the document is displayed properly.Test the mechanism to request permission for downloading.Test the e-mail response indicating that the download document is available.23Performance testingPart of release testing may involve testing the emergent properties of a system, such as performance and reliability.Performance tests usually involve planning a series of tests where the load is steadily increased until the system performance becomes unacceptable.

24Stress testingExercises the system beyond its maximum design load. Stressing the system often causes defects to come to light.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.25Component testingComponent or unit testing is the process of testing individual components in isolation.It is a defect testing process.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.

26Object class testingComplete test coverage of a class involvesTesting 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.

27Test case design28Test case designInvolves designing the test cases (inputs and outputs) used to test the system.The goal of test case design is to create a set of tests that are effective in validation and defect testing.Design approaches:Requirements-based testing;Partition testing;Structural testing.

29Requirements based testingA general principle of requirements engineering is that requirements should be testable.Requirements-based testing is a validation testing technique where you consider each requirement and derive a set of tests for that requirement.

30LIBSYS requirementsThe user shall be able to search either all of the initial set of databases or select a subset from it.

31LIBSYS tests

32Partition testingInput data and output results often fall into different classes where all members of a class are related.Each of these classes is an equivalence partition or domain where the program behaves in an equivalent way for each class member.Test cases should be chosen from each partition.33Equivalence partitioning

34ExampleProgram accepts 4-10 integer numbersNumbers contain exactly 5 digits35Equivalence partitioning

36Search routine specificationprocedure Search (Key : ELEM ; T: SEQ of ELEM; Found : in out BOOLEAN; L: in out ELEM_INDEX) ;

Pre-condition-- the sequence has at least one elementTFIRST = i