软件过程与管理chapter_17软件测试策略XXXX0329_第1页
软件过程与管理chapter_17软件测试策略XXXX0329_第2页
软件过程与管理chapter_17软件测试策略XXXX0329_第3页
软件过程与管理chapter_17软件测试策略XXXX0329_第4页
软件过程与管理chapter_17软件测试策略XXXX0329_第5页
已阅读5页,还剩35页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、1Chapter 17软件测试策略1著明软件错误案例研究23著明软件错误案例研究4讨论软件测试的重要性?56Software Testing Testing is the process of exercising a program with the specific intent of finding errors prior to delivery to the end user.1、测试就是实行具有特定意图计划的一个过程;2、测试的意图就是在把软件产品交付给最终用户前找出错误。测试是有计划有步骤的活动,因此,为测试软件建立系统化的测试策略是合情合理的。6717.1 Strategic

2、ApproachTo perform effective testing, you should conduct effective technical reviews. By doing this, many errors will be eliminated before testing commences.Testing begins at the component level and works outward toward the integration of the entire computer-based system. Different testing technique

3、s are appropriate for different software engineering approaches and at different points in time.7Testing is conducted by the developer of the software and (for large projects) an independent test group.Testing and debugging are different activities, but debugging must be accommodated in any testing

4、strategy. 8917.1.1V & VVerification refers to the set of tasks that ensure that software correctly implements a specific function. Validation refers to a different set of tasks that ensure that the software that has been built is traceable to customer requirements. Boehm states this another way: Ver

5、ification: Are we building the product right? Validation: Are we building the right product?9测试是软件质量安全网吗?101117.1.2Who Tests the Software?developerindependent testerUnderstands the system but, will test gentlyand, is driven by deliveryMust learn about the system,but, will attempt to break itand, is

6、driven by quality开发者精心地设计和执行测试,试图证明其程序的正确性,而不是注意发现错误。在整个软件项目中,开发人员和(独立)测试组(ITG)密切配合以确保测试严格地进行。在测试进行的过程中,必须随时可以找到开发人员,以便及时修改发现的错误。11讨论和作业用自己的话描述验证和确认的区别;理出一些与独立测试组的创建相关的问题。ITG和SQA小组是由相同的人员组成的吗?121317.1.3Testing StrategySystem engineeringAnalysis modelingDesign modelingCode generationUnit testIntegrat

7、ion testValidation testSystem test131417.2 Strategic IssuesSpecify product requirements in a quantifiable manner long before testing commences. State testing objectives explicitly. Understand the users of the software and develop a pro each user category.Develop a testing plan that emphasizes “rapid

8、 cycle testing.”什么样的指导原则导致成功的软件测试?14Build “robust” software that is designed to test itselfUse effective technical reviews as a filter prior to testingConduct technical reviews to assess the test strategy and test cases themselves. Develop a continuous improvement approach for the testing process.15

9、1617.3.1 Unit Testingmoduleto betestedtest casesresultssoftwareengineer单元测试侧重于软件设计的最小单元(软件构件或模块)的验证工作。1617Unit Testinginterface local data structuresboundary conditionsindependent pathserror handling pathsmoduleto betestedtest cases测试模块的接口是为了保证被测程序单元的信息能够正常的流入和流出;检查局部数据结构以确保临时存储的数据在算法的整个执行过程中能维护其完整性

10、。测试边界条件以确保模块在到达边界值的极限或受限处理的情形下仍能正确执行。走遍控制结构中的所有独立路径(基本路径)以确保模块中的所有语句至少执行一次。对所有的错误处理路径进行测试。1718Unit Test EnvironmentModulestubstubdriverRESULTSinterface local data structuresboundary conditionsindependent pathserror handling pathstest cases由于构件(模块)并不是独立的程序,因此,必须为每个测试单元开发驱动软件和(或)桩软件驱动程序只是一个“主程序”,它接收测试

11、用例数据,将这些数据传递给(将要测试的)构件并打印相关结果。桩程序的作用是替换那些从属于将要测试的构件或被其调用的构件。当构件具有高内聚时,可简化单元测试。181917.3.2 Integration Testing StrategiesOptions:the “big bang” approachan incremental construction strategy集成测试是构造软件体系结构的系统化技术,同时,也是进行一些旨在发现与接口相关的错误的测试。其目标是利用已通过单元测试的构件建立设计中描述的程序结构。“一步到位”的方式构造程序:所有的构件都事先连接在一起,全部程序作为一个整体进行

12、测试。增量集成:程序以小增量的方式逐步进行构造和测试,这样错误易于分离和纠正,更易于对接口进行彻底测试,而且可以运用系统化的测试方法。1920Top Down Integrationtop module is tested with stubsstubs are replaced one at a time, depth firstas new modules are integrated, some subset of tests is re-runABCDEFG2021Bottom-Up Integrationdrivers are replaced one at a time, dept

