Software Testing CS 408
Total Page:16
File Type:pdf, Size:1020Kb
Software Testing CS 408 Lecture 5: Higher-Order Testing 1/31/17 Myers, Chapter 6 Basics • A software error occurs when the program does not do what its end user reasonably expects it to do • Even if you could perform an absolutely-perfect module test, you still could not guarantee that you have found all software errors • To complete testing, higher-order testing is necessary • Software development is largely a process of communicating information about the eventual product and translating this information from one form to another 2 Basics • Translate the software user's needs into a set of written requirements (Product Backlog in Scrum) • Design -- partitions the system into individual programs, components, or subsystems, and defines their interfaces • Translate the Design into source code Most software errors stem from breakdowns in information communication One solution is to orient distinct testing processes toward particular classes of errors Need for higher-order testing increases along with the size of the program 3 Basics 4 Function Testing • Function testing is the process of attempting to find discrepancies between the program and the external specification • An external specification is a precise description of the program's behavior from the end-user point of view • Function testing is normally a black-box activity Equivalence partitioning, boundary value analysis, cause-effect graphing, and error-guessing methods Covered back in Chapter 5 5 System Testing • System testing is not a process of testing the functions of the complete system or program • System testing has a particular purpose: to compare the system or program to its original objectives • Several System Test categories can be used. Many of these are related to non-functional Software Quality Attributes Some of these will be important in CS 40800 (e.g., Stress Testing, Performance Testing, Usability Testing, ....) But, you are not required to do all (or even any!) of these 6 Sanity and Smoke Testing Sanity testing is a very brief run-through of the functionality of a program to assure that the software works roughly as expected. This is often prior to a more exhaustive round of testing Smoke Testing Origin -- physical tests using smoke made to closed systems of pipes to detect cracks or breaks Subset of test cases that cover the most important functionality of a component or system are selected and run to ascertain if the most crucial functions of a program work correctly Purpose is to determine whether the application is so badly- broken that further testing is unnecessary 7 Performance Testing Many programs have specific performance or efficiency objectives, stating such properties as response times and throughput rates under certain workload and configuration conditions Test cases should be designed to show that the program does not satisfy its performance objectives Volume Testing Subject the program to heavy volumes of data Purpose of volume testing is to show that the program cannot handle the volume of data specified in its objectives Example: The system is supposed to be able to store, retrieve, and modify information concerning 1.5 million customers 8 Stress Testing Stress testing subjects the program to heavy loads or stresses A heavy stress is a peak volume of data, or activity, encountered over a short span of time If an air traffic control system is supposed to keep track of up to 200 planes in its sector, you could stress-test it by simulating the presence of 200 planes ... or more. If an operating system is supposed to support a maximum of 150 concurrent jobs, the system could be stressed by attempting to run 150 jobs simultaneously ... or more. Web-based applications are common subjects of stress testing (Chapter 10) You could stress a mobile device application -- a mobile phone operating system, for example -- by launching multiple applications that run and stay resident, then try making or receiving one or more telephone calls 9 Usability Testing Tasking the ultimate end user of an application with testing the software in a real-world environment Covered in next chapter (Chapter 7) Security Testing Many programs now have specific security objectives Security testing is the process of attempting to devise test cases that subvert the program's security checks One way to devise such test cases is to study known security problems in similar systems and generate test cases that attempt to demonstrate comparable problems in the system you are testing Web-based applications often need a higher level of security testing than do most applications (Chapter 10) 10 Storage Testing Programs occasionally have storage objectives that state, for example, the amount of system memory the program uses and the size of temporary or log files Configuration Testing Some software must support a variety of hardware configurations, including various types and numbers of I/0 devices and communications lines, or different memory sizes Often, the number of possible configurations is too large to test each one Test a representative subset 11 Hey, You Have Given Me Too Many Knobs! Understanding and Dealing with Over-Designed ConfigurationinSystemSoftware Tianyin Xu*, Long Jin*, Xuepeng Fan*‡,YuanyuanZhou*, Shankar Pasupathy†,andRukmaTalwadker† *University of California San Diego, USA ‡Huazhong Univ. of Science & Technology, China †NetApp, USA {tixu, longjin, xuf001, yyzhou}@cs.ucsd.edu {Shankar.Pasupathy, Rukma.Talwadker}@netapp.com Configuration Testing ABSTRACT 700 500 s Storage-A s r 600 r MySQL e e t 400 Configuration problems are not only prevalent, but also severely t e 500 e m 5.6.2 m impair the reliability of today’s system software. One fundamental a a r r 300 5.5.0 a 400 a 5.1.3 p reason is the ever-increasing complexity of configuration, reflected p f f 5.0.16 o o 300 by the large number of configuration parameters (“knobs”). With 200 4.1.0 r r e e 4.0.12 b hundreds of knobs, configuring system software to ensure highre- b 200 3.23.0 m m 100 u u 100 liability and performance becomes a daunting, error-prone task. N N This paper makes a first step in understanding a fundamental 0 0 1/1999 1/2003 1/2007 1/2011 1/2014 question of configuration design: “do users really need so many 7/2006 7/2008 7/2010 7/2012 7/2014 Releasetime Releasetime knobs?”Toprovidethequantitativelyanswer,westudythecon- 600 200 figuration settings of real-world users, including thousands of cus- s Apache s r Hadoop 500 r 2.0.0 e e 160 t tomers of a commercial storage system (Storage-A), and hundreds t e 2.3.4 e 1.0.0 m 400 m of users of two widely-used open-source system software projects. a a r r 120 a a 0.19.0 p Our study reveals a series of interesting findings to motivatesoft- p 300 f f 2.2.14 o o ware architects and developers to be more cautious and disciplined 2.0.35 80 r r e e 200 b in configuration design. Motivated by these findings, we provide b 1.3.24 0.1.0 m m 40 u afewconcrete,practicalguidelineswhichcansignificantlyreduce u 100 1.3.14 MapReduce N N HDFS the configuration space. Take Storage-A as an example, the guide- 0 0 lines can remove 51.9% of its parameters and simplify 19.7% of 1/1998 1/2002 1/2006 1/2010 1/2014 1/2006 1/2008 1/2010 1/2012 1/2014 Releasetime Releasetime the remaining ones with little impact on existing users. Also, we study the existing configuration navigation methods in the context Figure 1: The increasing number of configuration parameters with of “too many knobs” to understand their effectiveness in deaXuling et. al.,software FSE’15 evolution. Storage-A is a commercial storage system from a with the over-designed configuration, and to provide practices for major storage company in the U.S. 12 building navigation support in system software. Categories and Subject Descriptors: D.2.10 [Software Engineer- all the customer-support cases in a major storage company in the ing]: Methodologies U.S., and were the most significant contributor (31%) among all the high-severity cases [75]. Rabkin and Katz reported that config- General Terms: Design, Human Factors, Reliability uration issues were the dominant source of support cost in Hadoop clusters (based on data from Cloudera Inc.), in terms of both the Keywords: Configuration, Complexity, Simplification, Navigation, number of support cases and the amount of supporting time [46]. Parameter, Difficulty, Error Moreover, configuration errors, the after-effects of configuration difficulties, have become one of the major causes of system fail- 1. INTRODUCTION ures. Barroso and Hölzle reported that configuration errors were the second major cause of service-level disruptions at one of Google’s 1.1 Motivation main services [16]. Recently, a number of outages of Internetand In recent years, configuration problems have drawn tremendous cloud services, including Google, LinkedIn, Microsoft Azure, and attention for their increasing prevalence and severity. Forexample, Amazon EC2, were caused by configuration errors [35, 59, 63, 68]. Yin et al. reported that configuration issues accounted for 27% of One fundamental reason for today’s prevalent configuration is- sues is the ever-increasing complexity of configuration, especially in system software. This is reflected by the large and still increasing Permission to make digital or hard copies of all or part of this work for personal or number of configuration parameters (“knobs”), as well as various classroom use is granted without fee provided that copies are not made or distributed configuration constraints and consistency requirements [32, 39, 45, for profit or commercial advantage and that copies bear this notice and the full citation on the first page.