测试是Web服务质量保证的主要手段之一,测试自动化是降低测试代价的有效途径,测试数据生成是测试自动化研究的一个重要内容.提出采用本体及规则的知识描述语言,建立服务接口的语义契约模型(interface semantic contract,简称ISC),并探讨了基于ISC的测试数据生成技术,给出了分区生成算法以及测试数据生成的模拟退火算法.实验结果表明,与随机测试相比,该方法能够采用10%的测试用例数量达到同样的测试覆盖率:在同样的测试用例数量上,最高可提高50%的测试覆盖率.
Testing is one of the primary methods for Web service quality control. Test automation is necessary to enhance test productivity and quality while reducing test effort. Test data generation is a critical issue of automated testing. The paper proposes a method called interface semantic contract (ISC) for modeling services' exposed functionalities using ontology and rule language. Algorithms are developed to generate input partitions and test data based on ISC. Case studies are exercised to illustrate the proposed approach. The results show that compared with conventional random testing, the proposed approach can enhance test coverage by 50% with the same number of test cases, and reduce test effort by 90% to reach the same test coverage.