Software Testing

  • Published on
    14-Nov-2014

  • View
    14

  • Download
    1

Embed Size (px)

DESCRIPTION

Explains in detail about Testing and types

Transcript

<p>MSIT 32 Software Quality and Testing</p> <p>1</p> <p>SOFTWARE QUALITY &amp; TESTING(MSIT - 32)</p> <p>: Contributing Author :</p> <p>Dr. B.N. SubrayaInfosys Technologies Ltd., Mysore</p> <p>PDF created with pdfFactory Pro trial version www.pdffactory.com</p> <p>2</p> <p>PDF created with pdfFactory Pro trial version www.pdffactory.com</p> <p>MSIT 32 Software Quality and Testing</p> <p>3</p> <p>a</p> <p>Contents</p> <p>Chapter 1 INTRODUCTION TO SOFTWARE TESTING 1.1 1.2 1.3 1.4 1.5 1.6 1.7 Learning Objectives.......................................................................... Introduction...................................................................................... What is Testing?............................................................................... Approaches to Testing....................................................................... Importance of Testing....................................................................... Hurdles in Testing............................................................................. Testing Fundamentals........................................................................ 1 1 1 3 5 6 6 7</p> <p>Chapter 2 SOFTWARE QUALITY ASSURANCE 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 2.10 2.11 2.12 Learning Objectives.......................................................................... Introduction...................................................................................... Quality Concepts............................................................................... Quality of design............................................................................... Quality of Conformance.................................................................... Quality Control (QC)......................................................................... Quality Assurance (QA).................................................................... Software Quality ASSURANCE (SQA)............................................. Formal Technical Reviews (FTR)....................................................... Statistical Quality Assurance.............................................................. Software Reliability........................................................................... The SQA Plan.................................................................................. 10 10 10 11 12 12 13 13 14 21 27 30 31</p> <p>PDF created with pdfFactory Pro trial version www.pdffactory.com</p> <p>4Chapter 3 PROGRAM INSPECTIONS, WALKTHROUGHS AND REVIEWS QUALITY ASSURANCE 3.1 3.2 3.3 3.4 3.5 3.6 Learning Objectives.......................................................................... Introduction...................................................................................... Inspections and Walkthroughs............................................................ Code Inspections.............................................................................. An Error Check list for Inspections.................................................... Walkthroughs....................................................................................</p> <p>Contents</p> <p>36 36 36 37 38 39 42</p> <p>Chapter 4 TEST CASE DESIGN 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 Learning Objectives.......................................................................... Introduction...................................................................................... White Box Testing............................................................................ Basis Path Testing............................................................................ Control Structure testing.................................................................... Black Box Testing............................................................................ . Static Program Analysis.................................................................... Automated Testing Tools................................................................... 43 43 43 44 45 49 53 57 58</p> <p>Chapter 5 TESTING FOR SPECIALIZED ENVIRONMENTS 5.1 5.2 5.3 5.4 5.5 Learning Objectives.......................................................................... Introduction...................................................................................... Testing GUIs.................................................................................... Testing of Client/Server Architectures................................................ Testing documentation and Help facilities............................................ 60 60 60 60 63 63</p> <p>Chapter 6 SOFTWARE TESTING STRATEGIES 6.1. 6.2. 6.3 6.4 6.5 6.6 6.7 6.8 Learning Objectives.......................................................................... Introduction...................................................................................... A Strategic Approach To Software Testing......................................... Verification and Validation.................................................................. Organizing for software testing.......................................................... A Software Testing Strategy.............................................................. Strategic issues................................................................................. Unit Testing...................................................................................... 65 65 65 69 70 71 72 75 75</p> <p>PDF created with pdfFactory Pro trial version www.pdffactory.com</p> <p>MSIT 32 Software Quality and Testing</p> <p>580 85 86 89</p> <p>6.9 6.10 6.11 6.12</p> <p>Integration Testing............................................................................ Validation Testing.............................................................................. System Testing.................................................................................. Summary..........................................................................................</p> <p>Chapter 7 TESTING OF WEB BASED APPLICATIONS 7.1 7.2 7.3 7.4 7.5 Introduction...................................................................................... Testing of Web Based Applications: Technical Peculiarities.................. Testing of Static Web- based applications........................................... Testing of Dynamic Web based applications........................................ Future Challenges............................................................................. 91 91 91 92 94 96</p> <p>Chapter 8 TEST PROCESS MODEL 8.0 8.1 Need for Test Process Model............................................................ Test Process Cluster.......................................................................... 97 97 98</p> <p>Chapter 9 TEST METRICS 9.0 9.1 9.2 9.3 9.4 9.5 Introduction...................................................................................... Overview of the Role and Use of Metrics........................................... Primitive Metric and Computed Metrics.............................................. Metrics typically used within the Testing Process................................ Defect Detection Effectiveness percentage (DDE)............................. Setting up and administering a Metrics Program.................................. 103 103 104 104 105 106 106</p> <p>PDF created with pdfFactory Pro trial version www.pdffactory.com</p> <p>6</p> <p>PDF created with pdfFactory Pro trial version www.pdffactory.com</p> <p>MSIT 32 Software Quality and Testing</p> <p>7</p> <p>Chapter 1</p> <p>Introduction to Software Testing</p> <p>1.1 LEARNING OBJECTIVES</p> <p>Yl l l l l</p> <p>ou will learn about:</p> <p>What is Software Testing? Need for software Testing, Various approaches to Software Testing, What is the defect distribution, Software Testing Fundamentals.</p> <p>1.2 INTRODUCTIONSoftware testing is a critical element of software quality assurance and represents the ultimate process to ensure the correctness of the product. The quality product always enhances the customer confidence in using the product thereby increases the business economics. In other words, a good quality product means zero defects, which is derived from a better quality process in testing. The definition of testing is not well understood. People use a totally incorrect definition of the word testing, and that this is the primary cause for poor program testing. Examples of these definitions are such statements as Testing is the process of demonstrating that errors are not present, The purpose of MSIT 32 Software Quality and Testing</p> <p>1</p> <p>PDF created with pdfFactory Pro trial version www.pdffactory.com</p> <p>8</p> <p>Chapter 1 - Introduction to Software Testing</p> <p>testing is to show that a program performs its intended functions correctly, and Testing is the process of establishing confidence that a program does what it is supposed to do. Testing the product means adding value to it, which means raising the quality or reliability of the program. Raising the reliability of the product means finding and removing errors. Hence one should not test a product to show that it works; rather, one should start with the assumption that the program contains errors and then test the program to find as many errors as possible. Thus a more appropriate definition is: Testing is the process of executing a program with the intent of finding errors.</p> <p>Purpose of TestingTo show the software works: It is known as demonstration-oriented To show the software doesnt work: It is known as destruction-oriented To minimize the risk of not working up to an acceptable level: it is known as evaluation-oriented</p> <p>Need for TestingDefects can exist in the software, as it is developed by human beings who can make mistakes during the development of software. However, it is the primary duty of a software vendor to ensure that software delivered does not have defects and the customers day-to-day operations do not get affected. This can be achieved by rigorously testing the software. The most common origin of software bugs is due to:l l l l</p> <p>Poor understanding and incomplete requirements Unrealistic schedule Fast changes in requirements Too many assumptions and complacency</p> <p>Some of major computer system failures listed below gives ample evidence that the testing is an important activity of the software quality process.l</p> <p>In April of 1999, a software bug caused the failure of a $1.2 billion military satellite launch, the costliest unmanned accident in the history of Cape Canaveral launches. The failure was the latest in a string of launch failures, triggering a complete military and industry review of U.S. space launch programs, including software integration and testing processes. Congressional oversight hearings were requested. On June 4, 1996, the first flight of the European Space Agencys new Ariane 5 rocket failed shortly after launching, resulting in an estimated uninsured loss of a half billion dollars. It was reportedly due to the lack of exception handling of a floating-point error in a conversion from a 64-bit integer to a 16-bit signed integer.</p> <p>l</p> <p>PDF created with pdfFactory Pro trial version www.pdffactory.com</p> <p>MSIT 32 Software Quality and Testing</p> <p>9</p> <p>l</p> <p>In January of 2001 newspapers reported that a major European railroad was hit by the aftereffects of the Y2K bug. The company found that many of their newer trains would not run due to their inability to recognize the date 31/12/2000'; the trains were started by altering the control systems date settings. In April of 1998 a major U.S. data communications network failed for 24 hours, crippling a large part of some U.S. credit card transaction authorization systems as well as other large U.S. bank, retail, and government data systems. The cause was eventually traced to a software bug. The computer system of a major online U.S. stock trading service failed during trading hours several times over a period of days in February of 1999 according to nationwide news reports. The problem was reportedly due to bugs in a software upgrade intended to speed online trade confirmations. In November of 1997 the stock of a major health industry company dropped 60% due to reports of failures in computer billing systems, problems with a large database conversion, and inadequate software testing. It was reported that more than $100,000,000 in receivables had to be written off and that multi-million dollar fines were levied on the company by government agencies. Software bugs caused the bank accounts of 823 customers of a major U.S. bank to be credited with $924,844,208.32 each in May of 1996, according to newspaper reports. The American Bankers Association claimed it was the largest such error in banking history. A bank spokesman said the programming errors were corrected and all funds were recovered.</p> <p>l</p> <p>l</p> <p>l</p> <p>l</p> <p>All the above incidents only reiterate the importance of thorough testing of software applications and products before they are put on production. It clearly demonstrates that cost of rectifying defect during development is much less than rectifying a defect in production.</p> <p>1.3 WHAT IS TESTING?l</p> <p>Testing is an activity in which a system or component is executed under specified conditions; the results are observed and recorded and an evaluation is made of some aspect of the system or component - IEEE Executing a system or component is known as dynamic testing. Review, inspection and verification of documents (Requirements, design documents Test Plans etc.), code and other work products of software is known as static testing. Static testing is found to be the most effective and efficient way of testing.</p> <p>l l</p> <p>l</p> <p>PDF created with pdfFactory Pro trial version www.pdffactory.com</p> <p>10l l</p> <p>Chapter 1 - Introduction to Software Testing</p> <p>Successful testing of software demands both dynamic and static testing. Measurements show that a defect discovered during design that costs $1 to rectify at that stage will cost $1,000 to repair in production. This clearly points out the advantage of early testing. Testing should start with small measurable units of code, gradually progress towards testing integrated components of the applications and finally be completed with testing at the application level. Testing verifies the system against its stated and implied requirements, i.e., is it doing what it is supposed to do? It should also check if the system is not doing what it is not supposed to do, if it takes care of boundary conditions, how the system performs in production-like environment and how fast and consistently the system responds when the data volumes are high.</p> <p>l</p> <p>l</p> <p>Reasons for Software BugsFollowing are the reasons for Software Bugs:l</p> <p>Miscommunication or no communication - as to specifics of what an application should or shouldnt do (the applications requirements). Software complexity - the complexity of current software applications can be difficult to comprehend for anyone without experience in modern-day software development. Windowstype interfaces, client-server and distributed applicat...</p>