留言板

尊敬的读者、作者、审稿人, 关于本刊的投稿、审稿、编辑和出版的任何问题, 您可以本页添加留言。我们将尽快给您答复。谢谢您的支持!

姓名
邮箱
手机号码
标题
留言内容
验证码

黑盒测试技术在流体仿真软件研发中的应用实践

张凡 刘婉 郭勇颜 曾志春 何乾伟 赵钟

张凡,刘婉,郭勇颜,等. 黑盒测试技术在流体仿真软件研发中的应用实践[J]. 北京航空航天大学学报,2025,51(11):3769-3780 doi: 10.13700/j.bh.1001-5965.2023.0621
引用本文: 张凡,刘婉,郭勇颜,等. 黑盒测试技术在流体仿真软件研发中的应用实践[J]. 北京航空航天大学学报,2025,51(11):3769-3780 doi: 10.13700/j.bh.1001-5965.2023.0621
ZHANG F,LIU W,GUO Y Y,et al. Application and practice of black box testing technology in fluid simulation software[J]. Journal of Beijing University of Aeronautics and Astronautics,2025,51(11):3769-3780 (in Chinese) doi: 10.13700/j.bh.1001-5965.2023.0621
Citation: ZHANG F,LIU W,GUO Y Y,et al. Application and practice of black box testing technology in fluid simulation software[J]. Journal of Beijing University of Aeronautics and Astronautics,2025,51(11):3769-3780 (in Chinese) doi: 10.13700/j.bh.1001-5965.2023.0621

黑盒测试技术在流体仿真软件研发中的应用实践

doi: 10.13700/j.bh.1001-5965.2023.0621
基金项目: 

国家数值风洞工程

详细信息
    通讯作者:

    E-mail:ugsytyc@ustc.edu

  • 中图分类号: V19;TP391.41

Application and practice of black box testing technology in fluid simulation software

Funds: 

National Numerical Windtunnel Project

More Information
  • 摘要:

    随着现代计算流体力学(CFD)的发展,在CFD仿真软件的系统测试中开展黑盒测试技术的研究和应用对于提高软件质量有着重要的意义。基于此,阐述了等价类划分、边界值分析、决策表、状态转换图等多种黑盒测试技术基本原理,结合国家数值风洞(NNW)软件研发需求,设计基于黑盒测试技术的有效测试用例,以满足CFD软件研发的测试需求及覆盖率,快速有效地发现软件设计实现和需求不一致而引起的失效问题。实践结果表明:在NNW软件的系统测试中合理地应用黑盒测试技术,能够有效提高测试覆盖范围和测试效率,具有较高的工程应用价值。

     

  • 图 1  黑盒测试技术分类

    Figure 1.  Black box test technology classification

    图 2  作业计算状态转换

    Figure 2.  State transition of running job

    图 3  HyFLOW计算框架[5]

    Figure 3.  Computational framework of HyFLOW software[5]

    图 4  HyFLOW主界面

    Figure 4.  Main interface of HyFLOW

    图 5  Ram-C外形

    Figure 5.  Configuration of Ram-C

    图 6  Ram-C计算网格

    Figure 6.  Computational mesh of Ram-C

    图 7  vEC-1测试结果

    Figure 7.  Test results for vEC-1

    图 8  流场电子数密度分布

    Figure 8.  Distribution of electron number density in flow filed

    图 9  电子数密度分布(x/R=8.1)

    Figure 9.  Electron number density distribution (x/R=8.1)

    图 10  壁面热流分布

    Figure 10.  Distribution of wall heat flux

    图 11  航天飞机外形

    Figure 11.  Configuration of space shuttle

    图 12  航天飞机计算网格

    Figure 12.  Computational mesh of space shuttle

    图 13  氧组分的边界值

    Figure 13.  Boundary value of oxygen component

    图 14  边界值测试结果

    Figure 14.  Test results of Boundary value

    图 15  计算状态转换

    Figure 15.  State transition of running job

    图 16  球头外形

    Figure 16.  Configuration of sphere

    图 17  球头计算网格

    Figure 17.  Computational mesh of sphere

    图 18  计算状态测试结果

    Figure 18.  Test results of running status

    图 19  每轮系统测试检出缺陷的分布

    Figure 19.  Distribution of defects detected in each round of system test

    图 20  每轮系统测试缺陷类型的分布

    Figure 20.  Distribution of defects types in each round of system test

    图 21  基于缺陷源的缺陷分类

    Figure 21.  Diagram of defects classification based on different sources

    图 22  基于检出方式的缺陷分类

    Figure 22.  Diagram of defects classification based on different methods

    表  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
    下载: 导出CSV

    表  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是一个经常导致程序失效的数据。
    下载: 导出CSV

    表  3  边界值方法

    Table  3.   Boundary value method

    参数 小于下限的值 [有效等价类] 大于上限的值
    A Minδ [MinMin +δ,···,MaxδMax] Max +δ
    下载: 导出CSV

    表  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+δ
    下载: 导出CSV

    表  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 正确
    下载: 导出CSV

    表  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 正确
    下载: 导出CSV

    表  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
    下载: 导出CSV

    表  8  NNW软件马赫数输入的错误推测值

    Table  8.   Error guessing values of Mach number input of NNW software

    测试对象 输入参数
    中文 英文 特殊字符
    马赫数 马赫数 Mach @, \, %, #
    下载: 导出CSV

    表  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
    下载: 导出CSV

    表  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
    下载: 导出CSV

    表  11  航天飞机计算条件

    Table  11.   Computational condition of space shuttle

    马赫数 迎角/(°) 密度/(kg· m−3 单位长度雷诺数/(m−1)
    14.2540.564.291×10−41.1×105
    压力/Pa壁温/K侧滑角/(°)来流温度/K
    32.3115000216.28
    下载: 导出CSV

    表  12  球头计算条件

    Table  12.   Computational condition of sphere

    马赫数 迎角/(°) 静温/K 静压/Pa
    100796.8795
    总温/K总压/Pa壁温/K雷诺数
    1659291958.86294.441.0×105
    下载: 导出CSV
  • [1] 陈坚强. 国家数值风洞(NNW)工程关键技术研究进展[J]. 中国科学: 技术科学, 2021, 51(11): 1326-1347. doi: 10.1360/SST-2020-0334

    CHEN 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.0048

    SUN 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.
  • 加载中
图(22) / 表(12)
计量
  • 文章访问数:  352
  • HTML全文浏览量:  99
  • PDF下载量:  6
  • 被引次数: 0
出版历程
  • 收稿日期:  2023-09-27
  • 录用日期:  2024-01-19
  • 网络出版日期:  2024-02-06
  • 整期出版日期:  2025-11-25

目录

    /

    返回文章
    返回
    常见问答