Application and practice of black box testing technology in fluid simulation software
-
摘要:
随着现代计算流体力学(CFD)的发展,在CFD仿真软件的系统测试中开展黑盒测试技术的研究和应用对于提高软件质量有着重要的意义。基于此,阐述了等价类划分、边界值分析、决策表、状态转换图等多种黑盒测试技术基本原理,结合国家数值风洞(NNW)软件研发需求,设计基于黑盒测试技术的有效测试用例,以满足CFD软件研发的测试需求及覆盖率,快速有效地发现软件设计实现和需求不一致而引起的失效问题。实践结果表明:在NNW软件的系统测试中合理地应用黑盒测试技术,能够有效提高测试覆盖范围和测试效率,具有较高的工程应用价值。
Abstract:With the development of the modern computational fluid dynamic (CFD), the research and application of black box testing technology in CFD software system testing are significant in improving software quality. The basic principles of various black box testing technologies including equivalence partitioning, boundary value analysis, decision table, and state transform diagram were introduced. The application of these technologies to determine test conditions and create valid test cases in order to satisfy testing requirements and function coverage in national numerical wind tunnel (NNW) software testing was then thoroughly explained. This allowed for the prompt and efficient identification of failures resulting from inconsistencies between the design and implementation of NNW software and requirements. Engineering practice has demonstrated the great value of black testing technologies, which when used to NNW software system testing may effectively increase testing efficiency and coverage.
-
表 1 马赫数有效等价类和代表值
Table 1. Valid equivalence classes and typical values of Mach number
程序参数 有效等价类 等价类代表值 Ma vEC-1: 0.001 ≤ Ma≤ 0.3(低速) 0.1 vEC-2: 0.3 < Ma≤ 0.8(亚声速) 0.5 vEC-3: 0.8 < Ma≤ 1.2(跨声速) 1.0 vEC-4: 1.2 < Ma≤ 4(超声速) 3.5 vEC-5: 4 < Ma≤ 30(高超声速) 8.0 vEC-6: 精度测试 0.001+1.0×10−9 表 2 马赫数无效等价类和代表值
Table 2. Invalid equivalence classes and typical values of Mach number
程序参数 无效等价类 等价类代表值 Ma iEC-1: Ma< 0.001 0 iEC-2: Ma> 30 100 注:等价类代表值0是一个经常导致程序失效的数据。 表 3 边界值方法
Table 3. Boundary value method
参数 小于下限的值 [有效等价类] 大于上限的值 A Min−δ [Min,Min +δ,···,Max−δ,Max] Max +δ 表 4 NNW软件的来流参数边界值
Table 4. Boundary values of inflow parameters of NNW software
程序参数 马赫数Ma 迎角α/(°) 侧滑角β/(°) 飞行高度H/km 静压P/Pa 静温T/K 单位长度
雷诺数ReL小于下限的值 0.001−δ −100−δ −100−δ 0−δ 0−δ 10−δ 0−δ [有效等价类] [0.001,0.001+δ,···,
30−δ,30][−100,−100+δ,···,
100−δ,100][−100,−100+δ,···,
100−δ,100][0,0+δ,···,
91−δ,91][0,0+δ,···,1.0×
106−δ,1.0×106][10,10+δ,···, 3000 −δ,3000 ][0,0+δ,···,1.0×
1010−δ,1.0×1010]大于上限的值 30+δ 100+δ 100+δ 91+δ 1.0×106+δ 3000 +δ1.0×1010+δ 表 5 NNW软件的来流参数边界值测试用例
Table 5. Boundary values test case of inflow parameters of NNW software
测试用例 Ma α/(°) β/(°) H/km P/Pa T/K ReL 预期结果 1 0.001 −100 −100 0 0 10 0 正确 2 0.001+δ −100+δ −100+δ 0+δ 0+δ 10+δ 0+δ 正确 3 15 50 50 45.5 103 1500 105 正确 4 30−δ 100−δ 100−δ 91−δ 1.0×106−δ 3000 −δ1.0×1010−δ 正确 5 30 100 100 91 1.0×106 3000 1.0×1010 正确 表 6 NNW软件的来流参数最小有效边界值测试用例
Table 6. Test case of minimum valid boundary values of inflow parameters of NNW software
测试
用例Ma α/(°) β/(°) H/km P/Pa T/K ReL 预期
结果1 0.001 50 50 45.5 103 1500 105 正确 2 15 −100 50 45.5 103 1500 105 正确 3 15 50 −100 45.5 103 1500 105 正确 4 15 50 50 0 103 1500 105 正确 5 15 50 50 45.5 0 1500 105 正确 6 15 50 50 45.5 103 10 105 正确 7 15 50 50 45.5 103 1500 0 正确 表 7 NNW软件气动力积分分析决策
Table 7. Decision for analyzing aerodynamic integration of NNW software
规则 条件桩 动作桩 C1 C2 C3 C4 C5 A1 A2 A3 A4 A5 1 Y N Y Y Y Y 2 Y Y N N Y Y 3 Y N Y N N Y 4 Y Y N N N Y 5 N N N N N Y 表 8 NNW软件马赫数输入的错误推测值
Table 8. Error guessing values of Mach number input of NNW software
测试对象 输入参数 中文 英文 特殊字符 马赫数 马赫数 Mach @, \, %, # 表 9 HyFLOW计算迎角的测试用例
Table 9. Test cases for angle of attack of HyFLOW
编号 α/(°) 结果 iEC-1 −101 I vEC-1 −50 N vEC-2 0 Y vEC-3 50 N iEC-2 101 I 表 10 Ram-C计算条件
Table 10. Computational condition of Ram-C
马赫数 速度/(m·s−1) 密度/(kg·m−3) 单位长度雷诺数/(m−1) 25.9144 7650 7.197×10−5 3.6079 ×104压力/Pa 壁温/K 侧滑角/(°) 来流温度/K 4.47956 1500 0 216.85 表 11 航天飞机计算条件
Table 11. Computational condition of space shuttle
马赫数 迎角/(°) 密度/(kg· m−3) 单位长度雷诺数/(m−1) 14.25 40.56 4.291×10−4 1.1×105 压力/Pa 壁温/K 侧滑角/(°) 来流温度/K 32.31 1500 0 216.28 表 12 球头计算条件
Table 12. Computational condition of sphere
马赫数 迎角/(°) 静温/K 静压/Pa 10 0 79 6.8795 总温/K 总压/Pa 壁温/K 雷诺数 1659 291958.86 294.44 1.0×105 -
[1] 陈坚强. 国家数值风洞(NNW)工程关键技术研究进展[J]. 中国科学: 技术科学, 2021, 51(11): 1326-1347. doi: 10.1360/SST-2020-0334CHEN J Q. Advances in the key technologies of Chinese national numerical windtunnel project[J]. Scientia Sinica (Technologica), 2021, 51(11): 1326-1347(in Chinese). doi: 10.1360/SST-2020-0334 [2] 陈坚强, 吴晓军, 张健, 等. FlowStar: 国家数值风洞(NNW)工程非结构通用CFD软件[J]. 航空学报, 2021, 42(9): 625739.CHEN J Q, WU X J, ZHANG J, et al. FlowStar: general unstructured-grid CFD software for national numerical windtunnel(NNW) project[J]. Acta Aeronautica et Astronautica Sinica, 2021, 42(9): 625739(in Chinese). [3] 何磊, 郭勇颜, 曾志春, 等. 国家数值风洞(NNW)软件自动化集成与测试平台设计与研发[J]. 空气动力学学报, 2020, 38(6): 1158-1164.HE L, GUO Y Y, ZENG Z C, et al. Design and development of software automated continuous integration and testing platform for national numerical windtunnel project[J]. Acta Aerodynamica Sinica, 2020, 38(6): 1158-1164(in Chinese). [4] 孙岩, 江盟, 孟德虹, 等. 国家数值风洞工程结构网格变形程序SGDP V1.0开发与应用[J]. 空气动力学学报, 2020, 38(4): 668-676. doi: 10.7638/kqdlxxb-2020.0048SUN Y, JIANG M, MENG D H, et al. Development and application of structured grid deformation program SGDP V1.0 in national numerical windtunnel project[J]. Acta Aerodynamica Sinica, 2020, 38(4): 668-676(in Chinese). doi: 10.7638/kqdlxxb-2020.0048 [5] 李鹏, 陈坚强, 丁明松, 等. NNW-HyFLOW高超声速流动模拟软件框架设计[J]. 航空学报, 2021, 42(9): 625718.LI P, CHEN J Q, DING M S, et al. Framework design of NNW-HyFLOW hypersonic flow simulation software[J]. Acta Aeronautica et Astronautica Sinica, 2021, 42(9): 625718(in Chinese). [6] 赵钟, 何磊, 何先耀. 风雷(PHengLEI)通用CFD软件设计[J]. 计算机工程与科学, 2020, 42(2): 210-219.ZHAO Z, HE L, HE X Y. Design of general CFD software PHengLEI[J]. Computer Engineering & Science, 2020, 42(2): 210-219(in Chinese). [7] 赵钟, 张来平, 何磊, 等. 适用于任意网格的大规模并行CFD计算框架PHengLEI[J]. 计算机学报, 2019, 42(11): 2368-2383.ZHAO Z, ZHANG L P, HE L, et al. PHengLEI: a large scale parallel CFD framework for arbitrary grids[J]. Chinese Journal of Computers, 2019, 42(11): 2368-2383(in Chinese). [8] 秦航. 软件质量保证与测试[M]. 2版. 北京: 清华大学出版社, 2017: 383.QIN H. Software quality assurance and testing[M]. 2nd ed. Beijing: Tsinghua University Press, 2017: 383(in Chinese). [9] 覃志东. 高可信软件可靠性和防危性测试与评价理论研究[D]. 成都: 电子科技大学, 2005.QIN Z D. Theoretical research on testing and evaluation of reliability and danger prevention of highly trusted software[D]. Chengdu: University of Electronic Science and Technology of China, 2005(in Chinese). [10] 丁宇航. 飞行管理系统软件测试技术应用研究[D]. 西安: 长安大学, 2008.DING Y H. Research on application of software testing technology in flight management system[D]. Xi’an: Changan University, 2008(in Chinese). [11] 邓小刚, 宗文刚, 张来平, 等. 计算流体力学中的验证与确认[J]. 力学进展, 2007, 37(2): 279-288.DENG X G, ZONG W G, ZHANG L P, et al. Verification and validation in computational fluid dynamics[J]. Advances in Mechanics, 2007, 37(2): 279-288(in Chinese). [12] 赵炜, 陈江涛, 肖维, 等. 国家数值风洞(NNW)验证与确认系统关键技术研究进展[J]. 空气动力学学报, 2020, 38(6): 1165-1172.ZHAO W, CHEN J T, XIAO W, et al. Advances in the key technologies of verification and validation system of national numerical windtunnel project[J]. Acta Aerodynamica Sinica, 2020, 38(6): 1165-1172(in Chinese). [13] 何磊, 赫新, 马戎, 等. 大型CFD软件自动化测试平台的初步设计与实现[J]. 空气动力学学报, 2016, 34(4): 418-425.HE L, HE X, MA R, et al. Preliminary design and application of CFD software automatic testing platform[J]. Acta Aerodynamica Sinica, 2016, 34(4): 418-425(in Chinese). [14] 郑文强, 周震漪, 马均飞. 软件测试基础教程[M]. 北京: 清华大学出版社, 2015: 193.ZHENG W Q, ZHOU Z Y, MA J F. Basic course of software testing[M]. Beijing: Tsinghua University Press, 2015: 193(in Chinese). [15] PAGE A, JOHNSTON K, ROLLISON B. How we testsoftware at microsoft[M]. Seattle: Microsoft Press, 2008. [16] WHITTAKER J, ARBON J, CAROLLO J. How google tests software[M]. Massachusetts: Addison-Wesley Professional, 2012. [17] Radio Technical Commission for Aeronautics. Software considerations in airborne systems and equipment certification: DO-178B[S]. Washington, D.C.: Radio Technical Commission for Aeronautics, 1992. [18] MYERS G J. The art of software testing[M]. Hoboken: John Wiley&Sons, 2011. -


下载: