Chapter 6 – Introduction to Software Testing PDF

Document Details

FluentTachisme447

Uploaded by FluentTachisme447

Ts. Dr. Noorayisahbe Binti Mohd Yaacoub

Tags

software testing software engineering program testing computer science

Summary

This document details the software testing concepts and process, including different types of testing, stages of testing, and testing policies. It focuses on introduction to software testing and is suited for introductory courses in computer science.

Full Transcript

Chapter 6 – Introduction to Software Testing P R E PRA RED BY TS. DR. N OOR AYISAHBE BI N T I M OHD YA ACOB Adapted from: 1 Software Engineering, Ian Sommerville, Tenth Editio...

Chapter 6 – Introduction to Software Testing P R E PRA RED BY TS. DR. N OOR AYISAHBE BI N T I M OHD YA ACOB Adapted from: 1 Software Engineering, Ian Sommerville, Tenth Edition Topics covered What is Software Testing Verification vs validation Fault Software Inspection and Testing Test cases Test Plan Stage of Testing General Testing Guidelines Requirement Based Testing 2 Program testing Testing is intended to show that a program does what it is intended to do and to discover program defects before it is put into use. When you test software, you execute a program using artificial data. You check the results of the test run for errors, anomalies or information about the program’s non-functional attributes. 3 Program testing Cont. Can reveal the presence of errors NOT their absence. Testing is part of a more general verification and validation process, which also includes static validation techniques. 4 Program testing goals To demonstrate to the developer and the customer that the software meets its requirements. ◦ For custom software, this means that there should be at least one test for every requirement in the requirements document. For generic software products, it means that there should be tests for all of the system features, plus combinations of these features, that will be incorporated in the product release. 5 Program testing goals Cont. To discover situations in which the behavior of the software is incorrect, undesirable or does not conform to its specification. ◦ Defect testing is concerned with rooting out undesirable system behavior such as system crashes, unwanted interactions with other systems, incorrect computations and data corruption. 6 Validation and defect testing The first goal leads to validation testing ◦ You expect the system to perform correctly using a given set of test cases that reflect the system’s expected use. The second goal leads to defect testing ◦ The test cases are designed to expose defects. The test cases in defect testing can be deliberately obscure and need not reflect how the system is normally used. 7 Testing process 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. Defect testing ◦ To discover faults or defects in the software where its behaviour 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. 8 An input-output model of program testing 9 Verification vs validation Verification: "Are we building the product right”. The software should conform to its specification. Validation: "Are we building the right product”. The software should do what the user really requires. 10 V & V confidence Aim of V & V is to establish confidence that the system is ‘fit for purpose’. Depends on system’s purpose, user expectations and marketing environment ◦ Software purpose ◦ The level of confidence depends on how critical the software is to an organisation. ◦ User expectations ◦ Users may have low expectations of certain kinds of software. ◦ Marketing environment ◦ Getting a product to market early may be more important than finding defects in the program. 11 What is a Fault? A fault (or bug) is an error in the software that causes it to behave unexpectedly or incorrectly. Types of Faults: Syntax Faults: Mistakes in the code syntax Logic Faults: Errors in the program logic Runtime Faults: Errors that occur during program execution 12 Inspections and testing Software inspections concerned with analysis of the static system representation to discover problems ◦ May be supplemented by tool-based document and code analysis. 13 Inspections and testing Cont. Software testing concerned with exercising and observing product behaviour ◦ The system is executed with test data and its operational behaviour is observed. 30/10/2014 CHAPTER 8 SOFTWARE TESTING 14 Inspections and testing 15 Software inspections These involve people examining the source representation with the aim of discovering anomalies and defects. Inspections not require execution of a system so may be used before implementation. 16 Software inspections Cont. They may be applied to any representation of the system (requirements, design, configuration data, test data, etc.). They have been shown to be an effective technique for discovering program errors. 17 Advantages of inspections During testing, errors can mask (hide) other errors. Because inspection is a static process, you don’t have to be concerned with interactions between errors. Incomplete versions of a system can be inspected without additional costs. If a program is incomplete, then you need to develop specialized test harnesses to test the parts that are available. 18 Advantages of inspections Cont. As well as searching for program defects, an inspection can also consider broader quality attributes of a program, such as compliance with standards, portability and maintainability. 19 Inspections and testing Inspections and testing are complementary and not opposing verification techniques. Both should be used during the V & V process. 20 Inspections and testing Cont. Inspections can check conformance with a specification but not conformance with the customer’s real requirements. Inspections cannot check non-functional characteristics such as performance, usability, etc. 21 A model of the software testing process 22 What is a Test Cases? A test cases is a specific set of instructions or conditions used to test a particular aspect of a software application. Help identify specific defects. Serve as documentation for future testing and debugging. 23 What is a Test Cases? Cont. It describes the steps to take and what the software should do if it works correctly. When all test cases have been executed successfully is a standard completion criterion in software testing. It indicates that all planned tests have been run, and the expected outcomes have been achieved, confirming that the software meets its requirements. 24 What is a Test Plan? A test plan is a document that outlines the overall strategy and scope of testing for a software project. It serves as a guide for the testing process. It also lists the tools, team members, and steps needed to make sure the software works properly. 25 What is a Test Plan? Cont. It also lists the tools, team members, and steps needed to make sure the software works properly. Deadlines for all testing activities are essential in a test plan, as they ensure the testing process is time-bound, organized, and aligns with the overall project schedule. 26 Stages of testing Development testing, where the system is tested during development to discover bugs and defects. Release testing, where a separate testing team test a complete version of the system before it is released to users. User testing, where users or potential users of a system test the system in their own environment. 27 Development testing Unit Testing: Testing individual components or modules of the system. Integration Testing: Ensuring that different components work well together. System Testing: Checking the behavior of the entire system. 28 Release testing Performed on a complete version of the software before it is delivered to customers. Usually conducted by a separate testing team to ensure objectivity. Aims to validate that all specified features, functionality, and performance requirements are met. 29 User testing Conducted by users or customers in their actual working environments. Helps identify issues related to usability, performance, and reliability that might not be captured in a controlled testing environment. 30 User testing Cont. Alpha Testing: Performed at the developer’s site with user involvement. Beta Testing: Conducted in the user’s environment with a nearly finished product. Acceptance Testing: Users confirm if the software meets their needs and is ready for deployment. 31 General testing guidelines Choose inputs that force the system to generate all error messages Design inputs that cause input buffers to overflow Repeat the same input or series of inputs numerous times 32 General testing guidelines Cont. Force invalid outputs to be generated Force computation results to be too large or too small. 33 Testing policies Exhaustive system testing is impossible so testing policies which define the required system test coverage may be developed. 34 Testing policies Cont. Examples of testing policies: ◦ All system functions that are accessed through menus should be tested. ◦ Combinations of functions (e.g. text formatting) that are accessed through the same menu must be tested. ◦ Where user input is provided, all functions must be tested with both correct and incorrect input. 35 Requirements based testing Requirements-based testing involves examining each requirement and developing a test or tests for it. Why is it Important? Ensures the system does what it is supposed to. Helps identify missing or incomplete requirements. 36 Requirements based testing Cont. Key Steps: Identify requirements from the specification. Design tests for each requirement. Verify that the software behaves as expected. 37 Key points Testing can only show the presence of errors in a program. It cannot demonstrate that there are no remaining faults. Development testing is the responsibility of the software development team. A separate team should be responsible for testing a system before it is released to customers. 38 Key points When testing software, you should try to ‘break’ the software by using experience and guidelines to choose types of test case that have been effective in discovering defects in other systems. Wherever possible, you should write automated tests. The tests are embedded in a program that can be run every time a change is made to a system. 39 Thank you. 40

Use Quizgecko on...
Browser
Browser