Principles of software testing
异常类型
故障
Fault
- Abnormal condition that can cause an element or an item to fail.
错误
Error
- These are mistakes made by software developers.
- Discrepancy between a computed, observed or measured value or condition and the true, specified, or theoretically correct value or condition.
Error of Commission
冗余错误
- Related to extra functionality that has been added to the code that is not in the specification.
- Error in knowledge or instruction.
Error of Omission
遗漏错误
- Related to missing required functionality that has not been implemented
- Something that occurred accidentally.
失效
Failure
- Termination of the ability of an element or an item to perform a function as required.
- Symptoms of a fault, and consist of incorrect, or out-of specification behaviour by the software.
软件开发过程
Software Development Process
- 客户需求 Customer Requirements
- 产品说明书 Specifications
- 进度表 Schedules
- 软件设计文档 Software Design Documents
- 测试文档 Test Documents
契约式设计
Design-by-Contract
- The pre-conditions and post-conditions must be specified for a method.
- These conditions are already assumed satisfied for testing, thus there is no need to test these conditions, hence Testing-by-Contract.
防御性设计
Defensive Design
- The test engineering must test the method under both normal and abnormal pre-conditions, hence the Defensive Testing.
软件测试设计
Test Design
- Analyzing the Software Under Test (SUT)
- Analysis of source code and specification
- To determine test cases
- Generating the test cases
- Allowing a single test to cover multiple test cases
- Each test case must have a unique identifier
- Generating the test data
- Input values: the actual specific values
- Expected output: always derived from the specification, never from the source code
- Implementing the test
- Code: for automate testing
- Procedures: for manual testing