Skip to main content

N-Gram Based Test Sequence Generation from Finite State Models

  • Conference paper
  • First Online:
Future Internet Testing (FITTEST 2013)

Part of the book series: Lecture Notes in Computer Science ((LNISA,volume 8432))

Included in the following conference series:

  • 379 Accesses

Abstract

Model based testing offers a powerful mechanism to test applications that change dynamically and continuously, for which only some limited black-box knowledge is available (this is typically the case of future internet applications). Models can be inferred from observations of real executions and test cases can be derived from models, according to various strategies (e.g., graph or random visits). The problem is that a relatively large proportion of the test cases obtained in this way might result to be non executable, because they involve infeasible paths.

In this paper, we propose a novel test case derivation strategy, based on the computation of the \(N\)-gram statistics. Event sequences are generated for which the subsequences of size \(N\) respect the distribution of the \(N\)-tuples observed in the execution traces. In this way, generated and observed sequences share the same context (up to length \(N\)), hence increasing the likelihood for the generated ones of being actually executable. A consequence of the increased proportion of feasible test cases is that model coverage is also expected to increase.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    http://www.adobe.com/devnet/flex/samples/flex_store_v2.html

  2. 2.

    http://project.cyclos.org

  3. 3.

    EU FP7 project n. 257574.

References

  1. Dias Neto, A.C., Subramanyan, R., Vieira, M., Travassos, G.H.: A survey on model-based testing approaches: a systematic review. In: Proceedings of the International Workshop on Empirical Assessment of Software Engineering Languages and Technologies (Co-located with ASE ’07), WEASELTech ’07, New York, USA, pp. 31–36. ACM (2007)

    Google Scholar 

  2. Mariani, L., Marchetto, A., Nguyen, C.D., Tonella, P., Baars, A.I.: Revolution: automatic evolution of mined specifications. In: Proceedings of the 23rd IEEE International Symposium on Software, Reliability Engineering (ISSRE), pp. 241–250 (2012)

    Google Scholar 

  3. Dallmeier, V., Lindig, C., Wasylkowski, A., Zeller, A.: Mining object behavior with ADABU. In: Proceedings of the 2006 International Workshop on Dynamic Systems Analysis WODA ’06, New York, USA, pp. 17–24. ACM (2006)

    Google Scholar 

  4. Biermann, A., Feldman, J.: On the synthesis of finite-state machines from samples of their behavior. IEEE Trans. Comput. 21(6), 592–597 (1972)

    Article  MATH  MathSciNet  Google Scholar 

  5. Krka, I., Brun, Y., Popescu, D., Garcia, J., Medvidovic, N.: Using dynamic execution traces and program invariants to enhance behavioral model inference. In: ICSE (2), pp. 179–182 (2010)

    Google Scholar 

  6. Lorenzoli, D., Mariani, L., Pezzè, M.: Automatic generation of software behavioral models. In: 30th International Conference on Software Engineering (ICSE). IEEE Computer Society (2008)

    Google Scholar 

  7. Tonella, P., Marchetto, A., Nguyen, C.D., Jia, Y., Lakhotia, K., Harman, M.: Finding the optimal balance between over and under approximation of models inferred from execution logs. In: Proceedings of the Fifth IEEE International Conference on Software Testing, Verification and Validation (ICST), pp. 21–30 (2012)

    Google Scholar 

  8. Hedley, D., Hennell, M.A.: The causes and effects of infeasible paths in computer programs. In: Proceedings of the 8th International Conference on Software Engineering ICSE ’85, Los Alamitos, CA, USA, pp. 259–266. IEEE Computer Society Press (1985)

    Google Scholar 

  9. Jurafsky, D., Martin, J.H.: Speech and Language Processing: An Introduction to Speech Recognition, Computational Linguistics and Natural Language Processing. Pearson Prentice Hall, Englewood Cliffs (2007)

    Google Scholar 

  10. Pezzè, M., Young, M.: Software Testing and Analysis: Process Principles and Techniques. Wiley, Hoboken (2007)

    Google Scholar 

  11. Shafique, M., Labiche, Y.: A systematic review of model based testing tool support. Technical Report SCE-10-04, Carleton University, Canada (2010)

    Google Scholar 

  12. Briand, L.C., Labiche, Y.: A UML-based approach to system testing. In: Gogolla, M., Kobryn, C. (eds.) UML 2001. LNCS, vol. 2185, pp. 194–208. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  13. Kim, Y., Hong, H., Bae, D., Cha, S.: Test cases generation from UML state diagrams. IEE Proc. Softw. 146(4), 187–192 (1999)

    Article  Google Scholar 

  14. Turner, C.D., Robson, D.J.: The state-based testing of object-oriented programs. In: Proceedings of the Conference on Software Maintenance (ICSM), Montreal, Canada, pp. 302–310. IEEE Computer Society (1993)

    Google Scholar 

  15. Yuan, X., Memon, A.M.: Using GUI run-time state as feedback to generate test cases. In: Proceedings the International Conference on Software Engineering (ICSE), Washington, DC, USA, pp. 396–405. IEEE Computer Society (2007)

    Google Scholar 

  16. Marchetto, A., Tonella, P., Ricca, F.: State-based testing of ajax web applications. In: Proceedings of IEEE International Conference on Software Testing (ICST), Lillehammer, Norway, pp. 121–131 (2008)

    Google Scholar 

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

    Article  Google Scholar 

  18. Dallmeier, V., Lindig, C., Wasylkowski, A., Zeller, A.: Mining object behavior with ADABU. In: Proceedings of the International Workshop on Dynamic Analysis (WODA), Shangai, China, pp. 17–24 (2006)

    Google Scholar 

  19. Dallmeier, V., Knopp, N., Mallon, C., Hack, S., Zeller, A.: Generating test cases for specification mining. In: Proceedings of the 19th International Symposium on Software Testing and Analysis ISSTA ’10, New York, USA, pp. 85–96. ACM (2010)

    Google Scholar 

  20. Offutt, J., Abdurazik, A.: Generating tests from UML specifications. In: France, R., Rumpe, B. (eds.) UML 1999. LNCS, vol. 1723, pp. 416–429. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  21. Stocks, P., Carrington, D.: A framework for specification-based testing. IEEE Trans. Softw. Eng. 22, 777–793 (1996)

    Article  Google Scholar 

  22. Corbett, J.C., Dwyer, M.B., Hatcliff, J., Laubach, S., Pasareanu, C.S., Robby, Zheng, H.: Bandera: extracting finite-state models from java source code. In: Proceedings of the International Conference on Software Engineering, pp. 439–448 (2000)

    Google Scholar 

  23. Walkinshaw, N., Bogdanov, K., Damas, C., Lambeau, B., Dupont, P.: A framework for the competitive evaluation of model inference techniques. In: Proceedings of the International Workshop on Model Inference in Testing (MIIT) (2010)

    Google Scholar 

Download references

Acknowledgments

This work has been funded by the European Union FP7 project FITTEST (grant agreement n. 257574).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Paolo Tonella .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this paper

Cite this paper

Tonella, P., Tiella, R., Nguyen, C.D. (2014). N-Gram Based Test Sequence Generation from Finite State Models. In: Vos, T., Lakhotia, K., Bauersfeld, S. (eds) Future Internet Testing. FITTEST 2013. Lecture Notes in Computer Science(), vol 8432. Springer, Cham. https://doi.org/10.1007/978-3-319-07785-7_4

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-07785-7_4

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-07784-0

  • Online ISBN: 978-3-319-07785-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics