首页 > 其他分享 >软件测试与检验复习1(Introduction to Software Engineering/Software Testing/Test-Driven design and refactoring/

软件测试与检验复习1(Introduction to Software Engineering/Software Testing/Test-Driven design and refactoring/

时间:2023-02-27 22:36:33浏览次数:39  
标签:testing 代码 Testing test 测试 Test Software 软件测试

 

  • What is Software Engineering? 什么是软件工程

The process of solving customers' problems by the systematic development and evolution of large, high-quality software systems within cost, time and other constraints.

在成本、时间和其他约束条件下,由大型、高质量的软件系统的系统开发和演变来解决客户问题的过程。   

  • Definition of software quality 软件质量定义

The degree to which a system, component, or process meets specified requirements (customer or user needs or expectations).(IEEE)   

系统、组件或过程满足特定要求(顾客或用户的需求或期望)的程度。

  • External and Internal Quality 外部和内部质量

1. Functionally 功能性

Functionality is an attribute which deals with the segree to which a software system satisfies user needs. 功能性是一种属性,它涉及软件系统满足用户需求的程度。

 2. Reliability 可靠性

 3. Usability 可用性

 4. Efficiency 效率

 5. Maintainability 可维护性

       Maintainability is a property of the software which reflects the degree to which the software can undergo any type of maintenance  ( corrective, preventive, perfective and adaptive).  可维护性是软件的一种属性,它反映了软件可以经受任何类型的维护(更正性、预防、完善和自适应)的程度。

 6. Portability 可移植性

 


 

  • What is software testing?什么是软件测试?

  Software testing consists of the dynamic verification of the behavior of a program on a finite set of test cases, suitably selected from the usually infinite executions domains,  against the specified expected behavior.

  软件测试是一个程序在一个有限集的测试用例上的行为的动态验证,该测试用例适当的从通常是无限的执行域中选择,与指定的预期行为相对。

—— Testing is the process of executing a program with the intention of finding errors. (Myers)

—— 测试是为了发现错误而执行程序的过程。 (迈尔斯)

  • What are the golas of testing?测试的目标是什么?

  To find as many faults and detect as many failures with limited resources. 在有限的资源下找到尽可能多的错误并检测到更多的失败。

  • Software errors, faults, failures and incidents 软件错误、故障、失效和事故  

  1. An error (or mistake) is something people make. 一个错误(或错误)是人们所做的。
  2. A faults (defect, bug) is the result of an error.   故障(缺陷,错误)是错误的结果。
  3. A failure is the program's actual incorrect or missing behavior. It occurs when a fault executes. 故障是指程序的实际不正确或缺失行为。它发生在故障执行时。
  4. An incident is a characteristic of a failure that helps you recognize that the program has failed. 事件是失败的一个特征,可以帮助你认识到程序已经失败。
  • Testing vs Debugging 测试与调试

  1. Testing is concerned with confirming the presence of faults.测试是为了确认故障的存在。
  2. Debugging is concerned with locating and repairing these faults.调试是关于定位和修复这些故障。
  • Test Cases 测试用例

  • A good test case is one that has a high probability of finding an as-yet-undiscovered bug.一个好的测试用例是具有高概率去发现尚未发现的错误的。
  • Each test case consists of the following(ideally):
    • Identifier 标识符
    • Statement of purpose 声明目的
    • Preconditions 前提条件
    • Inputs and expected outputs 输入和预期产出
    • Expexted post-conditions 延伸的后置条件
    • Expecytion history(data, tester, version, etc) 实验历史(数据、测试人员、版本等)
  • Identifying Test Cases 确定测试用例

The essence of software testing is to determine a setof test cases for the item to be tested. 软件测试的本质是为要测试的项目确定一套测试用例。

  • Approaches to derive test case  衍生出测试案例的方法

—— Functional (black-box) 功能性测试(黑箱)

  • Derived from specifications 源于规范
  • Reusable even if code changes 即使代码改变,也可重复使用

—— Structural (white-box) 结构性测试(白盒)

  • Derived from code documentation 来自于代码文档
  • Test coverage metrics 测试覆盖率指标
  • Testing levels 测试水平 

  • Unit testing 单元测试

—— Testing of individual components 单个组件的测试

  • Integration testing 集成测试

—— Testing to expose problems arising from the combination of components 测试暴露出由组件组合产生的问题

  • System testing 系统测试

—— Testing the complete system prior to dilivery 在交付前对整个系统进行测试

  • Acceptance testing 验收测试

—— Testing by user to check that the system satisfies requirements. 由用户测试,检查系统是否满足要求

—— Alpha testing (in-house) and Beta testing (at the customer site) α测试(内部)和β测试(在客户现场)

 


 

 

  •  Junit

A framework for automated unit testing of Java code 一个用于Java代码自动化单元测试的框架

Use Java ffeatures such as annotations and static imports 使用Java的特性,如注解和静态导入

  • How to define a test in Junit? 如何在Junit中定义一个测试?

To define that s certain methos is a test method, annotate it with the @Test annotation.  为了定义某个方法是一个测试方法,用@Test注解来注解它。

  • Assert 方法

assertEquals(Expected Output,method of test Class);

  • Test Suite 测试组

  • A TestSuite is a composite of tests. 一个TestSuite是一个测试的组合。
  • It runs a collection of test cases, grouped into a "Suite". 它运行一个测试案例的集合,被分组为一个 "套件"。
  • It allows specific ordering of tests. 它允许测试的特定排序。
  • Refactoring 代码重构(不属于测试)

A refactoring is a change made to the internal structure of S/W to make it easier to understand and less expensive to modify, without changing its observable behavior.

重构是对S/W的内部结构所做的改变,使其更容易理解,修改成本更低,而不改变其可观察的行为。

 


 

  • What is Code Walkthrough? 什么是代码走查?

    Code Walkthrough is a form of peer review in which a programmer leads the review process and the other team members ask questions and spot possible errors against development standards and other issues.

代码走查是一种同行评审的形式,在这个过程中,一个程序员领导评审过程,其他团队成员提出问题,并根据开发标准和其他问题发现可能的错误。

  • The main purpose of walkthrough is to enable learning about the content of the document under review to help team members gain an understanding if the content of the document and also to find defects.    走查的主要目的是为了了解被审查文件的内容,以帮助团队成员了解文件的内容,并发现缺陷。
  • What is Code Review? 什么是代码复查?

     Code REview is a systematic examination, which can find and remove the vulnerabilities in the code. 代码复查是一种系统的检查,它可以发现并消除代码中的漏洞。

  • What is code Inspection?什么是代码检验?

Code Inspection is the most formal type of review, which is a kind of static testing to avoid the defect multiplication at a later stage.

代码检查是最正式的审查类型,它是一种静态测试,以避免在以后的阶段出现缺陷的增殖。

  • The main purpose of code inspection is to find defects and it also spot any process improvement if any.

          代码检查的主要目的是发现缺陷,如果有的话,它也会发现任何过程的改进。

 

 

 

 

 

 

 

 

 

 

 

 

 

标签:testing,代码,Testing,test,测试,Test,Software,软件测试
From: https://www.cnblogs.com/chen1chen/p/17087434.html

相关文章