正确的时间属性和行为对于实时软件来说非常关键,然而这却很难得到完全的保障.在实际工业中,实时性错误不仅会在软件的设计开发阶段被引入,在软件的维护阶段,随着软件的演化也同样会引入这种错误.当软件维护人员对系统不够熟悉时,维护阶段引入这些错误的可能性会更大.目前,还没有研究结果可以在软件修改发生之前,通过分析系统的时间关系信息来帮助指导软件维护人员减少或者避免引入时间相关的错误.在这样的背景下,文中提出了一种实际可用的分析途径来解决这一问题,称之为时间变化影响分析.这一解决途径在软件维护人员做出修改之前就可以分析软件内在的时间关系信息,从而帮助维护人员在软件的实际演化前预测可能带来的时间影响.在具体的操作上,可以通过告知软件维护人员程序代码中的某些位置点可能会对整个程序任务的执行时间产生很大的影响,来提醒他们修改这些位置点的代码时应当特别小心.由于这些点对程序任务的执行时间敏感,我们称之为时间变化敏感点.文中通过一种基于扰动的测试实现来检测程序中的时间变化敏感点,通过在程序中插桩不同的代码时延,达到对执行时间的扰动作用.对这些扰动作用下的程序执行时间数据进行统计,得到程序中各个位置点对时间影响的定量度量.对于实际使用的大规模程序,该方法通过集成静态程序分析技术提高吞吐量和减小漏报率.文中对分析途径做了原型实现,并在M(a)lardalen WCET基准用例集和开源项目Free Lossless Audio Codec (FLAC)上做了实例评估.评估结果展示了该方法的可行性和有效性.
Correct time behavior is an important aspect for time sensitive software. However, it is difficult to get right. Real-time failures can be introduced not just during the development but also maintenance. So maintainers without time information of the software tend to have more chances to introduce unintended time behaviors. Few practical works have been done on collecting the time-related information before the software evolves, which we call time change impact analysis. In this paper, we propose a novel, practical framework to get high-level information about the impact of time before new code is added to the time-sensitive project. Our main insight is that by reminding maintainers some places (or points) in the source code, which largely affect the exe- cution time, maintainers can be more cautious when updating such places. Because these points have a leverage effect that multiplies the task time, we call them time-leverage points. Ourframework integrates a disturbing based testing technique to find these points for maintainers. The technique disturbs the evaluation time by instrumenting different codes in software. When summarizing the time changes, we can measure the time impact of points. For a real project, we also integrate several static program analysis techniques to reduce the false negatives and improve the scalability of our framework. We implement our method as a prototype and evaluate the method on Malardalen WCET Benchmark suite and Free Lossless Audio Codec (FLAC) project. The result shows that our framework successfully detected the time-leverage points in software.