Chapter 7 testing the software with X-ray glasses

Source: Internet
Author: User
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
Low Level
How to force program to operate a certain
Way
What different methods you can use
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
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
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
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
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
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 saved med 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 shoshould 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
Specification before white-box Cases
Data Coverage
Data and States
Map the white-box information to
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
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
Situation that can never happen in
The real world
A great way to use error forcing is
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 demo-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 demo-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
The quality of the software
Program Statement and line
Coverage
The most straightforward form
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
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
Branch statements into account
Example
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.