SmartUnit:工业嵌入式软件自动化单元测试的实证评估
SmartUnit: Empirical Evaluations for Automated Unit Testing of Embedded Software in Industry
摘要:
在本文中,我们针对嵌入式软件的自动化单元覆盖率为基础的测试。为了实现这一目标,通过分析工业需求和我们以前在自动化单元测试工具CAUT上的工作,我们重新构建了一个新的工具SmartUnit,以解决我们合作伙伴公司的工程需求。SmartUnit是一个动态符号执行实现,支持语句、分支、边界值和MC/DC覆盖。SmartUnit已经在实际项目中测试了超过一百万行代码。出于保密动机,我们选择了三个内部真实项目进行实证评估。我们还对两个开源数据库项目SQLite和PostgreSQL进行了评估,以测试我们的工具的可扩展性,因为嵌入式软件项目的规模大多不大,平均只有5 K-50 K行代码。从我们的实验结果来看,一般来说,商业嵌入式软件中90%以上的函数实现了100%的语句、分支、MC/DC覆盖,SQLite中80%以上的函数实现了100%的MC/DC覆盖,PostgreSQL中60%以上的函数实现了100%的MC/DC覆盖。此外,SmartUnit能够在单元测试级别找到运行时异常。我们还报告了SQLite中的异常,如数组索引越界和被零除。此外,我们还分析了自动化单元测试覆盖率低的原因,并对工业上手工单元测试相对于自动化单元测试的情况进行了调查。
英文摘要:
In this paper, we aim at the automated unit coverage-based testing for embedded software. To achieve the goal, by analyzing the industrial requirements and our previous work on automated unit testing tool CAUT, we rebuild a new tool, SmartUnit, to solve the engineering requirements that take place in our partner companies. SmartUnit is a dynamic symbolic execution implementation, which supports statement, branch, boundary value and MC/DC coverage. SmartUnit has been used to test more than one million lines of code in real projects. For confidentiality motives, we select three in-house real projects for the empirical evaluations. We also carry out our evaluations on two open source database projects, SQLite and PostgreSQL, to test the scalability of our tool since the scale of the embedded software project is mostly not large, 5K-50K lines of code on average. From our experimental results, in general, more than 90% of functions in commercial embedded software achieve 100% statement, branch, MC/DC coverage, more than 80% of functions in SQLite achieve 100% MC/DC coverage, and more than 60% of functions in PostgreSQL achieve 100% MC/DC coverage. Moreover, SmartUnit is able to find the runtime exceptions at the unit testing level. We also have reported exceptions like array index out of bounds and divided-by-zero in SQLite. Furthermore, we analyze the reasons of low coverage in automated unit testing in our setting and give a survey on the situation of manual unit testing with respect to automated unit testing in industry.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。