软件测试结果分析和质量报告
- 缺陷分析
- 错误
无明显错误。
- BUG
无。
- 缺陷
无。
- 失效
无。
- 测试结果
测试数据集:12345.678/1234.5678
测试结果集:123456.78/12345678.
2.检查代码
#include<stdio.h>
#include<stdlib.h>
#include <string.h>
int main() {
char node[5]={'1','2','3','4','5'};//装点个数以及各自的值
//char line[64]; //接收文件每行
char szTest[1000] = {0};
char result[100]; //存放结果字符串
int i = 0;
//打开的文件夹的路径
FILE *file = fopen("C:Users22326Desktop大学学习软件质量与测试上课myfile.txt", "r");
//按行读取txt文件数据
if(NULL == file){
printf("failed to open myfile.txtn");
}
//循环读取数据
while(!feof(file)){
memset(szTest,0, sizeof(szTest));
fgets(szTest,sizeof(szTest) - 1, file); //包含了换行符,szTest是读取的行的数据
char *s= szTest;
char *tmp=s;//指向查找的字符
while(strchr(tmp,'*')!=NULL){
tmp=strchr(tmp,'*')+1;
result[i]=*tmp;//存放
i++;
}
}
for(int j=0;j<5;j++){//装点数组
for(int k=0;k<i;k++){//result数组
if(strcmp(&result[k],&node[j])){
result[k]='0';
}
}
}
int count=0;//计数
char *p;
char a='0';
p=&a;
for(int q=0;q<i;q++){
if(!strcmp(&result[q],p)){
count++;
printf("%c未覆盖到n",result[q]);
}
}
int cover=(i-count)/i;
printf("覆盖率为:%dn",cover);
fclose(file);//关闭文件流
exit(EXIT_SUCCESS);
}