-
Notifications
You must be signed in to change notification settings - Fork 99
Writing_Tests
Unit testing is an essential instrument in GAMA. It allows the modeler to define a set of assertions that will be tested. Before the execution of the embedded set of instructions, if a setup is defined in the species, model or experiment, it is executed. In a test, if one assertion fails, the evaluation of other assertions continue.
In this unit testing tutorial, we intend to show how to write unit tests in GAML using the statement test
.
In GAML, the statement test
allows to write a part of code to verify if portions of our GAML model are doing exactly what they are written for. This is done independently from other parts.
To write a typical GAML unit test, we can follow three steps:
- Define a set of attributes to use within the test.
- Write initialisation instructions
- Write assertions.
The aim of using unit test is to observe the resulting behaviour of some parts of our model. If the observed behaviour is consistent with the expectations, the unit test passes, otherwise, it fails, indicating that there is a problem concerning the tested part of the model.
- Installation and Launching
- Workspace, Projects and Models
- Editing Models
- Running Experiments
- Running Headless
- Preferences
- Troubleshooting
- Introduction
- Manipulate basic Species
- Global Species
- Defining Advanced Species
- Defining GUI Experiment
- Exploring Models
- Optimizing Model Section
- Multi-Paradigm Modeling
- Manipulate OSM Data
- Diffusion
- Using Database
- Using FIPA ACL
- Using BDI with BEN
- Using Driving Skill
- Manipulate dates
- Manipulate lights
- Using comodel
- Save and restore Simulations
- Using network
- Headless mode
- Using Headless
- Writing Unit Tests
- Ensure model's reproducibility
- Going further with extensions
- Built-in Species
- Built-in Skills
- Built-in Architecture
- Statements
- Data Type
- File Type
- Expressions
- Exhaustive list of GAMA Keywords
- Installing the GIT version
- Developing Extensions
- Introduction to GAMA Java API
- Using GAMA flags
- Creating a release of GAMA
- Documentation generation