SWEN90006

本文深入探讨了软件测试和可靠性中的关键概念,包括等价类划分和边界值分析两种测试技术的应用。通过具体案例分析,展示了如何确定输入域的有效性和无效性类别,以及如何选取测试用例来覆盖各种边界条件。此外,文章还对比了这两种测试方法的有效性,指出边界值分析在测试覆盖率和准确性方面更具优势。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

The University of Melbourne
SWEN90006: Software Testing and Reliability
Assignment 1
Second Semester, 2018

Name:Xujia Zhu
Stu ID:951633

Task 1

First, we consider the input domain of this program:
(1) This list of strings must have instruction “RET”.
(2)The instruction in this list of strings must be one of “ADD,SUB,MUL,DIV,RET,MOV,LDR,STR,JMP,JZ”these 10 instructions or begin with “;”.
(3)Each register mentioned in the list of strings like Rx,must satisfy the condition: 0<=x<=31.
(4)The value of val in the instruction MOV must satisfy the condition: -65535<=v<=65535.
(5)The value of val in the instruction LDR and STR must satisfy the condition: 0<=b+v<=65535.
(6)The value of val in the instruction JMP and JZ must satisfy the condition: 0<=pc+v<=N-1.

Then, we examine the requirements and have the equivalence classes.
(1)Applying to guideline 2, we have two equivalence classes, list of strings which have the instruction RET, and which not. The valid class is the list of strings which have the instruction RET. The invalid class is the list of strings which don’t have the instruction RET.
(2)Applying to guideline 2, all instructions in the list of strings can be divided into 2 kinds: instructions starting with “;” and not. The valid class is instructions starting with “;”. We need to further divide the instructions not beginning with “;”.
(3)Continued from the preceding paragraph, applying to guideline 2, instructions not beginning with “;” can be divided into 2 kinds: instructions begin with one of “ADD,SUB,MUL,DIV,RET,MOV,LDR,STR,JMP,JZ” these 10 instructions, and instructions not begin with these 10 situations. The invalid class is instructions not begin with these 10 situations. And we need to divide the valid class further.
Then we are going to talk about instructions begin with these 10 situations:
(1)In these 10 kinds of instructions, which begin with “ADD,SUB,DIV,MUL,RET”, because the assumptions say that there are no syntax errors, so we only consider the value problem of the x in Rx.Applying to guideline 1, there are three equivalence classes, one of x in Rx <0, all of x in Rx are between 0 and 31, one of x in Rx >31.The valid class is all of x in Rx in these instructions are between 0 and 31, the invalid classes are one of x in Rx in these instructions < 0 and one of x in Rx in these instructions > 31.
(2)In these 10 kinds of instructions, which begin with “MOV”, if x in Rx is between 0 and 31,we can have another three equivalence classes applying to guideline 1: val<-65535, -65535<= val <=65535, val>65535. The valid classes are val in these instructions between -65535 and 65535. The invalid classes are val in these instructions which are < -65535 and > 65535.
(3)In these 10 kinds of instructions, which begin with “STR, LDR”, if x in Rx is between 0 and 31,we can have another three equivalence classes applying to guideline1: b+val<0, 0<=b+val <=65535, b+val>65535. The valid classes are b+val in these instructions between 0 and 65535. The invalid classes are b+val in these instructions which are <0 and >65535.
(4)In these 10 kinds of instructions, which begin with “STR, LDR”, if x in Rx is between 0 and 31,we can have another three equivalence classes applying to guideline1: pc+val<0, 0<=pc+val<=N-1,pc+val>N-1. The valid classes are pc+val in these instructions between 0 and N-1.The invalid classes are pc+val in these instructions which are <0 and >N-1.
The resulting test template tree is above.

