skip to main content
article

Experience report: growing and shrinking polygons for random testing of computational geometry algorithms

Published:04 September 2016Publication History
Skip Abstract Section

Abstract

This paper documents our experience of adapting and using the QuickCheck-style approach for extensive randomised property-based testing of computational geometry algorithms.

The need in rigorous evaluation of computational geometry procedures has naturally arisen in our quest of organising a medium-size programming contest for second year university students—an experiment we conducted as an attempt to introduce them to computational geometry. The main effort in organising the event was implementation of a solid infrastructure for testing and ranking solutions. For this, we employed functional programming techniques. The choice of the language and the paradigm made it possible for us to engineer, from scratch and in a very short period of time, a series of robust geometric primitives and algorithms, as well as implement a scalable framework for their randomised testing.

We describe the main insights, enabling efficient random testing of geometric procedures, and report on our experience of using the testing framework, which helped us to detect and fix a number of issues not just in our programming artefacts, but also in the published algorithms we had implemented.

References

  1. Y. Amit, J. S. B. Mitchell, and E. Packer. Locating guards for visibility coverage of polygons. In ALENEX. SIAM, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. T. Auer and M. Held. Heuristics for the generation of random polygons. In CCCG. Carleton University Press, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. F. Bungiu, M. Hemmer, J. Hershberger, K. Huang, and A. Kröller. Efficient computation of visibility polygons. CoRR, abs/1403.3905, 2014.Google ScholarGoogle Scholar
  4. V. Chvátal. A combinatorial theorem in plane geometry. Journal of Combinatorial Theory, Series B, 18, 1975.Google ScholarGoogle Scholar
  5. K. Claessen and J. Hughes. QuickCheck: a lightweight tool for random testing of Haskell programs. In ICFP. ACM, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. O. Danvy. Back to direct style. Sci. Comput. Program., 22(3), 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. O. Danvy and K. Millikin. Refunctionalization at work. Sci. Comput. Program., 74(8), 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. M. de Berg, O. Cheong, M. van Kreveld, and M. Overmars. Computational Geometry: Algorithms and Applications. Springer-Verlag TELOS, 3rd edition, 2008. ISBN 3540779736, 9783540779735. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. E. Dolstra, J. Hage, B. Heeren, S. Holdermans, J. Jeuring, A. Löh, C. Löh, A. Middelkoop, A. Rodriguez, and J. van Schie. Report on the Tenth ICFP Programming Contest. In ICFP. ACM Press, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. S. Fisk. A short proof of Chvátal’s watchman theorem. J. Comb. Theory, Ser. B, 24(3), 1978.Google ScholarGoogle ScholarCross RefCross Ref
  11. S. Ghosh. Visibility Algorithms in the Plane. Cambridge University Press, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. P. Haller and M. Odersky. Actors that unify threads and events. In COORDINATION, volume 4467 of LNCS. Springer, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. S. Holdermans. Random testing of purely functional abstract datatypes: guidelines for dealing with operation invariance. In PPDP. ACM, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. C. Hritcu, J. Hughes, B. C. Pierce, A. Spector-Zabusky, D. Vytiniotis, A. Azevedo de Amorim, and L. Lampropoulos. Testing noninterference, quickly. In ICFP. ACM, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. J. Hughes. QuickCheck Testing for Fun and Profit. In PADL, volume 4354 of LNCS. Springer, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. B. Joe and R. B. Simpson. Visibility of a simple polygon from a point. Technical Report CS-85-38, Dept. of Math and Computer Science, Drexel University, 1985.Google ScholarGoogle Scholar
  17. B. Joe and R. B. Simpson. Corrections to Lee’s Visibility Polygon Algorithm. BIT Numerical Mathematics, 27(4), 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. D. Lee and A. Lin. Computational complexity of art gallery problems. IEEE Transactions on Information Theory, 32(2), 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. G. H. Meisters. Polygons Have Ears. The American Mathematical Monthly, 82(6), 1975.Google ScholarGoogle Scholar
  20. J. Midtgaard and A. Møller. QuickChecking Static Analysis Properties. In ICST. IEEE, 2015.Google ScholarGoogle ScholarCross RefCross Ref
  21. R. Nilsson. ScalaCheck: The Definitive Guide – Property-based testing on the Java Platform. Artima Press, 2014.Google ScholarGoogle Scholar
  22. M. Odersky and A. Moors. Fighting bit Rot with Types (Experience Report: Scala Collections). In FSTTCS, volume 4 of LIPIcs. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, 2009.Google ScholarGoogle Scholar
  23. B. C. d. S. Oliveira, A. Moors, and M. Odersky. Type classes as objects and implicits. In OOPSLA. ACM, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. J. O’Rourke. Art Gallery Theorems and Algorithms. Oxford University Press, 1987. ISBN 0-19-503965-3. V. St-Amour and N. Toronto. Experience report: applying random testing to a base type environment. In ICFP. ACM, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. A. P. Tomás and A. L. Bajuelos. Quadratic-time linear-space algorithms for generating orthogonal polygons with a given number of vertices. In ICCSA (3), volume 3045 of LNCS. Springer, 2004.Google ScholarGoogle Scholar
  26. D. C. Tozoni, P. J. de Rezende, and C. C. de Souza. The quest for optimal solutions for the Art Gallery Problem: A practical iterative algorithm. In SEA, volume 7933 of LNCS. Springer, 2013.Google ScholarGoogle Scholar
  27. C.-K. Yap. Towards exact geometric computation. Comput. Geom., 7:3–23, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Experience report: growing and shrinking polygons for random testing of computational geometry algorithms

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!