版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
FunctionalSafetyASILLevelEvaluationElements功能安全ASIL等級評估要素思考一下Takeamomenttothink你正開著一輛具備自動緊急剎車功能的車在高速上飛馳。如果這個系統(tǒng)在需要剎車時失效了,后果會怎樣?Imagineyou'redrivingacarequippedwithanautomaticemergencybraking(AEB)systemonthehighway,andthesystemfailswhenit'sneededtobrake.Whatwouldtheconsequencesbe?ASIL,全稱是“汽車安全完整性等級”。ASIL不是一個單一的要求,它是一套完整的等級體系,從低到高依次為:QM,ASILA,ASILB,ASILC,ASILDASIL,whichstandsforAutomotiveSafetyIntegrityLevel,isnotasinglerequirementbutacomprehensivelevelsystem.Thelevelsrangefromlowtohighasfollows:QM,ASILA,ASILB,ASILC,andASILD.ASILASIL暴露度(E)Exposure(E)暴露度(E)Exposure(E)暴露度是衡量人類及自然系統(tǒng)接觸外部環(huán)境因素的量化指標,在環(huán)境健康與氣候災害研究中具有核心地位。Exposureisaquantitativemeasureofhowhumansandnaturalsystemsareexposedtoexternalenvironmentalfactors.Itplaysacentralroleinenvironmentalhealthandclimatedisasterresearch.暴露度(E)Exposure(E)等級Level定義(場景發(fā)生頻率)Definition(FrequencyofOccurrence)示例ExampleE0幾乎不可能
Almostimpossible車輛落水后自動駕駛啟動AutonomousdrivingactivationafterthevehiclefallsintowaterE1可能性非常低
Verylowprobability雪地極端天氣自動駕駛AutonomousdrivinginextremesnowyweatherE2可能性低Lowprobability郊區(qū)道路自動駕駛AutonomousdrivingonsuburbanroadsE3中等可能Moderateprobability城市快速路自動駕駛AutonomousdrivingonurbanexpresswaysE4可能性高Highprobability市區(qū)擁堵路段自動駕駛Autonomousdrivingincongestedcitystreets嚴重度(S)Severity(S)嚴重度(S)Severity(S)嚴重度是指失效模式對產(chǎn)品功能、安全性或法規(guī)符合性的影響程度Severityreferstothedegreeofimpactthatafailuremodehasontheproduct'sfunctionality,safety,orregulatorycompliance.嚴重度(S)Severity(S)等級Level定義(傷害程度)Definition(DegreeofInjury)示例ExampleS0無傷害
Noinjury輕微傷害(可快速恢復)Minorinjury(canrecoverquickly)S1輕微傷害Minorinjury車輛輕微剮蹭,人員輕微擦傷Minorvehiclescrape,minorabrasionstoindividualsS2嚴重或危機生命的傷害(可以幸存)Seriousorlife-threateninginjury(survivable)車輛碰撞,人員骨折Vehiclecollision,resultinginbonefracturestoindividualsS3危機生命的傷害(可能不能幸存)或致命傷害Life-threateninginjury(maynotbesurvivable)orfatalinjury車輛撞擊,人員重傷或死亡Vehiclecollision,resultinginseriousinjuryordeathtoindividuals可控性(C)Controllability(C)可控性(C)Controllability(C)對于每一個危害事件,應基于一個確定的理由預估駕駛員或其他潛在處于風險的人員對該危害事件的可控性。Foreachhazardousevent,thecontrollabilityshouldbeestimatedbasedonawell-definedreason,consideringhowthedriverorotherindividualspotentiallyatriskcancontrolorinterveneintheevent.小結Summarize記住這三個要素的量化標準和核心邏輯,就能準確評估ASIL等級,為功能安全設計匹配最適合的防護方案,讓每一個安全相關功能都有章可循~Byrememberingthequantitativestandardsandcorelogicofthesethreefactors,youcanaccuratelyassesstheASILlevel,matchthemostsuitableprotectionplanforfunctionalsafetydesign,andensurethateverysafety-relatedfunctionfollowsaclearandstructuredapproach.In-vehiclefilesystemtypes車載文件系統(tǒng)類型當你在車機上播放音樂、導航或升級系統(tǒng)固件時,這些文件是存儲在哪里、又是如何被訪問的?Whenyouplaymusic,navigate,orupdatesystemfirmwareonyourcar'sinfotainmentsystem,wherearethesefilesstoredandhowaretheyaccessed?車載文件系統(tǒng)并非獨立開發(fā)的專用系統(tǒng),而是主要基于成熟的通用文件系統(tǒng),核心目標是實現(xiàn)車載主機與外部存儲設備(如U盤、SD卡)的數(shù)據(jù)交互,以及管理內(nèi)部存儲的系統(tǒng)文件和多媒體資源。Thevehiclefilesystemisnotaseparatelydevelopeddedicatedsystem,butismainlybasedonamaturegeneral-purposefilesystem.Itscoreobjectiveistoenabledatainteractionbetweenthevehicle'sheadunitandexternalstoragedevices(suchasUSBflashdrivesandSDcards),aswellastomanagesystemfilesandmultimediaresourcesontheinternalstorage.車載文件系統(tǒng)的定義Definitionofvehiclefilesystem主流車載文件系統(tǒng)類型MainstreamvehiclefilesystemtypesFAT32、exFAT、NTFS、EXT系列(EXT4為主)、UBIFSFAT32,exFAT,NTFS,EXTseries(primarilyEXT4),andUBIFSEXT4主要存儲EXT4primarystorageEXT4通常位于“塊設備(eMMC/UFS)”上,負責整個車機操作系統(tǒng)和應用層數(shù)據(jù)的持久化。EXT4typicallyresidesonablockdevice(eMMC/UFS)andisresponsibleforthepersistenceofdataacrosstheentirevehicleinfotainmentsystemandapplicationlayers.典型存儲內(nèi)容舉例Typicalstoragecontentsinclude車機系統(tǒng):Linux內(nèi)核、系統(tǒng)庫(libc.so、libstdc++等)Vehicleinfotainmentsystem:Linuxkernel,systemlibraries(libc.so,libstdc++,etc.)驅動模塊:攝像頭、CAN、以太網(wǎng)驅動Drivermodules:Camera,CAN,Ethernetdrivers應用程序:導航、語音助手、車載應用APKApplications:Navigation,voiceassistant,in-vehicleapplicationAPKs日志與緩存:行車日志、診斷數(shù)據(jù)、地圖緩存Logsandcache:Drivinglogs,diagnosticdata,mapcacheUBIFS主要存儲UBIFSisthemainstorageUBIFS通常部署在原始NAND/NORFlash上,常用于實時控制類ECU(如VCU、BCU、ADAS控制器)。UBIFSistypicallydeployedonrawNAND/NORFlashmemoryandiscommonlyusedinreal-timecontrolECUs(suchasVCUs,BCUs,andADAScontrollers).典型存儲內(nèi)容舉例TypicalstoragecontentsincludeMCU控制邏輯(RTOS/LinuxEmbedded內(nèi)核)MCUcontrollogic(RTOS/LinuxEmbeddedkernel)電機/電池控制標定參數(shù)(CAN參數(shù)、PID參數(shù))Motor/batterycontrolcalibrationparameters(CANparameters,PIDparameters)系統(tǒng)日志(錯誤碼、運行時間、狀態(tài)快照)Systemlogs(errorcodes,runtime,statussnapshots)網(wǎng)絡與總線配置表(CANID映射、信號定義)Networkandbusconfigurationtables(CANIDmapping,signaldefinitions)斷電保護數(shù)據(jù)(最近運行狀態(tài)、計數(shù)器值)Powerfailureprotectiondata(recentoperatingstatus,countervalues)EXT4與UBIFS在車載環(huán)境下的穩(wěn)定性StabilityofEXT4andUBIFSinautomotiveenvironments針對閃存的“原生適配”能力Regardingthe"nativecompatibility"capabilitiesofflashmemoryEXT4:如果直接將EXT4用于無FTL的原始閃存,由于缺乏磨損均衡,會導致部分閃存塊被反復寫入而快速老化,出現(xiàn)壞塊,最終引發(fā)文件系統(tǒng)錯誤或數(shù)據(jù)丟失。EXT4:IfEXT4isuseddirectlywithrawflashmemorywithoutFTL,thelackofwearlevelingwillcausesomeflashblockstoberepeatedlywrittentoandagerapidly,resultinginbadblocksandultimatelyleadingtofilesystemerrorsordataloss.UBIFS:作為閃存原生文件系統(tǒng),UBIFS能動態(tài)監(jiān)測閃存塊的磨損情況,智能分配寫入位置,確保所有塊的磨損程度均勻。UBIFS:Asanativefilesystemforflashmemory,UBIFScandynamicallymonitorthewearofflashblocksandintelligentlyallocatewritelocationstoensurethatthewearofallblocksisuniform.EXT4與UBIFS在車載環(huán)境下的穩(wěn)定性StabilityofEXT4andUBIFSinautomotiveenvironments斷電恢復與數(shù)據(jù)完整性PowerOutageRecoveryandDataIntegrityEXT4:依賴日志功能,斷電后需要進行日志回放來恢復數(shù)據(jù)一致性,這個過程可能耗時較長,且在極端情況下(如日志區(qū)本身損壞),仍有小概率出現(xiàn)數(shù)據(jù)不一致。EXT4:Reliesonlogging.Afterapoweroutage,logreplayisrequiredtorestoredataconsistency.Thisprocesscanbetime-consuming,andinextremecases(suchaswhenthelogareaitselfiscorrupted),thereisstillasmallprobabilityofdatainconsistency.UBIFS:采用“寫時復制”(Copy-on-Write)和原子操作,每次寫入都是一個完整的事務。斷電后,系統(tǒng)重啟時無需復雜的日志恢復,能快速定位到最近的一致狀態(tài),恢復速度更快。UBISFS:Employs"copy-on-write"andatomicoperations,ensuringthateachwriteisacompletetransaction.Afterapoweroutage,systemrestartswithoutcomplexlogrecovery,quicklylocatingthemostrecentconsistentstateandresultinginfasterrecovery.適用場景建議Suggestedapplicationscenarios優(yōu)先選擇EXT4的情況WhentoprioritizeEXT4存儲介質層面:使用eMMC、UFS、SSD等帶FTL的塊存儲設備Storagemedialevel:UsingblockstoragedeviceswithFTLsuchaseMMC,UFS,andSSD系統(tǒng)架構層面:運行Linux或AndroidAutomotive系統(tǒng);系統(tǒng)具備大容量存儲空間Systemarchitecturelevel:RunningLinuxorAndroidAutomotive;thesystemhasalargestoragecapacity.適用場景建議Suggestedapplicationscenarios優(yōu)先選擇UBIFS的情況UBIFSispreferredwhen存儲介質層面:使用原始NAND/NORFlash(無FTL)Storagemedialevel:usingrawNAND/NORFlash(withoutFTL)系統(tǒng)架構層面:運行嵌入式Linux或RTOS系統(tǒng);系統(tǒng)存儲空間有限(幾十MB~幾百MB)Systemarchitecturelevel:runningembeddedLinuxorRTOS;systemstoragespaceislimited(tenstohundredsofMB).小結Summarize車載文件系統(tǒng)是數(shù)據(jù)管理的基礎設施,影響車機系統(tǒng)的性能與穩(wěn)定性。Thein-vehiclefilesystemistheinfrastructurefordatamanagement,affectingtheperformanceandstabilityofthevehicle'sinfotainmentsystem.EXT4與UBIFS各有側重EXT4andUBIFSeachhavetheirownstrengths.正確的選型取決于硬件架構Thecorrectchoicedependsonthehardwarearchitecture.DesignPrinciplesofanAPIGatewayAPI網(wǎng)關設計原則網(wǎng)關的定義DefinitionofaGateway網(wǎng)關(Gateway)又稱網(wǎng)間連接器、協(xié)議轉換器,完成不同網(wǎng)絡協(xié)議轉換的設備。主要指傳輸層以上的協(xié)議轉換。用于不同網(wǎng)絡的互連。既可用于廣域網(wǎng)互連,也可用于局域網(wǎng)互連。AGateway,alsoknownasaninter-networkconnectororprotocolconverter,isadevicethatperformsconversionsbetweendifferentnetworkprotocols.Itmainlyreferstoprotocolconversionatorabovethetransportlayerandisusedforinterconnectingdifferentnetworks.Agatewaycanbeappliedtobothwideareanetwork(WAN)interconnectionandlocalareanetwork(LAN)interconnection.網(wǎng)關的定義DefinitionofaGatewayAPI相比傳統(tǒng)網(wǎng)關,增加了對api的流量控制與篩選Comparedwithatraditionalgateway,anAPIGatewayintroducesadditionalcapabilitiesforAPItrafficcontrolandfiltering.API網(wǎng)關是應用程序客戶端的單一入口點。它位于客戶端和應用程序的一系列后端服務之間AnAPIGatewayservesasthesingleentrypointforapplicationclients.Itsitsbetweentheclientsandacollectionofbackendserviceswithintheapplication.api網(wǎng)關的功能FunctionsofanAPIGatewayUbuntu有多個版本,主要可以分為以下幾類AnAPIGatewaytypicallyprovidesseveralkeyfunctions,including0103040502身份驗證和安全策略執(zhí)行AuthenticationandSecurityPolicyEnforcement負載均衡LoadBalancing協(xié)議轉換ProtocolTransformation監(jiān)控、日志記錄、分析Monitoring,Logging,andAnalytics請求路由RequestRouting網(wǎng)關的設計原則DesignPrinciplesofanAPIGateway容錯與高可用FaultToleranceandHighAvailabilityThesemechanismsenhancesystemstabilityandpreventservicedowntime.提高穩(wěn)定性,防止宕機可插拔與可擴展PluggabilityandExtensibilitySupportsaplugin-basedarchitecturethatallowsdifferentfunctionalmodulestobeloadedondemand.支持插件化,按需加載不同功能模塊單一職責SingleResponsibilityImplementsonlyasingleresponsibilityanddoesnotdirectlyinteractwithbusinesslogicorapplicationcode.只實現(xiàn)單一職責,不接觸業(yè)務代碼可觀測性ObservabilityFacilitatesdebugging,troubleshooting,andtrafficcontrol.便于調(diào)試,排查與流量控制網(wǎng)關的請求路由實現(xiàn)ImplementationofRequestRoutinginaGateway請求路由的示意圖SchematicDiagramofRequestRouting用戶發(fā)起請求Theuserinitiatesarequest.網(wǎng)關接收請求Thegatewayreceivestherequest.網(wǎng)關獲取服務注冊中心的地址Thegatewayretrievestheserviceaddressesfromtheserviceregistry.網(wǎng)關選擇一個實例并轉發(fā)Thegatewayselectsoneinstanceandforwardstherequest.網(wǎng)關的請求路由實現(xiàn)ImplementationofRequestRoutinginaGateway負載均衡示意圖SchematicDiagramofLoadBalancing讓請求在不同服務實例之間均勻分布,從而提升系統(tǒng)的性能和可用性Distributesincomingrequestsevenlyamongdifferentserviceinstancestoenhancesystemperformanceandavailability.網(wǎng)關的請求路由實現(xiàn)ImplementationofRequestRoutinginaGateway負載均衡示意圖SchematicDiagramofLoadBalancing策略StrategiesRoundRobin(mostcommon)WeightedRoundRobinIPHashRandomDistribution(suitablewhenrequestsareevenlydistributed)輪詢(最常見)加權輪詢IP哈希隨機分配(適用于請求均勻)網(wǎng)關的協(xié)議轉換ProtocolTransformationinaGateway協(xié)議轉換接收端示意圖SchematicDiagramoftheProtocolConversionReceivingEnd協(xié)議轉換流程圖FlowchartofProtocolConversion小結Summarize網(wǎng)關的定義與特點DefinitionandCharacteristicsofaGatewayapi網(wǎng)關的組成ComponentsofanAPIGateway路由請求的實現(xiàn)ImplementationofRequestRouting負載均衡策略LoadBalancingStrategies網(wǎng)關協(xié)議的轉換ProtocolTransformationinaGatewayLogLevelClassificationStandard日志等級劃分標準01日志的核心價值?CoreValueofLogs?問題排查,系統(tǒng)監(jiān)控,行為追溯ProblemTroubleshooting,SystemMonitoring,BehaviorTracing02沒有日志等級的痛點?PainPointsWithoutLogLevels日志冗余,關鍵信息淹沒,排查效率低LogRedundancy,KeyInformationOverwhelmed,LowTroubleshootingEfficiencyDebug等級Debuglevel實際運行時不輸出NotOutputDuringActualOperation任何覺得有利于在調(diào)試時更詳細的了解系統(tǒng)運行狀態(tài)的均可輸出Anyinformationthathelpstobetterunderstandthesystem’srunningstateduringdebuggingcanbeoutput.info等級infolevel打印程序應該出現(xiàn)的正常狀態(tài)信息,便于追蹤定位PrintNormalStatusInformationoftheProgram.Thisfacilitatestrackingandlocalization.warn等級warnlevelwarn表明系統(tǒng)出現(xiàn)輕微的不合理但不影響運行和使用Warnindicatesthatthesystemhasencounteredaminorirregularity,butitdoesnotaffectoperationorusage.error等級errorlevel出現(xiàn)了系統(tǒng)錯誤和異常,無法正常完成目標操作Asystemerrororexceptionhasoccurred,makingitimpossibletocompletetheintendedoperationnormally.fatal等級fatallevel極其嚴重的錯誤會影響系統(tǒng)的正常運行Anextremelyseriouserrorthataffectsthenormaloperationofthesystem.小結Summarize日志的作用以及分級的意義ThePurposeofLogsandtheSignificanceofLogLevels各個分級對應的級別CorrespondingLevelsofEachLogCategoryDevelopmentofanAutomatedTestingFramework自動化測試框架開發(fā)基礎知識BasicKnowledge軟件測試是指在規(guī)定條件下對軟件進行操作,以發(fā)現(xiàn)錯誤并評估軟件質量的過程。Softwaretestingreferstotheprocessofoperatingsoftwareunderspecifiedconditionstoidentifyerrorsandevaluatethequalityofthesoftware.基礎知識BasicKnowledgeAtestcaseisasetoftestinputs,executionconditions,andexpectedresultsdesignedforaspecificpurpose,usedtotestaparticularprogrampathorverifywhetheraspecificrequirementhasbeensatisfied.測試用例是為某個特殊目標而編制的一組測試輸入、執(zhí)行條件以及預期結果,用于測試某個程序路徑或核實是否滿足某個特定需求?;A知識BasicKnowledgeAutomatedtestingistheprocessoftransformingmanuallydriventestingactivitiesintomachine-executedactions.自動化測試是把以人為驅動的測試行為轉化為機器執(zhí)行的一種過程。測試框架的架構圖TestFrameworkArchitectureDiagram框架文件結構FrameworkFileStructureapi_test_project/#項目根目錄#Projectrootdirectory├──config/#環(huán)境、參數(shù)、數(shù)據(jù)庫配置#Configurationforenvironment,parameters,anddatabase├──data/#測試數(shù)據(jù)、公共常量#Testdataandcommonconstants├──tool/#接口請求、日志、數(shù)據(jù)庫操作、通用工具#APIrequests,logging,databaseoperations,andutilityfunctions├──test/#按業(yè)務模塊拆分的測試場景#Testscenariosorganizedbybusinessmodules框架文件結構FrameworkFileStructureapi_test_project/#項目根目錄#Projectrootdirectory├──config/#環(huán)境、參數(shù)、數(shù)據(jù)庫配置#Environment,parameter,anddatabaseconfigurations├──data/#測試數(shù)據(jù)、公共常量#Testdataandsharedconstants├──tool/#接口請求、日志、數(shù)據(jù)庫操作、通用工具#APIrequests,logging,databaseoperations,andcommonutilities├──test/#按業(yè)務模塊拆分的測試場景#Testscenariosorganizedbybusinessmodules├──test/#按業(yè)務模塊拆分的測試場景#Testscenarioscategorizedbybusinessmodules│
├──mod1/#業(yè)務模塊1的用例(如登錄)#Testcasesforbusinessmodule1(e.g.,login)│
├──mod2/#業(yè)務模塊2的用例(如訂單)#Testcasesforbusinessmodule2(e.g.,order)│
└──base/#前置后置操作、基類#Setup/teardownoperationsandbaseclasses├──report/#測試報告#Testreports├──log/#執(zhí)行日志#Executionlogs├──entry/#用例運行、報告生成腳本#Scriptsforrunningtestcasesandgeneratingreports└──requirements.txt#第三方庫清單#Listofthird-partydependencies測試用例的劃分方法MethodsforTestCaseDesign等價類劃分Equivalence邊界值BoundaryValue測試用例的劃分方法MethodsforTestCaseDesign判定表DecisionTable正交法OrthogonalArray測試用例報告TestCaseReport用例編號TestCaseID測試項目TestItem測試標題TestTitle重要級別Priority前置條件Preconditions測試輸入TestInput操作步驟TestSteps預期結果ExpectedResultCAR-001-001車載導航功能測試In-VehicleNavigationFunctionTest驗證目的地輸入后導航路線規(guī)劃正確Verifythatthenavigationrouteiscorrectlyplannedafterenteringadestination高High車輛已啟動,導航系統(tǒng)已加載Thevehicleisstartedandthenavigationsystemisloaded輸入目的地“測試中心”
Enterdestination“TestCenter”打開車載導航界面;在搜索框輸入“測試
中心”;點擊“開始導航”按鈕1.Openthein-vehiclenavigationinterface;2.Enter“TestCenter”inthesearchbox;3.Clickthe“StartNavigation”button導航界面顯示正確的路線規(guī)劃,包括距離、預計耗時、途經(jīng)路段等信息Thenavigationinterfacedisplaysthecorrectrouteplan,includingdistance,estimatedtime,androutesegments小結Summarize自動化測試相關的概念ConceptsRelatedtoAutomatedTesting自動測試框架的架構圖ArchitectureofanAutomatedTestingFramework測試用例的劃分方法TestCaseDesignTechniquesDevelopmentofaTestingFramework自動化測試用例設計原則基本概念BasicConcepts-用例對框架的影響-TheImpactofTestCasesontheFramework測試用例是自動化測試框架的核心執(zhí)行依據(jù),為框架提供明確的測試目標、步驟和判定標準,是框架實現(xiàn)自動化執(zhí)行、結果校驗的基礎。它決定了框架的測試范圍和執(zhí)行邏輯。Testcasesserveasthecoreexecutionbasisofanautomatedtestingframework.Theyprovidetheframeworkwithcleartestingobjectives,steps,andevaluationcriteria,formingthefoundationforautomatedexecutionandresultverification.Testcasesdeterminethetestingscopeandexecutionlogicoftheframework.基本概念BasicConcepts-失敗設計的影響-ImpactofPoorTestCaseDesign設計不當?shù)臏y試用例會導致框架執(zhí)行失穩(wěn)、結果不可靠,既浪費資源又延長測試周期,還大幅增加維護成本。同時讓框架難以發(fā)揮自動化優(yōu)勢,無法精準排查問題、易漏關鍵缺陷。Improperlydesignedtestcasescancausethetestingframeworktobecomeunstableandproduceunreliableresults.Thisnotonlywastesresourcesandextendsthetestingcyclebutalsosignificantlyincreasesmaintenancecosts.Furthermore,itpreventstheframeworkfromfullyleveragingtheadvantagesofautomation,makingitdifficulttoaccuratelylocateissuesandpronetomissingcriticaldefects.獨立性原則PrincipleofIndependence
測試用例獨立性是指每個測試用例應能夠獨立執(zhí)行,不依賴于其他測試用例的執(zhí)行結果或狀態(tài)。一個用例的執(zhí)行結果不應影響其他用例的執(zhí)行結果。Theindependenceoftestcasesmeansthateachtestcaseshouldbeabletoexecuteindependently,withoutrelyingontheexecutionresultsorstatesofothertestcases.Theoutcomeofonetestcaseshouldnotaffecttheresultsofanyothertestcases.獨立性原則PrincipleofIndependence車載平臺測試案例AutomotivePlatformTestCases車載導航系統(tǒng)測試中,路線規(guī)劃和語音導航功能應設計為獨立用例:Inautomotivenavigationsystemtesting,therouteplanningandvoicenavigationfunctionsshouldbedesignedasindependenttestcases:路線規(guī)劃用例:獨立初始化地圖數(shù)據(jù),不依賴導航狀態(tài)RoutePlanningTestCase:Independentlyinitializesmapdatawithoutrelyingonthenavigationstatus.語音導航用例:獨立設置導航狀態(tài),不依賴路線規(guī)劃結果VoiceNavigationTestCase:Independentlysetsthenavigationstatuswithoutdependingontherouteplanningresults.每個用例執(zhí)行后恢復初始狀態(tài),確保后續(xù)用例不受影響Post-ExecutionReset:Eachtestcaseshouldrestorethesystemtoitsinitialstateafterexecutiontoensurethatsubsequenttestcasesarenotaffected.可重復性原則PrincipleofRepeatability
測試用例可重復性是指相同測試用例在相同條件下多次執(zhí)行,應產(chǎn)生一致的結果。無論執(zhí)行順序如何,測試結果都應保持穩(wěn)定和可預測。Therepeatabilityoftestcasesreferstotheabilityofthesametestcasetoproduceconsistentresultswhenexecutedmultipletimesunderidenticalconditions.Regardlessoftheexecutionorder,thetestoutcomesshouldremainstableandpredictable.車載平臺測試案例AutomotivePlatformTestCases車載娛樂系統(tǒng)藍牙連接測試:BluetoothConnectivityTestingforIn-VehicleInfotainmentSystems使用固定設備ID和連接參數(shù)UsefixeddeviceIDsandconnectionparameters.可重復性原則PrincipleofRepeatability每次測試前清除配對記錄,恢復初始狀態(tài)Clearpairingrecordsandrestorethesystemtoitsinitialstatebeforeeachtest.驗證連接狀態(tài)和音頻傳輸功能Verifytheconnectionstatusandaudiotransmissionfunctionality.測試結果應完全一致,不受環(huán)境干擾Testresultsshouldbecompletelyconsistentandunaffectedbyenvironmentalinterference.可判定性原則PrincipleofDeterminability
測試用例可判定性是指每個測試用例應有明確的預期結果和清晰的判定標準,使測試執(zhí)行后能夠明確判斷測試是否通過,避免模糊或主觀的判斷。Thedeterminabilityoftestcasesmeansthateachtestcaseshouldhaveaclearlydefinedexpectedresultandexplicitevaluationcriteria,enablingacleardeterminationofwhetherthetesthaspassedorfailedafterexecution.Thishelpsavoidambiguousorsubjectivejudgments.車載平臺測試案例AutomotivePlatformTestCases車載導航系統(tǒng)定位精度測試:NavigationAccuracyTestforAutomotiveNavigationSystem預期結果:定位誤差≤5米(具體數(shù)值)ExpectedResult:Thepositioningerrorshouldbe≤5meters(specificvalue).可判定性原則PrincipleofDeterminability判定標準:連續(xù)10次定位均滿足誤差要求AcceptanceCriteria:Theerrorrequirementmustbemetin10consecutivepositioningtests.驗證方法:自動比對GPS坐標與實際位置VerificationMethod:AutomaticallycomparetheGPScoordinateswiththeactuallocation.結果判定:通過/失敗,無需人工判斷ResultDetermination:Pass/Fail—nomanualjudgmentrequired.覆蓋率要求CoverageRequirements測試用例覆蓋率是指測試用例對軟件功能、代碼路徑和場景的覆蓋程度。高覆蓋率能更全面地發(fā)現(xiàn)潛在缺陷,提高軟件質量,特別是在車載平臺這種對安全性和可靠性要求極高的環(huán)境中。Testcasecoveragereferstotheextenttowhichtestcasescoverthesoftware’sfunctions,codepaths,andusagescenarios.Highcoverageenablesmorecomprehensivedetectionofpotentialdefectsandimprovesoverallsoftwarequality—particularlyinautomotiveplatforms,wheresafetyandreliabilityrequirementsareextremelyhigh.車載平臺測試案例AutomotivePlatformTestCases車載娛樂系統(tǒng)多媒體播放功能測試:MultimediaPlaybackFunctionTestingforIn-VehicleInfotainmentSystem需求覆蓋:音頻、視頻、圖片全格式支持RequirementCoverage:Supportforallaudio,video,andimageformats.場景覆蓋:正常播放、中斷恢復、切換模式ScenarioCoverage:Normalplayback,interruptionrecovery,andmodeswitching.風險覆蓋:惡意播放文件RiskCoverage:Handlingofmaliciousmediafiles.代碼覆蓋:核心解碼模塊≥95%CodeCoverage:Coredecodingmodules≥95%覆蓋率要求CoverageRequirements需求覆蓋率RequirementCoverage代碼覆蓋率CodeCoverage場景覆蓋率ScenarioCoverage風險覆蓋率RiskCoverage需求功能實現(xiàn)程度RequirementImplementationLevel代碼執(zhí)行路徑比例CodeExecutionPathRatio真實使用場景比例Real-WorldScenarioRatio(已識別并納入測試的風險項數(shù)量
÷
系統(tǒng)潛在風險項總數(shù)量)×100%RiskCoverage=(TotalNumberofPotentialRiskItemsNumberofIdentifiedandTestedRiskItems?)×100%車載測試用例設計實例DesignExamplesofAutomotiveTestCasesTakingtherouteplanningfunctionofanautomotivenavigationsystemasanexample,thissectiondemonstrateshowtoapplytheprinciplesofindependence,repeatability,determinability,andcoverageintestcasedesign.以車載導航系統(tǒng)路線規(guī)劃功能為例,展示如何應用獨立性、可重復性、可判定性和覆蓋率原則設計測試用例。車載測試用例設計實例DesignExamplesofAutomotiveTestCases測試用例設計TestCaseDesign測試場景:用戶從當前位置導航到目的地TestScenario:Usernavigatesfromthecurrentlocationtothedestination.前置條件:系統(tǒng)初始化,GPS信號正常Preconditions:Thesystemisinitialized,andtheGPSsignalisnormal.輸入數(shù)據(jù):固定起點坐標116.404,39.915,終點坐標116.397,39.916InputData:Fixedstartingcoordinates:116.404,39.915,Destinationcoordinates:116.397,39.916汽車GPS子系統(tǒng)通常僅限于測試跑道上的實時天空信號測試場景TestScenario獨立性Independence可重復性Repeatability可判定性Determinability覆蓋率Coverage車載測試用例設計實例DesignExamplesofAutomotiveTestCases測試用例設計TestCaseDesign執(zhí)行步驟:啟動導航→輸入目的地→開始導航→驗證路線Startnavigation→Enterdestination→Beginnavigation→Verifygeneratedroutes預期結果:生成3條備選路線,默認選擇最短路線ExpectedResults:Threealternativeroutesaregenerated,andthesystemautomaticallyselectstheshortestroutebydefault.汽車GPS子系統(tǒng)通常僅限于測試跑道上的實時天空信號測試場景TestScenario獨立性Independence可重復性Repeatability可判定性Determinability覆蓋率Coverage后置操作:清除導航狀態(tài),恢復初始環(huán)境Post-ExecutionActions:Clearnavigationstatusandrestorethesystemtoitsinitialenvironment.車載測試用例設計實例DesignExamplesofAutomotiveTestCases//初始化測試環(huán)境functionsetupTestEnvironment
{//清除導航狀態(tài)navigation.clearState;//設置模擬GPSgps.setMockLocation("116.404,39.915");}//執(zhí)行測試用例functiontestRoutePlanning
{//輸入目的地navigation.setDestination("116.397,39.916");
//開始導航navigation.startNavigation;//驗證路線assert(navigation.getRouteCount==3);}測試代碼片段TestScenario原則應用PrincipleApplication獨立性:每次測試前初始化地圖數(shù)據(jù),不依賴其他用例狀態(tài)Independence:Initializemapdatabeforeeachtestexecutiontoensurethatthetestdoesnotdependonthestateofothertestcases.可重復性:使用固定坐標和模擬GPS信號,確保結果一致Repeatability:UsefixedcoordinatesandsimulatedGPSsignalstoensureconsistentandreproducibleresults.車載測試用例設計實例DesignExamplesofAutomotiveTestCases//初始化測試環(huán)境functionsetupTestEnvironment
{//清除導航狀態(tài)navigation.clearState;//設置模擬GPSgps.setMockLocation("116.404,39.915");}//執(zhí)行測試用例functiontestRoutePlanning
{//輸入目的地navigation.setDestination("116.397,39.916");
//開始導航navigation.startNavigation;//驗證路線assert(navigation.getRouteCount==3);}測試代碼片段TestScenario原則應用PrincipleApplication可判定性:驗證路線數(shù)量、長度和關鍵節(jié)點,明確通過/失敗Determinability:Verifythenumberofroutes,routelength,andkeywaypointstodetermineclearpass/failcriteria.覆蓋率:設計正常、異常和風險場景,覆蓋核心功能Coverage:Designnormal,abnormal,andriskscenariostoensurecomprehensivecoverageofallcorefunctionalities.小結Summarize自動化測試用例設計原則是車載平臺測試的核心基礎,通過遵循獨立性、可重復性、可判定性和覆蓋率要求,能夠有效提升測試效率和質量,保障車載系統(tǒng)的可靠性和安全性。Theprinciplesofautomatedtestcasedesignformthefundamentalbasisofautomotiveplatformtesting.Byadheringtotherequirementsofindependence,repeatability,determinability,andcoverage,testingefficiencyandqualitycanbesignificantlyimproved,ensuringthereliabilityandsafetyofautomotivesystems.InformationSecurityAttackSurfaceAnalysis信息安全攻擊面分析基本概念BasicConcepts
信息是通過施加于數(shù)據(jù)上的某些約定而賦予這些數(shù)據(jù)的特定含義。Informationisthespecificmeaningassignedtodatathroughtheapplicationofcertainconventions.基本概念BasicConcepts而信息安全指的是在信息產(chǎn)生,傳輸,交換,處理和儲存的各個環(huán)節(jié)中,保證我們信息的機密性、完整性以及可用性不被破壞。Informationsecurityreferstoensuringtheconfidentiality,integrity,andavailabilityofinformationthroughoutitsgeneration,transmission,exchange,processing,andstorage.基本概念BasicConcepts攻擊面描述了攻擊者可以進入系統(tǒng)以及從中獲取數(shù)據(jù)的所有不同入口點。Theattacksurfacedescribesallthedifferententrypointsthroughwhichanattackercanaccessasystemandextractdatafromit.診斷接口Thediagnosticinterface診斷接口,即OBD接口,常位于方向盤下方,由OBD系統(tǒng)控制。為通用的標準化接口,現(xiàn)在常用的為16針腳的OBD-II接口。Thediagnosticinterface,alsoknownastheOBDinterface,isusuallylocatedbelowthesteeringwheelandiscontrolledbytheOBDsystem.Itisauniversalstandardizedinterface,andthecommonlyusedtypetodayisthe16-pinOBD-IIinterface.診斷接口DiagnosticInterface診斷接口ThediagnosticinterfaceOBD是OnBoardDiagnostics的縮寫,通俗講就是車載自動診斷系統(tǒng),它的作用就是在汽車運行過程中實時監(jiān)控發(fā)動機和其他工作模塊的工作狀態(tài),一旦發(fā)現(xiàn)異常便會以OBD,shortforOn-BoardDiagnostics,iscommonlyknownasthevehicle’sonboardautomaticdiagnosticsystem.Itsfunctionistocontinuouslymonitortheoperatingstatusoftheengineandothercontrolmoduleswhilethevehicleisrunning.Whenanabnormalityisdetected,itrecordsthefaultintheformofadiagnostictroublecode(DTC)inthememory.故障碼的形式記錄在存儲器當中。診斷接口DiagnosticInterfaceOBD接口攻擊面分析OBDInterfaceAttackSurfaceAnalysis物理接入攻擊PhysicalAccessAttacks協(xié)議濫用攻擊ProtocolAbuseAttacksCAN總線CANbus?can即控制器局域網(wǎng)(ControllerAreaNetwork),是一種異步,半雙工,高可靠性,支持多設備的一種車輛嵌入式常用的通信協(xié)議CAN,shortforControllerAreaNetwork,isanasynchronous,half-duplex,highlyreliable,andmulti-device-supportedcommunicationprotocolcommonlyusedinvehicleembeddedsystems.CAN總線攻擊面分析CANBusAttackSurfaceAnalysis協(xié)議攻擊ProtocolAttacks物理層攻擊Physical-LayerAttacks節(jié)點安全ProtocolAttacksOTA升級OTAUpgrade汽車遠程升級技術OTA:AutomotiveOver-the-Air(OTA)?汽車遠程升級技術OTA是指通過移動通信網(wǎng)絡對汽車的零部件終端上固件、數(shù)據(jù)及應用進行遠程管理的技術。Step-by-StepDebugging:Aftermodifyingyourprogram,testitaftereachchangeandchecktheoutput.Avoidmakingtoomanychangesatonce,asthiscanmakeitdifficulttolocateerrors.OTA升級OTAUpgrade汽車遠程升級技術OTA:AutomotiveOver-the-Air(OTA)?OTA技術實現(xiàn)分三步:首先將更新軟件上傳到OTA中心,然后OTA中心無線傳輸更新軟件到車輛端,最后車輛端自動更新軟件。TheimplementationofOTAtechnologyconsistsofthreesteps:first,theupdatedsoftwareisuploadedtotheOTAcenter;second,theOTAcenterwirelesslytransmitstheupdatepackagetothevehicle;andfinally,thevehicleautomaticallyinstallstheupdatedsoftware.OTA攻擊面分析OTAAttackSurfaceAnalysis云端CloudSide通訊鏈路CommunicationLink車端VehicleSide小結Summarize信息安全攻擊面分析的基礎概念BasicConceptsofAttackSurfaceAnalysis診斷接口與攻擊分析AttackAnalysis(OBD/DiagnosticPort)CAN通信與攻擊分析AttackAnalysis(ControllerAreaNetwork)OTA與攻擊分析
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2026年度馬鞍山市直事業(yè)單位公開招聘工作人員88名考試重點題庫及答案解析
- 2026年浙江工業(yè)職業(yè)技術學院單招綜合素質考試模擬試題含詳細答案解析
- 2026年桂林師范高等??茖W校單招職業(yè)技能考試備考題庫含詳細答案解析
- 2026年湖南大眾傳媒職業(yè)技術學院單招綜合素質筆試備考試題含詳細答案解析
- 2026年蕪湖南陵縣事業(yè)單位公開招聘工作人員16名備考考試試題及答案解析
- 2026年池州職業(yè)技術學院單招職業(yè)技能考試模擬試題含詳細答案解析
- 2026年昌吉職業(yè)技術學院單招綜合素質考試模擬試題含詳細答案解析
- 2026年遼寧城市建設職業(yè)技術學院單招綜合素質考試參考題庫含詳細答案解析
- 2026年湖南都市職業(yè)學院單招職業(yè)技能考試備考試題含詳細答案解析
- 2026年商丘工學院單招綜合素質筆試備考試題含詳細答案解析
- 研發(fā)資料規(guī)范管理制度(3篇)
- GB/T 16770.1-2025整體硬質合金直柄立銑刀第1部分:型式與尺寸
- 工業(yè)產(chǎn)品銷售單位質量安全日管控周排查月調(diào)度檢查記錄表
- 2025年風險管理自查報告
- 2026年中國煤炭資源行業(yè)投資前景分析研究報告
- 項目成本控制動態(tài)監(jiān)測表模板
- DBJ46-074-2025 海南省市政道路瀝青路面建設技術標準
- 幼兒園小班語言《大一歲了》課件
- GB/T 14071-2025林木品種審定規(guī)范
- en590居間合同范本
- 移風易俗問答題目及答案
評論
0/150
提交評論