软件测试课程学习总结

一、知识结构

介绍:

1.Definition of Software testing:

Software testing is any activity aimed at evaluating an attribute or capability of a program or system and determining that it meets its required results

Software Testing is an empirical(观察和实验) investigation conducted to provide stakeholders with information about the quality of the product or service under test

Software testing is any activity , which exists through the whole lifecycle, aimed at testing a program by using test cases to test the software behaviors(true/false)

2.Why Software Testing

Because we just are not good enough programmers

We probably don’t concentrate enough to keep from making mistakes

We forget some times to use full structured programming, top-down design to get our solutions

We should be able to distinguish what another programmer or customer says and what they really think or mean

Testing is an admission of failure

3.Some of the Definitions

error(错误): mistake that designer or programmer makes

defect(fault, bug)(缺陷) : the results from “errors” in source code, or. requirements gaps

failure(失败或失效): cause of the executed “defect”, in certain situations the system will produce wrong results.

4.Understanding Software Testing

黑盒测试

1.Black Box Testing:It is a common method of testing, it is regarded as a black box that can not be open, and it design cases  according to functional requirements.Some commom black box testing methods and testing tools will be introduced here. 

2.Equivalence Class Partitioning

 所谓等价类是指输入域的某个互不相交的子集合,所有等价类的并集便是整个输入域。目的在于测试用例的无冗余性。

划分等价类( valid / invalid ) (1)有效等价类:检验程序是否实现了规格说明预先规定的功能和性能。 (2)无效等价类:检查软件功能和性能的实现是否有不符合规格说明要求的地方。

常用的等价类划分原则 (1)按区间划分 (2)按数值划分 (3)按数值集合划分 (4)按限制条件或规则划分 (5)细分等价类

3.Boundary Value Analysis 

大量的软件测试实践表明,故障往往出现在定义域或值域的边界上,而不是在其内部。为检测边界附近的处理专门设计测试用例,通常都会取得很好的测试效果。因此边界值分析法是一种很实用的黑盒测试用例方法,它具有很强的发现故障的能力。  

4.因果图法及决策表法

E,I, O,R Equal,And,Or,Not

白盒测试:

1.

白盒测试:又称结构测试,它一般用来测试程序的内部结构(Control Flow , Data Flow)。并判定其结果是否与预期的结果一致。

白盒测试的种类:静态分析测试(Static Analysis Test,Code Inspection)、语句分支覆盖测试(Ctrl Flow Test)等。

2.

语句覆盖(Statement coverage)准则 是最简单的结构性测试方法之一,它要求测试中,程序中的每条语句都得到运行。即,控制流图中的所有语句都被运行的充分必要条件是,覆盖图中的所有节点。 测试数据集T称为语句覆盖充分的,当且仅当LT覆盖了GP中的所有节点。NODE(LT)为路径集合LT中所覆盖的GP中的节点的集合。 NG 是GP 中所有节点的集合。

3.

分支覆盖准则 分支覆盖要求在软件测试中,每个分支都至少获得一次真/假取值的经历。 测试数据集T称为分支覆盖充分的,当且仅当LT覆盖了GP中的所有有向边。EDGE(LT)为路径集合LT中所覆盖的GP中的有向边的集合, EG 是GP 中所有边的集合。

4.

谓词(Predicate)测试 一个分支的条件是由谓词组成。单个谓词称为原子谓词。 例如前面的例子中的 a!=0、mid>0等。原子谓词通过逻辑运算符的连接构成复合谓词。

系统测试:

Testing conducted on a complete, integrated system to evaluate the system's compliance with its specified requirements. System testing falls within the scope of black box testing, and as such, should require no knowledge of the inner design of the code or logic.

系统测试的测试类型及内容 功能测试、GUI测试、性能测试、压力测试、容量测试、健壮性测试、安全性测试、可靠性测试、恢复测试与备份测试、协议一致性测试、兼容性测试、安装性测试、可用性测试、配置性测试、文档性测试、验收测试、回归测试

UNIT Test:

A software verification & validation method where the programmer gains confidence that individual units of source code are fit for use. A unit is the smallest testable part of an application:function, procedure; method of class Unit tests are typically written and run by software developers to ensure that code meets its requirements and behaves as intended. xUnit:a family of unit testing frameworks

验证代码与设计相符合(Code Inspection与Unit Test相结合) 跟踪需求和设计的实现 发现设计和需求中存在的错误 发现编码过程中引入的错误

Integration Test:

集成(Integration)是指把多个单元组合起来形成更大的单元。 集成测试(Integration Testing)是在假定各个软件单元已经通过了单元测试的前提下,检查各个软件单元之间的相互接口是否正确。

所有公共接口必须被测试到 关键模块必须进行充分测试 集成测试应当按一定层次进行 集成测试策略选择应当综合考虑质量、成本和进度(Q.C.D)三者之间的关系 集成测试应当尽早开始,并以概要设计为基础 在模块和接口的划分上,测试人员应该和开发人员进行充分沟通

Peer review:

A work product (normally some form of document) is examined by its author and one or more colleagues, in order to evaluate its technical content and quality. Purpose is to test whether each stage of software development and software testing are complete、standard or not. Whether each stage of product meets the prescribed technical requirements and quality requirements, in order to decide whether it can go into the next phase of the work. 。

The division of Review stage (1) System analysis and design (2) Software requirement analysis (3) System outline design (4) Software detailed design (5) Coding and unit test (6) Software component test (7) Software configuration test (8) Software system test (9) System acceptance   

Measure of peer review Defect density = defects/review scale Review speed = review scale/review hours Review efficiency = defects/man-hour Note: review scale: number of document pages(A4) man-hour: members * review hours

Merit of Technical peer review Have proven over time to be one of the most efective practices available for ensuring quality products and on-time deliveries. Have demonstrated its benefits across industry. Improve quality and reduce cost by reducing rework. More quickly bringing new members up to speed. Educating project members about efective develop-ment practices.

二、学习感想

通过本课程,我知道了什么是软件测试、如何进行软件测试、软件测试的两种方法----黑盒测试与白盒测试、不同阶段的测试----单元测试集成测试系统测试,并学会了如何使用visual studio 2013 ultimate 经行UI黑盒测试,手动进行白盒测试,使软件出现问题的可能性大大的降低。

原文地址:https://www.cnblogs.com/airjasonsu/p/4474470.html