Task 3
Using boundary-value analysis, we can select test cases by each side as on point and off point.
For x in Rx, we have
x = 0 (on point)
x = 31 (on point)
x = -1 (off point)
x = 31 (off point)
For val in instruction “MOV”, we have
val = -65535 (on point)
val = 65535 (on point)
val = -65536 (off point)
val = 65536 (off point)
For val in instruction LDR and STR, we have
b+v = 0 (on point)
b+v = 65535 (on point)
b+v = -1 (off point)
b+v = 65536 (off point)
For val in instruction JMP and JZ, we have
pc+val = 0 (on point)
pc+val = N-1 (on point)
pc+val = -1 (off point)
pc+val = N (off point)
The resulting tests are:
EC1 ;R1 hold N
MOV R1 1
RET R1 on point begin with “;”
EC2 MOV R1 1
MOV R2 2
ADD R-1 R1 R2
RET R-1 off point for one of a,b,c<0
EC3 MOV R1 1
MOV R2 2
ADD R0 R1 R2
RET R0 on point for one of a, b,c<0
MOV R1 1
MOV R2 2
ADD R31 R1 R2
RET R31 on point for one of a,b,c>31
EC4 MOV R1 1
MOV R2 2
ADD R32 R1 R2
RET R32 off point for one of a,b,c>31
EC5 MOV R-1 1
MOV R2 2
ADD R3 R-1 R2
RET R3 off point for a<0
EC6 MOV R0 -65536
MOV R1 2
ADD R3 R0 R1
RET R3 off point for val<-65535
EC7 MOV R0 -65535
MOV R1 2
ADD R3 R0 R1
RET R3 on pint for val<-65535
MOV R0 65535
MOV R1 2
ADD R3 R0 R1
RET R3 on point for val>65535
EC8 MOV R0 65536
MOV R1 2
ADD R3 R0 R1
RET R3 off point for val>65535
EC9 MOV R32 1
MOV R1 2
ADD R3 R32 R1
RET R3 off point for a>31
EC10 MOV R1 1
LDR R-1 R1 1
RET R-1 off point for a<0
EC11 MOV R0 1
LDR R1 R0 -1
RET R1 off point for b+v<0
EC12 MOV R0 1
LDR R1 R0 0
RET R1 on point for b+v<0
MOV R0 1
LDR R1 R0 65535
RET R1 on point for b+v>65535
EC13 MOV R1 1
LDR R2 R1 65535
RET R2 on point for b+v>65535
EC14 MOV R0 1
LDR R32 R0 1
RET R32 off point for a>31
EC15 MOV R-1 0
MOV R2 2
MOV R3 1
JZ R-1 2
SUB R0 R2 R3
ADD R4 R2 R3
RET R4 off point for a<0
EC16 MOV R1 0
MOV R2 2
MOV R3 1
JZ R1 -5
SUB R0 R2 R3
ADD R4 R2 R3
RET R4 off point for pc+val<0
EC17 MOV R1 0
MOV R2 2
MOV R3 1
JZ R1 -4
SUB R0 R2 R3
ADD R4 R2 R3
RET R4 on point for pc+val<0
MOV R1 0
MOV R2 2
MOV R3 1
JZ R1 2
SUB R0 R2 R3
ADD R4 R2 R3
RET R4 on point for pc+val>N-1
EC18 MOV R1 0
MOV R2 2
MOV R3 1
JZ R1 3
SUB R0 R2 R3
ADD R4 R2 R3
RET R4 off point for pc +val>N-1
EC19 MOV R32 0
MOV R2 2
MOV R3 1
JZ R32 2
SUB R0 R2 R3
ADD R4 R2 R3
RET R4 off point for a>31
EC20 ERC R1 R2
YGT R3 R1 R2
RET R3 off point for not begin with one of 10 instructions
EC21 MOV R1 1
MOV R2 2 off point for not contain RET instruction

Note that some equivalence classes have more than one test because there are multiple boundaries.

Task 5
Because we need to use control flow.And we are using multiple-condition coverage.So we need to combine all of conditions.
There are
10 if statements containing two conditions
3 if statements containing a single condition
This gives a total of 102+3=23 conditions,and
10
22+32=46 condition permutations
For testing , list the conditions:
condition Branch code permutations
C1||C2 if (pc < 0 || pc >= progLength) {00,01,10,11}
C3 if (inst.equals("")) {0,1}
C4 if (toks.length < 2) {0,1}
C5&&C6 if (toks[0].equals(INSTRUCTION_ADD)&&toks.length != 4) {00,01,10,11}
C7&&C8 if (toks[0].equals(INSTRUCTION_SUBTRACT)&&toks.length!= 4) {00,01,10,11}
C9&&C10 if (toks[0].equals(INSTRUCTION_MULT)&&toks.length!= 4) {00,01,10,11}
C11&&C12 if (toks[0].equals(INSTRUCTION_DIVIDE)&&toks.length!= 4) {00,01,10,11}
C13 if (toks[0].equals(INSTRUCTION_RETURN)) {0,1}
C14&&C15 if (toks[0].equals(INSTRUCTION_LOAD)&&toks.length!= 4) {00,01,10,11}
C16&&C17 if (toks[0].equals(INSTRUCTION_STORE)&&toks.length!= 4) {00,01,10,11}
C18&&C19 else if (toks[0].equals(INSTRUCTION_MOVE)&&toks.length != 3) {00,01,10,11}
C20&&C21 else if (toks[0].equals(INSTRUCTION_JUMP)&&toks.length != 2) {00,01,10,11}
C22&&C23 else if (toks[0].equals(INSTRUCTION_JZ)&&toks.length != 3) {00,01,10,11}
Then we consider the multiply-condition scoring.
And first we consider domain partitioning multiple-condition coverage and have the results is that we miss (0,1) and (1,1) in C3, miss (1)in C4,and we all miss (0,0) and (1,0) in C4…12,C14…C23,
So the score is 41/46=89.1%
And if we consider boundary analysis multiple-condition coverage and have the results is that we miss (1)in C4,and we all miss (0,0) and (1,0) in C4…12,C14…C23,
So the score is 43/46=93.5%

