Test Cases of cyclic structure

Source: Internet
Author: User

The cyclic structure has many applications in software programs, but the testing cases of the cyclic structure are relatively special. The white box testing method alone does not work. The conditional coverage method and path coverage method must be used, only when the equivalence classes in the black box testing method are divided and the boundary value analysis is combined can the problem be solved.

1. Single-Cycle Structure

Zero execution cycle

Execute the loop body once

Maximum number of execution cycles

The maximum number of execution cycles minus one

You can test the value in the middle.

2 nested loops

Set the cycle of all other layers to the minimum value from the inmost loop (excluding the inmost loop ).

Perform a simple loop test on the innermost loop. During the test, the minimum and maximum values of the loop variables that keep all Outer Loops are obtained. In addition, the cross-border value is similar to the invalid value.

Step by step, test the external layer of loops. The minimum value is used for loop variables that keep all Outer Loops during testing, and the "typical" value is used for loop variables of all other nested memory loops.

Repeat until all layers are tested cyclically.

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.