Software Test Third Job

Source: Internet
Author: User

This assignment is mainly based on the code, drawing the control flow diagram, and related to the side coverage, point coverage, the master path of knowledge.

The specific job content is as follows

/******************************************************* * Finds and prints n prime integers * Jeff Offutt, Spring 2003 ******************************************************/public static void Printprimes (int n) {in T Curprime; Value currently considered for primeness int numprimes;        Number of primes found so far. Boolean isprime;        Is Curprime prime? int [] primes = new int [maxprimes];                 The list of prime numbers.        Initialize 2 into the list of primes.        primes [0] = 2;        Numprimes = 1;        Curprime = 2;            while (Numprimes < n) {curprime++;//Next number to consider ... isprime = true;                for (int i = 0; I <= numPrimes-1, i++) {//For each previous prime.                    if (curprime%primes[i]==0) {//Found a divisor, curprime is not prime.                    IsPrime = false; Break Out of Loop ThrougH primes.                }} if (IsPrime) {//Save it!                Primes[numprimes] = Curprime;            numprimes++;        }}//End while//Print all the primes out.        for (int i = 0; I <= numPrimes-1; i++) {System.out.println ("Prime:" + primes[i]); }}//End Printprimes

Draw a Control flow chart

Second, design a t2= (n=5) than t1= (n=3) easy to find errors found

Write a test case so that the corresponding test path access connection While statement starts to the edge of the FOT statement, instead of passing through while the loop body

T:n=1

Iv. example of each node overlay, Edge overlay and master path covered TR

Node Overwrite requirement: {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}

Side coverage Requirements: {(a), (2,11), (2,3), (3,4), (4,5), (5,6), (5,7), (6,5), (6,9), (7,8), (7,2), (8,2), (9,10), (10,7), (11,12), (12,13), (12,15), (13,14), (14,12)}

Main PATH Coverage requirements:

Software Test Third Job

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.