Skip to main content

Legislation-driven development of a Gift Aid system using Event-B


This work presents our approach to formally model the Swiftaid system design, a digital platform that enables donors to automatically add Gift Aid to donations made via card payments. Following principles of Behaviour-Driven Development, we use Gherkin to capture requirements specified in legislation, specifically the UK Charity (Gift Aid Declarations) Regulations 2016. The Gherkin scenarios provide a basis for subsequent formal modelling and analysis using Event-B, Rodin and ProB. Interactive model simulations assist communication between domain experts, software architects and other stakeholders during requirements capture and system design, enabling the emergent system behaviour to be validated. Our approach was employed within the development of the real Swiftaid product, launched by Streeva in February 2019. Our analysis helped conclude that there was not a strong enough business case for one of the features, whichwas shown to provide nominal user convenience at the expense of increased complexity. This work provides a case study in allying formal and agile software development to enable rapid development of robust software.


  1. Abrial, J.-R., Butler, M., Hallerstede, S., Hoang, T.S., Mehta, F., Voisin, L.: Rodin: an open toolset for modelling and reasoning in Event-B. Int J Softw Tools Technol Transf 12(6), 447–466 (2010)

    Article  Google Scholar 

  2. Abrial, J.-R.: The B-book: assigning programs to meanings. Cambridge University Press, Cambridge (1996)

    Book  Google Scholar 

  3. Abrial, J.-R.: Modeling in EventB: system and software engineering. Cambridge University Press, Cambridge (2010)

    Book  Google Scholar 

  4. Behave: behavior-driven development, python style. Accessed 24 May 2019

  5. Carter J (2017) BHive: behaviour-driven development meets B-method. Ph.D. thesis, The University of Guelph

  6. Common criteria for information technology security evaluation. V3.1r5. Technical report, Common Criteria (2017)

  7. Cucumber: 10 minute tutorial. Accessed 24 May 2019

  8. Cucumber: a tool that supports behaviour-driven development. Accessed 24 May 2019

  9. Falampin, J., Le-Dang, H., Leuschel, M., Mokrani, M., Plagge, D.: Improving railway data validation with ProB, pp. 27–43. Springer, Berlin (2013)

    Google Scholar 

  10. Gherkin Reference: Cucumber. Accessed 24 May 2019

  11. Gmehlich, R., Jones, C.: Experience of deployment in the automotive industry, pp. 13–26. Springer, Berlin (2013)

    Google Scholar 

  12. Hallerstede, S., Leuschel, M., Plagge, D.: Validation of formal models by refinement animation. Sci Comput Program 78(3), 272–292 (2013)

    Article  Google Scholar 

  13. HMRC (2016) The donations to charity (gift aid declarations) regulations 2016. Statutory instruments

  14. HMRC (2018a) Alternative method of VAT collection—split payment. Summary of responses

  15. HMR (2018b) Charitable giving and gift aid. HMRC research report 482

  16. HMRC (2018c) Measuring tax gaps 2018 edition. An official statistics release

  17. Hoare, C.A.R.: An axiomatic basis for computer programming. Commun. ACM 12(10), 576–580 (1969)

    Article  Google Scholar 

  18. Hansen D, Schneider D, Leuschel M (2016) Using B and ProB for data validation projects. In: Proceedings ABZ 2016, pp 167–182. Springer International Publishing

  19. Hoang, T.S., Schneider, S., Treharne, H., Williams, D.M.: Foundations for using linear temporal logic in Event-B refinement. Formal Asp Comput 28(6), 909–935 (2016)

    MathSciNet  Article  Google Scholar 

  20. Ilić, D., Laibinis, L., Latvala, T., Troubitsyna, E., Varpaaniemi, K.: Deployment in the space sector, pp. 45–62. Springer, Berlin (2013)

    Google Scholar 

  21. JBehave: a framework for behaviour-driven development. Accessed 24 May 2019

  22. Leuschel, M., Butler, M.: ProB: A model checker for B. FME 2003: formal methods, pp. 855–874. Springer, Berlin (2003)

    Chapter  Google Scholar 

  23. Larsen PG, Fitzgerald JS, Wolff S (2010) Are formal methods ready for agility? a reality check. Technical report no. CS-TR-1218, Newcastle University

  24. Ladenberger L, Leuschel M (2016) BMotionWeb: A tool for rapid creation of formal prototypes. In: Software engineering and formal methods—14th international conference, SEFM 2016, Held as part of STAF 2016, Vienna, Austria, July 4–8, 2016, Proceedings, pp 403–417

  25. Manifesto for agile software development. Accessed 24 May 2019

  26. Principles behind the agile manifesto. Accessed 24 May 2019

  27. North D (2006) Introducing behaviour-driven development (BDD). Better Software

  28. Romanovsky, A., Thomas, M.: Industrial deployment of system engineering methods providing high dependability and productivity. Springer, Berlin (2013)

    Book  Google Scholar 

  29. Siqueira FL, de Sousa TC, Silva PSM (2017) Using BDD and SBVR to refine business goals into an Event-B model: a research idea. In: 2017 IEEE/ACM 5th international FME workshop on formal methods in software engineering (FormaliSE), pp 31–36. IEEE

  30. Snook C, Hoang TS, Dghyam D, Butler M, Fischer T, Schlick R, Wang K (2018) Behaviour-driven formal model development. In: Formal methods and software engineering, pp 21–36. Springer

  31. Smart JF (2015) BDD in action: behavior-driven development for the whole software lifecycle. Manning

  32. Streeva. Swiftaid. Accessed 09 July 2019

  33. Schneider, S., Treharne, H., Wehrheim, H.: The behavioural semantics of Event-B refinement. Formal Asp Comput 26(2), 251–280 (2014)

    MathSciNet  Article  Google Scholar 

  34. Solis C, Wang X (2011) A study of the characteristics of behaviour driven development. In: 2011 37th EUROMICRO conference on software engineering and advanced applications, pp 383–387. IEEE

  35. UKRI gateway to research: Swift Aid project reference 133294. Accessed 24 May 2019

  36. Woodcock, J., Davies, J.: Using Z: specification, refinement, and proof. Prentice Hall, Upper Saddle River (1996)

    MATH  Google Scholar 

  37. Williams, D.M., Darwish, S., Schneider, S., Michael, D.R.: Swiftaid rodin event-b models. Zonodo (2020).

    Article  Google Scholar 

  38. Wieczorek, S., Kozyura, V., Wei, W., Roth, A., Stefanescu, A.: Business information sector, pp. 63–79. Springer, Berlin (2013)

    Google Scholar 

  39. Werth M, Leuschel M (2020) VisB: A lightweight tool to visualize formal models with SVG graphics. In: Proceedings ABZ 2020, LNCS

Download references


This work was funded by UKRI through the Innovate UK Swiftaid Project (Grant Number 133294). We thank Chris Chorley and Dr. François Dupressoir for contributing to the specification of Gherkin scenarios and Event-B modelling and we thank Dr. Benjamin Aziz and Dr. Philip Godsiff for insightful comments on an early draft of this paper. We also thank the anonymous reviewers for providing their essential critical insight.

Author information



Corresponding author

Correspondence to David M. Williams.

Additional information

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Michael Butler

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Williams, D.M., Darwish, S., Schneider, S. et al. Legislation-driven development of a Gift Aid system using Event-B. Form Asp Comp 32, 251–273 (2020).

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI:


  • Behaviour-driven development
  • Formal modelling
  • Gherkin
  • Event-B
  • Gift Aid
  • Swiftaid