Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/2951913.2951927acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

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

Published: 04 September 2016 Publication History

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.
[2]
T. Auer and M. Held. Heuristics for the generation of random polygons. In CCCG. Carleton University Press, 1996.
[3]
F. Bungiu, M. Hemmer, J. Hershberger, K. Huang, and A. Kröller. Efficient computation of visibility polygons. CoRR, abs/1403.3905, 2014.
[4]
V. Chvátal. A combinatorial theorem in plane geometry. Journal of Combinatorial Theory, Series B, 18, 1975.
[5]
K. Claessen and J. Hughes. QuickCheck: a lightweight tool for random testing of Haskell programs. In ICFP. ACM, 2000.
[6]
O. Danvy. Back to direct style. Sci. Comput. Program., 22(3), 1994.
[7]
O. Danvy and K. Millikin. Refunctionalization at work. Sci. Comput. Program., 74(8), 2009.
[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.
[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.
[10]
S. Fisk. A short proof of Chvátal’s watchman theorem. J. Comb. Theory, Ser. B, 24(3), 1978.
[11]
S. Ghosh. Visibility Algorithms in the Plane. Cambridge University Press, 2007.
[12]
P. Haller and M. Odersky. Actors that unify threads and events. In COORDINATION, volume 4467 of LNCS. Springer, 2007.
[13]
S. Holdermans. Random testing of purely functional abstract datatypes: guidelines for dealing with operation invariance. In PPDP. ACM, 2013.
[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.
[15]
J. Hughes. QuickCheck Testing for Fun and Profit. In PADL, volume 4354 of LNCS. Springer, 2007.
[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.
[17]
B. Joe and R. B. Simpson. Corrections to Lee’s Visibility Polygon Algorithm. BIT Numerical Mathematics, 27(4), 1987.
[18]
D. Lee and A. Lin. Computational complexity of art gallery problems. IEEE Transactions on Information Theory, 32(2), 1986.
[19]
G. H. Meisters. Polygons Have Ears. The American Mathematical Monthly, 82(6), 1975.
[20]
J. Midtgaard and A. Møller. QuickChecking Static Analysis Properties. In ICST. IEEE, 2015.
[21]
R. Nilsson. ScalaCheck: The Definitive Guide – Property-based testing on the Java Platform. Artima Press, 2014.
[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.
[23]
B. C. d. S. Oliveira, A. Moors, and M. Odersky. Type classes as objects and implicits. In OOPSLA. ACM, 2010.
[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.
[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.
[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.
[27]
C.-K. Yap. Towards exact geometric computation. Comput. Geom., 7:3–23, 1997.

Cited By

View all
  • (2018)Teaching how to program using automated assessment and functional glossy games (experience report)Proceedings of the ACM on Programming Languages10.1145/32367772:ICFP(1-17)Online publication date: 30-Jul-2018
  • (2018)QuickChecking Patricia TreesTrends in Functional Programming10.1007/978-3-319-89719-6_4(59-78)Online publication date: 19-Apr-2018

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ICFP 2016: Proceedings of the 21st ACM SIGPLAN International Conference on Functional Programming
September 2016
501 pages
ISBN:9781450342193
DOI:10.1145/2951913
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 04 September 2016

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Art Gallery Problem
  2. QuickCheck
  3. Scala
  4. computational geometry
  5. random testing
  6. visibility

Qualifiers

  • Research-article

Conference

ICFP'16
Sponsor:

Acceptance Rates

Overall Acceptance Rate 333 of 1,064 submissions, 31%

Upcoming Conference

ICFP '25
ACM SIGPLAN International Conference on Functional Programming
October 12 - 18, 2025
Singapore , Singapore

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)2
  • Downloads (Last 6 weeks)1
Reflects downloads up to 13 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2018)Teaching how to program using automated assessment and functional glossy games (experience report)Proceedings of the ACM on Programming Languages10.1145/32367772:ICFP(1-17)Online publication date: 30-Jul-2018
  • (2018)QuickChecking Patricia TreesTrends in Functional Programming10.1007/978-3-319-89719-6_4(59-78)Online publication date: 19-Apr-2018

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media