Generating Test Cases With High Branch Coverage for Web Applications
Andrey Zakonov, Anatoly Abramovich Shalyto · Proceedings of the Spring/Summer young researchers' colloquium on software engineering · 2012
Web applications have become significantly more complex and have begun to be used in wide variety of areas including social networks, shopping, online banking and other safety critical systems.We present an approach for automated white-box test generation for web applications.Our approach is to convert problem of high branch coverage test suite generation into a reachability problem and to utilize existing software verification techniques to generate test data for each execution branch.Set of Abstract Syntax Trees (ASTs) is built that describes web application as a whole, both client-and serverside code, by analyzing JavaScript code, its AJAX server calls and callbacks.Constructed AST is converted into an C# function with similar behavior and a set of arguments that represent user inputs.Existing test automation tools are used to discover test data that covers all the possible execution branches in a C# function.Web application test cases are generated with the discovered values, Selenium toolkit is used to emulate user actions and to automatically run the program under test against test cases.