![]() ![]() By analyzing the execution traces, the invariant detector is able, for instance, to find the following invariant: the number of products in the cart of a user must be always equal to the number of products she/he added in-or removed from-the cart (e.g., if five products have been added and then two have been removed, an automatically generated invariant will check that the cart contains three products). The resulting log will include information concerning interesting values shown on the web pages (e.g., the number of products in the carts during the users’ navigations) and the info about every action performed by the users (e.g., adding or removing products). As a first step, it is required to trace a large number of user sessions. As an example of possible additional assertion, consider a simple online shop web application. The assertion generator of Ts-Ext can benefit from a Daikon-like automatic invariant detector. Examples include: being constant ( x = a), nonzero ( x ! = 0), being in a range ( a <= x <= b), linear relationships ( y = ax + b), ordering ( x <= y), functions from a library ( x = f( y)), containment ( x belongs y), sortedness ( x is sorted). Invariants can be used in assert statements, documentation, and formal specifications. ![]() An invariant is a property that can be relied upon to be true during the execution of a program or a portion of it. More in detail, assertions can be created by levering on dynamic detection of likely invariants techniques similar to the ones implemented in Daikon. To produce these novel test cases a Web crawler will be employed to discover unexplored paths while input data and assertions will be computed by means of an input generator, leveraging available user-session data (i.e., data gathered when users exercise a Web application, as seen in Section 5.5), and using a tool for generating assertions. More in detail, Ts-Ext will: (1) mine existing test code to infer existing input data and assertions, (2) execute the test code to find already explored web application paths, and (3) expand the initial human-written test suite with other novel test cases. The idea is the following: by starting from an existing limited test suite, Ts-Ext will extend it automatically adding more test cases so as to cover unexplored paths in the web graph model. ![]() Similarly to Fard et al., who proposed the Testilizer tool, we believe that these problems can be faced by combining the manual approach with an automated one. There are three specific problems to address: (1) automated input generation, (2) paths selection (among the unbounded number of behaviors) and (3) assertions generation. To implement Ts-Ext a web crawler is necessary, i.e., a program that automatically retrieves web pages of a target application and builds a web graph model where, in the simplest case, nodes are web pages and edges are hyperlinks between pages. With improving the effectiveness of the target test suite we mean: augmenting the coverage and fault finding capability of the test suite. The goal of the Ts-Ext (Test Suite EXTender) prototype is to improve the effectiveness of the target test suite by extending it. Human-written test suites can be a gold mine, i.e., a valuable source of domain knowledge related to which interactions are more important to cover, which data have been used as inputs, and what elements on the page need to be asserted and how. Andrea Stocco, in Advances in Computers, 2019 5.6 Extending Existing Test Suites With Ts-EXT ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |