软件测试策略讲义课件.ppt

上传人:小飞机 文档编号:1788524 上传时间:2022-12-18 格式:PPT 页数:40 大小:2.96MB
返回 下载 相关 举报
软件测试策略讲义课件.ppt_第1页
第1页 / 共40页
软件测试策略讲义课件.ppt_第2页
第2页 / 共40页
软件测试策略讲义课件.ppt_第3页
第3页 / 共40页
软件测试策略讲义课件.ppt_第4页
第4页 / 共40页
软件测试策略讲义课件.ppt_第5页
第5页 / 共40页
点击查看更多>>
资源描述

《软件测试策略讲义课件.ppt》由会员分享,可在线阅读,更多相关《软件测试策略讲义课件.ppt(40页珍藏版)》请在三一办公上搜索。

1、著明软件错误案例研究,著明软件错误案例研究,讨论,软件测试的重要性?,6,Software 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、测试的意图就是在把软件产品交付给最终用户前找出错误。,测试是有计划有步骤的活动,因此,为测试软件建立系统化的测试策略是合情合理的。,7,17.1 Strategic Approach,To pe

2、rform 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 techniques are appropr

3、iate for different software engineering approaches and at different points in time.,Testing 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 strategy.,9,1

4、7.1.1V & V,Verification 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: Verification: A

5、re we building the product right? Validation: Are we building the right product?,测试是软件质量安全网吗?,11,17.1.2Who 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

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

7、ation test,Validation test,System test,14,17.2 Strategic Issues,Specify product requirements in a quantifiable manner long before testing commences. State testing objectives explicitly. Understand the users of the software and develop a profile for each user category.Develop a testing plan that emph

8、asizes “rapid cycle testing.”,什么样的指导原则导致成功的软件测试?,Build “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 testi

9、ng process.,16,17.3.1 Unit Testing,moduleto betested,test cases,results,softwareengineer,单元测试侧重于软件设计的最小单元(软件构件或模块)的验证工作。,17,Unit Testing,interface,local data structures,boundary conditions,independent paths,error handling paths,moduleto betested,test cases,测试模块的接口是为了保证被测程序单元的信息能够正常的流入和流出;,检查局部数据结构以确

10、保临时存储的数据在算法的整个执行过程中能维护其完整性。,测试边界条件以确保模块在到达边界值的极限或受限处理的情形下仍能正确执行。,走遍控制结构中的所有独立路径(基本路径)以确保模块中的所有语句至少执行一次。,对所有的错误处理路径进行测试。,18,Unit Test Environment,Module,stub,stub,driver,RESULTS,interface,local data structures,boundary conditions,independent paths,error handling paths,test cases,由于构件(模块)并不是独立的程序,因此,必

11、须为每个测试单元开发驱动软件和(或)桩软件,驱动程序只是一个“主程序”,它接收测试用例数据,将这些数据传递给(将要测试的)构件并打印相关结果。,桩程序的作用是替换那些从属于将要测试的构件或被其调用的构件。,当构件具有高内聚时,可简化单元测试。,19,17.3.2 Integration Testing Strategies,Options:the “big bang” approachan incremental construction strategy,集成测试是构造软件体系结构的系统化技术,同时,也是进行一些旨在发现与接口相关的错误的测试。其目标是利用已通过单元测试的构件建立设计中描述的

12、程序结构。,“一步到位”的方式构造程序:所有的构件都事先连接在一起,全部程序作为一个整体进行测试。,增量集成:程序以小增量的方式逐步进行构造和测试,这样错误易于分离和纠正,更易于对接口进行彻底测试,而且可以运用系统化的测试方法。,20,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 tests is re-run,A,B,C,D,E,F,G,21,Botto

13、m-Up Integration,drivers are replaced one at a,time, depth first,worker modules are grouped into,builds and integrated,A,B,C,D,E,F,G,cluster,22,Regression Testing,Regression testing is the re-execution of some subset of tests that have already been conducted to ensure that changes have not propagate

