Software Testing Fundamentals 24S2 PDF
Document Details
Uploaded by DeadCheapJasper8678
Tags
Summary
This document provides an overview of software testing fundamentals including the purpose, principles, and aims of software testing. It also covers the various levels and types of testing.
Full Transcript
Official (Closed) and Non-Sensitive Software Testing Fundamentals 24S2 Official (Closed) and Non-Sensitive Learning Outcomes Explain the purpose of testing D...
Official (Closed) and Non-Sensitive Software Testing Fundamentals 24S2 Official (Closed) and Non-Sensitive Learning Outcomes Explain the purpose of testing Describe the 7 principles of software testing Explain the aims of software testing at different levels Official (Closed) and Non-Sensitive Software Testing Overview 1. Why is testing necessary? 2. What is testing? 3. Fundamental test principles Fundamental of Testing Overview of Software Testing Test Linking to 1. Test Levels 1. Black box testing Design SDLC 2. Test types 2. White box testing Techniques Official (Closed) and Non-Sensitive Software Testing Official (Closed) and Non-Sensitive Fundamentals of Testing Focusing on Why and What is Testing Why is testing necessary? To verify the software system behaves what it is expected to be. To keep software under control so that it does not cause harm to us What is testing? A systematic approach to find and report defects of a software system Necessary corrections are followed up and then re-test it again Part of the overall quality in any software Official (Closed) and Non-Sensitive Fundamentals of Testing Focusing on Why and What is Testing Testing principles Testing shows the presence of bugs; exhaustive testing is impossible Early testing is recommended; absence of errors fallacy Testing activities Planning and control, analysis and design test cases Carrying out testing and reporting Official (Closed) and Non-Sensitive Objectives of Software Testing Verification Process confirming that the software meets its specifications Building the software right Validation Process confirming that the software meets the users/business intended environment. Building the right software Defect (Bug) Detection and Elimination A variance between the expected and actual result Official (Closed) and Non-Sensitive 7 Principles of Software Testing Exhaustive testing is impossible This is only possible if the software system under test has an extremely simple logical structure and limited inputs. Otherwise, exhaustive testing is not possible. For this reason, risk and priorities are used to focus on the most important aspects to test. Defect clustering In larger systems, it is usually the more complex modules that will exhibit the majority of the defects. Therefore, it is possible to identify the target areas where the higher proportion of defects can be found while still searching for defects from the remaining modules. The pesticide paradox Like over-used pesticide, a set of tests that is used repeatedly on the same software product will decrease in efficacy. Using a variety of tests and techniques will expose a range of defects across different areas of the product. Testing shows the presence of bugs Conduct testing on software system can only show that one or more defects exist. It cannot show that the software system is error free. Therefore, testing should be designed to find as many defects as possible. Official (Closed) and Non-Sensitive 7 principles of Software Testing Absence of errors fallacy Declaring that a test has no outstanding defects is not the same as declaring the software system is “error-free”. In order to ensure that adequate software testing procedures are carries out in every situation, testers should assume that all software contains some faults. Early testing The earlier the testing activities is started, the longer the elapsed time available. Work products are created throughout the software development life cycle. As soon as these are ready, we can test them. Moreover, it is more cost effective to correct the defects as it costs less to fix them. Testing is context dependent Different testing is needed for different circumstances. The approach to test a e-commerce web site is different from an air-traffic control system. Therefore, risk can be a large factor to determine the type of testing that is needed. Official (Closed) and Non-Sensitive Cost of Fixing Critical Defects $16,000 $14,102 $14,000 $12,000 $10,000 $7,136 $8,000 $6,000 $4,000 $977 $2,000 $455 $139 $0 Source: A CISO’s Guide to Application Security (www.Fortify.com) Official (Closed) and Non-Sensitive Software Testing Best Practices Always test against complete and accurate requirement specifications. Document the test cases and record the test results. Test early, finding more errors earlier will ultimately reduce costs. Complement testing with techniques such as static analysis and dynamic analysis (peer reviews/code inspections). Have the right attitude to testing - it should be a challenge, not the chore it so often becomes. 23S1 Official (Closed) and Non-Sensitive Types of Testing and Testing Levels Testing Levels Acceptance Unit Test testing Integration Test System System Test Testing Acceptance Test Integration testing Types of Testing Black box testing Unit testing White box testing Official (Closed) and Non-Sensitive Unit Testing Testing on a single building block or a component of a software system. Examples: a function in a C/C++ program a method in Java/C# program Focus: To verify components developed Generally white box testing techniques will Unit testing be used Official (Closed) and Non-Sensitive Integration Testing Involves 2 or more units join together to verify whether they are working and function cohesively Focus: To verify combined modules ( sub-systems ) Integration meet functional specifications. testing Need to re-run unit testing for modules if modifications are carried out. Generally black box testing techniques will Unit testing be used Official (Closed) and Non-Sensitive System Testing To test the system, as a whole, in iterations System Basing on scenario(s) from the use cases Testing Focus : Integration testing To verify that the system meets the functional & non-functional requirements by the developer team internally The system test looks at the system Unit testing functions from the perspective of the customer before UAT. Official (Closed) and Non-Sensitive System Testing (Continuation) Every time changes are made to the system, regression testing attempts to verify that: System System works as specified after the changes Testing are made Original tested functionality produces the Integration same expected tested result testing No new bug has been introduced due to the change or bug fixes Unit testing Official (Closed) and Non-Sensitive System Testing (Continuation) Non-functional System Testing includes but does not limit to the following: Performance testing: Performance- speed, scalability , stability System Load - Application behavior under normal & Testing heavy load Stress- Application behavior beyond normal & Integration peak load testing Interoperability testing Hardware testing Security testing Unit testing Official (Closed) and Non-Sensitive Acceptance Testing Also known as UAT (User Acceptance Testing) Acceptance testing Formal testing conducted to determine whether a system satisfies its acceptance criteria, and it is System Testing carried out by the end-users Integration Focus: Evaluate the software application against testing the end-user requirement and specification. Once the users acknowledge the successful Unit testing testing, it indicates that the software system is ready to be deployed for live usage Official (Closed) and Non-Sensitive People - The test team Unit Tests System Test To be developed and executed by the To be tested by software quality developers control/assurance engineers Separated from the development team - usually has a separate head count and a separate budget Integration Test User Acceptance Test To be performed by the system To be tested by user representatives integration test engineers. The engineers involved need to know the software modules and their interaction very well Official (Closed) and Non-Sensitive V Model of Software Testing in SDLC Requirement Acceptance Acceptance test planning specifications Testing Functional System test planning System Testing specifications Integration These are These are Technical Integration development test planning testing specifications Testing Activities activities (Test levels Unit test Types of testing) Program planning Unit Testing specifications Coding Official (Closed) and Non-Sensitive Agile (Scrum) Software Development Process Traditional The team has to decide Build + Deploy/ Requirements Design what to test while the final Test Deliver product is still unfinished. In each sprint, the testing Agile (Scrum) activities may be: Requirements Potentially identify the test Daily scrum Shippable Product scenarios Increment 2-4 weeks write the test cases Sprint prepare the test data execute the test cases report bugs and verify Product Backlog Sprint Backlog fixes Software Testing is not a phase, it is built into each iteration Automate testing as much as possible. Official (Closed) and Non-Sensitive Summary What is software testing and why software testing is needed Levels of software testing at different levels