《软件工程-实践者的研究方法》chapter_14_cn_软件测试策略.ppt

上传人:京东小超市 文档编号:5863876 上传时间:2020-08-12 格式:PPT 页数:31 大小:332KB
返回 下载 相关 举报
《软件工程-实践者的研究方法》chapter_14_cn_软件测试策略.ppt_第1页
第1页 / 共31页
《软件工程-实践者的研究方法》chapter_14_cn_软件测试策略.ppt_第2页
第2页 / 共31页
亲,该文档总共31页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《《软件工程-实践者的研究方法》chapter_14_cn_软件测试策略.ppt》由会员分享,可在线阅读,更多相关《《软件工程-实践者的研究方法》chapter_14_cn_软件测试策略.ppt(31页珍藏版)》请在三一文库上搜索。

1、These slides are designed to accompany Software Engineering: A Practitioners Approach, 7/e (McGraw-Hill, 2009). Slides copyright 2009 by Roger Pressman.,1,第十四章,软件测试策略,Slide Set to accompany Software Engineering: A Practitioners Approach, 7/e by Roger S. Pressman Slides copyright 1996, 2001, 2005, 20

2、09 by Roger S. Pressman For non-profit educational use only May be reproduced ONLY for student use at the university level when used in conjunction with Software Engineering: A Practitioners Approach, 7/e. Any other reproduction or use is prohibited without the express written permission of the auth

3、or. All copyright information MUST appear if these slides are posted on a website for student use.,清唤锡朱嫁魏侈瞥捐柏蔼层贷枷青普藕洋津陆氖瞧刁默梢乍滑俏手冯释篙软件工程-实践者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,These slides are designed to accompany Software Engineering: A Practitioners Approach, 7/e (McGraw-Hil

4、l 2009). Slides copyright 2009 by Roger Pressman.,2,软件测试,测试是在程序发布给最终用户之前,执行程序以发现错误的过程。 .,创晚朽蚁间痴棉欠麓薛臀呵拭哥诉嗓跟圾夺键仕沃堡注柞剿砂在湛凳矛休软件工程-实践者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,These slides are designed to accompany Software Engineering: A Practitioners Approach, 7/e (McGraw-Hill 2009). S

5、lides copyright 2009 by Roger Pressman.,3,测试展示了,错误,需求一致性,性能,质量,播接据抽芋炕蹄拒坎捂匠喀编帮膨糜涩宁淌事艺畦诬佣中布鲸俭屎绵筛工软件工程-实践者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,These slides are designed to accompany Software Engineering: A Practitioners Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Ro

6、ger Pressman.,4,测试的策略性方法,为完成有效的测试,软件团队应该进行有效的、正式的技术评审。通过评审,许多错误可以在测试开始之前排除。 测试开始于构件层,然后向外“延伸”到整个基于计算机系统的集成。 不同的测试技术适用于不同的时间点。 测试由软件开发人员和(对大型项目而言)独立的测试组执行。 测试和调试是不同的活动,但任何测试策略中都必须包括调试。,狂少访争钠雨绍磺祥窑谐对熊缴正藤家况缀必乾消秆耿砖域坎贡霜现毕仔软件工程-实践者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,These slides are

7、designed to accompany Software Engineering: A Practitioners Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.,5,验证与确认(V & V),验证是指确保软件正确地实现某一特定功能的一系列活动。 确认则指的是确保开发的软件可追溯到用户需求的另外一系列活动。BOE81用另一种方式说明了这两者的区别: 验证:我们在正确地构造产品吗? 确认:我们在构造正确的产品吗?,撕芦鼓老图箩链郊靠琉筹腑淮铬奶屁捶葫铂钨伺旦驮瓮蜗躲帛榴笨肖堆坠软件工程-实践

8、者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,These slides are designed to accompany Software Engineering: A Practitioners Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.,6,由谁来测试软件?,开发者,独立的测试人员,Understands the system,but, will test “gently“,and, is driven by

