Regression testing is crucial in ensuring that pure code refactoring does not adversely affect existing software functionality, but it can be expensive, accounting for half the cost of software maintenance. Automated test case generation reduces effort but may generate weak test suites. Test amplification is a promising solution that enhances tests by generating additional or improving existing ones, increasing test coverage, but it faces the test oracle problem. To address this, we propose a test oracle derivation approach that uses object state data produced during System Under Test (SUT) test execution to amplify regression test oracles. The approach monitors the object state during test execution and compares it to the previous version to detect any changes in relation to the SUT's intended behaviour. Our preliminary evaluation shows that the proposed approach can enhance the detection of behaviour changes substantially, providing initial evidence of its effectiveness.
翻译:回归测试对于确保纯代码重构不会对现有软件功能产生负面影响至关重要,但其成本高昂,可占软件维护成本的一半。自动化测试用例生成可减少工作量,但可能生成薄弱测试套件。测试放大是一种有前景的解决方案,通过生成额外测试或改进现有测试来增强测试效果、提升测试覆盖率,但仍面临测试预言符问题。为解决该问题,我们提出一种基于被测系统(SUT)测试执行过程中产生的对象状态数据来推导回归测试预言符的方法。该方法在测试执行期间监测对象状态,并与先前版本进行对比,以检测与SUT预期行为相关的任何变化。初步评估表明,所提方法能显著增强对行为变化的检测能力,为其有效性提供了初步证据。