13、h firstworker modules are grouped into builds and integratedABCDEFGcluster2122Regression TestingRegression testing is the re-execution of some subset of tests that have already been conducted to ensure that changes have not propagated unintended side effectsWhenever software is corrected, some aspec

14、t of the software configuration (the program, its documentation, or the data that support it) is changed. Regression testing helps to ensure that changes (due to testing or for other reasons) do not introduce unintended behavior or additional errors.Regression testing may be conducted manually, by r

15、e-executing a subset of all test cases or using automated capture/playback tools.2223Smoke TestingA common approach for creating “daily builds” for product softwareSmoke testing steps:Software components that have been translated into code are integrated into a “build.” A build includes all data fil

16、es, libraries, reusable modules, and engineered components that are required to implement one or more product functions.23A 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 the

17、 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.242517.4Object-Oriented Testingbegins by evaluating the correctness

18、 and consistency of the analysis and design modelstesting strategy changesthe concept of the unit broadens due to encapsulationintegration focuses on classes and their execution across a thread or in the context of a usage scenariovalidation uses conventional black box methodstest case design draws

19、on conventional methods, but also encompasses special features25These slides are designed to accompany Software Engineering: A Practitioners Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman. 26Broadening the View of “Testing”It can be argued that the review of OO analysis an

20、d design models is especially useful because the same semantic constructs (e.g., classes, attributes, operations, messages) appear at the analysis, design, and code level. Therefore, a problem in the definition of class attributes that is uncovered during analysis will circumvent side effects that m

21、ight occur if the problem were not discovered until design or code (or even the next iteration of analysis). OO分析和设计模型的审查特别有用,是因为在分析、设计和编码阶段具有相同的语义构图(例如,类、属性、操作、消息)。所以,类属性定义问题可以在分析阶段发现,这将避免副作用的发生:问题直到设计或编码(或者分析的下一次迭代)阶段才发现2627OO Testing Strategyclass testing is the equivalent of unit testingoperatio

22、ns within the class are testedthe state behavior of the class is examinedintegration applied three different strategiesthread-based testingintegrates the set of classes required to respond to one input or eventuse-based testingintegrates the set of classes required to respond to one use casecluster

23、testingintegrates the set of classes required to demonstrate one collaboration272817.5WebApp Testing - IThe content model for the WebApp is reviewed to uncover errors. The interface model is reviewed to ensure that all use cases can be accommodated. The design model for the WebApp is reviewed to unc

24、over navigation errors. The user interface is tested to uncover errors in presentation and/or navigation mechanics.Each functional component is unit tested. 2829WebApp Testing - IINavigation throughout the architecture is tested. The WebApp is implemented in a variety of different environmental conf

25、igurations and is tested for compatibility with each configuration. Security tests are conducted in an attempt to exploit vulnerabilities in the WebApp or within its environment.Performance tests are conducted.29The WebApp is tested by a controlled and monitored population of end-users. The results

26、of their interaction with the system are evaluated for content and navigation errors, usability concerns, compatibility concerns, and WebApp reliability and performance.3031High Order TestingValidation testingFocus is on software requirementsSystem testingFocus is on system integrationAlpha/Beta tes

27、tingFocus is on customer usageRecovery testingforces the software to fail in a variety of ways and verifies that recovery is properly performedSecurity testingverifies that protection mechanisms built into a system will, in fact, protect it from improper penetrationStress testing executes a system i

28、n a manner that demands resources in abnormal quantity, frequency, or volumePerformance Testingtest the run-time performance of software within the context of an integrated system313217.8Debugging: A Diagnostic Process调试并不是测试,但总是发生在测试之后。调试试图将症状(symptom)与原因相匹配,从而使错误得到修正 。3233The Debugging Process3334

29、Debugging Efforttime requiredto diagnose thesymptom anddetermine thecausetime requiredto correct the errorand conductregression tests3435Symptoms & Causessymptomcausesymptom and cause may be geographically separated symptom may disappear when another problem is fixedcause may be due to a combination

30、 of non-errors cause may be due to a system or compiler errorcause may be due to assumptions that everyone believessymptom may be intermittent为什么调试如此困难?3536Consequences of BugsdamagemildannoyingdisturbingseriousextremecatastrophicinfectiousBug TypeBug Categories: function-related bugs, system-related bugs, data bugs, coding bugs, design bugs, documentation bugs, standards violations, etc.3637Debugging Techniquesbrute force / testingbacktrackinginductiondeduction蛮力调试法:利用“让计算机自己找错误”的思想。最常用但最低效的方法。回溯法:从发现症状的地方开始,向后追踪(手工)源代码,直到发现错误的原因。原因排除法:通过演绎(dedu

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论