Behaviour-driven model development and test-driven model reviewBehaviour-Driven Model Development and Test-Driven Model Review combines Behaviour-Driven Development concepts, Model-Driven Development and Model-Based Testing to auto-generate code and associated tests.https://repo.valu3s.eu/method/behaviour-driven-model-development-and-test-driven-model-review-1https://repo.valu3s.eu/@@site-logo/logo_valu3s_green_transparent.png
Behaviour-driven model development and test-driven model review
Behaviour-Driven Model Development and Test-Driven Model Review combines Behaviour-Driven Development concepts, Model-Driven Development and Model-Based Testing to auto-generate code and associated tests.
Develop high-quality behaviour models in UML that are fit for test and code generation. High-quality functional tests are a side-product. The model can also be used to generate non-functional tests.
Behaviour-Driven Model Development and Test-Driven Model Review combines Behaviour-Driven Development [BHM1] concepts, Model-Driven Development and Model-Based Testing in the following steps:
Define the test interface as methods and signal receptions in UML class diagrams
Express scenarios from the requirements as UML sequence diagrams
Model the required behaviour as UML state machine diagrams
While doing so, continually run the scenarios from the sequence diagrams against the state machines. The modeler gets feedback which scenarios do not run through yet and where they get stuck.
Validate, that the scenarios work on the finished state machine models
Evaluate coverage of the scenarios on the state machines
Generate a minimal set of tests to complete the coverage
Review the generated tests – they represent all behaviour that might have been unintentionally added while modelling the state machines.
Go back and change the model and the initial scenarios, if necessary and repeat.
Use the model to generate code
Run the original and the generated scenarios against
the generated code (to exclude problems introduced by the code generator)
the target compiled code (to exclude problems introduced by the compiler or the platform)
the deployed binary in the target environment (to exclude problems introduced by the environment and production periphery)
The approach has been described in more detail in [BHM2], it is similar to Behaviour-Driven Formal Model Development [BHM3].
Produces high-quality behaviour models
Enables domain experts to review the model indirectly by reviewing scenarios
Only limited tool support available yet
[BHM1] Solis and X. Wang, “A study of the characteristics of behaviour-driven development,” in2011 37th EUROMICRO Conference on Software Engineering and Advanced Applications, pp. 383–387.
[BHM2] Schlick R., Krenn W. (2019) Tackling the Challenges of Internet-of-Things-Development using Models. 2ndInternational Workshop on Embedded Software for the Industrial IOT, DATE, Florence, 2019.
[BHM3] Snook C. et al. (2018) Behaviour-Driven Formal Model Development. In: Sun J., Sun M. (eds) Formal Methods and Software Engineering. ICFEM 2018. Lecture Notes in Computer Science, vol 11232. Springer, Cham. https://doi.org/10.1007/978-3-030-02450-5_2