Task 7
I believe that boundary-value analysis method is more effective than equivalence partitioning, because we can use the more accurate values and more test cases, this can make our testing more effective, as we can see the input domain, the boundary-value analysis has a more detailed scope and a higher coverage, because the boundary value is defined and tested, and the output domain is more comprehensive. Moreover, the boundary-value analysis has a higher test coverage score. In summary, I think that boundary-value analysis is more effective than equivalence partitioning.

内容概要:《2024年中国城市低空经济发展指数报告》由36氪研究院发布,指出低空经济作为新质生产力的代表,已成为中国经济新的增长点。报告从发展环境、资金投入、创新能力、基础支撑和发展成效五个维度构建了综合指数评价体系,评估了全国重点城市的低空经济发展状况。北京和深圳在总指数中名列前茅,分别以91.26和84.53的得分领先,展现出强大的资金投入、创新能力和基础支撑。低空经济主要涉及无人机、eVTOL(电动垂直起降飞行器)和直升机等产品,广泛应用于农业、物流、交通、应急救援等领域。政策支持、市场需求和技术进步共同推动了低空经济的快速发展,预计到2026年市场规模将突破万亿元。 适用人群:对低空经济发展感兴趣的政策制定者、投资者、企业和研究人员。 使用场景及目标:①了解低空经济的定义、分类和发展驱动力;②掌握低空经济的主要应用场景和市场规模预测;③评估各城市在低空经济发展中的表现和潜力;④为政策制定、投资决策和企业发展提供参考依据。 其他说明:报告强调了政策监管、产业生态建设和区域融合错位的重要性,提出了加强法律法规建设、人才储备和基础设施建设等建议。低空经济正加速向网络化、智能化、规模化和集聚化方向发展,各地应找准自身比较优势,实现差异化发展。
数据集一个高质量的医学图像数据集,专门用于脑肿瘤的检测和分类研究以下是关于这个数据集的详细介绍:该数据集包含5249张脑部MRI图像,分为训练集和验证集。每张图像都标注了边界框(Bounding Boxes),并按照脑肿瘤的类型分为四个类别:胶质瘤(Glioma)、脑膜瘤(Meningioma)、无肿瘤(No Tumor)和垂体瘤(Pituitary)。这些图像涵盖了不同的MRI扫描角度,包括矢状面、轴面和冠状面,能够全面覆盖脑部解剖结构,为模型训练提供了丰富多样的数据基础。高质量标注:边界框是通过LabelImg工具手动标注的,标注过程严谨,确保了标注的准确性和可靠性。多角度覆盖:图像从不同的MRI扫描角度拍摄,包括矢状面、轴面和冠状面,能够全面覆盖脑部解剖结构。数据清洗与筛选:数据集在创建过程中经过了彻底的清洗,去除了噪声、错误标注和质量不佳的图像,保证了数据的高质量。该数据集非常适合用于训练和验证深度学习模型,以实现脑肿瘤的检测和分类。它为开发医学图像处理中的计算机视觉应用提供了坚实的基础,能够帮助研究人员和开发人员构建更准确、更可靠的脑肿瘤诊断系统。这个数据集为脑肿瘤检测和分类的研究提供了宝贵的资源,能够帮助研究人员开发出更准确、更高效的诊断工具,从而为脑肿瘤患者的早期诊断和治疗规划提供支持。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值