




已阅读5页,还剩64页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
第7章一致性测试技术 2 TTCN 2 内容提要 概述 1 TTCN 3 2 一致性测试系统 3 测试集生成方法 4 3 测试集 测试集包括两部分 一部分是测试数据 另一部分是测试例 TestCase 对于给定测试目的 被UT和LT执行的参数化测试事件的集合称为测试例 对于给定测试目的 IUT应该执行的符合协议一致性要求的事件序列称为测试序列 实际上 测试序列是对IUT进行结构测试 structuraltesting 的事件序列 因此 在设计测试序列时 只要考虑IUT的控制结构就可以 而不需考虑测试序列中每个事件所携带的参数和数据是什么 测试序列引导出测试例 对同一测试序列的事件施加不同的测试数据 即测试事件携带不同参数 就产生不同的测试例 因此一个测试序列对应于多个测试例 4 测试集 Cont 测试例还必须考虑 选择事件 即当UT或LT接收不到IUT的正常响应事件时 UT或LT应该做什么 测试集具有层次结构 每一个测试集都是针对某一被测协议的 它由多个测试组 TestGroup 组成 每一测试组往往是针对某一类测试目的 TestPurpose 的覆盖 比较常用的测试组划分是根据协议的不同状态 对每一状态的测试目的集合构造一个测试组测试组由多个测试例组成 每一测试例是针对某一测试目的的 5 测试集 Cont 测试集具有层次结构 Cont 利用被称为测试步 TestStep 的子划分 可以将测试例模块化 在每一个测试例中 可以提取较为公共的部分作为测试步 编组成测试步库被调用 可按任意的配套深度 将测试步构造成测试步的配套集 可以把测试步库与整个测试集或一个特定的测试组联系起来 测试例和测试步的最小单位是测试事件 TestEvent 是测试步内规范的不可见单元 它实际上是测试序列的每一步 直接描述ASPs PDUs和时钟的一次具体行为 发 收 启动计时 超时等 所有测试步都是按照测试事件的顺序或其它较小的测试步来规定的 因此全部测试步等效于测试事件的序列 6 测试集 Cont 测试集以最基本的测试事件序列组成 详细定义了测试系统和协议实体的行为 从而作出测试 通过 或 失败 的判定 它是协议一致性测试的基础需要用一种形式语言来定义测试系统和IUT的行为 测试表示方法是协议测试理论的一个重要分支 它的研究目的是为了提供一种适合于表达在PCO处的测试交互动作以及测试集结构的语言 7 协议测试描述语言 通用的协议测试表示方法 应满足以下要求 使用这种测试表示方法所描述的测试集应该是系统独立的 使用这种测试表示方法可以描述任一协议的一致性测试集 能为测试集的设计人员提供自动或半自动支持工具以加快测试集开发过程 降低整个测试集的开发和维护费用 提高协议一致性测试集的标准化程度 以增强开放系统之间的互操作性 易于学习和掌握 易于测试操作人员理解 8 协议测试描述语言 有许多方法被用于描述测试集 它们包括 前面介绍的形式描述语言SDL ESTELLE LOTOS 编程语言树型记法和表型记法其中树型记法和表型记法都具备易于被测试人员所理解的优点 最后ISO将二者综合起来 提出了树表组合记法TTCN TreeandTabularCombinedNotation ISO9646 3 1991 9 TTCN 与协议的静态信息和动态行为相对应 TTCN支持协议的静态信息和动态行为的描述 其静态说明部分专用于协议的静态信息描述 如协议数据单元和抽象服务原语的格式和参数值 为了支持标准化的一致性测试方法和框架 TTCN还支持PCO 定时器 测试集变量和测试例变量的描述 对于动态行为 TTCN提供了与消息的接收和发送相关联的操作与操作符 10 TTCN TTCN提供两种表示方法 树型记法和表型记法 树型记法主要用于描述测试事件之间的时序关系 即描述协议的动态行为 而表型记法主要用于简化所有静态数据的表示 如数据类型 PDU和ASP的格式 与测试事件相关联的测试判决等等 一种具有可操作性的语法和语义 用于说明测试的形式化描述语言 它可以建立一个实际被测系统的抽象模型 并说明各种测试动作的执行过程 11 TTCN 针对应用中存在的问题 1998年欧洲电信标准协会ETSI成立了特别任务组 STF 133专门研究新的TTCN 2001年ETSI制定了TTCN 3 TestingandTestControlNotationversion3 标准代号为EISIES201873一般将1991至1993年间的TTCN版本称为TTCN 将1994年至1996年间的TTCN称为TTCN 2 将1997至2000年间的TTCN称为TTCN 2 将2001年ETSI制定的TTCN及以后版本称为TTCN 3 12 TTCN 3 13 内容提要 概述 1 TTCN 3 2 一致性测试系统 3 测试集生成方法 4 14 WhatisTTCN 3 InternationallystandardizedtestinglanguageProductoftheETSITechnicalCommitteeMTS MethodsforTestingandSpecification Aprogramminglanguagethathasbeenusedformorethan20yearsinstandardizationaswellasindustrySpecificallydesignedforblackboxtestingandcertificationConstantlydevelopedandmaintainedatETSIbyateamofleadingtestingexpertsfromindustry institutes andacademiaAtestingtechnologythatappliestoavarietyofapplicationdomainsandtypesoftestingKnowledgeofTTCN 3isvaluablebothforemployeesaswellasemployersduetoitswideapplicabilityOfferspotentialforreducingtrainingandtestmaintenancecostssignificantlyProventoworkinverylargeandcomplexindustrialtests e g 3Gnetworkelements 15 TheTTCN 3Standards ES201873 1 Z 140 TTCN 3CoreLanguageES201873 2 Z 141 TTCN 3TabularPresentationFormat TFT ES201873 3 Z 142 TTCN 3GraphicalPresentationFormat GFT ES201873 4 Z 143 TTCN 3OperationalSemanticsES201873 5TTCN 3RuntimeInterface TRI ES201873 6TTCN 3ControlInterfaces TCI ES201873 7andonwards underdevelopment UsingASN 1 XML IDL C C withTTCN 3 16 WhatmakesTTCN 3different Fromconventionalprogrammingorscriptinglanguages RichtypesystemincludingnativelisttypesandsupportforsubtypingEmbodiespowerfulbuild inmatchingmechanismSnapshotsemantics i e welldefinedhandlingofportandtimeoutqueuesduringtheiraccessConceptofverdictsandaverdictresolutionmechanismSupportforspecificationofconcurrenttestbehaviourSupportfortimersAllowstestconfigurationatrun timeTestsfocusonlyonimplementationtobetestedFromatesttoolorvendorproprietarytestinglanguage Nottiedtoaparticularapplicationoritsinterface s Nottiedtoanyspecifictestexecutionenvironment compileroroperationsystemTTCN 3assuchisnotexecutableandrequiresacompiler interpreter adapteraswellascodecimplementations 17 HowdoesTTCN 3relatetoTTCN 2 TTCN 3buildsontopofTTCN 2butextendsitsignificantlyCorelanguagehasnowlookandfeelofaregularprogramminglanguage mucheasiertolearnNolongerusesprotocolspecificterminologylikePCO ASP PDU etcDifferentpresentationformats tabular graphical CompletelydynamictestconfigurationsSupportforsynchronouscommunicationSupportfortestingdistributedsystemsStandardizedtestsysteminterfaces TRI TCI Improvedtextstringmatching regularexpressionsBetterharmonisationwithASN 1Extensionmechanismtointegrateothertypesystems e g XML ASN 1 C 18 TTCN 3testsystemsinanutshell TTCN 3specifiesatestbutatestsystemisneededfortestexecutionTRIandTCIstandardsdefinetestsystemarchitectureTTCN 3toolsarerequiredtosupportinternalinterfacesAllowsreuseoftestplatformswithdifferenttoolsbutalsofordifferentSUTsAtestsystemrequiresATTCN 3tool TTCN 3compilerandexecutionenvironmentAtestplatformforaspecificdeviceundertestNote ToolscomewithdefaultTestControl Logging TestSystemExecutor SUTAdapter PlatformAdapter TestControl SystemUnderTest SUT compiled TTCN 3Executable Codecs Logging TTCN 3TestSystem TCI TRI TCI TTCN 3ControlInterfaceTRI TTCN 3RuntimeInterface 19 Anexampleadaptation AIPv6testsystem TestSystemExecutor EthernetAdapter Real timeAdapter ParameterFile OpenSourceFreeBSDRouter compiled IPv6ATS TTCN 3Executable IPv6Codecs ToolLogging TTCN 3TestSystem TCI TRI 20 TTCN 3Benefits TTCN 3iseasytolearnLookandfeelofaregularprogramminglanguageUnambiguousspecificationandexecutionoftestsWelldefinedsyntax static andoperationalsemanticsEnablescompletelyautomatedtestexecutionOff the shelftoolsandtestsystemsarereadilyavailableFivedifferentcommercialTTCN 3toolsonthemarketOpensourcecommunitynowtakingshapeToolsaswellastestsuitesandusefulmodulesCanbeusedtospecifytestsforstandardizationaswellasproprietaryproductfeaturesFlexibletestingtechnologyVirtuallynolimitstoadaptatestsystemtoyourneedsScalable allowstestsystemstogrowovertime 21 TTCN 3Successstories AtETSIUsedfordevelopmentofanynewconformancetestsuite e g SIP VoIP IPv6 Core Mobility Security HiperMAN WiMax 3GPPIPMultimediaSubsystem InindustryAppliedinavarietyofapplicationdomains e g telecom automotive financial seewww tt medal org Ericssonreported1 000activelicensesatTTCN 3UserConference2006NokiaexperiencescapturedinIEEESoftware23 4 2006MotorolareportsdoublingoftestingproductivityAlsousedbeyondEuropeStrongcommunityinChina 22 Laboratory ExpansionofTTCN 3Use Integration Layer Unit Module Telecom TestType TestDomain 23 TTCN 3canautomateConformanceandInteroperabilityTesting 24 MainCapabilitiesofTTCN 3 DynamicconcurrenttestingconfigurationsVariouscommunicationmechanisms synchandasynch Dataandsignaturetemplateswithpowerfulmatchingmechanisms includingregularexpressions Attributesforencoding displayoruser definedinformationTestsuiteparameterizationControlofTestCaseexecutionandselectionmechanismsControlofcomplextestconfigurationsAssignmentandhandlingoftestverdictsHarmonizedwithASN 1 XMLandIDLcoming DifferentpresentationformatsWell definedsyntax static andoperationalsemantics 25 TheCoreLanguageandOtherPresentationFormats TTCN 3CoreLanguage Coreformatistextbased mostpopular TTCN 3canbeeditedorviewedinotherformatsTabularformat forTTCN 2people Graphicalformat goodforvisualoverview Otherstandardizedformatsinthefuture Proprietaryformatspossible 26 ExampleCore Text Format testcaseTC resolveEtsiWww runsonDnsClient timert ack serverPort send m dnsQuestion www etsi org t ack start 1 0 alt serverPort receive mw dnsAnswer 172 26 1 17 setverdict pass serverPort receive anyothermessagesetverdict fail t ack timeout setverdict inconc t ack stop 27 testcaseTC resolveEtsiWww runsonDnsClient ExampleGraphicalFormat DnsClient mtc DnsPort serverPort m dnsQuestion www etsi org timert ack t ack alt mw dnsAnswer 172 26 1 17 t ack inconc fail pass t ack 28 ExampleTabularFormat 29 UseofTTCN 3WithOtherLanguages TTCNcanbeintegratedwithtypessystemsofotherlanguagesFullyharmonizedwithASN 1 1997 HarmonizedwithotherlanguagesIDL XML C C TTCN 3CoreLanguage 30 MinimalTestConfiguration SUTAdapter PlatformAdapter SystemUnderTest SUT TTCN 3Executable TTCN 3TestSystem TRI MTC ImplementationUnderTest TestControl Codecs Logging TCI Alltestbehaviorisexecutedonone main testcomponent CommunicationwithIUT CommunicationwithSUT CommunicationwithIUT 31 ExampleConcurrentTestConfiguration SUTAdapter PlatformAdapter SystemUnderTest SUT TTCN 3Executable TTCN 3TestSystem TRI ImplementationUnderTest TestControl Codecs Logging TCI AtestinvolvesexecutionofmanyparalleltestcomponentsDynamicinstantiationofcomponentsandcommunicationlinks InternalCommunication PTC PTC MTC 32 BuildingblocksofaTTCN 3TestSuite DatatypeswhichspecifyStructureofmessagesorcallsandtheirinformationelements fields parameters Internaldatastructures e g forcomputation PossiblyencodingordisplayinformationBuilt inbasictypesinteger boolean float bitstring hexstring octetstring charstring universalcharstring andstructuredtypesrecord recordof set setofunion enumerated andspecialtypessuchascomponent port verdicttype default etc 33 BuildingblocksofaTTCN 3TestSuite Actualtestdata values usedduringtestingConstantsorTemplatesforspecificmessageorcallparametervaluesMatchingexpressionsforallowingmultiplemessageorcallparametervaluesvaluerange valuelist wildcards presence length size permutationregularexpressionsUsingalsotemplatedecomposition parameterizationandmodification 34 BuildingblocksofaTTCN 3TestSuite StaticaspectsTestcomponentandporttypesDynamicaspectsDynamicinstantiationandmanagementoftestcomponentsMappingsoftestcomponentstoabstracttestsysteminterfacesConnectionsbetweentestcomponentinterfacesManagementoftestcomponents 35 BuildingblocksofaTTCN 3TestSuite testcasesspecifysending receivingmessages computation e g checksums andverdictassignmentcanbedecomposedwithfunctionsandaltstepscan re usedefaultbehaviourcanusetimersandtimeoutstestexecutioncontrol optional order repetition conditions etc 36 TTCN 3Module moduleEtsiDnsTests Testdefinitionpartcontrol Testexecutionpart optional Module 37 DefinitionsPart moduleEtsiDnsTests Messagestructure Actualtestdata Testconfiguration TestCasedefinitions 38 moduleEtsiDnsTests groupMessageStructure Defintionsofmessagetypes groupTestData Templatesformessagesinstances groupTestSystemConfiguration Portandcomponenttypesandmappings groupTestCases Testcasedefinitions StructuredDefinitionsPart 39 MessageStructureandTestData typerecordDnsMsg simplifiedmessagestructure DnsMsgKindkind charstringquestion charstringansweroptional typeenumeratedDnsMsgKind e query e response templateDnsMsgm dnsQuestion charstringp question kind e query question p question answer omit noanswer templateDnsMsgmw dnsAnswer charstringp answer kind e answer question anyquestionokanswer p answer 40 TestConfiguration typeportDnsPortmessage inoutDnsMsg Note porttypesmayalsoallowmultipledifferent messagetypesorrestrictthedirection typecomponentDnsClient portDnsPortserverPort Note componenttypescanalsodefinemultipleport instancesofthesameordifferentporttypeand declaretimers constantsorvariables 41 TestBehaviour query response serverPort testcaseTC resolveEtsiWww runsonDnsClient timert ack serverPort send m dnsQuestion www etsi org t ack start 1 0 alt serverPort receive mw dnsAnswer 172 26 1 17 setverdict pass serverPort receive anyothermessagesetverdict fail t ack timeout setverdict inconc t ack stop mtc 42 TheControlPart Module moduleEtsiDnsTests Testdefinitionpartmoduleparbooleanmp example testcaseTC resolveEtsiWww runsonDnsClient asinpreviousslide Testexecutionpartcontrol if mp example execute TC resolveEtsiWww 43 WherecanIlearnmore VisitETSI sofficialTTCN 3website www ttcn 3 org PublicTTCN 3testsuites usefulTTCN 3modulesLinkstocommercialaswellasopensourcetoolsReadwellwrittenTTCN 3standardsuiteJointheETSImailinglist list etsi org TTCN3 html Takeacourse seewww tt medal org ReadpublicationsProceedingsofConferenceforTestingofCommunicatingSystems TESTCOM PresentationsofyearlyTTCN 3UserConferencesinEuropeorAsia seewww ttcn 3 org Getatextbook 44 内容提要 概述 1 TTCN 3 2 一致性测试系统 3 测试集生成方法 4 45 TTCN 3测试系统结构 46 路由协议测试系统结构 47 内容提要 概述 1 TTCN 3 2 一致性测试系统 3 测试集生成方法 4 48 测试集生成方法 测试集是测试活动的主线 测试的各个阶段都围绕着测试集进行 而测试集的生成又是这条线的起点 随着网络协议的日益复杂 用手工方法生成测试集变得非常困难 一方面需要大量人力 花费时间长 另一方面测试集的正确性和覆盖度也很难保证 因此 如何从形式描述的协议规范中自动地产生出具有较高检查能力和覆盖范围 同时又不是很庞大的测试集是一个最重要的问题 协议测试集的自动生成过程主要分为两步 首先用一种形式化描述技术根据协议文本给出协议的形式描述 然后采用一定的自动生成算法生成测试例 49 测试集生成方法 一 基于有限状态机的测试集生成方法 50 基于FSM的测试集生成方法 目前大部分协议测试集的生成算法是基于FSM模型的 这类算法又可分为两类 变迁游历法 TransitionTours 对于FSM中所有的变迁 所生成的测试序列中至少包含一次 在这种方法中 经常使用中国邮递员算法或乡村中国邮递员算法来找到一条游历路径 对于所有的FSM都存在着邮递员游历路径 此路径对FSM中的各个变迁至少访问一次 变迁游历法并不能检测出FSM的输入 输出函数中的所有错误 但是其它几种方法却可以 51 基于FSM的测试集生成方法 目前大部分协议测试集的生成算法是基于FSM模型的 这类算法又可分为两类 Cont 特殊交互作用序列法这类方法要求协议的FSM具有一些特殊的交互作用序列 如特征集 CharacterizationSet 可区分序列 DistinguishingSequence 和唯一输入 输出序列UIO UniqueInput OutputSequence 等 是否选择这类方法取决于协议的FSM是否具备要求的特殊交互序列 由于在某些协议的标准文本中 并未给了完整的FSM描述 所以找出这些特殊的交互序列一般是比较困难的 其中的UIO方法相对来说比较易于实现 而且它所生成的测试例长度较短 目前的许多测试集生成技术都把上述几种方法结合起来 52 算法假定 由于完整比较一个未知设备和一个协议标准的内部结构几乎是不可能的 为了简化问题的描述 作以下假定 IUT模型是一个有限状态机 即已知它的最大状态数 输入和输出词汇 IUT在已知的 有限的时间内响应一个输入信号 IUT的状态以及状态变迁构成一个强连通图 即图中的每一个状态均可从某一状态开始经过一个或多个状态变迁到达 并且 这种变迁是确定性的 即FSM是确定有限状态机 完整性假定 在任何一个状态 IUT能够接收并响应系统词汇表中的所有输入信号 空响应 即状态变迁到自身 一个合法的响应 这个假定的目的是为了一般化算法 在许多情况下 如果不是所有可能的输入组合需要被测试 一致性测试可以被简化 状态命令 STATUS 当IUT收到一个STATUS命令时 IUT以它的当前状态作为响应 但不改变状态 53 算法假定 由于完整比较一个未知设备和一个协议标准的内部结构几乎是不可能的 为了简化问题的描述 作以下假定 复位命令 RESET 当IUT收到一个RESET命令时 无论它当前处于何种状态 都复位到初始状态 且不产生输出事件 置位命令 SET 当IUT收到一个SET i 命令时 IUT将其状态置成状态i 且不产生输出事件 上面假定中 前3条假定是这类测试的基本要求 而第 4 条是一般化条件而不是基本要求 后3条假定是为了处理问题的方便 而不是基本要求 54 算法1 穷举测试序列 对所有可能的状态i和输入信号j的组合 执行下面三步 利用RESET命令将IUT置成初始态 然后用SET i 命令将IUT置成状态i 向IUT输入信号j 接收并核对IUT的输出事件 包括空响应 是否与协议规范所描述的匹配 利用STATUS命令检查IUT是否转换到协议规范中所描述的状态 55 算法1 实例 在图中 1为初始状态 x 1表示输入为x 输出为1的转换 56 算法1 小结 上述测试能够验证IUT能够正确地执行协议规范中描述的所有状态转换 测试用的输入信号当然也包括 SET RESET和STATUS消息 如果IUT通过上述测试 则IUT能够重复协议规范中描述的所有行为 但是对其它的非合法行为则是未知的 例如 如果IUT本身有错误 则它可能违反前述的第 1 条假定 一个非法输入信号可能导致IUT进入产生错误行为的状态 57 算法2 没有SET命令的转换游程算法 设i为当前状态 算法如下 利用RESET命令将IUT置为初始状态 且i 初始状态 向IUT输入信号j 接收并核对IUT的输出事件 包括空响应 是否与协议规范所描述的匹配 并标记j已被测试 利用STATUS命令检查IUT是否转换到指定状态k 且i k 重复2 3 直至所有转换都被测试一次 对于上图所示的IUT 算法2产生的测试序列可以是 RESET x 1 STATUS y 1 STATUS y 1 STATUS y 1 STATUS x 0 STATUS x 0 STAT与算法1相比 算法2只是缩短了测试序列 还可以对其作进一步改进 58 特殊交互作用序列法 D方法W方法U方法 59 测试集生成方法 二 基于Estelle的测试集生成方法 60 基于Estelle的测试集生成方法 我们在前面已讲过 Estelle是基于扩展有限状态机EFSM的形式化描述语言 能够完整地描述一个协议的控制部分和数据部分 因此基于Estelle的测试集生成技术得到了很大的发展 目前基于Estelle的
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 民宿2025节水技术创新与应用研究报告
- 2025-2030中国平板玻璃市场发展趋势及未来创新现状分析报告
- 2025-2030中国工业副产石膏行业投资情况与发展前景分析报告
- 小儿高热惊厥课件
- 佛山公招面试实战模拟题库:教育行业篇
- 小儿食用菌科普课件
- 广告公司面试题库:高级营销策略与实战案例分析
- 大班科学教案《植物的身体》
- 小儿腹泻护理
- 垃圾清扫承包合同
- 浙江省舟山市2024-2025学年高二下学期6月期末物理+答案
- 执法办案培训课件
- 气候变化对水资源供需关系的动态演变分析
- 行政执法培训课件
- 老年人吸入性肺炎护理
- 停产报告管理制度
- 合并家庭组建协议书
- 宽带小区进场协议书
- 电解铝公司工程项目投资估算
- 融资专员测试题及答案
- 钣金工考试试题及答案
评论
0/150
提交评论