Академический Документы
Профессиональный Документы
Культура Документы
Unit V Software testing fundamentals: test case design, Whitebox testing. Basis path, control structure-, BlackboxTesting, & for specialized environments. Strategic approach to S/W testing. Unit testing, integration testing, validation testing, system testing. Debugging. Technical metrics for software.
Book Recommended
U1-1,2,3 U2-4,5,6 U3-7,8,9 U4-10,11,13 U5-14,15,16 U6-17,18,19
Software Engineering, A Practitioners Approach - Pressman Roger. S. TMH. (Strictly 5th Ed)
Reference Books R1 Software Engineering Somerville R2 Software Engineering Fairly R R3 Principles of Software Development R4 Software Engineering Shooman, M.L
Software Testing
Testing is the process of exercising a program with the specific intent of finding errors prior to delivery to the end user.
Testability
Operabilityit operates cleanly Observabilitythe results of each test case are readily observed Controlabilitythe degree to which testing can be automated and optimized Decomposabilitytesting can be targeted Simplicityreduce complex architecture and logic to simplify tests Stabilityfew changes are requested during testing Understandabilityof the design
developer
Understands the system but, will test "gently" and, is driven by "delivery"
independent tester
Must learn about the system, but, will attempt to break it and, is driven by quality
Exhaustive Testing
loop < 20 X
There are 10 possible paths! If we execute one test per millisecond, it would take 3,170 years to test this program!!
14
Selective Testing
Selected path
loop < 20 X
Software Testing
white-box methods black-box methods
Methods Strategies
White-Box Testing
... our goal is to ensure that all statements and conditions have been executed at least once ...
Why Cover?
logic errors and incorrect assumptions are inversely proportional to a path's execution probability we oftenbelieve that a path is not likely to be executed; in fact, reality is often counter intuitive
typographical errors are random; it's likely that untested paths will contain some
Cyclomatic Complexity
A number of industry studies have indicated that the higher V(G), the higher the probability or errors.
modules
Loop Testing
for example, the final loop counter value of loop 1 is used to initialize loop 2.
Black-Box Testing
requirements
output
input
events
Equivalence Partitioning
user queries
data
user queries
data
input domain
output domain
Testing Strategy
unit test integration test
system test
validation test
Unit Testing
Unit Testing
module to be tested interface local data structures boundary conditions independent paths error handling paths
test cases
Module
stub
stubs are replaced one at a time, "depth first" as new modules are integrated, some subset of tests is re-run
Bottom-Up Integration
A
drivers are replaced one at a time, "depth first" worker modules are grouped into builds and integrated
cluster
Sandwich Testing
A
cluster
new test regression cases tests suspected causes corrections identified causes
results
Debugging
Debugging Effort
time required to diagnose the symptom and determine the cause
symptom cause
cause may be due to assumptions that everyone believes symptom may be intermittent
Consequences of Bugs
infectious damage catastrophic extreme serious disturbing
mild
Bug Categories: function-related bugs, system-related bugs, data bugs, coding bugs, design bugs, documentation bugs, standards violations, etc.
Debugging Techniques
brute force / testing backtracking
induction
deduction
4. Be absolutely sure to conduct regression tests when you do "fix" the bug.
A Comment
McCalls quality factors were proposed in the early 1970s. They are as valid today as they were in that time. Its likely that software built to conform to these factors will exhibit high quality well into the 21st century, even if there are dramatic changes in technology.
Formulation Principles
The objectives of measurement should be established before data collection begins; Each technical metric should be defined in an unambiguous manner; Metrics should be derived based on a theory that is valid for the domain of application (e.g., metrics for design should draw upon basic design concepts and principles and attempt to provide an indication of the presence of an attribute that is deemed desirable); Metrics should be tailored to best accommodate specific products and processes [BAS84]
Attributes
simple and computable. It should be relatively easy to learn how to derive the metric, and its computation should not demand inordinate effort or time empirically and intuitively persuasive. The metric should satisfy the engineers intuitive notions about the product attribute under consideration consistent and objective. The metric should always yield results that are unambiguous. consistent in its use of units and dimensions. The mathematical computation of the metric should use measures that do not lead to bizarre combinations of unit. programming language independent. Metrics should be based on the analysis model, the design model, or the structure of the program itself. an effective mechanism for quality feedback. That is, the metric should provide a software engineer with information that can lead to a higher quality end product
Analysis Metrics
Function-based metrics: use the function point as a normalizing factor or as a measure of the size of the specification Bang metric: used to develop an indication of software size by measuring characteristics of the data, functional and behavioral models Specification metrics: used as an indication of quality by measuring number of requirements by type
HK metric: architectural complexity as a function of fan-in and fan-out Morphology metrics: a function of the number of modules and the number of interfaces between modules
Code Metrics
Halsteads Software Science: a comprehensive collection of metrics all predicated on the number (count and occurrence) of operators and operands within a component or program