LECTURE 3 BASIC CONCEPTS OF SOFTWARE TESTING - I WHAT IS SOFTWARE TESTING? Testing can find faults in the software but cannot prove that the software is error-free. OBJECTIVES OF SOFTWARE TESTING To test whether the software is working as per the functional requirements. To find errors in the software. To test the quality of software. To identify weakness / risks / limitations in the software. WHY SHOULD TESTING BE PERFORMED? Humans make mistakes. Humans can make errors while typing the code, understanding the requirements and interpreting data etc. Hence it is recommended to test the software. Many people use software directly / indirectly almost daily. From bank transactions to using cell phones, everybody use some kind of software. Any mistake in the software can lead to many problems. Software is used even for medical purposes and even a smallest mistake can cost lives. Software errors can lead to fatal accidents. Software errors can not only lead to loss of money for many companies but can also affect their brand and reputation. CONSTRAINS ON TESTING Budget and Schedule Changes in Technology Limited Tester s Skills DIFFERENCE BETWEEN SOFTWARE VERIFICATION AND VALIDATION: Verification Validation 1. Verification is a static practice of verifying 1. Validation is a dynamic mechanism of documents, design, code and program. validating and testing the actual product. 2. It does not involve executing the code. 2. It always involves executing the code. 3. It is human based checking of documents and files. 3. It is computer based execution of program. Prepared by: Engr. M. Nadeem Page 1
4. Verification uses methods like inspections, reviews, walkthroughs, and Desk-checking etc. 5. Verification is to check whether the software conforms to specifications. 6. It can catch errors that validation cannot catch. It is low level exercise. 7. Target is requirements specification, application and software architecture, high level, complete design, and database design etc. 8. Verification is done by QA team to ensure that the software is as per the specifications in the SRS document. 9. It generally comes first-done before validation. 4. Validation uses methods like black box (functional) testing, gray box testing, and white box (structural) testing etc. 5. Validation is to check whether software meets the customer expectations and requirements. 6. It can catch errors that verification cannot catch. It is High Level Exercise. 7. Target is actual product-a unit, a module, a bent of integrated modules, and effective final product. 8. Validation is carried out with the involvement of testing team. 9. It generally follows after verification. Example of verification and validation are explained below:- Suppose we have the specifications related to the project than by checking that specifications without executing to see whether the specifications are up to the mark or not is what we have done in verification. Similarly Validation of the software is done to make sure that the software always meets the requirements of the customer by executing the specifications of the project and product. Note that the customer and end users are concerned in validation of the software. It is also crucial to differentiate between end users, and customers. Considering example, if you are developing a library monitoring system, the librarian is the client and the person who issue the books, collect fines etc. are comes under the category of the end users. Techniques or Methods of Verification and Validation Methods of Verification Methods of Validation Walkthrough Unit Testing Inspection System Testing Review Integration Testing Acceptance Testing Lots of people use verification and validation interchangeably but both have different meanings. Prepared by: Engr. M. Nadeem Page 2
STATIC TESTING Under Static Testing code is not executed. Rather it manually checks the code, requirement documents, and design documents to find errors. Hence, the name "static". Main objective of this testing is to improve the quality of software products by finding errors in early stages of the development cycle. This testing is also called as Non-execution technique or verification testing. Testing Techniques used for Static Testing: Informal Reviews: This is one of the types of review which doesn't follow any process to find errors in the document. Under this technique, you just review the document and give informal comments on it. Technical Reviews: A team consisting of your peers review the technical specification of the software product and checks whether it is suitable for the project. They try to find any discrepancies in the specifications and standards followed. This review concentrates mainly on the technical document related to the software such as Test Strategy, Test Plan and requirement specification documents. Walkthrough: The author of the work product explains the product to his team. Participants can ask questions if any. Meeting is led by the author. Scribe makes note of review comments. Inspection: The main purpose is to find defects and meeting is led by trained moderator. This review is a formal type of review where it follows strict process to find the defects. Prepared by: Engr. M. Nadeem Page 3
Reviewers have checklist to review the work products.they record the defect and inform the participants to rectify those errors. Static code Review: This is systematic review of the software source code without executing the code. It checks the syntax of the code, coding standards, code optimization, etc. This is also termed as white box testing.this review can be done at any point during development. DYNAMIC TESTING Under Dynamic Testing code is executed. It checks for functional behavior of software system, memory/cpu usage and overall performance of the system. Hence the name "Dynamic" Main objective of this testing is to confirm that the software product works in conformance with the business requirements. This testing is also called as Execution technique or validation testing. Also, Non-functional testing like performance, security testing fall under the category of dynamic testing. Testing Techniques used for Dynamic Testing: Unit Testing: Under unit testing, individual units or modules is tested by the developers. It involves testing of source code by developers. Integration Testing: Individual modules are grouped together and tested by the developers. The purpose is to determine that modules are working as expected once they are integrated. System Testing: System testing is performed on the whole system by checking whether the system or application meets the requirement specification document. DIFFERENCE BETWEEN STATIC AND DYNAMIC TESTING: Static Testing Dynamic Testing 1. Testing done without executing the 1. Testing done by executing the program program 2. This testing does verification process 2. Dynamic testing does validation process 3. Static testing is about prevention of defects 3. Dynamic testing is about finding and fixing the defects 4. Static testing gives assessment of code and documentation 4. Dynamic testing gives bugs/bottlenecks in the software system. 5. Static testing involves checklist and process to be followed 5. Dynamic testing involves test cases for execution 6. This testing can be performed before 6. Dynamic testing is performed after Prepared by: Engr. M. Nadeem Page 4
compilation compilation 7. Static testing covers the structural and 7. Dynamic testing covers the executable file statement coverage testing of the code 8. Cost of finding defects and fixing is less 8. Cost of finding and fixing defects is high 9. Return on investment will be high as this 9. Return on investment will be low as this process involved at early stage process involves after the development phase 10. More reviews comments are highly 10. More defects are highly recommended for recommended for good quality good quality. 11. Requires loads of meetings 11. Comparatively requires lesser meetings Verification and Validation are two measures used to check that the software product meets the requirements specifications. Static testing involves verification whereas dynamic testing involves validation. Together they help improve software quality. Prepared by: Engr. M. Nadeem Page 5