软件质量与结构化测试已读版修正版

上传人:mg****85 文档编号:53579084 上传时间:2018-09-03 格式:PPT 页数:102 大小:1.60MB
返回 下载 相关 举报
软件质量与结构化测试已读版修正版_第1页
第1页 / 共102页
软件质量与结构化测试已读版修正版_第2页
第2页 / 共102页
软件质量与结构化测试已读版修正版_第3页
第3页 / 共102页
软件质量与结构化测试已读版修正版_第4页
第4页 / 共102页
软件质量与结构化测试已读版修正版_第5页
第5页 / 共102页
点击查看更多>>
资源描述

《软件质量与结构化测试已读版修正版》由会员分享,可在线阅读,更多相关《软件质量与结构化测试已读版修正版(102页珍藏版)》请在金锄头文库上搜索。

1、1,软件质量,与结构化测试,2,内容提要,什么是软件质量 软件质量特性与质量模型 软件质量的度量 常用软件度量方法 McCabe复杂度 结构化测试技术,3,软件开发,4,Maintenance,软件开发的工作分配,Design,Coding,Testing,5,什么是软件质量,“The totality of features and characteristics of a product or service that bear on its ability to satisfy stated or implied needs” (ISO 8402) 与软件产品满足规定的和隐含的需求的能力

2、有关的特征或特性的全体,The degree of excellence 软件的优秀程度,“The ability of a software product to satisfy its specified requirements” (DoD-STD-2168)软件产品满足其规定的需求的能力,6,什么是软件质量,“The degree to which a system, component, or process meets specified requirements.” (IEEE standard 610.12-1990)一个系统、组件或过程满足规定的需求的程度,“The degr

3、ee to which a system, component, or process meets customer or user needs or expectations.” (IEEE standard 610.12-1990)一个系统、组件或过程满足客户或用户的需求的程度,或满足期望值的程度,7,ISO 9126,Software Quality:软件质量The totality of features and characteristics of a software product that bear on its ability to satisfy stated or imp

4、lied needs.与软件产品满足规定的和隐含的需求的能力有关的特征或特性的全体,Software Quality Characteristics:软件质量特性A set of attributes of a software product by which its ability is described and evaluated. A software quality characteristic may be refined into multiple levels of sub-characteristics.软件质量特性是软件产品的一组属性,用来对软件的能力进行描述和评估。软件

5、质量特性可细分为多层次的子特性。,Software Quality Metric:软件质量度量A quantitative scale and method which can be used to determine the value a feature takes for a specific software product.用于确定软件产品质量特性的定量的衡量和分析方法,8,Quality in Software,9,缩短时间表,“Quality does not happen by mistake!”,为什么质量差?,压缩的预算,人员的变化,用户需求的改变,提高或增加功能或性能,B

6、ug Fixing,无效的测试,10,软件质量保证(QA),原则 质量不必是“最好”的 质量是用户想要的和愿意购买的,范围 QA is more than testing QA not only at the end of the project QA of product and process,格言 Moving from quality controlling (ex post) to prevention by quality service. 通过质量服务把质量控制变换到预防,11,Quality Characteristics 质量特征,12,Software Complexity

7、,A software product is a solution of a problem. The complexity of the solution generally depends on the complexity of the problem.,13,Quality Models,分配用户需求Quality Factors(质量因素),到开发标准Quality Criteria(质量标准),到可证明的和测量的值Metrics(度量),14,软件质量的因子-标准-度量关系,15,可维护性,16,Boehm 质量模型,17,McCall Model,18,质量与质量管理,质量要用需

8、求,可接受性和它们达到的证据来衡量,质量是通过解决问题实现的,质量管理确保前面解决过的问题不再出现,没有质量测量来做质量管理只能是幻想,19,测量工具的好处,支持质量管理系统,开发工程师可以自己检查,支持代码评审,评价外部软件,支持测试,20,Software,Metrics,21,什么是度量( Metric )?,任何测量的单位 e.g. Cm, Litre, Ohm, Second, Color,描述一个实体的属性,度量的类型: 和项目相关 时间表/开支 估算测量 功能点 软件度量,22,You cant control what you cant measure.,De Marco, 1

