Commonsense and Strategies in Software Testing

Commonsense and Strategies

The minimum mandatory testing requirements are branch and statement coverage
The questions "why not use a judicious sampling of paths?" and "what is wrong with leaving some code, untested?" are ineffectual in the view of common sense and experience since:
    Not testing a piece of a code leaves a residue of bugs in the program in proportion to the size of the untested code and the probability of bugs
    The high probability paths are always thoroughly tested if only to demonstrate that the system works properly
Which paths to be tested?
We must pick enough paths to achieve C1 + C2
The question of what is the fewest number of such paths is interesting to the designer of test tools that help automate the path testing, but it is not crucial to the pragmatic (practical) design of test
It is better to make many simple paths than a few complicate paths
Practical Suggestions in Path Testing
Draw the control flow graph on a single sheet of paper
Make several copies, as many as you will need for coverage (C1+C2) and several more
Use a yellow highlighting marker to trace paths. Copy the paths onto a master sheet
Continue tracing paths until all lines on the master sheet are covered, indicating that you appear to have achieved C1+C2
As you trace the paths, create a table that shows the paths, the coverage status of each process and each decision
Depending on the flow graph example the following table appears:

Practical Suggestions in Path Testing:
After you have traced a covering path set on the master sheet and filled in the table for every path, check the following
Does every decision have a YES and NO in its column? (C2)
Has every case of all case statements been marked? (C2)
Is every three-way branch. (less, equal, grater) covered? (c2)
Is every link (process) covered at least once? (C1)

Revised Path Selection Rules:
1. Pick the simplest, functionally sensible entry/exit path
2. Pick additional paths as small variation from previous paths. Pick paths that do not have loops rather than paths that do. Favor short paths that make sense over paths that don't
3. Pick additional paths that have no obvious functional meaning only if its necessary to provide coverage
4. Be comfortable with your chosen paths, keep guessing until you achieve C1+C2
5. Don't follow rules blindly, except for coverage.
Share on Google Plus

About Data Sciences by Venu

Hi, My name is Venugopala Chary and I'm Currently working as Associate Professor in Reputed Engineerng College, Hyderabad. I have B.Tech and M.tech in regular from JNTU Hyderabad. I have 11 Years of Teaching Experience for both B.Tech and M.Tech Courses.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment