摘要
针对由于并发程序的行为不可控而导致难以对其进行测试的问题,提出了一种控制C程序中并发行为的方法。该方法以多线程同步为基础,使用测试序列和测试单位完成对并发行为的控制。在此基础上,实现了对C程序测试活动中并发行为控制的工具支持,以生产者-消费者为例说明了使用此工具进行测试活动,并讨论了其效率。
Concurrent programs are hard to test due to their nondeterminism.To solve this problem,a method to control the concurrent behavior of C program is proposed.This method is based on synchronization of multithreading,using test-sequence and test-cell to accomplish the goal of controlling the concurrent behavior.With the basis of this method,tool support for controlling concurrent behavior in testing C program has been implemented;besides,an example to test the producer-consumer problem using this tool is illustrated,with a short discussion about the efficiency.
出处
《电脑编程技巧与维护》
2010年第14期138-139,157,共3页
Computer Programming Skills & Maintenance
关键词
并发
控制
测试
测试序列
测试单位
concurrent
control
test
test-sequence
test-cell