计算机与现代化

• 软件工程 • 上一篇    下一篇

基于线程调度顺序控制的多线程程序测试

  

  1. (长沙环境保护职业技术学院,湖南 长沙 410001)
  • 收稿日期:2016-10-31 出版日期:2017-06-23 发布日期:2017-06-23
  • 作者简介:李婧(1982-),女(土家族),湖南常德人,长沙环境保护职业技术学院讲师,硕士,研究方向:软件工程。
  • 基金资助:
    湖南省教育厅科研项目(15C0017)

Multithreaded Program Testing Based on Controlling Sequence of Thread Schedule

  1. (Changsha Environmental Protection College, Changsha 410001, China)
  • Received:2016-10-31 Online:2017-06-23 Published:2017-06-23

摘要: 随着多核技术越来越普及,多线程程序的编程也越来越流行。但是多线程程序的正确性问题已经严重影响软件可靠性,且现有的测试技术不能很好地满足多线程程序的需求。本文重点研究多线程程序中最常见的一种bug,即数据竞争,提出一种基于线程调度顺序控制的测试方法。该方法混合静态方法和动态方法,能够有效地找到多线程程序中存在的数据竞争,且能够区分出哪些数据竞争是有害的,需要程序员优先修复。实验结果显示,对于数据竞争的触发概率,本文的方法使其平均从0.53%提高到79.2%,且本文所引入的运行时开销平均只有80%,与相关方法所引入370%的开销相比更优。

关键词: 多线程程序, 测试, 软件可靠性, 线程调度, 数据竞争

Abstract: As multi-core techniques become pervasive, programming multithreaded programs is becoming popular. However, the problem of correctness of multithreaded program has affected software reliability severely. Moreover, current testing techniques can not satisfy the requirements of multithreaded programs. This paper focuses on the most common type of bugs in multithread programs, which is called data race. We propose a testing approach based on controlling sequence of thread schedule, combining static approach with dynamic approach. The approach can effectively find the data races in multithreaded programs, and identify the harmful data races that are required to be fixed urgently. Experimental results show that our approach improves the probability of triggering data races significantly, from 0.53% to 79.2% averagely. Moreover, the runtime overhead imposed by our approach is on average 80%, and the overhead imposed by related approach is 370%, demonstrating our approach is better.

Key words: multithreaded program, testing, software reliability, thread schedule, data race

中图分类号: