Software Test Map Overlay

Source: Internet
Author: User

  Public Static voidPrintprimes (intN) {intCurprime; intNumprimes; BooleanIsPrime; int[] primes =New int[Maxprimes]; primes [0] = 2; Numprimes= 1; Curprime= 2;  while(Numprimes <N) {curprime++; IsPrime=true;  for(inti = 0; I <= numPrimes-1; i++)             {                if(curprime%primes[i]==0) {IsPrime=false;  Break; }             }             if(IsPrime) {Primes[numprimes]=Curprime; Numprimes++; }         }                  for(inti = 0; I <= numPrimes-1; i++) {System.out.println ("Prime:" +Primes[i]); } 

First, control flow diagram

Second, the test Case t1= (n=3), and t2= (n=5), T2 prone to two T1 is not prone to errors are: array out of bounds.

Third, n=1, the corresponding test path access connection While statement starts to the edge of the for statement, rather than passing through the while loop body.

Iv. node overwrite: {0,1,2,3,4,5,6,7,8,9,10,11,12}

Side overlays: {(0,1), (2,3), (3,4), (4,5), (5,7), (4,6), (3,7), (7,9), (6,3), (7,8), (8,9), (1,9), (9,10), (10,11), (11,10), ( 10,12)}

Main path overrides: {(0,1,2,3,4,5,7,8,9,10,11,), (0,1,2,3,4,5,7,8,9,10,12), (0,1,2,3,4,5,7,9,10,11), (0,1,2,3,4,5,7,9,10,12), ( 0,1,2,3,4,6),

(0,1,9,10,12), (10,11,10), (11,10,11), (3,4,6,3), (4,6,3,4), (6,3,4,6)}

V. Main PATH coverage

Software Test Map Overlay

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.