Year13 Testing[1]

23
Software Testing an Implementation

description

Year13 Testing[1]

Transcript of Year13 Testing[1]

  • Software Testing and Implementation

  • ReviewTestingTest casesWhite & black box testingUnit testingIntegrated testingSystem & acceptance testingImplementation

  • OverviewIntroduction.Testing Techniques:black-box & white-box testing.Testing Strategies:unit, integration, and system testing.

  • IntroductionThe design phase produces:module structure e.g. structure chart;module specifications e.g. data structures and algorithms (pseudo-code).Every module in the design is implemented according to its specification.Objectives of the development phase:to transform the design into program code;to unit test and debug each module in isolation.

  • DevelopmentDevelopment is a relatively short phase in the software lifecycle:it is likely to become less and less important as CASE tools improve.Testing requires the most effort of all the development phases:in general, the largest number of staff will be needed during testing;

  • TestingAim: to identify defects in a software product.The input domain of most non-trivial software is too large (often infinite) to test completely:a system with just six inputs, each with ten possible values, has 106 possible test cases!It is usually impractical, if not impossible, to test a software product exhaustively:hence it is rarely possible to guarantee that software is entirely free of defects!

  • Test Cases & Test SuitesTesting a program involves:using a set of carefully designed test cases as input to the program;analyzing the resulting output to determine whether the program behaved as expected.A test case is a triplet [I, S, O]:I is the data to be input to the system;S is the system state for which I will be input;O is the expected output from the system.A set of test cases is called a test suite.

  • Designing Test CasesThere are two complimentary approaches to the design of test cases:black-box testing;white-box (or glass-box) testing.Black-box testing is sometimes called functional testing.White-box testing is sometimes called structural testing.

  • Black Box Testing

  • Black-box testingDesigning black box test cases:requires knowledge of the software specification;does not require knowledge of the software design or implementation.

  • Software Testing StrategiesSoftware is usually tested at several levels of complexity:Unit Testing test each module in isolation;Integration Testing test a growing set of integrated modules each time a new one is added;System Testing test the complete system once integration is finished.Why not just test the software once when integration is complete?

  • Unit TestingTesting each module in isolation (before integration) reduces debugging effort:testing can begin before all of the modules in the system are ready;errors detected when several modules are tested together will be difficult to locate.Regression Testing: the module must be completely re-tested when a bug is fixed.Who: the module programmer?

  • Integration TestingA software product begins to take shape as its modules are integrated:integration can begin as soon as two related modules have been coded and unit tested.Modules are integrated and tested according to a well-defined plan, usually one at a time:Regression Testing: the system must be completely re-tested after each integration.Who: an independent test team.

  • System TestingSystem testing begins once all the modules have been integrated successfully.There are several kinds of system testingAlpha Testing: users (supervised).Beta Testing: users (unsupervised).Stress Testing: the developers.Acceptance Testing: the customer.

  • System TestingAlpha Testing:off-the-shelf software is tested by the developer observing users at work;however, this is done in a controlled environment.Beta Testing:the software is then tested by (friendly?) users in an uncontrolled environment i.e. field testing;the developer is usually not present.Beta testing is the final live testing before the software is officially released.

  • Stress TestingStress testing involves using abnormal inputs to push a system to its limits.The system is evaluated using performance measures such as:input and output quantity and frequency;processing and response times;bandwidth and memory utilization.The system should be tested well beyond the designed capacity.

  • Acceptance TestingIn contract-based projects acceptance testing is carried out by the customer.The aim is to determine whether the system meets its specification:this involves validating the system against the original SRS document.After successful system testing the customer takes delivery and you finally get paid!

  • ReferencesEssential Reading:Pressman Chapters 17 & 18.Background Reading:Pfleeger Chapters 7, 8 & 9;Sommerville Chapters 19 & 20.

  • ImplementationWhen a new ICT system has been developed, it is ready is be implemented into the working environment, replacing the original system. There are four strategies that can be used to do this: direct phased pilot parallel running

  • Direct implementation

    Advantages: The most rapid of all the strategies, provided it works! Less risk of confusion between old and new systems. Disadvantages: Most stressful for the users - the old system has gone so there is no going back if they have difficulties. Most difficult to train staff on as the new system was not in place to learn on before the change over. Most stressful for the developers - all the data and files from the old system will have to be converted ready for use on the new one. Most risky - if the new system does not work properly then there is nothing to fall back on.

  • PHASED implementation

    Advantages: Very structured, each phase can be fully evaluated before moving onto the next one. Lower risk, a well planned and controlled introduction of the new system. Easy to train staff by letting them learn new skills on each phase as it is introduced. Disadvantages: Slower than direct implementation. Although each phase is easy to evaluate, you have to wait until all the phases are complete before you can evaluate the whole change over.

  • PILOT implementation

    Advantages: Easy to control, the pilot can be halted at any time. Easy to evaluate because the new and old systems are both running. Low risk, if a small-scale pilot fails then not too much has been lost. Easy to train staff by letting them learn new skills on the pilot system. Disadvantages: It can be slow to get a pilot to completely replace the old system. A pilot may not show up problems that a full-scale implementation would. This is because a system can work well as a small-scale pilot but has difficulties when it is scaled up to a full operating system with more realistic volumes of data to be processed

  • PHASED implementation

    Advantages: If there are initial problems with the new system then the old one can still be used. Both systems can easily be compared. Easy to train staff by letting them learn new skills on the parallel system. Easy to evaluate because the new and old systems are both running. Disadvantages: Expensive - both systems are being run as fully operating versions so both are doing the same job. This may mean duplication of staff and hardware. Some risk - there is a greater chance of confusion or errors if the two different systems are being run side-by-side.