Software Testing 2
Software Testing 2
of Software Testing
Software Quality Assurance
and Testing Course
Deeply understand the connotation of software quality,
master defect analysis methods, learn the testing
classification system, and cultivate professional testing
mindsets. CHAPTER 2
Chapter 1 Review
2.1 Software Quality 2.2 Software Testing 2.3 Static Testing and 2.4 Active Testing and
and Software Defects Classification System Dynamic Testing Passive Testing
2.5 White-box Testing 2.6 Software Testing 2.7 Test Plan and Test 2.8 Requirements for
and Black-box Testing Levels Cases Professional Testers
2.1 Software Quality and
Software Defects
Definition of Quality: ISO 8492 Standard
A software product satisfies all the stated and implied characteristics and features
related to the ability to meet requirements.
The degree to which software
1 product quality meets user The combination degree of
2
various attributes of software
requirements
The comprehensive reflection
3 degree of users on software 4 The degree to which software
meets user requirements during use
products
3. Reliability
Definition: The robustness
and dependability of software,
2. Performance code integrity, and technical
Definition: The resource utilization compatibility.
rate and operational characteristics of
the system.
Resource utilization includes CPU
occupancy and memory usage level.
Classic Quality Model: McCall Model
A hierarchical classification framework
for software product quality attributes Product Operation
Correctness, Reliability,
Efficiency, Integrity,
Usability, etc.
Product Focus on user experience
Operation
Product Modification
Maintainability, Flexibility,
Testability, etc.
Product
Modification Focus on software maintainability
Product Transition
Product Portability, Reusability,
Transition Interoperability, etc.
Focus on software
adaptability
International Standard: ISO 9126 Three-layer
Software Quality Model
The three-layer evaluation criteria system:
SQRC • SQDC • SQMC
Common Point: Violating quality requirements, failing to meet customer needs, and
leading to functional failure.
Standard Definition of Software Defects
What exactly is a software defect? The essence of defects from a dual perspective
② Software Itself
p Document errors, failure to consider user scenarios
p Issues such as system self-recovery, remote data backup and disaster recovery
③ Team Work
Inadequate communication and misunderstandings
Causes of Software Defects: Technical Problems
Analysis of Technical Challenges and Limitations
(a)Limitations of Development Technology (c)Difficulties in Complexity Management
① Limitations of developers' technical capabilities ① Excessively complex logic that is difficult to handle
perfectly at one time
② Failure of system design to fully balance
functionality, performance and security ② Poor system structure design leading to low performance
③ Mismatch between technical selection and actual ③ Unscientific algorithm selection affecting system
requirements efficiency
(b)Challenges of New Technology Application (d) Interface and Compatibility Problems
① Immature performance in the initial adoption of ① Mismatched transmission caused by excessive
new technologies interface parameters
② Certain functions in requirement specifications
② Insufficient experience in solving and handling problems
cannot be implemented technically
③ Risks brought by the steep learning curve of new
③Insufficient consideration of recovery mechanisms
technologies
after system crashes
Thinking: Which type of technical problem is the most common in your project experience?
Causes of Software Defects: The Software Itself
and Processes
Problems with the Software Itself Inadequate design considerations
Problems with the software itself often stem from the neglect of quality standards and
underestimation of complexity in the development process.
Causes of Software Defects: Team Collaboration
and Communication Quality risk factors at the management level
Team Culture Issues
Weak quality awareness and insufficient emphasis on
software quality; lack of a team culture that prioritizes
quality.
Requirements Communication
Barriers
Deviations in understanding customer requirements;
insufficient clarity in analyzing customer needs during
system analysis; difficulties and misunderstandings in
communication with users.
Information Transmission in the
Development Phase
Team collaboration problems are often more
Inconsistent understanding across phases; deviations in
the design team’s interpretation of requirements analysis difficult to detect and solve than technical
results; insufficient attention paid by programmers to problems, but have a far-reaching impact on
design specifications. product quality.
This data subverts the traditional perception that "testing mainly finds
programming errors"
Why Are Specifications a Defect Prone Area?
Accounting for 41% of software defects
1. Challenges of the Communication Gap
Users are mostly non-technical personnel, with a professional
language gap with the development team, leading to easy
deviations in the understanding of product functions.
2. Limitations of Imaginative Description Specifications are the key
The product has not yet been implemented, and system functions bridge connecting user
are described entirely by imagination, resulting in unclear and requirements and technical
inaccurate descriptions of certain features. implementation, bearing
3. Inconsistency in Requirement Changes the greatest conversion
User requirements change continuously, and the delayed update of
risks.
specifications is prone to contradictions and contextual conflicts.
System Testing
Integration
Testing
Unit Testing
Methods
Performance Testing
Stress Testing White-box Black-box
Testing Testing
Functional Testing
Compatibility Testing
Reliability Testing
Security Testing
Objectives/Characteristics
2.3 Static Testing and
Dynamic Testing
Static Testing and Dynamic Testing
Evolution of the Concept: Generalized Testing vs Narrow Testing
Early testing was limited to the dynamic execution of programs, while modern testing
has expanded to quality assurance activities throughout the development process.
2.3.1 Product Review
According to the definition of IEEE Std 1028—1988, a review is an evaluation method for the
status of software elements or projects to determine whether they are consistent with the
planned results and to drive their improvement.
Advantages: Mutual checks and balances, Advantages: High comprehensiveness, Advantages: High authority,
knowledge sharing. discovering in-depth problems. thorough problem solving.
Core Points of Requirement Review
Inspect the completeness, correctness and clarity of the requirement specifications.
Value of Early Involvement of Testers
Core Review Dimensions ✔ Identify potential risk points from a testing
Completeness Check perspective
• Whether requirements cover all user scenarios ✔ Ensure the testability of requirements
• Whether functional descriptions omit key elements ✔ Lay the foundation for subsequent test design
• Whether non-functional requirements are clearly defined
Correctness Verification
• Whether requirement expressions are accurate and
error-free
• Whether business logic conforms to user expectations
• Whether technical implementation is feasible
The cost of fixing problems found
Clarity Assessment
in the requirement stage is only
• Whether term definitions are consistent
1/100 of that in the later stage.
• Whether descriptive language is easy to understand
• Whether ambiguous expressions are clarified
Design Review and Code Review
Discover potential defects in system design and code implementation through
collaborative reviews.
Design Review Code Review
Check the rationality of system structure Organization of joint review process
- Whether the architectural design conforms to requirements - Programmers explain logic sentence by sentence
- Evaluate the rationality of module division - Team members ask questions and discuss
Analyze testability Key inspection content
- Whether the design facilitates test execution - Correctness of program structure and algorithms
- Completeness of test interfaces - Consistency of coding style
Verify database design - Standardization of global variable usage
- eview using standardization theories Types of problems discovered
- Consistency check of data schemas Logical errors and boundary conditions
Evaluate non-functional requirements Interface problems between modules
- Consideration of performance and security System structure parameter conflicts
- Check of extensibility design Global variable usage issues
2.3.2 Technical Means of Static Analysis
In-depth analysis technology without running code
• Inspect or review software entirely by manual work • Conduct feature analysis using static analysis tools
• Focus on checking coding style and algorithm logic • Extract key information from programs
• Discover security and internationalization issues • Check various defects in program logic
• Check code problems such as fault tolerance • Discover suspicious program constructs
Discover logical design errors that are not easily found by computer analysis
Practical Significance: To determine whether each lifecycle activity is complete and whether the next
phase can be initiated.
Connotation of Validation
Are we building the right product?
Definition: Provide evidence to show whether the software truly meets the
actual needs of customers. Because the design specifications themselves
may have understanding deviations, verification alone is insufficient.
Key Characteristics:
Practical Significance:
Even if the software fully conforms to the design specifications, if the design specifications themselves
misunderstand the user requirements, the software is still a failure.
Dialectical Relationship Between Verification
and Validation A dual guarantee mechanism in quality assurance
Even if verification is passed, the product may still fail to meet user requirements!
Verification Validation
Are we building the product right?
Are we building the right product?
Inspect whether the software correctly implements
Inspect whether product functions truly meet user
the product specificationsI Both are
requirements
• Focus on internal consistency • Focus on external effectiveness indispensable and
jointly form a
- Conformity between code and design
complete quality
documents - Consistency between functions and user
assurance system.
- Matching between implementation and expectations
specifications - Accuracy of requirement understanding
- Standardization level of the development - Achievement of customer satisfaction
process
Verification ensures "doing things right" ↔ Validation ensures "doing the right things".
2.4 Active Testing and
Passive Testing
2.4 Active Testing and Passive Testing
Comparison of Testing Methods in Controlled vs Production Environments
Active Testing Passive Testing
Active testing is the most common To solve the limitations of product
method in software testing, which online testing, the passive testing
emphasizes the tester's absolute method came into being. It
control over the testing process and emphasizes "non-intervention" and
the tested object. "real environment".
Definition: Testers actively Definition: The software product runs in
send requests to the tested the actual environment, and testers
object, or drive the behavior passively monitor the operation of the
of the tested object with the product without intervening in it. Obtain
help of data and events, so as the system operation data including input
to verify the response or and output data through certain passive
output results of the tested mechanisms.
object. Key Difference: Active testing emphasizes control, while passive testing
emphasizes observation.
2.5 Black-Box Testing &
White-Box Testing
2.5 White-Box Testing (Structural Testing)
The Testing Philosophy of Seeing Through the Internal Structure of Programs
What is White-Box Testing??
Black-box testing does not focus on the internal structure of the software, but on the external user interface
of the program, the input and output of the software, and user requirements, to directly obtain the user
experience.
Types of Defects Commonly Detected by Black-
Box Testing
Identify problems in the external performance of the software from the user's
perspective.
l Functional Defects
1. Defective functions or missing certain functions.
2. Failure to receive input data correctly and output wrong
results.
l User Interface Defects
Black-box testing focuses on the
Distorted, incorrect or unattractive interface display. external performance of the
l Operation Experience Defects software and verifies whether the
Irrational and inconvenient functional operation logic. system meets the requirements of
l System Integration Defects the specification from the user's
1. Problems during the installation process, unclear and perspective.
inflexible installation steps.
2. System initialization issues, etc.
Combination Matrix of Static/Dynamic and
White-Box/Black-Box
White-Box Testing Black-Box Testing
System functions,
System Testing security, robustness,
efficiency
Integration Testing
Interfaces between components
Unit Testing
Component functions,
Implementation (Coding) robustness, efficiency
Tes
t
Unit Testing
Laying a Solid Foundation for Building a Reliable System
Unit testing is a test conducted on the smallest units (classes, functions, modules, components) in a
program system, mainly using white-box testing methods to check the consistency between the
implemented functions and the defined functions.
• What to test? The smallest units in the program system, such as a class, a function or a
component.
• How to test? Mainly use white-box testing methods to delve into the internal code logic and
check for coding errors.
• Who tests? Usually completed by programmers (developers) and testers together, with
programmers playing a leading role.
Integration Testing: Big-Bang Integration and
Incremental Integration
A Comparison of Two Strategies for Finding Unit Interface Problems
What to test? Interface problems after units are assembled together, such as whether data
transmission is lost, whether parameter types match, and whether errors accumulate.
Test Case: Test guidelines for manual execution. Test Script: A collection of instructions for automatic
execution by tools.
Functions and Design Process of Test Cases
Four Core Functions of Test Cases Standard Design Process of Test Cases
[Link] important 1. Formulate Strategies: Define the strategies and ideas
reference basis for test for test case design, and record them clearly in the
execution.
test plan.
2.A guarantee for the
implementation of 2. Design Framework: Design the macro framework
efficient testing. and hierarchical structure of test cases.
3. Refine and Deliberate: Refine the structure and
[Link]
gradually design specific test cases (including
accumulation and
continuous improvement. preconditions, input data, execution steps and
expected results).
[Link] for 4. Review and Optimize: Continuously optimize and
regression testing.
improve the test case set through internal or multi-
party reviews of test cases.
2.8 The Responsibilities and
Requirements of Professional
Testers
2.8 Responsibilities and Requirements for
Professional Testers
Core Responsibilities and Value Embodiment of Test Experts
Responsibility 1: Problem Discovery and Responsibility 2: Quality Assessment and
Supervision of Resolution Status Feedback
Discover problems in software programs, Evaluate software quality comprehensively and
systems or products as early and as much objectively, and provide the current quality status
as possible. of the project in a timely manner.
Supervise developers to fix program Continuously provide feedback on the quality of
defects as soon as possible. software products and expose product quality
risks.
Responsibility 3: Professional Responsibility 4: Defect Analysis and
Competence and Efficiency Improvement Prevention Guidance
Be responsible for the quality and efficiency Conduct root cause analysis of defects and abstract
of quality work, and act as the Test Owner. defect patterns.
Become a test expert, continuously improve Help the team do a good job in defect prevention and
testing methods and enhance test efficiency. establish a quality assurance system.
Combination of Testing and Quality Assurance (QA)
Role Expansion from Tester to Quality System Builder
Only with a high sense of responsibility can the An excellent test engineer can communicate
reliability of testing work be guaranteed. well with both users and developers.
Qualities of an Excellent Test Engineer (2):
Technical Ability and Self-Confidence
Technical Ability: Self-Confidence: Adhere to Correct
Foundation of R&D Work Views
[Link] and Development Experience [Link] Doubts from Developers
Understand the principles of system architecture Have confidence in the bugs you report, not be easily
design, have code review capabilities, and be able to influenced by others, and maintain the independence
develop test tools and automated scripts. of testing work.
[Link] Technical Knowledge [Link] Design Problems
Master operating system configuration and Dare to challenge the logical problems of
troubleshooting, network technology and database specifications, conduct professional discussions with
management, performance tuning and security product designers, and adhere to the correct
testing. understanding of user requirements.
[Link] of Testing Methods [Link] Resolution
Not limited to black-box testing, combine with Speak based on facts and data, maintain a professional
white-box testing methods to improve test efficiency attitude, and promote the fundamental solution of
and coverage. problems.
Qualities of an Excellent Test Engineer (3):
Patience and Skeptical Mindset
Patience Skeptical Mindset
[Link] in Repeated Execution [Link] All Explanations
The same test case may need to be run dozens or even Developers will try to downplay errors; stay highly alert
hundreds of times and verified repeatedly in different and do not easily accept unreasonable explanations.
test environments. [Link] Judgment Ability
[Link] on Solving Complex Problems Listen to everyone's explanations patiently and make
Spend a lot of time separating and identifying errors, decisions only after personal analysis or testing.
and understand the occurrence rules of errors under [Link] Design Rationality
specific conditions. Maintain a skeptical attitude towards functional design
[Link] with Heavy Workload and implementation, and explore better implementation
Maintain concentration and execution quality when methods.
facing the execution of hundreds of test cases.