25.07.2014 Views

Analysis and Testing of Ajax-based Single-page Web Applications

Analysis and Testing of Ajax-based Single-page Web Applications

Analysis and Testing of Ajax-based Single-page Web Applications

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Robot<br />

event<br />

UI<br />

Embedded<br />

Browser<br />

generate event<br />

update<br />

event<br />

Crawljax Controller<br />

DOM<br />

event<br />

update<br />

<strong>Ajax</strong><br />

Engine<br />

Analyze<br />

Dom<br />

DOM<br />

Analyzer<br />

update<br />

State<br />

Machine<br />

Legend<br />

Access<br />

Control flow<br />

Event invocation<br />

Data component<br />

Processing component<br />

inCrawling<br />

plugins<br />

postCrawling<br />

plugins<br />

Static file<br />

Implementation<br />

DOM<br />

Validator<br />

Test-case<br />

Generator<br />

Test<br />

Cases<br />

Transform<br />

DOM to HTML<br />

report<br />

DB<br />

report<br />

Test<br />

Executor<br />

Validate HTML<br />

Validation<br />

Report<br />

Test<br />

Report<br />

Coverage<br />

Report<br />

Figure 6.3 Processing view <strong>of</strong> ATUSA.<br />

inCrawling occurs after each detected state change, different types <strong>of</strong> invariants<br />

can be checked through plugins such as Validated DOM, Consistent<br />

Back-button, <strong>and</strong> No Error Messages in DOM.<br />

postCrawling occurs after the crawling process is done <strong>and</strong> the state-flow<br />

graph is inferred fully. The graph can be used, for instance, in a plugin<br />

to generate test cases from.<br />

Algorithms 4 <strong>and</strong> 5 show the hooks along the crawling process. For each<br />

phase, Atusa provides the tester with specific APIs to implement plugins for<br />

validation <strong>and</strong> fault detection. Atusa <strong>of</strong>fers generic invariant checking components,<br />

a plugin-mechanism to add application-specific state validators, <strong>and</strong><br />

generation <strong>of</strong> a test suite from the inferred state-flow graph. Figure 6.3 depicts<br />

the processing view <strong>of</strong> Atusa, showing only the DOM Validator <strong>and</strong> Test Case<br />

Generator as examples <strong>of</strong> possible plugin implementations.<br />

Atusa supports looking for many different types <strong>of</strong> faults in <strong>Ajax</strong>-<strong>based</strong><br />

applications, from errors in the DOM instance, to errors that involve the nav-<br />

140 6.8. Tool Implementation: Atusa

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!