Skip to main content
Top

2019 | OriginalPaper | Chapter

Property-Based Test Case Generators for Free

Authors : Emanuele De Angelis, Fabio Fioravanti, Adrián Palacios, Alberto Pettorossi, Maurizio Proietti

Published in: Tests and Proofs

Publisher: Springer International Publishing

Activate our intelligent search to find suitable subject content or patents.

search-config
loading …

Abstract

Property-Based Testing requires the programmer to write suitable generators, i.e., programs that generate (possibly in a random way) input values for which the program under test should be run. However, the process of writing generators is quite a costly, error-prone activity. In the context of Property-Based Testing of Erlang programs, we propose an approach to relieve the programmer from the task of writing generators. Our approach allows the automatic, efficient generation of input test values that satisfy a given specification. In particular, we have considered the case when the input values are data structures satisfying complex constraints. That generation is performed via the symbolic execution of the specification using constraint logic programming.

Dont have a licence yet? Then find out more about our products and how to get one now:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Footnotes
1
More detailed information about types and contract specifications can be found at http://​erlang.​org/​doc/​reference_​manual/​typespec.​html
 
Literature
2.
go back to reference Arts, Th., Hughes, J., Johansson, J., Wiger, U.T.: Testing telecoms software with Quviq QuickCheck. In: Feeley, M., Trinder, Ph.W., (eds.) Proceedings of the 2006 ACM SIGPLAN Workshop on Erlang, Portland, Oregon, USA, 16 September 2006, pp. 2–10. ACM (2006) Arts, Th., Hughes, J., Johansson, J., Wiger, U.T.: Testing telecoms software with Quviq QuickCheck. In: Feeley, M., Trinder, Ph.W., (eds.) Proceedings of the 2006 ACM SIGPLAN Workshop on Erlang, Portland, Oregon, USA, 16 September 2006, pp. 2–10. ACM (2006)
4.
go back to reference Boyapati, C., Khurshid, S., Marinov, D.: Korat: automated testing based on Java predicates. In: Proceedings of the 2002 ACM SIGSOFT International Symposium on Software Testing and Analysis, pp. 123–133. ACM, New York (2002)CrossRef Boyapati, C., Khurshid, S., Marinov, D.: Korat: automated testing based on Java predicates. In: Proceedings of the 2002 ACM SIGSOFT International Symposium on Software Testing and Analysis, pp. 123–133. ACM, New York (2002)CrossRef
7.
go back to reference Cheney, J., Momigliano, A.: \(\alpha \)Check: a mechanized metatheory model checker. Theory Pract. Log. Program. 17(3), 311–352 (2017)MathSciNetCrossRef Cheney, J., Momigliano, A.: \(\alpha \)Check: a mechanized metatheory model checker. Theory Pract. Log. Program. 17(3), 311–352 (2017)MathSciNetCrossRef
8.
go back to reference Claessen, K., Hughes, J.: QuickCheck: a lightweight tool for random testing of Haskell programs. In: Odersky, M., Wadler, Ph. (eds.) Proceedings of the 5th ACM SIGPLAN International Conference on Functional Programming (ICFP 2000), Montreal, Canada, 18–21 September 2000, pp. 268–279. ACM (2000) Claessen, K., Hughes, J.: QuickCheck: a lightweight tool for random testing of Haskell programs. In: Odersky, M., Wadler, Ph. (eds.) Proceedings of the 5th ACM SIGPLAN International Conference on Functional Programming (ICFP 2000), Montreal, Canada, 18–21 September 2000, pp. 268–279. ACM (2000)
9.
go back to reference Coppit, D., Le, W., Sullivan, K.J., Khurshid, S., Yang, J.: Software assurance by bounded exhaustive testing. IEEE Trans. Softw. Eng. 31(4), 328–339 (2005)CrossRef Coppit, D., Le, W., Sullivan, K.J., Khurshid, S., Yang, J.: Software assurance by bounded exhaustive testing. IEEE Trans. Softw. Eng. 31(4), 328–339 (2005)CrossRef
10.
go back to reference Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 3rd edn. MIT Press, Cambridge (2009)MATH Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 3rd edn. MIT Press, Cambridge (2009)MATH
13.
go back to reference Fioravanti, F., Proietti, M., Senni, V.: Efficient generation of test data structures using constraint logic programming and program transformation. J. Log. Comput. 25(6), 1263–1283 (2015)MathSciNetCrossRef Fioravanti, F., Proietti, M., Senni, V.: Efficient generation of test data structures using constraint logic programming and program transformation. J. Log. Comput. 25(6), 1263–1283 (2015)MathSciNetCrossRef
14.
go back to reference Gligoric, M., Gvero, T., Jagannath, V., Khurshid, S., Kuncak, V., Marinov, D.: Test generation through programming in UDITA. In: Kramer, J., Bishop, J., Devanbu, P.T., Uchitel, S. (eds.) Proceedings of the 32nd ACM/IEEE International Conference on Software Engineering, Cape Town, South Africa, 2–8 May 2010, pp. 225–234. ACM (2010) Gligoric, M., Gvero, T., Jagannath, V., Khurshid, S., Kuncak, V., Marinov, D.: Test generation through programming in UDITA. In: Kramer, J., Bishop, J., Devanbu, P.T., Uchitel, S. (eds.) Proceedings of the 32nd ACM/IEEE International Conference on Software Engineering, Cape Town, South Africa, 2–8 May 2010, pp. 225–234. ACM (2010)
15.
go back to reference Godefroid, P., Klarlund, N., Sen, K.: DART: directed automated random testing. In: Sarkar, V., Hall, M.W. (eds.) Proceedings of the ACM SIGPLAN 2005 Conference on Programming Language Design and Implementation, Chicago, IL, USA, 12–15 June 2005, pp. 213–223. ACM (2005) Godefroid, P., Klarlund, N., Sen, K.: DART: directed automated random testing. In: Sarkar, V., Hall, M.W. (eds.) Proceedings of the ACM SIGPLAN 2005 Conference on Programming Language Design and Implementation, Chicago, IL, USA, 12–15 June 2005, pp. 213–223. ACM (2005)
16.
go back to reference Gómez-Zamalloa, M., Albert, E., Puebla, G.: Test case generation for object-oriented imperative languages in CLP. Theory Pract. Log. Program. 10(4–6), 659–674 (2010)MathSciNetCrossRef Gómez-Zamalloa, M., Albert, E., Puebla, G.: Test case generation for object-oriented imperative languages in CLP. Theory Pract. Log. Program. 10(4–6), 659–674 (2010)MathSciNetCrossRef
17.
go back to reference Gotlieb, A.: Euclide: a constraint-based testing framework for critical C programs. In: 2nd International Conference on Software Testing, Verification and Validation, ICST 2009, Denver, Colorado, USA, 1–4 April 2009, pp. 151–160. IEEE Computer Society (2009) Gotlieb, A.: Euclide: a constraint-based testing framework for critical C programs. In: 2nd International Conference on Software Testing, Verification and Validation, ICST 2009, Denver, Colorado, USA, 1–4 April 2009, pp. 151–160. IEEE Computer Society (2009)
19.
go back to reference Hewitt, C., Bishop, P., Steiger, R.: A universal modular ACTOR formalism for artificial intelligence. In: Proceedings of the 3rd International Joint Conference on Artificial Intelligence, IJCAI 1973, San Francisco, CA, USA, pp. 235–245. Morgan Kaufmann Publishers Inc. (1973) Hewitt, C., Bishop, P., Steiger, R.: A universal modular ACTOR formalism for artificial intelligence. In: Proceedings of the 3rd International Joint Conference on Artificial Intelligence, IJCAI 1973, San Francisco, CA, USA, pp. 235–245. Morgan Kaufmann Publishers Inc. (1973)
20.
21.
go back to reference Jones, N.D., Gomard, C.K., Sestoft, P.: Partial Evaluation and Automatic Program Generation. Prentice Hall, Upper Saddle River (1993)MATH Jones, N.D., Gomard, C.K., Sestoft, P.: Partial Evaluation and Automatic Program Generation. Prentice Hall, Upper Saddle River (1993)MATH
23.
go back to reference Kowalski, R.A.: Logic for Problem Solving. North Holland, Amsterdam (1979)MATH Kowalski, R.A.: Logic for Problem Solving. North Holland, Amsterdam (1979)MATH
24.
go back to reference Lampropoulos, L., Paraskevopoulou, Z., Pierce, B.C.: Generating good generators for inductive relations. In: Proceedings of the ACM on Programming Languages, vol. 2, pp. 45:1–45:30 (2017)CrossRef Lampropoulos, L., Paraskevopoulou, Z., Pierce, B.C.: Generating good generators for inductive relations. In: Proceedings of the ACM on Programming Languages, vol. 2, pp. 45:1–45:30 (2017)CrossRef
25.
go back to reference Marre, B.: Toward automatic test data set selection using algebraic specifications and logic programming. In: Furukawa, K. (eds.) Logic Programming, Proceedings of the 8th International Conference, Paris, France, 24–28 June 1991, pp. 202–219. MIT Press (1991) Marre, B.: Toward automatic test data set selection using algebraic specifications and logic programming. In: Furukawa, K. (eds.) Logic Programming, Proceedings of the 8th International Conference, Paris, France, 24–28 June 1991, pp. 202–219. MIT Press (1991)
26.
go back to reference Marre, B., Arnould, A.: Test sequences generation from LUSTRE descriptions: GATeL. In: Proceedings of the 15th IEEE International Conference on Automated Software Engineering, ASE 2000, Grenoble, France, 11–15 September 2000, p. 229. IEEE Computer Society (2000) Marre, B., Arnould, A.: Test sequences generation from LUSTRE descriptions: GATeL. In: Proceedings of the 15th IEEE International Conference on Automated Software Engineering, ASE 2000, Grenoble, France, 11–15 September 2000, p. 229. IEEE Computer Society (2000)
27.
go back to reference Papadakis, M., Sagonas, K.: A PropEr integration of types and function specifications with property-based testing. In: Rikitake, K., Stenman, E. (eds.) Proceedings of the 10th ACM SIGPLAN Workshop on Erlang, Tokyo, Japan, 23 September 2011, pp. 39–50. ACM (2011) Papadakis, M., Sagonas, K.: A PropEr integration of types and function specifications with property-based testing. In: Rikitake, K., Stenman, E. (eds.) Proceedings of the 10th ACM SIGPLAN Workshop on Erlang, Tokyo, Japan, 23 September 2011, pp. 39–50. ACM (2011)
29.
go back to reference Pretschner, A., Lötzbeyer, H.: Model based testing with constraint logic programming: first results and challenges. In: Proceedings of the 2nd ICSE Workshop on Automated Program Analysis, Testing and Verification (WAPATV), pp. 1–9 (2001) Pretschner, A., Lötzbeyer, H.: Model based testing with constraint logic programming: first results and challenges. In: Proceedings of the 2nd ICSE Workshop on Automated Program Analysis, Testing and Verification (WAPATV), pp. 1–9 (2001)
31.
go back to reference Runciman, C., Naylor, M., Lindblad, F.: SmallCheck and lazy SmallCheck: automatic exhaustive testing for small values. In: Gill, A. (ed.) Proceedings of the 1st ACM SIGPLAN Symposium on Haskell, Haskell 2008, Victoria, BC, Canada, 25 September 2008, pp. 37–48. ACM (2008) Runciman, C., Naylor, M., Lindblad, F.: SmallCheck and lazy SmallCheck: automatic exhaustive testing for small values. In: Gill, A. (ed.) Proceedings of the 1st ACM SIGPLAN Symposium on Haskell, Haskell 2008, Victoria, BC, Canada, 25 September 2008, pp. 37–48. ACM (2008)
34.
go back to reference Sen, K., Marinov, D., Agha, G.: CUTE: a concolic unit testing engine for C. In: Wermelinger, M., Gall, H.C. (eds.) Proceedings of the 10th European Software Engineering Conference held jointly with 13th ACM SIGSOFT International Symposium on Foundations of Software Engineering, 2005, Lisbon, Portugal, 5–9 September 2005, pp. 263–272. ACM (2005) Sen, K., Marinov, D., Agha, G.: CUTE: a concolic unit testing engine for C. In: Wermelinger, M., Gall, H.C. (eds.) Proceedings of the 10th European Software Engineering Conference held jointly with 13th ACM SIGSOFT International Symposium on Foundations of Software Engineering, 2005, Lisbon, Portugal, 5–9 September 2005, pp. 263–272. ACM (2005)
36.
go back to reference Virding, R., Wikström, C., Williams, M.: Concurrent programming in Erlang, 2nd edn. In: Armstrong, J. (ed.) Prentice Hall International Ltd, Hertfordshire (1996) Virding, R., Wikström, C., Williams, M.: Concurrent programming in Erlang, 2nd edn. In: Armstrong, J. (ed.) Prentice Hall International Ltd, Hertfordshire (1996)
37.
go back to reference Williams, N., Marre, B., Mouy, P., Roger, M.: PathCrawler: automatic generation of path tests by combining static and dynamic analysis. In: Dal Cin, M., Kaâniche, M., Pataricza, A. (eds.) EDCC 2005. LNCS, vol. 3463, pp. 281–292. Springer, Heidelberg (2005). https://doi.org/10.1007/11408901_21CrossRef Williams, N., Marre, B., Mouy, P., Roger, M.: PathCrawler: automatic generation of path tests by combining static and dynamic analysis. In: Dal Cin, M., Kaâniche, M., Pataricza, A. (eds.) EDCC 2005. LNCS, vol. 3463, pp. 281–292. Springer, Heidelberg (2005). https://​doi.​org/​10.​1007/​11408901_​21CrossRef
39.
go back to reference Yatoh, K., Sakamoto, K., Ishikawa, F., Honiden, S.: ArbitCheck: a highly automated property-based testing tool for Java. In: Proceedings of the 7th IEEE International Conference on Software Testing, Verification, and Validation Workshops, ICSTW 2014, Cleveland, Ohio, USA, 31 March–April 4 2014, pp. 405–412. IEEE Computer Society (2014) Yatoh, K., Sakamoto, K., Ishikawa, F., Honiden, S.: ArbitCheck: a highly automated property-based testing tool for Java. In: Proceedings of the 7th IEEE International Conference on Software Testing, Verification, and Validation Workshops, ICSTW 2014, Cleveland, Ohio, USA, 31 March–April 4 2014, pp. 405–412. IEEE Computer Society (2014)
Metadata
Title
Property-Based Test Case Generators for Free
Authors
Emanuele De Angelis
Fabio Fioravanti
Adrián Palacios
Alberto Pettorossi
Maurizio Proietti
Copyright Year
2019
DOI
https://doi.org/10.1007/978-3-030-31157-5_12

Premium Partner