1、These courseware materials are to be used in conjunction with Software Engineering: A Practitioners Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright 1996, 2001, 2005,1,Software Engineering: A Practitioners Approach, 6/e Chapter 13 Software Testing Strateg
2、ies 测试策略 copyright 1996, 2001, 2005 R.S. Pressman & Associates, Inc. For University Use Only May be reproduced ONLY for student use at the university level when used in conjunction with Software Engineering: A Practitioners Approach. Any other reproduction or use is expressly prohibited.,These cours
3、eware materials are to be used in conjunction with Software Engineering: A Practitioners Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright 1996, 2001, 2005,2,Software Testing,Testing is the process of exercising a program with the specific intent of findin
4、g errors prior to delivery to the end user.( 测试是在软件交付给用户前,以找出软件中的 错误为目的的一种软件运行过程),These courseware materials are to be used in conjunction with Software Engineering: A Practitioners Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright 1996, 2001, 2005,3,What
5、Testing Shows,errors,requirements conformance,performance,an indication of quality,These courseware materials are to be used in conjunction with Software Engineering: A Practitioners Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright 1996, 2001, 2005,4,Who
6、Tests the Software?,developer,independent tester,Understands the system,but, will test “gently“,and, is driven by “delivery“(交付),Must learn about the system,but, will attempt to break it,and, is driven by quality,These courseware materials are to be used in conjunction with Software Engineering: A P
7、ractitioners Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright 1996, 2001, 2005,5,Testing Strategy,unit test,integration test,validation test,system test,These courseware materials are to be used in conjunction with Software Engineering: A Practitioners Ap
8、proach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright 1996, 2001, 2005,6,Testing Strategy,We begin by testing-in-the-small(从小开始) and move toward testing-in-the-large For conventional software(对传统软件) The module (component) is our initial focus Integration of modu
9、les follows For OO software our focus(聚集) when “testing in the small” changes from an individual module(单独模块)(the conventional view) to an OO class that encompasses(包括) attributes and operations(属性和操作) and implies(暗含) communication and collaboration(通讯和协作),These courseware materials are to be used i
10、n conjunction with Software Engineering: A Practitioners Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright 1996, 2001, 2005,7,Strategic Issues(策略问题),State(陈述) testing objectives explicitly.(显示说明测试目的) Understand the users of the software and develop a profi
11、le for each user category.(了解软件有哪些用户,为每一类用户写出他们的特点) Develop a testing plan that emphasizes “rapid cycle testing.”(写出测试计划,强调“快速周期测试”) Build “robust” software that is designed to test itself Use effective formal technical reviews as a filter prior to(先于) testing Conduct(实施) formal technical reviews to
12、 assess(评估) the test strategy and test cases themselves. Develop a continuous improvement approach for the testing process.,These courseware materials are to be used in conjunction with Software Engineering: A Practitioners Approach, 6/e and are provided with permission by R.S. Pressman & Associates
13、, Inc., copyright 1996, 2001, 2005,8,Unit Testing,module to be tested,test cases,results,software engineer,These courseware materials are to be used in conjunction with Software Engineering: A Practitioners Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright
14、 1996, 2001, 2005,9,Unit Testing,interface,local data structures,boundary conditions,independent paths,error handling paths,module to be tested,test cases,These courseware materials are to be used in conjunction with Software Engineering: A Practitioners Approach, 6/e and are provided with permissio
15、n by R.S. Pressman & Associates, Inc., copyright 1996, 2001, 2005,10,Unit Test Environment,Module,stub,stub,driver,RESULTS,interface,local data structures,boundary conditions,independent paths,error handling paths,test cases,These courseware materials are to be used in conjunction with Software Engi
16、neering: A Practitioners Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright 1996, 2001, 2005,11,Integration Testing Strategies,Options: the “big bang” approach an incremental construction strategy,These courseware materials are to be used in conjunction wit
17、h Software Engineering: A Practitioners Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright 1996, 2001, 2005,12,Top Down Integration,top module is tested with,stubs,stubs are replaced one at,a time, “depth first“,as new modules are integrated,some subset of
18、tests is re-run,A,B,C,D,E,F,G,These courseware materials are to be used in conjunction with Software Engineering: A Practitioners Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright 1996, 2001, 2005,13,Bottom-Up Integration,drivers are replaced one at a,time
19、, “depth first“,worker modules are grouped into,builds and integrated,A,B,C,D,E,F,G,cluster,These courseware materials are to be used in conjunction with Software Engineering: A Practitioners Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright 1996, 2001, 20
20、05,14,Sandwich Testing,Top modules are tested with stubs,Worker modules are grouped into,builds and integrated,A,B,C,D,E,F,G,cluster,These courseware materials are to be used in conjunction with Software Engineering: A Practitioners Approach, 6/e and are provided with permission by R.S. Pressman & A
21、ssociates, Inc., copyright 1996, 2001, 2005,15,Object-Oriented Testing,begins by evaluating the correctness and consistency(一致性) of the OOA and OOD models testing strategy changes the concept of the unit broadens(变宽) due to encapsulation validation uses conventional black box methods test case desig
22、n draws on conventional methods, but also encompasses(包含) special features,These courseware materials are to be used in conjunction with Software Engineering: A Practitioners Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright 1996, 2001, 2005,16,OOT Strateg
23、y,class testing is the equivalent of(等于) unit testing operations within the class are tested the state behavior of the class is examined integration applied three different strategies(集成测试可应用三种不同的策略) thread-based testingintegrates the set of classes required to respond to one input or event use-base
24、d testingintegrates the set of classes required to respond to one use case cluster testingintegrates the set of classes required to demonstrate one collaboration,These courseware materials are to be used in conjunction with Software Engineering: A Practitioners Approach, 6/e and are provided with pe
25、rmission by R.S. Pressman & Associates, Inc., copyright 1996, 2001, 2005,17,Smoke Testing,A common approach for creating “daily builds” for product software Smoke testing steps: Software components that have been translated into code are integrated into a “build.” A build includes all data files, li
26、braries, reusable modules, and engineered components that are required to implement one or more product functions. A series of tests(一系列测试) is designed to expose(暴露) errors that will keep the build from properly performing its function. The intent should be to uncover “show stopper” errors that have
27、 the highest likelihood of throwing the software project behind schedule. The build is integrated with other builds and the entire product (in its current form) is smoke tested daily. The integration approach may be top down or bottom up.,18,High Order Testing,Validation testing Focus is on software
28、 requirements System testing Focus is on system integration Alpha/Beta testing Focus is on customer usage Recovery testing forces the software to fail in a variety of ways(各种办法) and verifies that recovery is properly performed Security testing verifies that protection mechanisms built into a system
29、will, in fact, protect it from improper penetration(不正确的穿透) Stress testingexecutes a system in a manner that demands resources in abnormal quantity, frequency, or volume Performance Testing test the run-time performance of software within the context of an integrated system,These courseware material
30、s are to be used in conjunction with Software Engineering: A Practitioners Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright 1996, 2001, 2005,19,Debugging: A Diagnostic Process,These courseware materials are to be used in conjunction with Software Engineer
31、ing: A Practitioners Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright 1996, 2001, 2005,20,The Debugging Process,test cases,results,Debugging,suspected causes,identified causes,corrections,regression tests,new test cases,These courseware materials are to b
32、e used in conjunction with Software Engineering: A Practitioners Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright 1996, 2001, 2005,21,Debugging Effort,time required to diagnose the Symptom(症状) and determine the cause,time required to correct the error and
33、 conduct regression tests,These courseware materials are to be used in conjunction with Software Engineering: A Practitioners Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright 1996, 2001, 2005,22,Symptoms & Causes,symptom,cause,symptom and cause may be,geo
34、graphically separated,symptom may disappear when,another problem is fixed,cause may be due to a,combination of non-errors,cause may be due to a system,or compiler error,cause may be due to,assumptions that everyone,believes,symptom may be intermittent,These courseware materials are to be used in con
35、junction with Software Engineering: A Practitioners Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright 1996, 2001, 2005,23,Consequences(后果) of Bugs,damage,mild,annoying,disturbing,serious,extreme,catastrophic,infectious,Bug Type,Bug Categories:,function-rel
36、ated bugs,system-related bugs, data bugs, coding bugs,design bugs, documentation bugs, standards,violations, etc.,These courseware materials are to be used in conjunction with Software Engineering: A Practitioners Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., co
37、pyright 1996, 2001, 2005,24,Debugging Techniques,brute force / testing,backtracking,Induction(归纳),Deduction(演绎),These courseware materials are to be used in conjunction with Software Engineering: A Practitioners Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copy
38、right 1996, 2001, 2005,25,Debugging: Final Thoughts,Dont run off half-cocked,Think about the,symptom youre seeing.,Use tools,(e.g., dynamic debugger) to gain,more insight.,If at an impasse, get help from someone else,.,Be absolutely sure to conduct regression tests,when you do “fix“ the bug.,1.,2.,3.,4.,