Abstract
AbstractThe importance of Agent-Based Simulation (ABS) as scientific method to generate data for scientific models in general and for informed policy decisions in particular has been widely recognised. However, the important technique of code testing of implementations like unit testing has not generated much research interested so far. As a possible solution, in previous work we have explored the conceptual use of property-based testing. In this code testing method, model specifications and invariants are expressed directly in code and tested through automated and randomised test data generation. This paper expands on our previous work and explores how to use property-based testing on a technical level to encode and test specifications of ABS. As use case the simple agent-based SIR model is used, where it is shown how to test agent behaviour, transition probabilities and model invariants. The outcome are specifications expressed directly in code, which relate whole classes of random input to expected classes of output. During test execution, random test data is generated automatically, potentially covering the equivalent of thousands of unit tests, run within seconds on modern hardware. This makes property-based testing in the context of ABS strictly more powerful than unit testing, as it is a much more natural fit due to its stochastic nature.
Publisher
Springer Science and Business Media LLC
Reference36 articles.
1. Asta, S., Özcan, E., & Siebers, P. O. (2014). An investigation on test driven discrete event simulation. In Operational research society simulation workshop 2014 (SW14). http://eprints.nottingham.ac.uk/28211/.
2. Axelrod, R. (1995). The convergence and stability of cultures: Local convergence and global polarization. Working paper, Santa Fe Institute. http://econpapers.repec.org/paper/wopsafiwp/95-03-028.htm.
3. Axelrod, R. (1997). Advancing the art of simulation in the social sciences. In R. Conte, R. Hegselmann, & P. Terna (Eds.), Simulating social phenomena (pp. 21–40). Berlin: Springer. https://doi.org/10.1007/978-3-662-03366-1_2.
4. Axelrod, R. (2006). Chapter 33 agent-based modeling as a bridge between disciplines. In L. T. A. K. L. Judd (Ed.), Handbook of computational economics (Vol. 2, pp. 1565–1584). Amsterdam: Elsevier. https://doi.org/10.1016/S1574-0021(05)02033-2.
5. Axelrod, R., & Tesfatsion, L. (2006). A guide for newcomers to agent-based modeling in the social sciences. Staff general research papers archive, Iowa State University, Department of Economics. http://econpapers.repec.org/paper/isugenres/12515.htm.