Skip to main content

\(\mathsf {Harvey}\): A System for Random Testing in ASP

  • Conference paper
  • First Online:
Logic Programming and Nonmonotonic Reasoning (LPNMR 2017)

Part of the book series: Lecture Notes in Computer Science ((LNAI,volume 10377))

Abstract

We present \(\mathsf {Harvey}\), a tool for random testing in answer-set programming (ASP) that allows to incorporate constraints to guide the generation of test inputs. Due to the declarative nature of ASP, it can be argued that there is less need for testing than in conventional software development. However, it is shown in practice that testing is still needed when more sophisticated methods are not viable. Random testing is recognised as a simple yet effective method in this regard. The approach described in this paper allows for random testing of answer-set programs in which both test-input generation and determining test verdicts is facilitated using ASP itself: The test-input space is defined using ASP rules and uniformity of test-input selection is achieved by using XOR sampling. This allows to go beyond simple random testing by adding further ASP constraints in the process.

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.

    The name of our tool refers to Harvey Dent, one of the infamous adversaries of Batman, who, under his pseudonym Two-Face, makes all important decisions by flipping a coin.

References

  1. Beizer, B.: Black-Box Testing: Techniques for Functional Testing of Software and Systems. Wiley, New York (1999)

    Google Scholar 

  2. Chakraborty, S., Meel, K.S., Vardi, M.Y.: A scalable and nearly uniform generator of SAT witnesses. In: Sharygina, N., Veith, H. (eds.) CAV 2013. LNCS, vol. 8044, pp. 608–623. Springer, Heidelberg (2013). doi:10.1007/978-3-642-39799-8_40

    Chapter  Google Scholar 

  3. Gomes, C.P., Hoffmann, J., Sabharwal, A., Selman, B.: Short XORs for model counting: from theory to practice. In: Marques-Silva, J., Sakallah, K.A. (eds.) SAT 2007. LNCS, vol. 4501, pp. 100–106. Springer, Heidelberg (2007). doi:10.1007/978-3-540-72788-0_13

    Chapter  Google Scholar 

  4. Gomes, C.P., Sabharwal, A., Selman, B.: Near-uniform sampling of combinatorial spaces using XOR constraints. In: Proceedings of NIPS 2006, pp. 481–488. MIT Press (2006)

    Google Scholar 

  5. Janhunen, T., Niemelä, I., Oetsch, J., Pührer, J., Tompits, H.: On testing answer-set programs. In: Proceedings of ECAI 2010, pp. 951–956. IOS Press (2010)

    Google Scholar 

  6. Janhunen, T., Niemelä, I., Oetsch, J., Pührer, J., Tompits, H.: Random vs. structure-based testing of answer-set programs: An experimental comparison. In: LPNMR 2011, pp. 242–247. Springer (2011)

    Google Scholar 

  7. Janhunen, T., Oikarinen, E.: LPEQ and DLPEQ – translators for automated equivalence testing of logic programs. In: Lifschitz, V., Niemelä, I. (eds.) LPNMR 2004. LNCS, vol. 2923, pp. 336–340. Springer, Heidelberg (2003). doi:10.1007/978-3-540-24609-1_30

    Chapter  Google Scholar 

  8. Myers, G.J.: Art of Software Testing. Wiley, Hoboken (1979)

    Google Scholar 

  9. Oetsch, J., Prischink, M., Pührer, J., Schwengerer, M., Tompits, H.: On the small-scope hypothesis for testing answer-set programs. In: Proceedings of KR 2012, pp. 43–53. AAAI Press (2012)

    Google Scholar 

  10. Oetsch, J., Seidl, M., Tompits, H., Woltran, S.: Testing relativised uniform equivalence under answer-set projection in the system ccT. In: Seipel, D., Hanus, M., Wolf, A. (eds.) INAP/WLP -2007. LNCS, vol. 5437, pp. 241–246. Springer, Heidelberg (2009). doi:10.1007/978-3-642-00675-3_16

    Chapter  Google Scholar 

  11. Potassco – The Potsdam answer set solving collection. https://potassco.org/

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Johannes Oetsch .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2017 Springer International Publishing AG

About this paper

Cite this paper

Greßler, A., Oetsch, J., Tompits, H. (2017). \(\mathsf {Harvey}\): A System for Random Testing in ASP. In: Balduccini, M., Janhunen, T. (eds) Logic Programming and Nonmonotonic Reasoning. LPNMR 2017. Lecture Notes in Computer Science(), vol 10377. Springer, Cham. https://doi.org/10.1007/978-3-319-61660-5_21

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-61660-5_21

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-61659-9

  • Online ISBN: 978-3-319-61660-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics