欢迎来到天天文库
浏览记录
ID:44791354
大小:245.00 KB
页数:41页
时间:2019-10-29
《软件测试基本过程》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、软件测试与软件质量朱蔚恒09.春珠海学院-第二章:测试的数学1Overview测试人员的离散数学集合论函数关系概率图RepresentationPathsDirectedGraphsGraphsforTesting2集合定义列举:Example:Y={10,20,30,40}使用判断规则:Examples:Y={item_number
2、803、xispositiveinteger}Y={x4、PI(x)}空集:Y={year:20125、ramsthatillustratedifferentsetrelationshipsorillustrateasetwithrespecttothedomain(U)集合运算:并Union:AUB={x:xinAorxinB}交Intersection:A∩B={x:xinAandxinB}补Complement:A*={x:xnotinA}相对补Relativecomplement:A–B={x:xinAandxnotinB}对称差Symmetricdifference:AB={x:xinAxinB}=(AUB)–6、(A∩B)++4集合关系和划分子集ASubsetB:ainAainB真子集AProperSubsetB:AsubsetBand(B–A)≠O两集合相等Equalsets:A=BiffAsubsetBandBsubsetA划分GivenasetBandasetofsubsetsA1,A2,AnofB,thesubsetsareapartitionofBiffA1UA2U..An=BFori≠jAi∩Aj=O5函数,定义域,值域GiventwosetsAandB,afunctionf:ABisasubsetofthep7、roductAXBsuchthatforanyofai,ajinA,thereexistbi,bjinBsuchthatf(ai)=bi,andf(aj)=bj.ThesetAiscalledthedomainoffandBiscalledtherangeoff.Thefunctionfcanberepresentedasasetofpairs.6函数类型Functionsarefurtherdescribedbytheparticularsofthemappinge.g.f(A)={biinB:bi=f(ai)for8、someaiinA}ThissetissometimescalledtheimageofAunderfTypesoffunctionsthatrelatetheimageandtherangeare:FunctionfisafunctionofAontoBifff(A)=BFunctionfisafunctionofAintoBifff(A)propersubsetBFunctionfisaone-to-onefunctionfromAtoBiffforallai,ajinA,s.t.ai≠ajimpliesthatf9、(ai)≠f(aj)7复合函数Supposewehavesetsandfunctionssuchthattherangeofoneisthedomainofthenext:f:ABg:BCh:CDWecandefineanewfunctionw:ADsuchthatw(a)=(hogof)(a)=h(g(f(a)))So,iff(a)=b,andg(b)=c,andh(c)=dthenw(a)=h(g(f(a)))=h(g(b))=h(c)=d8ApplicationSnapshotCausalFlowNon-10、CausalFlowafbgcafgcbbbB9关系GiventwosetsA,BarelationRisasubsetoftheCartesianproductAXBFunctionsareaspecialcaseofarelation:BotharesubsetsofsomeCartesianproductFunctionshavetheadditionalrequirementthatadomainelementcannotbeassociatedwithmorethanonerangeelement.Whena11、relationisnotafunctionthenisalsocalledamapping.Arelationhasapropertycalledcardinality(势)10RelationsamongSetsGiventwosetsA,B,andarelationRamongthesesets,thecardinality
3、xispositiveinteger}Y={x
4、PI(x)}空集:Y={year:20125、ramsthatillustratedifferentsetrelationshipsorillustrateasetwithrespecttothedomain(U)集合运算:并Union:AUB={x:xinAorxinB}交Intersection:A∩B={x:xinAandxinB}补Complement:A*={x:xnotinA}相对补Relativecomplement:A–B={x:xinAandxnotinB}对称差Symmetricdifference:AB={x:xinAxinB}=(AUB)–6、(A∩B)++4集合关系和划分子集ASubsetB:ainAainB真子集AProperSubsetB:AsubsetBand(B–A)≠O两集合相等Equalsets:A=BiffAsubsetBandBsubsetA划分GivenasetBandasetofsubsetsA1,A2,AnofB,thesubsetsareapartitionofBiffA1UA2U..An=BFori≠jAi∩Aj=O5函数,定义域,值域GiventwosetsAandB,afunctionf:ABisasubsetofthep7、roductAXBsuchthatforanyofai,ajinA,thereexistbi,bjinBsuchthatf(ai)=bi,andf(aj)=bj.ThesetAiscalledthedomainoffandBiscalledtherangeoff.Thefunctionfcanberepresentedasasetofpairs.6函数类型Functionsarefurtherdescribedbytheparticularsofthemappinge.g.f(A)={biinB:bi=f(ai)for8、someaiinA}ThissetissometimescalledtheimageofAunderfTypesoffunctionsthatrelatetheimageandtherangeare:FunctionfisafunctionofAontoBifff(A)=BFunctionfisafunctionofAintoBifff(A)propersubsetBFunctionfisaone-to-onefunctionfromAtoBiffforallai,ajinA,s.t.ai≠ajimpliesthatf9、(ai)≠f(aj)7复合函数Supposewehavesetsandfunctionssuchthattherangeofoneisthedomainofthenext:f:ABg:BCh:CDWecandefineanewfunctionw:ADsuchthatw(a)=(hogof)(a)=h(g(f(a)))So,iff(a)=b,andg(b)=c,andh(c)=dthenw(a)=h(g(f(a)))=h(g(b))=h(c)=d8ApplicationSnapshotCausalFlowNon-10、CausalFlowafbgcafgcbbbB9关系GiventwosetsA,BarelationRisasubsetoftheCartesianproductAXBFunctionsareaspecialcaseofarelation:BotharesubsetsofsomeCartesianproductFunctionshavetheadditionalrequirementthatadomainelementcannotbeassociatedwithmorethanonerangeelement.Whena11、relationisnotafunctionthenisalsocalledamapping.Arelationhasapropertycalledcardinality(势)10RelationsamongSetsGiventwosetsA,B,andarelationRamongthesesets,thecardinality
5、ramsthatillustratedifferentsetrelationshipsorillustrateasetwithrespecttothedomain(U)集合运算:并Union:AUB={x:xinAorxinB}交Intersection:A∩B={x:xinAandxinB}补Complement:A*={x:xnotinA}相对补Relativecomplement:A–B={x:xinAandxnotinB}对称差Symmetricdifference:AB={x:xinAxinB}=(AUB)–
6、(A∩B)++4集合关系和划分子集ASubsetB:ainAainB真子集AProperSubsetB:AsubsetBand(B–A)≠O两集合相等Equalsets:A=BiffAsubsetBandBsubsetA划分GivenasetBandasetofsubsetsA1,A2,AnofB,thesubsetsareapartitionofBiffA1UA2U..An=BFori≠jAi∩Aj=O5函数,定义域,值域GiventwosetsAandB,afunctionf:ABisasubsetofthep
7、roductAXBsuchthatforanyofai,ajinA,thereexistbi,bjinBsuchthatf(ai)=bi,andf(aj)=bj.ThesetAiscalledthedomainoffandBiscalledtherangeoff.Thefunctionfcanberepresentedasasetofpairs.6函数类型Functionsarefurtherdescribedbytheparticularsofthemappinge.g.f(A)={biinB:bi=f(ai)for
8、someaiinA}ThissetissometimescalledtheimageofAunderfTypesoffunctionsthatrelatetheimageandtherangeare:FunctionfisafunctionofAontoBifff(A)=BFunctionfisafunctionofAintoBifff(A)propersubsetBFunctionfisaone-to-onefunctionfromAtoBiffforallai,ajinA,s.t.ai≠ajimpliesthatf
9、(ai)≠f(aj)7复合函数Supposewehavesetsandfunctionssuchthattherangeofoneisthedomainofthenext:f:ABg:BCh:CDWecandefineanewfunctionw:ADsuchthatw(a)=(hogof)(a)=h(g(f(a)))So,iff(a)=b,andg(b)=c,andh(c)=dthenw(a)=h(g(f(a)))=h(g(b))=h(c)=d8ApplicationSnapshotCausalFlowNon-
10、CausalFlowafbgcafgcbbbB9关系GiventwosetsA,BarelationRisasubsetoftheCartesianproductAXBFunctionsareaspecialcaseofarelation:BotharesubsetsofsomeCartesianproductFunctionshavetheadditionalrequirementthatadomainelementcannotbeassociatedwithmorethanonerangeelement.Whena
11、relationisnotafunctionthenisalsocalledamapping.Arelationhasapropertycalledcardinality(势)10RelationsamongSetsGiventwosetsA,B,andarelationRamongthesesets,thecardinality
此文档下载收益归作者所有