14、d unintended side effectsWhenever software is corrected, some aspect 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 a

15、dditional errors.Regression testing may be conducted manually, by re-executing a subset of all test cases or using automated capture/playback tools.,23,Smoke Testing,A common approach for creating “daily builds” for product softwareSmoke testing steps:Software components that have been translated in

16、to code are integrated into a “build.” A build includes all data files, libraries, 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.

17、The intent should be to uncover “show stopper” errors that have 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、,25,17.4Object-Oriented Testing,begins by evaluating the correctness 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 scenariov

19、alidation uses conventional black box methodstest case design draws on conventional methods, but also encompasses special features,These slides are designed to accompany Software Engineering: A Practitioners Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.,26,Broadening the

20、 View of “Testing”,It can be argued that the review of OO analysis and 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

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

22、sting Strategy,class testing is the equivalent of unit testingoperations 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 testingint

23、egrates the set of classes required to respond to one use casecluster testingintegrates the set of classes required to demonstrate one collaboration,28,17.5WebApp Testing - I,The content model for the WebApp is reviewed to uncover errors. The interface model is reviewed to ensure that all use cases

24、can be accommodated. The design model for the WebApp is reviewed to uncover navigation errors. The user interface is tested to uncover errors in presentation and/or navigation mechanics.Each functional component is unit tested.,29,WebApp Testing - II,Navigation throughout the architecture is tested.

25、 The WebApp is implemented in a variety of different environmental configurations 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.,The WebApp is test

26、ed by a controlled and monitored population of end-users. The results of their interaction with the system are evaluated for content and navigation errors, usability concerns, compatibility concerns, and WebApp reliability and performance.,31,High Order Testing,Validation testingFocus is on software

27、 requirementsSystem testingFocus is on system integrationAlpha/Beta testingFocus 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,

28、 protect it from improper penetrationStress testing executes a system in a manner that demands resources in abnormal quantity, frequency, or volumePerformance Testingtest the run-time performance of software within the context of an integrated system,32,17.8Debugging: A Diagnostic Process,调试并不是测试,但总

29、是发生在测试之后。,调试试图将症状(symptom)与原因相匹配,从而使错误得到修正 。,33,The Debugging Process,34,Debugging Effort,time requiredto diagnose thesymptom anddetermine thecause,time requiredto correct the errorand conductregression tests,35,Symptoms & Causes,symptom,cause,symptom and cause may be,geographically separated,sympto

30、m 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,为什么调试如此困难?,36,Consequences of Bugs,damage,mild,annoying,disturbing,serious,e

31、xtreme,catastrophic,infectious,Bug Type,Bug Categories:,function-related bugs,system-related bugs, data bugs, coding bugs,design bugs, documentation bugs, standards,violations, etc.,37,Debugging Techniques,brute force / testing,backtracking,induction,deduction,蛮力调试法:利用“让计算机自己找错误”的思想。最常用但最低效的方法。,回溯法:

32、从发现症状的地方开始,向后追踪(手工)源代码,直到发现错误的原因。,原因排除法:通过演绎(deduction)或归纳(induction)并引入二分法的概念来实现。,38,Correcting the Error,Is the cause of the bug reproduced in another part of the program? In many situations, a program defect is caused by an erroneous pattern of logic that may be reproduced elsewhere. What next bu

33、g might be introduced by the fix Im about to make? Before the correction is made, the source code (or, better, the design) should be evaluated to assess coupling of logic and data structures. What could we have done to prevent this bug in the first place? This question is the first step toward estab

34、lishing a statistical software quality assurance approach. If you correct the process as well as the product, the bug will be removed from the current program and may be eliminated from all future programs.,39,Final Thoughts,Think - before you act to correctUse tools to gain additional insightIf youre at an impasse, get help from someone elseOnce you correct the bug, use regression testing to uncover any side effects,项目进度安排是如何影响集成测试的?谁应该完成集成测试,是软件开发人员还是软件使用者,说明你的理由。17.10,

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号