Testing the Software
with X-Ray Glasses
Chapter 7
Highlights
What dynamic white-box testing is
The difference between debugging and
dynamic white-box testing
What unit and integration testing are
How to test low-level functions
The data areas that need to be tested at a
low level
How to force program to operate a certain
way
What different methods you can use to
measure the thoroughness of your testing
Dynamic White-Box Testing
Definition
• Using information you gain from seeing
what the code does and how it works to
determine what to test, what not to test,
and how to approach the testing
• Structural testing
Calculator example
Dynamic White-Box Testing (2)
Four areas of dynamic white-box testing
• Directly testing low-level functions, procedures,
subroutines, or libraries
• Testing the software at the top level, as a
completed program
• Gaining access to read variables and state
information from the software to help you
determine whether your tests are doing what
you thought
• Measuring how much of the code and
specifically what code you hit when you run
your tests
Dynamic White-Box Testing Versus
Debugging
Both involve dealing with software
bugs and looking at the code
Goals
• Dynamic white-box testing
To find bugs
• Debugging
Fix bugs
Dynamic White-Box Testing Versus
Debugging (2)
Dynamic White-Box
Testing
Isolating the Bug Debugging
Testing Programming
Testing the Pieces
Why dynamic black-box testing is not
enough?
• It’s difficult and sometimes impossible
to figure out exactly what caused the
problem
• Some bugs hide others
Never have it happen in the first
place
Unit and Integration Testing
Code is built and tested in pieces and
gradually put together into larger and
larger portions
Process --- incremental testing
• Unit testing or module testing
• Integration testing is performed against groups
of modules
• Continues
• Test the entire product --- system testing
Unit and Integration Testing (2)
Main
ABC
BC
A B C D E F
DEF
Incremental Testing
Bottom up and top-town
Example
Temperature
Display Module
Temperature
Display Module
Thermometer
Interface Module
Thermometer
Interface Module
An Example of Module Testing
atoi() function
• ASCII to Integer
• A bottom module in the program
• Called by others but not call others
How
• Write test driver to send test strings to the atoi( )
function, read back the return values and compare them
with expected results
• Analyze the specification to decide what black-box test
cases should be tried and then apply equivalence
partitioning to reduce total set
• Use white-box knowledge of the module to add or
remove test cases
Creating black-box testing cases based on the
specification before white-box cases
Data Coverage
Data and states
Map the white-box information to the
black-box cases
Data Flow
Tracking a piece of data completely
through the software
• Individual module or function
• Integrated modules
• Entire software product
How
• Use a debugger and watch variables to
view the data as program runs
Sub-Boundaries
Every piece of software will have its
own unique sub-boundaries
• Computes taxes
• OS running low on RAM
• Number precision problem
Examine the code carefully to look
for sub-boundary conditions and
create test cases that will exercise
them
Formulas and Equations
Formulas and equations are buried
deep in the code
Compound interest example
Error Forcing
Use the debugger to force error
Make sure you aren’t creating a
situation that can never happen in
the real world
A great way to use error forcing is to
cause all the error messages in your
software to appear
Code Coverage
Code coverage testing
• Enter and exit every module
• Execute every line of code
• Follow every logic and decision path
Simplest form
• Single-step through the program using
debugger to view lines of code
Code coverage analyzer
• A function, a line of code, or logic decision is
executed, the analyzer records the information
Code Coverage (2)
What parts of the software your test
cases don’t cover
Which test cases are redundant
What new test cases need to be
created for better coverage
You will also have a general feel for
the quality of the software
Program Statement and Line
Coverage
The most straightforward form of
code coverage
But, it can’t tell you if you’ve taken
all the paths through the software
Branch Coverage
Path testing
• Attempting to cover all the paths in the
software is called path testing
• Simplest form
Branch coverage testing
Most code coverage analyzers give
you report both statement coverage
and branch coverage
Condition Coverage
Condition coverage testing
• Takes the extra conditions on the
branch statements into account
Example
分享到:
相关推荐
Testing the Software with X-Ray Glasses Dynamic White-Box Testing Dynamic White-Box Testing Versus Debugging Testing the Pieces Data Coverage Code Coverage Summary Quiz Part III. ...
Nondestructive Raman spectroscopy and external-beam proton-induced X-ray emission (PIXE) technique to analyze eight ancient glasses unearthed from the provinces of Henan, Hubei, and Jiangsu, which ...
THERMAL-CONDUCTIVITY-OF-GLASSES 传热研究。。
Optically transparent Er3+-doped tellurite-based nanocrystallized glasses with the composition of 70TeO2-15Li2O-15Nb2O5-0.5Er2O3 (mol) have been prepared by a conventional melting quenching and the ...
超快速冷却金属玻璃体的热力学异常行为及其与强脆转变现象的相关性,胡丽娜,宋敏,本文研究了超快速冷却制备的Cu46Zr46Al8金属玻璃体低于玻璃转变温度的热弛豫行为与冷却速度之间的关系。结果表明,在较高和较低的...
Wavelength combining with a transmitting Volume Bragg Grating recorded in photo-thermo-refractive glasses is present. The combining condition is determined with theoretical simulation. The combining ...
Tm2O3-doped 40GeO(2)-35TeO(2)-15PbO-5Al(2)O(3)-2.5CaO-2.5SrO glasses with different Tm3+ ion concentrations are fabricated by conventional melt-quenching method. From the measurements of thermal ...
Investigations on the photoluminescence of the iron and cobalt doped fluoride-containing phosphate-based glasses and its defects-related nature
中温固体氧化物燃料电池封接玻璃的结构与封接性能:TiO2含量对TiO2-CaO-SrO-B2O3-SiO2玻璃体系的影响,张腾,陈嘉琳,本文中,TiO2作为CaO-SrO-B2O3-SiO2玻璃体系的形核添加剂,通过改变体系的结晶过程来调整微晶...
In this paper, the glasses were melted with traditional method. The influences of mixed alkali effect (MAE) on refractive index, thermal expansion coefficient 'alpha', glass transition temperature Tg...
The fragility index (m) of a series of Ge-As-S glasses covering a wide range of mean coordination () and stoichiometry is measured by differential scanning calorimetry. The evolution of the fragility ...
A series of highly Er^(3+)/Yb^(3+) co-... In the glasses with Er^(3+) concentrations below 10 mol%, concentration quenching is very low and the Er^(3+)/Yb^(3+) co-doped fluoroaluminate glasses have st
Novel Ga-Sb-S chalcogenide glasses doped with different amount of Dy3+ ions were prepared. Their thermal stability, optical properties, and mid-infrared (MIR) emission properties were investigated. ...
The Yb^(3+)/Er^(3+) co-doped TeO_(2)-WO_(3)-ZnO glasses bubbling with different times were prepared. The infrared (IR) transmission spectra, emission spectra and fluorescence lifetime of Er^(3+) at ...
The xNb2O5-(15-x)La2O3-40B2O3-45BaO (x=5, 7.5, 12.5 mol%) glasses doped with Eu3+ ions in 1 mol% are fabricated by the melting method. The Fourier transform infrared (FTIR) spectra, phonon side-band ...
Chapter 7 presents the linear GLCs combined with machine learning, including hybrid, automatic, interactive, and collaborative versions of linear GLC, with the data classification applications from ...
Results show that undergoing heat treatment, re-markable luminescence quenching occurs for the glasses containing Na2O and K2O due to the formation of Bi metallic colloids, whereas the glass with Li2...
Two series of Yb3+-doped silica glasses ... Co-doping with Al and P decreases the hydroxyl group content in the glasses because of the reduction in non-bridging oxygen content. The lowest OH content in
Chapter 1, Introduction to DevOps and Continuous Delivery, deals with the background of DevOps and sets the scene for how DevOps fts in the wider world of Agile systems development. Chapter 2, A View ...