
BHive: Behaviour-Driven Development Meets B-Method by John Douglas Carter A Thesis presented to The University of Guelph In partial fulfilment of requirements for the degree of Doctor of Philosophy in Computer Science Guelph, Ontario, Canada © John Douglas Carter, March, 2017 ABSTRACT BHIVE: BEHAVIOUR-DRIVEN DEVELOPMENT MEETS B-METHOD John Douglas Carter Advisor: University of Guelph, 2017 Professor W. B. Gardner Behaviour-Driven Development (BDD) is an agile, “outside-in” approach to software development built upon semi-formal mediums for specifying the behavior of a sys- tem as it would be observed externally. Through the representation of a system as a collection of user stories and scenarios using BDD's notation, practitioners automate acceptance tests using examples of desired behavior for the envisioned system. A for- mal model created in concert with BDD tests would provide valuable insight into test validity and enhance the visibility of the problem domain. This work called BHive builds upon the formal underpinnings of BDD scenarios by mapping their “Given,” “When,” and “Then” statements to “Precondition,” “Command,” and “Postcondi- tion” constructs as introduced by Floyd-Hoare logic. We posit that this mapping allows for a B-Method representation to be created and that such a model is useful for exploring system behavior and exposing gaps in requirements and test plans. In combining BDD with B-Method through BHive, a bridge between the worlds of agile and formal is created, reaping benefits of both approaches. We also outline exten- sions to BDD tooling required for the described integration and present benefits of the BHive approach to integrating formalism within a BDD project. Acknowledgments I would like to thank the following people for their support throughout this project: • Dr. Bill Gardner for his supervision, instruction, support and patience throughout the research project. • My advisory committee for their 11th-hour contributions of time. • The support staff at the University of Guelph who were always helpful despite my living 500 km off campus. • My parents, Lynn and Don Carter, for their support. • My grandparents, the late John and Jean Murray, and Doug and Eileen Carter. • Dave Rooney, for many productive discussions on agile methods and book recommen- dations. • Marion Scott, for her support throughout the work, not the least being her enthusiasm for last-minute babysitting. iii Dedication This work is dedicated to my family: My wife, Katherine Anne Scott, who never doubted my completion and has kept the world turning for the past months of “shock work.” My sons Huck, Willie, and Abe who are anxious to have their dad back and their tree house built. John Douglas Carter Richmond, Ontario, Canada March 2017 iv Table of Contents Acknowledgments . iii Dedication . iv Table of Contents . .v List of Tables . viii List of Figures . ix Chapter 1 Introduction . .1 1.1 Agile? Formal? Why not both? . .5 1.2 Bridging agile and formal development . .8 1.3 Road map . .10 Chapter 2 Context of BHive . .11 2.1 BDD Development Process . .12 2.1.1 Concentric Development Processes . .13 2.1.2 Going Green with Test Doubles. .15 2.2 Using B-Method to Discover Problems with Global Mutable State . .16 Chapter 3 Related Work . .18 3.1 Development Approaches Leading to BDD . .18 3.1.1 Extreme Programming . .18 3.1.2 Test-Driven Development (TDD) . .20 3.2 Behaviour-Driven Development (BDD) . .25 3.2.1 BDD Tooling . .26 3.2.2 Invoking Tooling . .28 3.2.3 Tooling Packages . .29 3.3 Approaches Related to BDD . .32 3.3.1 Specification By Example . .32 3.3.2 Domain-Driven Design (DDD) . .32 3.3.3 Example-Driven Modeling (EDM) . .34 3.3.4 Acceptance Test Driven Development (ATDD) . .35 3.4 Formalisms. .35 3.4.1 B-Method . .35 3.4.2 Event-B. .37 3.4.3 Hoare Logic . .37 3.5 Combining agile and formal methods . .38 3.5.1 Specification-Driven Development . .38 3.5.2 Formal Specification-Driven Development . .40 v Chapter 4 Approach . .42 4.1 The Search for a Third Way. .42 4.2 Theoretical Underpinnings of BHive. .46 4.2.1 Naming. .48 4.2.2 Types and Constants. .48 4.2.3 State . .50 4.2.4 Scenarios . .51 4.2.5 BHive Directives . .53 4.2.6 Guidelines and Practices for Applying BHive . .57 4.3 Joining BHive and Behave. .58 4.3.1 Features . .60 4.3.2 Scenarios . .60 4.3.3 Steps . .62 4.3.4 Step Functions . .62 4.3.5 Implementing with Behave . .68 4.3.6 Integrating BHive. .72 4.3.7 Synthesis of “Start_Machine” . .75 4.3.8 Test Case Generation . .76 4.3.9 Scenario Outlines . .79 4.3.10 Typing in BHive. .79 4.4 Complete Example. .80 Chapter 5 Case Study . .85 5.1 Introducing the IPTV Application . .87 5.1.1 Launching IPTV. .88 5.1.2 Home Screen . .89 5.1.3 Lander Screen. .89 5.1.4 Media Details Screen . .91 5.1.5 Player Screen.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages151 Page
-
File Size-