请结合等价类方法给出getNumDaysInMonth(int month,int year)方法的测试用例,其中getNumDaysInMonth方法根据给定的月份和年份返回该月份的总天数。
第1题:
给出下列代码,如何使成员变量m被方法fun( )直接访问?Class Test{private int m;public static void fun( ){} }
A.将private int m改为protected int m
B.将private int m改为public int m
C.将private int m改为static int m
D.将private int m改为int m
第2题:
在C++语言中,若类C中定义了一个方法int (int a,int b),那么方法(1)不能与该方法同时存在于类C中。
A.int f(int x,int y)
B.int f(float a,int b)
C.float f(int x,float y)
D.int f(int x,float y)
第3题:
类的说明如下,请指出错误的地方 ______。 class Myclass { int a=111; public: Myclass(int x, int y); Myclass(int val); ~Myclass(); }
A.int a=111;
B.Myclass(Int x, int y);
C.Myclass(int val);
D.~Myclass();
第4题:
请给出如下程序的结果
int aaa = 0x01;
htonl(aaa) = ____。
第5题:
软件测试分为黑盒测试和白盒测试,其中,______方法属于黑盒测试。
A.等价类划分和边界类划分
B.循环覆盖以及基本路径测试
C.错误推测和逻辑覆盖
D.因果图和路径覆盖
请帮忙给出正确答案和分析,谢谢!
第6题:
用等价类测试方法给出输入条件的等价类表。

第7题:
某公司招聘人员,其要求为:学历:本科及以上;专业:计算机、通信、自动化;年龄 :22-30 岁。 (1)请划分出各条件的有效等价类和无效等价类。 (2)给出弱一般等价类、强一般、弱健壮等价类法的测试用例 (3)写出强健壮法设计的测试用例的个数
第8题:
第9题:
第10题:
类MyClass的构造方法MyClass(int x,int y)的目的是使MyClass的成员变量privateintx,privateinty的值分别等于方法参数表中所给的值int x,int y。请写出MyClass(int x,int y)的方法体(用两条语句):()
第11题:
setRefPixelPosition(int x,int y)
defineReferencePixel(int x,int y)
setVisible(boolean visible)
setPosition(int x,int y)
第12题:
第13题:
黑盒测试用例的设计技术主要有( )、因果图、功能图。
A.逻辑覆盖法、边界值划分、错误推测法
B.等价类划分、边界值划分、错误推测法
C.等价类划分、逻辑覆盖法、错误推测法
D.等价类划分、边界值划分、逻辑路径法
请帮忙给出正确答案和分析,谢谢!
第14题:
请分析下面的程序并给出该程序的执行结果【 】。
include <iostream>
class AA {
int a;
public:
AA() {cout<<" Initializing AA!\n" ; }
AAM() {cout<<" Destroying AA!\n" ;
};
class BB {
int b;
AA p;
public:
BB() {cout<<"Initializing BB!\n" ;
~BB() {cout<<"Destroying BB!\n" ;
};
void main() {
BB X;
cout<<"Ending main!\n' ;
}
第15题:
请给出如下程序的结果
int a = 3;
int b = a << 3;
a = ____,b = ____。
第16题:
请给出如下程序的结果
#define MAX_NUM 100+200
int nTemp = MAX_NUM*10;
则Temp = ____。
第17题:
请分析该程序的规则说明和被测程序的功能,采用等价类划分方法设计测试用例。

第18题:
已知类SubClass的getSum方法返回其父类成员i与类SubClass成员j的和;类SuperClass中的getSum为抽象函数,程序中的第14行有错误,请修改该错误并给出修改后的完整结果,然后完善程序中的空缺,当程序运行到第22行且尚未执行第22行语句时成员变量i的值,最后给出程序运行后的输出结果。
[Java代码]
行号 代码
01 public class UainJava{
02 public static void main(String[]args){
03 SuperClass s=new SubClass();
04 System.out.printin(s.getValue());
05 System.out.printIn(s.getSum()):
06 }
07 }
08 abstract class SuperClass {
09 private int i;
10 public SuperClass(){i=5;}
11 public int getValue(){
12 return i:
13 }
14 public final abstract int getSum():
15 }
16 class SubClass extends SuperClass{
17 int j;
18 public SubClass(){
19 this(-3);
20 }
21 public SubClass(int j){
22 (1) .j=j;
23 }
24 publiC int getValue()(return j;}
25 public int getSum(){
26 return (2) .getValue()+j;
27 }
28
第19题:
有定义语句:“int*p[4];”,以下选项中与此语句等价的是( )。
A.int p[4];
B.int**P;
C.int*(p[4]);
D.int(*p)[4];
第20题:
第21题:
下列方法中哪个方法是Sprite类中用来设置对准点的方法:()
第22题:
等价类划分方法中,划分好等价类后设计测试用例的步骤是什么?
第23题: