SoftwareTest homework3

(a).

(b).Maxprimes=4,越界。

(c).n=1,没有进入while循环。

(d).节点覆盖:{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}

边覆盖:

{(1,2),(2,3),(3,4),(4,5),(5,6),(6,7),(6,8),(8,5),(5,9),(7,9),(9,10),(10,11),(9,11),(11,2),(2,12),(12,13),(13,14),(14,13),(13,15)}

主路径覆盖:{(3,4,5,6,7,9,10,11,2,12,13,15),(3,4,5,6,7,9,10,11,2,12,13,14)}

(e).{(1,2,3,4,5,6,8,5,6,7,9,10,11,2,12,13,14,13,15)}

(f).{(1,2,3,4,5,6,7,9,10,11,2,3,4,5,6,8,5,9,11,2,12,13,14,13,15)}

时间: 2024-12-20 01:09:08

SoftwareTest homework3的相关文章

人工智能作业homework3——模拟退火解决TSP

模拟退火算法 受固体退火过程的启发,Kirkpatrick等人意识到组合优化问题与固体退火过程的类似性,将组合优化问题类比为固体的退火过程,提出了求解组合优化问题的模拟退火算法. 表7.3给出了组合优化问题与固体退火过程的类比关系. 表7.3:组合优化问题与退火过程的类比 固体退火过程 组合优化问题 物理系统中的一个状态 组合优化问题的解 状态的能量 解的指标函数 能量最低状态 最优解 温度 控制参数 设一个定义在有限集S上的组合优化问题,i∈S是该问题的一个解,f(i)是解i的指标函数.由表7

软件测试,Homework3

软件测试,Homework3 题目 private static void printPrimes(int n) { int 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

软件工程 Homework3

1 /******************************************************* 2 * Finds and prints n prime integers 3 * Jeff Offutt, Spring 2003 4 ******************************************************/ 5 public static void printPrimes (int n) 6 { 7 int curPrime; // Va

homework3

a: b: 将13行(primes[0]=2;)改为primes[0]=3; 15行(curPrime=2;)改为curPrime=3; c:测试用例t(n=1) d:节点覆盖:{1,2,3,4,5,6,7,8,9,10,11,12,13,14} 边覆盖:{(1,2),(2,3),(2,11),(3,4),(4,5),(4,8),(5,6,)(5,7),(6,8),(8,9),(8,10),(9,2),(10,2),(11,12),(12,13),(12,14)(13,11)} 主路径覆盖: [

homework3:课本习题练习

首先,书上给的代码如下: /******************************************************* * Finds and prints n prime integers * Jeff Offutt, Spring 2003 ******************************************************/ public static void printPrimes (int n) { int curPrime; // Val

软件测试homework3

题目:课本49页7题a)b)c)d) 解答如下: a)PrintPrimes()方法的控制流图如下: b)例如MAXPRIMES=4时,t2=(n=5)会出现数组越界的问题. c)n=1时会出现. d)节点覆盖:{0,1,2,3,4,5,6,7,8,9,10,11,12,13} 边覆盖:{(0,1),(1,2),(1,10),(2,3),(3,4),(3,7),(4,5),(4,6),(5,7),(6,3),(7,8),(7,9),(8,9),(9,1),(10,11),            

SoftwareTest lab2 homework

1. Install the Selenium IDE for the firefox browser. To begin with, I install the firfox(V42.0). Then, the selenium IDE for firfoxe can be found in the marketplace, so all I have do is install it according to the indication. 2.Record and Export the t

【SoftwareTesting】Homework3

(a) (b) 数组越界问题 (c) n=0 (d) 点覆盖:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16] 边覆盖:[(1,2),(2,3),(3,4),(4,5),(5,6),(6,7),(7,5),(6,8),(8,9),(5,9),(9,10),(10,11),(11,2),(2,12),(12,13),(13,14),(14,15),(15,13),(13,16)] 主路径覆盖: [1,2,3,4,5,6,7] [1,2,3,4,5,9,10,11]

软件测试homework3的主路径覆盖

package test; public class test { void printPrimes(int n){ int curPrime; int numPrimes; boolean isPrime; int [] primes = new int [43]; primes[0]=2; numPrimes = 1; curPrime = 2; while ( numPrimes < n) { curPrime ++ ; isPrime = true; for ( int i = 0 ;