




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、1Chapter 17Software Testing StrategiesSoftware Engineering: A Practitioners Approach, 7/e by Roger S. Pressman2Software TestingTesting is the process of exercising a program with the specific intent of finding errors prior to delivery to the end user.3Strategic ApproachTo perform effective testing,
2、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 appropriate for different softwa
3、re 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. 4V & VVerification(验证) re
4、fers 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 Boe81 states this another way: Verification: Are we building t
5、he product right? Validation: Are we building the right product?5Who Tests the Software?developerindependent testerUnderstands the system but, will test “gently”(温和地)and, is driven by deliveryMust learn about the system,but, will attempt to break(破坏) itand, is driven by quality6Testing StrategySyste
6、m engineeringAnalysis modelingDesign modelingCode generationUnit testIntegration testValidation testSystem test7Testing StrategyWe begin by testing-in-the-small and move toward testing-in-the-largeFor conventional softwareThe module (component) is our initial focusIntegration of modules followsFor O
7、O softwareour 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 collaboration8Strategic Issues (参考P324)Specify product requirements in a quantifiable manner long before t
8、esting commences. State testing objectives explicitly. Understand the users of the software and develop a profile(轮廓) for each user category.Develop a testing plan that emphasizes “rapid cycle testing”Build “robust” software that is designed to test itselfUse effective technical reviews as a filter
9、prior to testingConduct technical reviews to assess the test strategy and test cases themselves. Develop a continuous improvement approach for the testing process. 9Unit Testingmoduleto betestedtest casesresultssoftwareengineer10Unit Testinginterface local data structuresboundary conditionsindepende
10、nt pathserror handling pathsmoduleto betestedtest cases11Unit Test EnvironmentModulestubstubdriverRESULTSinterface local data structuresboundary conditionsindependent pathserror handling pathstest cases驱动模块桩模块被测模块12Integration Testing StrategiesOptions:一步到位:“big bang”(大爆炸)approach增量集成:the incrementa
11、l construction strategy13Top Down Integrationtop module is tested with stubs stubs are replaced one at a time depth firstas new modules are integrated, some subset of tests is re-runABCDEFG1415Top Down Integration Breadth-first integration16Bottom-Up Integrationdrivers are replaced one at a time, de
12、pth firstworker modules are grouped into builds and integratedABCDEFGclusterBottom-Up Integration由底向上集成测试的步骤示例1718Sandwich Testing(混合方式测试)Top modules aretested with stubsWorker modules are grouped into builds and integratedABCDEFGcluster首先对含读操作的子系统自底向上直至根结点模块进行组装和测试;然后对含写操作的子系统做自顶向下的组装与测试。19Regressi
13、on Testing(回归测试)Regression testing is the re-execution of some subset of tests that have already been conducted to ensure that changes have not propagated unintended side effects.Whenever software is corrected, some aspect of the software configuration (the program, its documentation, or the data th
14、at 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 re-executing a subset of all test cases or by using automated capture/playback t
15、ools.20Smoke Testing(冒烟测试)Smoke testing is a common approach of Integration Testing by creating “daily builds(当前版本)” for product software.Smoke testing steps:Software components that have been translated into code are integrated into a “build.” (第1步-构造构建)A build includes all data files, libraries, r
16、eusable 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. (第2步-测试构建)The intent should be to uncover “show stopper(项目阻塞)” errors that have the h
17、ighest 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. (第3步-集成构建并对当前获得的软件版本进行冒烟测试)The integration approach may be top down or bottom up.21Smoke Testing冒烟测试(微软最早提出的方法)是指软件人员对个人新开发
18、的软件版本进行验证测试,确保新增代码段后软件产品不出故障。只有通过了冒烟测试后,才能提交专门的测试组进行软件功能的测试。22Object-Oriented Testingbegins 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 executi
19、on across a thread or in the context of a usage scenariovalidation uses conventional black box methodstest case design draws on conventional methods, but also encompasses special features23OO Testing Strategyclass testing is the equivalent of unit testingoperations within the class are testedthe sta
20、te 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 testingintegrates the set of classes
21、required to demonstrate one collaboration24High Order TestingValidation testing(确认):focus is on software requirementsAlpha/Beta testing:focus is on customer usageSystem testing:focus is on system integrationStress testing(压力) :executes a system in a manner that demands resources in abnormal(异常) quan
22、tity, frequency, or volume.Performance Testing:test the run-time performance of software within the context of an integrated system.Recovery testing:forces the software to fail in a variety of ways and verifies that recovery is properly performedSecurity testing:verifies that protection mechanisms b
23、uilt into a system will.2022/7/1825Validation testing有效性测试软件配置复审验收测试和安装测试可交付的软件2022/7/1826Acceptance Testing如果软件是为某个客户定制开发的,则需要进行一系列的验收测试来保证客户对软件满意。验收测试是以用户为主的测试。软件开发人员和质量保证人员也应参加。用户参加设计测试用例,并使用实际数据进行测试。2022/7/1827Alpha testing & Beta Testing如果软件是给大众(或一类用户)使用的,则让每一个用户都参加验收测试是不现实的。软件厂商通常采用Alpha测试和Bet
24、a测试来发现那些通常只有最终用户才能发现的错误。Alpha测试:开发者在场指导用户进行的测试。由开发者记录用户使用中出现的错误和其它问题。Beta测试:不同用户在自己的使用场所进行的测试。由用户记录(或自动记录)遇到的问题,并定期报告(或网络发送)给开发者。2022/7/1828System testing测试目的:把确认合格的软件安装到系统中后,检查能否与系统中的其余部分协调运行,完成预先规定的任务。系统测试不只限于“系统”。如果软件产品是一个程序,那么系统测试就是力图证明程序与其目标相符的过程。程序目标用户文件程序系统测试2022/7/1829 压力测试检查在异常情况下,系统可以运行到何种
25、程度的测试。例如:设计并发访问用户数特别多(按数量级增加)的测试用例,测试软件是否能正常响应。设计需要占用最大存储量或其它资源的测试用例进行测试。设计出会对常驻内存的数据过度访问的测试用例进行测试。 Stress testing 2022/7/1830性能测试是要检查系统是否满足在需求说明书中规定的性能。特别是对于实时系统或嵌入式系统。性能测试常常需要与压力测试结合进行,常要求同时进行硬件和软件检测。性能测试设计指标通常包括:响应时间、吞吐量、辅存区(如缓冲区、工作区)大小、处理精度等。Performance testing2022/7/1831恢复测试是要证实在修复硬件故障(如掉电、硬件或网
26、络出错等)后,系统能否正常继续工作。采用人工手段模拟硬件故障,并检查:错误探测功能系统能否发现故障;在故障发生时能否保护正在运行的作业和系统状态;在系统恢复后能否从最后记录下来的无错误状态开始继续执行作业。掉电测试:测试软件系统在发生电源中断时能否保护当时的状态且不毁坏数据;在电源恢复后能否从保留的断点处重新进行操作。Recovery testing2022/7/1832安全测试是检验系统的安全性和保密性措施是否发挥作用,有无漏洞。力图破坏系统的保护机构以进入系统的常用方法有:正面攻击或从侧面攻击系统中易受损坏的部分;以系统输入为突破口,利用输入容错性进行攻击;申请并占用过多资源压垮系统以破坏
27、安全措施;故意使系统出错,利用恢复过程窃取用户口令及有用信息;浏览那些逻辑上不存在,但物理上存在的各种记录和资料等。 Security testing33Debugging: A Diagnostic Process34The Debugging Process35Debugging Efforttime requiredto diagnose thesymptom anddetermine thecausetime requiredto correct the errorand conductregression tests36Symptoms & Causessymptomcausesym
28、ptom and cause may be geographically separated symptom may disappear when another problem is fixedcause may be due to a combination of non-errors cause may be due to a system or compiler errorcause may be due to assumptions that everyone believessymptom may be intermittent(断断续续的)37Debugging Techniquesbrute force / testing(蛮干法)Backtracking(回溯法)Induction(归纳法)Deduction(演绎法)381.蛮干法(试凑法):根据错误状况,凭经验设定一个可疑区域,然后采用一些简单的纠错手段(如增加重要变量值的动态显示等),进一步获取出错的细节信息,若找到出错原因就进行修改,若未找到则另设定一个可疑区域继续找错。2.回溯法(跟踪法):针对出错的地方,追踪相关
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 项目管理流程优化与项目管理信息化改造合同
- 五星级酒店厨师长任期目标与权益保障合同
- 教育项目合作终止协议及学生权益保护协议
- 保障房课件教学课件
- 2025年学历类自考公共课物理(工)-计算机网络技术参考题库含答案解析(5卷)
- 2025年学历类自考公共课思想道德修养与法律基础-思想道德修养与法律基础参考题库含答案解析(5卷)
- 2025年学历类自考专业(电子商务)网页设计与制作-市场营销(三)参考题库含答案解析(5卷)
- 2025年学历类自考专业(电子商务)电子商务与现代物流-电子商务法概论参考题库含答案解析(5卷)
- 2025年学历类自考专业(电子商务)商务交流(二)-网页设计与制作参考题库含答案解析(5卷)
- 2025年学历类自考专业(法律)税法-外国法制史参考题库含答案解析(5卷)
- 2025年三类人员安全员C证继续教育题库及参考答案
- 2025内蒙古锡林郭勒盟公安局招聘警务辅助人员95人考试参考题库附答案解析
- 急性肾小球肾炎
- 工程管理面试题目及答案
- 《一年级开学第一课》课件
- 2025秋人教版(2024)八年级上册英语一学期教学计划
- 会展推广的合同范本
- 武消院火灾调查B讲义01电气火灾调查
- 起搏器植入患者全程护理要点
- (2025年标准)会议代办协议书
- 工贸企业企业安全检查表
评论
0/150
提交评论