Skip to main content
Log in

Using search-based algorithms for Ajax event sequence generation during testing

  • Published:
Empirical Software Engineering Aims and scope Submit manuscript

Abstract

Modern Web applications offer a rich and unique user experience by taking advantages of the so called Web 2.0 technologies, among which Ajax. Ajax supports the intensive use of asynchronous communication between client-pages and the Web server and it allows on-the-fly manipulations of client-pages content and structure to realize a rich, dynamic and interactive user interface. Correspondingly, new types of faults that cannot be easily revealed by existing Web testing techniques are associated with modern Ajax-based applications. In our previous investigations, we used state-based testing for event sequence generation and it proved to be quite effective in exposing Ajax specific faults. However, the search space of the semantically interacting event sequences is huge, as it can grow exponentially with the event sequence length. In this paper, we apply search-based algorithms, namely hill climbing and simulated annealing, to the problem of generating maximally diverse event sequences of various lengths. In this way, we control the size of the generated test suites, while keeping the included test cases as diverse as possible. We evaluate the performance of the algorithms on two open source Ajax applications.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8

Similar content being viewed by others

Notes

  1. Document Object Model, see http://www.w3.org/DOM.

  2. The tool and additional information on its usage can be found at http://selab.fbk.eu/marchetto/tools/ajax/reAJAX.

  3. http://www.openqa.org/selenium

  4. http://tudu.sourceforge.net

  5. http://bpt.hpi.uni-potsdam.de/Oryx

  6. The tool, additional information about the experimentation, and raw data are available at: http://selab.fbk.eu/marchetto/tools/ajax/testing1/experimentData.zip.

  7. (Tudu) http://sourceforge.net/tracker/?group_id=131842&atid=722407. (Oryx) http://code.google.com/p/oryx-editor/issues/list

  8. The computation time for all the algorithms has been computed on a desktop PC with an Intel(R) Core(TM) 2 Duo CPU working at 2.66 GHz and with 3GB of RAM memory.

References

  • Andrews A, Offutt J, Alexander R (2005) Testing web applications by modeling with FSMs. Softw Syst Model 4(3):326–345

    Article  Google Scholar 

  • Bozdag E, Mesbah A, van Deursen A (2009) Performance testing of data delivery techniques for ajax applications. J Web Eng 8(4):477–492

    Google Scholar 

  • Cheon Y, Kim MY, Perumandla A (2005) A complete automation of unit testing for Java programs. In: Proc. of the international conference on software engineering research and practice (SERP05), USA, pp 290–295

  • Dallmeier V, Lindig C, Wasylkowski A, Zeller A (2006) Mining object behavior with ADABU. In: Proc. of the international workshop on dynamic analysis (WODA), Shangai, China, pp 17–24

  • Elbaum S, Rothermel G, Karre S, Fisher M (2005) Leveraging user session data to support web application testing. IEEE Trans Softw Eng 31(3):187–202

    Article  Google Scholar 

  • Gatlin KS (2004) Trials and tribulations of debugging concurrency. ACM Queue 2(7):67–73

    Article  Google Scholar 

  • Kirkpatrick S, Gelatt CD, Vecchi MP (1983) Optimization by simulated annealing. Science 220(4598):671–680

    Article  MathSciNet  Google Scholar 

  • Marchetto A, Tonella P (2009) Search-based testing of ajax web applications. In: Proc. of IEEE international symposium on search based software engineering (SSBSE). IEEE Computer Society, Windsor, pp 3–13

  • Marchetto A, Tonella P, Ricca F (2008a) A case study-based comparison of web testing techniques applied to ajax web applications. Int J Softw Tools Technol Transf (STTT) 10(6):477–492

    Article  Google Scholar 

  • Marchetto A, Tonella P, Ricca F (2008b) State-based testing of ajax web applications. In: Proc. of IEEE international conference on software testing (ICST), Lillehammer, Norway, pp 121–131

  • Marchetto A, Tonella P, Ricca F (2010) Under and over approximation of state models for ajax applications. In Proc. of IEEE European conference on software maintenance and reengineering (CSMR), Madrid, Spain, pp 241–245

  • McMinn P (2004) Seach-based software test data generation: a survey. Software testing, verification and reliability, Wiley

  • Mesbah A, van Deursen A (2009) Invariant-based automatic testing of ajax user interfaces. In: Proc. of the international conference on software engineering (ICSE). IEEE Computer Society, Vancouver, pp 210–220

  • Nikolik B (2006) Test diversity. Inf Softw Technol 48:1083–1094

    Article  Google Scholar 

  • Pargas R, Harrold MJ, Peck R (1999) Test-data generation using genetic algorithms. Softw Test Verif Reliab 9:263–282

    Article  Google Scholar 

  • Patton RM, Wu AS, Walton GH (2003) A genetic algorithm approach to focused software usage testing. Software engineering with computational intelligence, Kluwer Academic

  • Ricca F, Tonella P (2001) Analysis and testing of Web applications. In: Proc. of the international conference on software engineering (ICSE), Toronto, Canada, pp 25–34

  • Russell SJ, Norvig P (2003). Artificial intelligence: a modern approach. Prentice Hall, NJ

    Google Scholar 

  • Suman B, Kumar P (2006) A survey of simulated annealing as tool for single and multiobjective optimization. J Oper Res Soc 57:1143–1160

    Article  MATH  Google Scholar 

  • Turner CD, Robson DJ (1993) The state-based testing of object-oriented programs. In: Proc. of the international conference on software maintenance (ICSM), pp 302–310

  • Xiong J, Williams M, Price J (2006) Testing Ajax applications with Selenium. InfoQ magazine. http://www.infoq.com/articles/testing-ajax-selenium (last visit: 2010)

  • Yuan X, Memon A (2008) Alternating gui test generation and execution. In: Proc. of IEEE testing: academic and industrial conference (TAIC PART). IEEE Computer Society, Washington, pp 23–33

  • Yuan X, Memon AM (2007) Using GUI run-time state as feedback to generate test cases. In: Proc. the international conference on software engineering (ICSE), 23–25 May 2007. IEEE Computer Society, Washington, pp 396–405

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Alessandro Marchetto.

Additional information

Editors: Massimiliano Di Penta and Simon Poulding

Appendix

Appendix

In this section we provide additional data computed during the case study for both applications, but not included in the main sections of the paper for space reasons.

Table 9 Chi-square p-values computed to compare the distribution of test cases of Tudu generated by HILL and SA with respect to SEM/ALT
Table 10 Chi-square p-values computed to compare the distribution of test cases of Oryx generated by HILL and SA with respect to SEM/ALT
Table 11 Percentage of revealed faults, out of 15 injected into Tudu and 13 into Oryx
Table 12 Fault revealing test cases ratio
Table 13 Fault detection capability ratio

Rights and permissions

Reprints and permissions

About this article

Cite this article

Marchetto, A., Tonella, P. Using search-based algorithms for Ajax event sequence generation during testing. Empir Software Eng 16, 103–140 (2011). https://doi.org/10.1007/s10664-010-9149-1

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10664-010-9149-1

Keywords

Navigation