9、982,软件质量度量,23,测量非常有用,但我们必须先解决如下问题:,5.1o-1s,测量,What do we want to measure?测量什么,How do we measure?如何测,What do the measurements mea测量的意义何在,24,5.2o-2s,What to Measure?,25,直观的,Good Metrics should:,和错误出现有直接关系,好的度量,客观的,语言独立,和测试努力直接有关,自动化,简单,26,提高质量,4.1s,确定质量,防止质量退化,辅助做出决策,提高生产力,确定变更的影响,风险分析,确保质量,提高测试效率,27,

10、Metrics+,Halstead Metrics 霍尔斯特德度量,可用的软件度量包括:,Function Point 功能点,Line Count Metrics 线计数度量,McCabe Metrics 圈复杂度,Data Metrics,System Level Metrics,OO Metrics,Derived Metrics,28,Halstead Metrics,起源:,1977年,由Maurice Halstead 开发介绍,计算模块的操作数和操作符,直接得出模块的复杂程度的一种定量测试方法,通过源代码测量模块的复杂度,重点是复杂性的计算,应用于代码,经常作为一种维护性度量,自

11、诞生之日起,就充满争议,29,技术,Halstead度量主要基于以下四层源自程序代码的统计数值:,n1 = the number of distinct(独立的 )operators 操作符 n2 = the number of distinct operands 操作数 N1 = the total number of operators N2 =the total number of operands,Measure Symbol Formula Program length长度 N N= N1 + N2 Program vocabulary词汇量 n n= n1 + n2 Volume

12、容量 V V= N * (LOG2 n) Difficulty难度 D D= (n1/2) * (N2/n2) Effort 工作量 E E= D * V,from the above, five measures are derived.,Halstead Metrics,30,Halstead Metrics,优势:,不必深入分析程序的结构,预测错误的数目,预测维护的工作量,对报告和计划项目的健康程度有帮助,对整个程序有帮助,计算简单,适合任何编程语言,经过很多工业研究,都支持使用Halstead 来预测开发工作量和平均bugs,31,Function Points,起源:,1977 由

13、A.J.Albrecht 开发设计,测量软件的大小和生产力,技术:,将基本功能点分为5组: outputs输出 inquiries查询 inputs输入 files文件 interfaces接口 功能点就是最终用户的业务功能,比如对输入的查询.,和软件完成的功能紧密相关,32,Function Points,优势:,对以下情况,通常被公认为是一种有效方法:,较大的用户群;International Function Point Group (IFPG) 多于 1,200 会员公司,建立每小时功能点的生产率,评估对需求的支持,评估软件工程的大小 (以及周期),软件模块比较的标准化,评估系统变更的

14、开销,IFPG提供功能点实践手册,以及标准化的实践活动,Source: Software Engineering Institute Carnegie Mellon,33,Line Count Metrics,表明每个模块的行数, 包括代码,注释, 空白行, 混合代码和注释.,技术,LOC 可分为以下几类:,Lines-of-Code (LOC) metrics 提供代码的总额, 但是对内容的测量不太好,blanks - Lines with only space (eg. space and tabs) or no text comment,code - Source lines of co

15、de that contain only code and white space,comments - Source lines of code that are purely comments,Mixed - Lines that contain both code and comments,34,Line Count Metrics,优势:,测量软件的物理尺寸,鉴别特殊行, 如注释行和空行,帮助查明难以理解的模块. (Comment lines often increase readability, although an unusually large number of commen

16、ts can indicate that the module is difficult to understand.),35,McCabe Metrics,起源:,圈复杂度(Cyclomatic Complexity)由Thomas McCabe于1976提出,测量贯穿程序模块的独立线性路径数,提供了比较两个程序复杂度的一种简单的指标,通常被称为程序复杂度或McCabe复杂度,36,McCabe Metrics,优势:,广泛应用的静态软件度量,和其他度量互补,独立于开发语言,扩展到可以包括设计和结构复杂度,基于软件结构的严格的数学分析,37,McCabe Metrics,优势:,可以应用到几个领域:,维护的风险分析 Code complexity tends to increase through maintenance over time. By measuring before and after complexity can be monitored, managed and minimise the risk of change.,

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 生活休闲 > 科普知识

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号