逻辑覆盖法是设计白盒测试用例的主要方法之一,它是通过对程序逻辑结构的遍历实现程序的覆盖。针对以下由C语言编写的程序,按要求回答问题。 getit( int m) { int i, k; k=sqrt(m); for ( i=2; iimage.png=k; i++) if (m % i=0) break; if ( i>=k+1 ) printf( "%d is a selected number\n", m); else printf( "%d is not a selected number\n", m ); }1、请找出程序中所有的逻辑判断子语句。2、请将满足100%DC(判定覆盖)所需的逻辑条件填入下表。
3、请画出上述程序的控制流图,并计算其控制流图的环路复杂度VG.。假设函数getit的参数m取值范围是150image.pngmimage.png160,请使用基本路径测试法设计测试用例,将参数m的取值填入下表,使之满足基本路径覆盖要求。
1、本题考查对编程语言的理解,着重考查判断语句。程序中的逻辑判断子语句如下:i<=k m%i==0i>=k+111、
本题考查白盒测试用例设计方法:判定覆盖法。判定覆盖法又称为逻辑覆盖,是通过对程序逻辑结构的遍历实现程序的覆盖。
2、本题考查白盒测试用例设计方法:基本路径法。涉及的知识点包括:根据代码绘制程序流图、计算环路复杂度以及设计测试用例。注意测试用例的数目本应和环路复杂度是一致的,但存在特殊情况。控制流图:
3、环路复杂度:V(G)=4 基本路径覆盖用例:
( )is the process of transforming information so it is unintelligible to anyone but the intended recipient.
As each application module is completed,it undergoes( )to ensure that it operates correctly and reliably.
( )algorithm specifies the way to arrange data in a particular order.
After analyzing the source code,( )generates machine instructions that will carry out the meaning of the program at a later time.
( )can help organizations to better understand the information contained within the data and will also help identify the data that is most important to the business and future business decisions.
浏览器开启无痕浏览模式后,( )依然会被保存下来。
下列协议中,不属于TCP/IP协议簇的是( )。
下列传输介质中,带宽最宽、抗干扰能力最强的是( )。
数控编程常需要用参数来描述需要加工的零件的图形。在平面坐标系内,确定一个点需要2个独立的参数,确定一个正方形需要( )个独立的参数。
某书的页码为1,2,3,...,共用数字900个(一个多位数页码包含多个数字),据此可以推断,该书最大的页码为( )。