计算机类
公务员类
工程类
语言类
金融会计类
计算机类
医学类
研究生类
专业技术资格
职业技能资格
学历类
党建思政类
计算机等级考试(NCRE)
全国计算机应用水平考试(NIT)
计算机软件水平考试
计算机等级考试(NCRE)
全国高校计算机等级考试CCT
行业认证
信息素养
软件测试工程师(计算机等级考试四级)
计算机等级考试一级
网络工程师(计算机等级考试四级)
计算机等级考试二级
数据库工程师(计算机等级考试四级)
计算机等级考试三级
信息安全工程师(计算机等级考试四级)
嵌入式系统开发工程师(计算机等级考试四级)
软件测试工程师(计算机等级考试四级)
问答题设计一组测试用例,使该程序所有函数的语句覆盖率和分支覆盖率尽量达到最大。如果认为该程序的语句覆盖率或分支覆盖率无法达到100%,需说明为什么。(9分)
进入题库练习
问答题针对以下C语言程序,请按要求回答问题。 已知link. c源程序如下: /*link. c程序对单向链表进行操作,首先建立一个单向链表,然后根据用户的选择可以对其进行插入结点、删除结点和链表反转操作*/ #include<stdio.h> #include<stdlib.h> typedef struct list_node*list_pointer; //定义链表指针 typedef struct list_node{ //定义链表结构 int data; list_pointer link; }list_node; //用到的操作函数 list_pointer create(); //建立一个单向链表 void insert(list_pointer*p_ptr, list_pointer node); //在node后加入一个新的结点 void delete_node(list_pointer*p_ptr, list_pointer trail, list_pointer node); //删除前一个结点是trail的当前结点node void print(list_pointer*p_ptr); //打印链表结点中的值 list_pointer invert(list_pointer lead); //反转链表 int main() { list_pointer ptr=NULL; list_pointer node, trail; list_pointer * p= int choose, location, i; printf("you should create a link first:/n"); prt=create(); //*ptr 指向链表的第一个结点*/ print(ptr); //根据用户的不同选择进行相应的操作; printf("input number 0, you can quit the program/n"); printf("input number 1, you can insert a new node to link/n"); printf("input number 2, you can delete a node from the linkkn"); printf("input number 3, you can invert the link/n"); printf("please input you choicekn"); scanf(" %d", while(i<location){ node=node->link; i++; } insert(p,node); /*p为指向ptr的指针*/ print(ptr); break; case 2: printf("you will delete a node from the link/n"); printf("please input the location of the node:/n"); scanf("%d", node=ptr; if(location==1) trail=NULL; trail=ptr; i=1; while<i<location){ trail=trail->link; i++; } node=trail->link; delete_node(p, trail, node); print(ptr); break; case 3: printf("you will invert the link/n"); ptr=invert (ptr) print(ptr); break; default : break return -1: } printf("please input you choice/n"); scanf("%d", } return 0; //根据用户的输入值建立一个新的单向链表: list_pointer create() { int i, current, length; list_pointer p1, p2, head; printf("please input the node number of the link:/n"); scanf("%d", printf("the number of the link is: %d", length); printf("please input the data for the link node: /n"); i=0; p1=p2=(list_pointer)malloc(sizeof(list_node)); head=p1; for(i=1; i<length; i++){ scanf("%d", p1->data=current; p2->link=p1; p2=p1; p1=(list_pointer)malloc(sizeof(list_node)); } p2->link=NULL; return head; }
进入题库练习
问答题针对以下C语言程序,请按要求回答问题。 已知link. c源程序如下: /*link. c程序对单向链表进行操作,首先建立一个单向链表,然后根据用户的选择可以对其进行插入结点、删除结点和链表反转操作*/ #include<stdio. h> #include<stdlib. h> typedef struct list_node * list_pointer; //定义链表指针 typedef struct list_node //定义链表结构 int data; list_pointer link; list_node; //用到的操作函数 list_pointer create(); //建立一个单向链表 void insert(list_pointer * p_ptr,list_pointer node); //在node后加入一个新的结点 void delete_node(list_pointer * p_ptr,list_pointer trail,list_pointer node); //删除前一个结点是trail的当前结点node void print(list_pointer * p_ptr); //打印链表结点中的值 list_pointer invert(list_pointer lead); //反转链表 int main() list_pointer ptr=NULL; list_pointer node,trail; list_pointer * P=&ptr; int choose,location,i; printf("you should create a link first:/n"); //建立一个单向链表 prt=create(); //ptr指向链表的第一个结点 print(ptr); //根据用户的不同选择进行相应的操作: printf("input number 0,you can quit the program/n"); printf("input number 1,you can insert a new node to link/n"): printf("input number 2,you can delete a node from the link/n"); printf("input number 3,you can invert the link/n"): printf("please input you choice/n"); scanf("%d",&choose); while(choose!=0) switch(choose) case 1: i=1: while(i<location) node=node->link; i++: insert(p,node); //p为指向ptr的指针 print(ptr); break; case 2: printf("you will delete a node from the link/n"); printf("please input the location of the node:/n"); scanf("%d",&location): node=ptr; if(location==1) trail=NULL; trail=ptr; i=1: while(i<location) trail=trail->link: i++: node=trail->link; delete_node(p,trail,node); print(ptr); break; case 3: printf("you will invert the link/n"); ptr=invert(ptr); print(ptr); break; default; break; return -1; printf("please input you choice/n"); scanf("%d". &choose): return 0; //根据用户的输入值建立一个新的单向链表: list_pointer create() int i,current,length; list_pointer p1,p2,head; printf("please input the node number of the link:/n"); scanf("%d". &length): printf("the number of the link is:%d",length); printf("please input the data for the link node:/n"); i=0; p1=p2=(list_pointer)malloc(sizeof(list_node)); head=p1; for(i=1;i<length;i++) scanf("%d",&current); p1->data=current; p2->link=p1; p2=p1; p1=(list_pointer)malloc(sizeof(list_node)); p2->link=NULL; return head;
进入题库练习
问答题请简述风险控制的方法。
进入题库练习
问答题对下图中的事务Ti和Tj,构造一个符合两阶段锁协议、并且冲突等价于串行调度<Ti;Tj>的并发调度。 Ti Tj read(C)C:=C+1write(C)read(A)A:=A*2write(A) read(A)A:=A+1write(A)read(B)B:=B+1write(B)
进入题库练习
问答题已知C源程序如下: /*Input today"s date,output tomorrow"s date * / /* version 2 * / #include<stdio. h> struct ydate { int day; int month; int year;}; int leap(struct ydate d) { if((d. year%4==0&&d. year%100 ! =0)||(d. year%400==0)) return 1; else return 0; } int numdays(struct ydate d) { int day; static int daytab[]= {31,28,31,30,31,30,3l,31,30,31,30,31}; if(1eap(d)&&d. month==2) day=29; else day=daytabEd. month-1]; return day; } int main(void) { struct ydate today,tomorrow;printf("format of date is:year,month,day输入的年、月、日之间应用逗号隔开/n); printf(" today is:"); scanf(“%d,%d.%",&today.year,&today.month,&today.day); while(0>=today. year || today. year>65535||0>=today. month||today. month>12)|| 0>=today. day||today. day>numdays(today)) { printf("input date error!reenter the day!/n"); printf(" today is:"); scanf("%d,%d,%d",&today. year,&today.month,&today. day); } if(today. day!=numdays(today)) {tomorrow. year=today. year; tomorrow. month=today. month; tomorrow. day=today. day+1; } else if(today.month==12) {tomorrow. year=today. year+1; tomorrow. month=1; tomorrow. day=1; } else {tomorrow. year=today. year; tomorrow. month=today. month+1: tomorrow.day=1; } printf("tomorrow is:%d,%d,%d/n/n", tomorrow. year,tomorrow. month,tomorrow. day); } (1) 画出程序中所有函数的控制流程图; (2) 设计一组测试用例,使该程序所有函数的语句覆盖率和分支覆盖率均能达到100%。如果认为该程序的语句或分支覆盖率无法达到100%,需说明为什么。
进入题库练习
问答题以下是某应用程序的规格描述,请按要求回答问题。
进入题库练习
问答题已知C源程序如下: /* 分数运算fsys.c */ include <stdio.h> int main() { long int a, b, c, d, i, x, y, z; char op; printf("两分数b/a, d/c作+、-、*、/四则运算,结果为分数。/n"); printf(请输入分数运算式: b/a op d/c /n"); scanf("% ld/% ld% c% ld/ % ld", if(a==0 || c==0) { printf("分母为0,输入错误! /n"); return(0); } if(op=='+') { y=b*c+d*a; x=a*c; /* 运算结果均为y/x */ } if(op=="-') { y=b*c-d*a; x=a*c; } if(op=='*') { y=b*c; x=a *d; } z=x; if(x>y)z=y; i=z; while(i>1) { if(x % i==0 y=y/i; continue; } i--; } printf("% ld/% ld% c% ld/% ld=% ld/% ld./n", b, a, op, d, c, y, x); return 0; }
进入题库练习
问答题论述题2:QESuiteWebVersion1.0中,已知某OA系统测试项目的部分信息如下:●测试版本:总计4个测试版本,按日期排序分别为OA1.0_111009,OA1.0_111025,OA1.0_111103,OA1.0_111129。●功能分类视图中部分待测区域及人员分配定义如下表所示:下表是功能区域“发文管理/发文”下某一个软件问题的操作历史信息,请依据QESuiteWebVersion1.0的软件问题生命周期定义和题中提供的相关人员分配和测试版本信息,填写表中5项空缺的操作历史信息。
进入题库练习
问答题以下程序的作用是从i到n个元素的序列A[i..n]中选取具有最小值的元素,通过下标k得到该元素的位置。现对程序执行简单循环,限定循环次数为0次、1次和2次,请设计该程序的简单循环测试用例。 int minValue(int A[], int n, int i) int k=I; for(int j=i+1;j<=n;j++) if(A[j]<A[k])k=j; return k;
进入题库练习
问答题以下是教材购销系统的描述,请仔细阅读并按要求回答问题。 某图书管理系统有以下功能:A) 借书:输入读者借书证,系统首先检查借书证是否有效。然后检查该读者所借图书是否超过10本,若已达到,拒借;未达到10本,办理借书,修改库存并记录。B) 还书:从借书文件中读出与读者有关的记录,查阅所借日期,如果超期(1个月)做罚款处理;否则,修改库存目录与借书文件。C) 查询:可通过借书文件、库存目录文件查询读者情况、图书借阅情况及库存。
进入题库练习
问答题QESuite Web Version 1.0中,已知某认证网关系统测试项目的部分信息如下: ·测试版本:总计4个测试版本,按日期排序分别为SAG2.0_110209,SAG2.0_110225,SAG2.0_1110303,SAG2.0_110309。 ·功能分类视图中部分待测区域及人员分配定义如下表所示: 功能区域 功能区域 测试人员 开发人员 安装 安装更新 李晓军 王蒙 功能 身份认证与访问控制 张丽 郑君 白名单管理 张丽 郑君 …… …… …… Web配置 郭畅达 郑君 性能 网关传输延迟 刘晖 王小林 …… …… …… …… 下表是功能区域“性能/网关传输延迟”下某一个软件问题的操作历史信息,请依据QESuite Wet,Version 1.0的软件问题生命周期定义和题中提供的相关人员分配和测试版本信息,且假设已知“执行操作”均正确,请找出下表中的错误并说明理由。 操作序号 操作者 执行操作 操作后的问题状态 测试版本 1 张丽 新建 打开 SAG2.0_110209 2 郑君 校验/再现 打开/再现 SAG2.0_110209 3 王小林 修复/不修复 待验/修复 SAG2.0_110225 4 刘晖 验证/同意 解决/修复 SAG2.0_110225 5 刘晖 重新打开/再现 打开/修复 SAG2.0_110303 6 王小林 修复/修复 待验/修复 SAG2.0_110303 7 刘晖 验证/不同意 打开/再现 SAG2.0_110309
进入题库练习
问答题以下是QESuite web Velsion 1.0的用户手册,请按要求回答问题。
进入题库练习
问答题针对以下C语言程序,请按要求回答问题  以下是一个用来求解一元二次方程的C语言程序:   1 main()   2 {   3 float a,b,c,x1,x2,delta;   4 scanf("%f%f%f",&a, &b, &c);   5 if (a!=0)   6 {   7 delta=b*b-4*a*c;   8 if (delta>0)   9 {   10 x1=(-b+sqrt(delta))/(2*a);   11 x2=(-b-sqrt(delta))/(2*a);   12 printf("x1=%f,x2=%f/n",x1,x2);   13 }    14 else   15 {   16 if (delta==0)   17 {   18 x1=-b/(2*a);   19 printf("x1=%f/n",x1);   20 }    21 else   22 {   23 printf("no real solution/n");   24 }   25 }   26 }   27 }  
进入题库练习
问答题已知C源程序如下: #include <stdio.h> #include <string.h> void reverse(char s[]) { int c, i, j; for(i=0, j=strlen(s)-1; i<j; i++, j++) { c=s[i]; s[i]=s[j]; s[j]=c; } } void getHex(int number, char s[]) { int i; i=0; while(number>0) { if(number % 16<10) s[i++]=number % 16+'0'; else switch(number % ]6) { case 10: s[i++]='A'; break; case 11: s[i++]='B'; break; case 12: s[i++]='C'; break; case 13: s[i++]='D'; break; case 14:s[i++ ]='E'; break; case 15: s[i++]='F'; break; default: printf("Error"); break; } number/=16; } s[i]='/0'; reverse(s); } int main() { unsigned int number; int i=0; char s[50]; printf("% s","please input number:/n"); scanf("% d", getHex(number, s); i=0; while(s[i]) printf("% c", s[i++]); return 0; }
进入题库练习
问答题设计一组测试用例,使该程序addLInt函数的语句覆盖率和分支覆盖率均能达到100%。如果认为该函数的语句覆盖率或分支覆盖率无法达到100%,需说明为什么。
进入题库练习
问答题以下是学生选课系统中“学生成绩查询”交互行为的描述,请仔细阅读程序并完成要求。 交互开始时,终端上显示首页,用户选择“查询”请求后,显示“请输入学号”。在用户输入学号后,系统核对学生学号:若输入的学号不正确,则显示“输入的学号不正确”,此次查询取消,回到首页;若输入的学号正确,则出现“请输入课程名称”。一旦输入课程名,就开始核对课程名称:若输入的课程名称不正确,则显示“输入的课程名称不正确”,此次查询取消,回到首页;若输入的课程名称正确,则根据“学号”和“课程名”查询学生成绩。 若查询学生成绩成功,则显示查询到的成绩,系统询问是否继续查询:当用户选择“继续查询”后回到“请输入学号”;当用户选择“结束查询”后回到首页。若查询失败,则显示“查询失败”后回到首页。
进入题库练习
问答题根据你对单无测试的理解,谈谈在任何情况下单元测试都是可能的吗,都足需要的吗?
进入题库练习
问答题以下是某C语言程序,用来求一个数的绝对值,请仔细阅读程序并完成要求。 #include"stdi.h" main() float x,y; scanf("%f",&x); if(x>0) y=x; else y=-x; printf("%f",y); getch();
进入题库练习
问答题某测试项目中的测试执行阶段按计划在三天后结束,将进入测试总结阶段。
进入题库练习
软件测试工程师(计算机等级考试四级)