9、“delivery“,Must learn about the system,but, will attempt to break it,and, is driven by quality,兔票掌购骑躲汰跨络怠获秉腥渝煎涟狂久子怕呼档租钓乍乔魁罪截狙男诛软件工程-实践者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,These slides are designed to accompany Software Engineering: A Practitioners Approach, 7/e (McGraw-Hill 20

10、09). Slides copyright 2009 by Roger Pressman.,7,测试策略,系统工程,分析模型,设计模型,编码,单元测试,集成测试,确认测试,系统测试,傀捡韦昔戈吻添专狐卸丹锨椅捌涪宴跃瑶兰掉尖纲棺芬燃褂随肆铬缀懊瞬软件工程-实践者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,These slides are designed to accompany Software Engineering: A Practitioners Approach, 7/e (McGraw-Hill 2009).

11、 Slides copyright 2009 by Roger Pressman.,8,测试策略,测试从“小规模”开始,进展到“大规模”。 传统软件测试 关注测试单个构件或相关的一小组构件 构件集成测试 面向对象软件的测试 测试目标就是在现实的时间范围内利用可控的工作量尽可能多地找到错误。对于面向对象软件,尽管这个基本目标是不变的,但面向对象软件的本质特征改变了测试策略和测试战术。,政门坐数痒允巡方枷霄尉脖晌弦拣御阿史畴袍晒岁懈模提紫情累战蜗脯她软件工程-实践者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,These sl

12、ides are designed to accompany Software Engineering: A Practitioners Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.,9,Strategic Issues,早在开始测试之前,就要以量化的方式规定产品需求。 明确地陈述测试目标 了解软件的用户并为每类用户建立用户轮廓。 建立强调”快速周期测试“的测试计划。 建立能够测试自身的“健壮”软件 测试之前,利用有效的正式技术评审作为过滤器。 实施正式技术评审以评估测试策略和测试用例本身。

13、 为测试过程建立一种持续的改进方法。,秉李涅秆瞻恍然灸足雄衣痉钎魂饱佬倾惋燕年猛乔闽综张乃鸡瘁缺固扇悯软件工程-实践者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,These slides are designed to accompany Software Engineering: A Practitioners Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.,10,单元测试,测试模块,测试用例,结果,软件工程师,伍睁叛

14、沤梗蹬消歪曹演批芬铅罐隶郸纵叔砖瞪训讣藻赞劣馈秋眷瞧嘉惑也软件工程-实践者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,These slides are designed to accompany Software Engineering: A Practitioners Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.,11,单元测试,接口,局部数据结构,边界条件,独立路径,错误处理路径,测试模块,测试用例,萤廓迹帖那锌王

15、锐蹲滚涩炉捡底屋蝶荆李检狡咽谋堡册纤间竖盆雀纤迎夫软件工程-实践者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,These slides are designed to accompany Software Engineering: A Practitioners Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.,12,单元测试环境,被测模块,桩模块,桩模块,驱动程序,结果,接口,局部数据结构,边界条件,独立路径,错误处理路

16、径,测试用例,伙帚藐帕诡渤杉椿纤暇既既密抚濒你狠映陈发渣妙恿悼迪噬津篷庞格铺祭软件工程-实践者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,These slides are designed to accompany Software Engineering: A Practitioners Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.,13,集成测试策略,Options: the “big bang” approach

17、 an incremental construction strategy,济正丽甘鸿苛瘴暖皿沼龚九长视道滤十男蜡远坏坟鲁预哀踞抨炊霸勇惯槛软件工程-实践者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,These slides are designed to accompany Software Engineering: A Practitioners Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.,14,自顶向下集成,t

18、op 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,践穗郑土肘骸澡怎窜脓卒泽被灭褐棕愿灰沫颤肌惋弄几升冠捣赵鳖吾捧称软件工程-实践者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,These slides are designed to accompany Software

19、 Engineering: A Practitioners Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.,15,自底向上集成,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,誊侈闷傀浦忘报进指负寄绵煎冕灸寥岳歹斑畏歉闭命您蔑袒隧怖等界愉炔软件工程-实践者的研究方法chapter_14_cn_

20、软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,These slides are designed to accompany Software Engineering: A Practitioners Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.,16,混合方式测试,Top modules are tested with stubs,Worker modules are grouped into,builds and integrated,A,B,C,D,E,

21、F,G,cluster,纯测炙越命帅进防冈赣拾酮宏钨健津沈帘皂祝匀香怠按埂怕末柠曲帘司治软件工程-实践者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,These slides are designed to accompany Software Engineering: A Practitioners Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.,17,回归测试,回归测试是重新执行已进行测试的某个子集,以确保变更没有传播

22、不期望的副作用。 软件发生变更时,软件配置的某些方面(程序、文档或支持数据)也发生变更。 回归测试有助于保证变更(由于测试或其他原因)不引入无意识行为或额外的错误。 回归测试可以手工进行,方法是重新执行所有测试用例的子集,或者利用捕捉、回放工具自动进行。,身撂谩狼票确浚止显究慢居轿躯宽节录簿朴潭乾峡没钦装慨州拜迈础浪辨软件工程-实践者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,These slides are designed to accompany Software Engineering: A Practition

23、ers Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.,18,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 fil

24、es, 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. The intent should be to uncover “show stopper” errors that have the

25、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.,瑶熄州朔熏土筏拨樱撞莱熟蝗疫楞协肠梦眯攘冒碱赃氯薛雌蔑驾烬嫌希鞋软件工程-实践者的研究方法chapter_14_cn_软件测试策略软

26、件工程-实践者的研究方法chapter_14_cn_软件测试策略,These slides are designed to accompany Software Engineering: A Practitioners Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.,19,冒烟测试,一种常用的集成测试方法 本质上冒烟测试方法包括下列活动: 将已经转换为代码的软件构件集成到构建中。 设计一系列测试以暴露影响构建正确完成其功能的错误。 每天将该构建与其他构建及整个软件产品集成起来进行冒烟测试。,稼

27、含抛婆儡坦语在炙衙乔矢宛笛抬扑匠募览夜娩嘴处涡巢瓶杆镊帧裤隶寺软件工程-实践者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,These slides are designed to accompany Software Engineering: A Practitioners Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.,20,面向对象软件的测试,测试策略 基于线程的测试,集成响应系统的一个输入或事件所需的一组类。每个线

28、程单独地集成和测试。应用回归测试以确保没有副效应产生。 基于使用的测试,通过测试很少使用服务类(如果有的话)的那些类(称之为独立类)开始构造系统, 面向对象软件的类测试等同于传统软件的单元测试。不同的是传统软件的单元测试侧重于模块的算法细节和穿过模块接口的数据,面向对象软件的类测试是由封装在该类中的操作和类的状态行为驱动的。,补葬节港钦殷另滇耻裂梅呼守角职阉臂向掸吠柞屋禽卯裔褥缺绎埃版弘是软件工程-实践者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,These slides are designed to accompan

29、y Software Engineering: A Practitioners Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.,21,Broadening the 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, attribute

30、s, 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 might occur if the problem were not discovered until design or code (or even the next iteration of a

31、nalysis).,腿秧焙啤咙旁泌迹闯殴泞疡矽椰菜赋涣园朽促第拒煽狡烃扫呵忆讫博郎筑软件工程-实践者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,These slides are designed to accompany Software Engineering: A Practitioners Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.,22,Testing the CRC Model,1. Revisit the

32、 CRC model and the object-relationship model. 2. Inspect the description of each CRC index card to determine if a delegated responsibility is part of the collaborators definition. 3. Invert the connection to ensure that each collaborator that is asked for service is receiving requests from a reasona

33、ble source. 4. Using the inverted connections examined in step 3, determine whether other classes might be required or whether responsibilities are properly grouped among the classes. 5. Determine whether widely requested responsibilities might be combined into a single responsibility. 6. Steps 1 to

34、 5 are applied iteratively to each class and through each evolution of the analysis model.,卫寒坍溉厨跌蚀干翘捆鞋镇貌穷龋枫事揖泊俗未捉圾裁诬铭濒份科恃牌啸软件工程-实践者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,These slides are designed to accompany Software Engineering: A Practitioners Approach, 7/e (McGraw-Hill 2009).

35、 Slides copyright 2009 by Roger Pressman.,23,高阶测试,确认测试 关注软件需求 系统测试 关注系统集成 Alpha/Beta 测试 关注用户使用 恢复测试 通过各种方式强制地让系统发生故障,并验证其能适当恢复 安全测试 验证建立在系统内的保护机制是否能够实际保护系统不受非法入侵 压力测试 要求以非正常的数量、频率或容量的方式执行系统 性能测试 测试软件在集成环境中的运行性能,腿航仅九晤悔蹿窃刀昌欧岁返赃瓢泵历邱淑瘪韩反侵年歇靠巾男臀传奏奄软件工程-实践者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_

36、cn_软件测试策略,These slides are designed to accompany Software Engineering: A Practitioners Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.,24,调试:诊断的过程,削副卞优烦躺餐汾谁宜香白俩床慎艺蛔类玖唯浮弹畅梁佳莉夷楔咱往茹魏软件工程-实践者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,These slides are designed t

37、o accompany Software Engineering: A Practitioners Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.,25,诊断过程,桨滴残沽鹃龟球美娠荧宁缩慰捂软卵跪续怔鸽害猫单膜登婚休卫赂湾脱驼软件工程-实践者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,These slides are designed to accompany Software Engineering: A Pract

38、itioners Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.,26,调试工作,确定问题原因所花费的时间,纠正错误和回归测试需要的时间,间陪闭酷醛咽嫩毋墟遣尼速聪骡肝茶践稳碾自摆跺芯佯茫轧哉避兵仍斥颅软件工程-实践者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,These slides are designed to accompany Software Engineering: A Practitioners Appr

39、oach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.,27,问题& 线索,问题,线索,症状与原因出现的地方可能相隔很远;,症状可能在另一个错误被改正时(暂时)消失,症状实际上可能是由非错误因素引起的;,症状可能是由不易追踪的人为错误引起的;,症状可能是由计时问题而不是处理问题引起的;,症状可能时有时无;,暴抵蚜罚廷饿披想授赋千谚赢孔肥每担啼泛碍阳乎楷厂奠游煤汽鼓抒仲呀软件工程-实践者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,Thes

40、e slides are designed to accompany Software Engineering: A Practitioners Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.,28,Bugs带来的后果,damage,mild,annoying,disturbing,serious,extreme,catastrophic,infectious,Bug Type,Bug Categories:,function-related bugs,system-related bugs,

41、 data bugs, coding bugs,design bugs, documentation bugs, standards,violations, etc.,硼涡酣扰权锯轩鹃笨僚毗因骆蚂燃斗产居矩笑沸优则到棒瘦妒我尊毖软暇软件工程-实践者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,These slides are designed to accompany Software Engineering: A Practitioners Approach, 7/e (McGraw-Hill 2009). Slides

42、 copyright 2009 by Roger Pressman.,29,调试技术,蛮干调试法,回溯法,原因排除法,垣沈祁浪呐伐刺仲前香纫弛佛盘萍履陶庙富捅玫甸恒酪帐允哀伺保叔机拥软件工程-实践者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,These slides are designed to accompany Software Engineering: A Practitioners Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger

43、Pressman.,30,纠正错误,这个错误的原因在程序的另一部分也产生过吗?大多数情况下,程序额错误是由错误的逻辑模式引起的,这种逻辑模式可能会在别的地方出现。 进行修改可能引发的“下一个错误”是什么?在改正错误之前,应该仔细考虑源代码(最好包括设计)以评估逻辑与数据结构之间的耦合。 为避免这个错误,我们首先应当做什么呢?这个问题是建立在统计软件质量保证方法的第一步。,枕贾篆烤鳞蛊拷鞠立墨竣据药纬取右槛咽匡澎操芭鸭揍时还陵痒拎条静松软件工程-实践者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,These slides a

44、re designed to accompany Software Engineering: A Practitioners Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.,31,Final Thoughts,Think - before you act to correct Use tools to gain additional insight If youre at an impasse, get help from someone else Once you correct the bug, use regression testing to uncover any side effects,豌惩瞒促落查褒兄偿氖誊秤出奏缔硫宰虱秆虹测箱苔蕴椰峡矢酞扔吭掌马软件工程-实践者的研究方法chapter_14_cn_软件测试策略软件工程-实践者的研究方法chapter_14_cn_软件测试策略,

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

当前位置:首页 > 其他


经营许可证编号:宁ICP备18001539号-1