Abstract:
In SaaS (software-as-a-service), software functions are encapsulated as independent and self-contained services, and users can access these services through well-defined interface. The correctness and reliability of service interfaces are critical for service understanding, reuse and integration. With the increasing acceptance of SaaS, more and more software expose interfaces for Internet-based open access. API testing for service interfaces is thus getting increasing attentions. To this end, a model-driven automatic testing method is presented to facilitate efficient and effective service interfaces testing. A model called ISC (interface semantic contract) is defined for modeling services with domain knowledge. Following the model-driven approach, tests are generated from ISC at three levels: test data, test cases for individual services and for composite services. Test cases are then translated to target programming languages through a kind of meta-model defined for test cases. An automatic testing tool (AutoTest) has been designed and implemented, which integrates various algorithms to optimize test generation. What’s more, the tool supports design test plan in graphical form and generates test cases in multiple programming languages, for example, C++ or Java. Experimental results demonstrate that AutoTest can support design and generation of large quantities of test cases effectively and efficiently, and test cases generated by OED (orthogonal experimental design) algorithm have more satisfactory test coverage than those by pairwise IPO (in parameter order) algorithm.