SlideShare una empresa de Scribd logo
1 de 15
Given When Then
           and other styles
                  for
  documenting (testable) requirements
The Given-When-Then style
of writing requirements
clarifies thinking.
  "Given" defines the preconditions
  that hold before an event or operation.

 • "When" identifies an event or operation

 • "Then" identifies the post conditions
   that hold after the event or operation.
We can apply Given-When-Then at
  three levels of requirements writing
  to document intended

1. business events (business behavior) involved
    at the highest level (organization/user actor)

2. user interface for business process proxies

3. code behavior at the unit-test level (robot actor).
Business Process Level:

Given:[business goal / strategy]
When: [business process / event]
Then: [desired business behavior]

(This can be tested by a process audit.)
User Interface Level:

Given: [user-interface context / mode]
 When: [user action]
 Then: [system response]



(This can be tested through the UI. )
Robot / Computer Level:


Given: [system state]
 When: [system event / input / additional state ]

 Then: [expected system post-condition]



(This can be automated via xUnit framework.)
At the business process level, our focus is
on describing the business context of a set
of requirements.

Given: The survey (ballot) is published (on-line);
       and, the survey (voting) period is in-progress.

When: A respondent (voter) enters a vote on a ballot item.

Then: That vote is tallied.

Then: The vote is secret.
      (It can be authenticated. But, it cannot be traced.)

Then: The voter can audit
      (verify that their entry is in the collection).
The interface level requirement identifies the interaction
between actors.
Typically, one actor is a user and the second actor is the
system.
(In an Enterprise Integration scenario, it might be two robots.)


Given: The user is signed-in
        and authenticated
        and has navigated to the survey (ballot) panel.
When: Some question is a proposal.
Then: The allowed responses are Yes, No, and Abstain.
        Abstain is the default value.
But we cannot write an automated test without
knowing a great deal about the design.
However, the design can be indicated with
Given-When-Then also.
Given: A ballot or survey represented in XML.

When: The ballot contains a proposal.

Then: The XML representation includes the
       pattern:"<proposal>text</proposal>".

Then: The interface-builder (component)
        will generate user interface code (HTML)
          from the XML.
At this point, a competent programmer can write code that conforms to this design.
 The executable test might look like this (Smalltalk):

test1234ballotProposalXMLGeneratesHTML
 "The allowed responses for a proposal are Yes, No, and Abstain."
 | ballot ballotElement proposalElement html |
 self given: [ ballot := XML element: 'ballot'
                              with: [ XML element: 'proposal'
                                              with: ['proposal text'].
                                    ].
             "configuration comes from setUp"
             builder := configuration interfaceBuilder.

           ]
     when: [ ballotElement := ballot nextElement.
              proposalElement := ballotElement content at: 1.
              self assert: ( proposalElement isTag: 'proposal' ).
              html := builder buildHTMLfrom: proposalElement.
           ]
     then: [ self assert: ( html includes: 'Yes' ).
              self assert: ( html includes: 'No' ).
              self assert: ( html includes: 'Abstain' ).
           ].
Some things cannot be
completely automated.
• We cannot prove that HTML will execute properly.
• We cannot prove that generated code is conceptually
  correct.
• The previous Given-When-Then’s did not specify
  if widgets would be radio-buttons or pull-downs.
  But that is probably a good thing.
Compare: User Story
• Template:
   As a <role name>,
   I need <business capability>,
   in order to <business benefit statement>.
• A user story is a reminder to have a
  deeper conversation with the user
  (or user rep).
• It provides a place-holder in the backlog.
Compare: Use Case
 Title: (Identify the situation or end-use.)
 Preconditions: (Specify context. “Given”)
 Scenario: (Describe interaction / steps. “When-Then”)
 Post Conditions: (Expected effects. “Then”)
 Business Rules: (Identify policy constraints.)
Given When Then
clarifies thinking because:
Given clause makes context and assumptions
        more explicit.
When clause indicates when/where
      new behavior is expected.
Then clauses indicate expected results
       (actions / end-states).
GitHub Resources

• https://github.com/RichardAlexanderGreen/
  GivenWhenThen
• See also:
 • https://github.com/KentBeck/TDD-Tyrant
 • https://github.com/pivotal/jasmine

Más contenido relacionado

La actualidad más candente

DevOps with GitHub Actions
DevOps with GitHub ActionsDevOps with GitHub Actions
DevOps with GitHub ActionsNilesh Gule
 
Flutter tutorial for Beginner Step by Step
Flutter tutorial for Beginner Step by StepFlutter tutorial for Beginner Step by Step
Flutter tutorial for Beginner Step by StepChandramouli Biyyala
 
Shields Up! Securing React Apps
Shields Up! Securing React AppsShields Up! Securing React Apps
Shields Up! Securing React AppsZachary Klein
 
CICD Pipeline Using Github Actions
CICD Pipeline Using Github ActionsCICD Pipeline Using Github Actions
CICD Pipeline Using Github ActionsKumar Shìvam
 
The complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide showThe complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide showSubhas Malik
 
Specification-By-Example with Gherkin
Specification-By-Example with GherkinSpecification-By-Example with Gherkin
Specification-By-Example with GherkinChristian Hassa
 
Introduction to flutter's basic concepts
Introduction to flutter's basic conceptsIntroduction to flutter's basic concepts
Introduction to flutter's basic conceptsKumaresh Chandra Baruri
 
GitHub Actions with Node.js
GitHub Actions with Node.jsGitHub Actions with Node.js
GitHub Actions with Node.jsStefan Stölzle
 
Getting Started With Cypress
Getting Started With CypressGetting Started With Cypress
Getting Started With CypressKnoldus Inc.
 
[Public] gerrit concepts and workflows
[Public] gerrit   concepts and workflows[Public] gerrit   concepts and workflows
[Public] gerrit concepts and workflowsYanbin Kong
 
Allure framework
Allure frameworkAllure framework
Allure frameworkartkoshelev
 
Selenium test automation
Selenium test automationSelenium test automation
Selenium test automationSrikanth Vuriti
 
BDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVABDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVASrinivas Katakam
 

La actualidad más candente (20)

DevOps with GitHub Actions
DevOps with GitHub ActionsDevOps with GitHub Actions
DevOps with GitHub Actions
 
Flutter tutorial for Beginner Step by Step
Flutter tutorial for Beginner Step by StepFlutter tutorial for Beginner Step by Step
Flutter tutorial for Beginner Step by Step
 
Shields Up! Securing React Apps
Shields Up! Securing React AppsShields Up! Securing React Apps
Shields Up! Securing React Apps
 
CICD Pipeline Using Github Actions
CICD Pipeline Using Github ActionsCICD Pipeline Using Github Actions
CICD Pipeline Using Github Actions
 
How to install android sdk
How to install android sdkHow to install android sdk
How to install android sdk
 
Introduction git
Introduction gitIntroduction git
Introduction git
 
Visual Studio
Visual StudioVisual Studio
Visual Studio
 
The complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide showThe complete ASP.NET (IIS) Tutorial with code example in power point slide show
The complete ASP.NET (IIS) Tutorial with code example in power point slide show
 
Specification-By-Example with Gherkin
Specification-By-Example with GherkinSpecification-By-Example with Gherkin
Specification-By-Example with Gherkin
 
Introduction to flutter's basic concepts
Introduction to flutter's basic conceptsIntroduction to flutter's basic concepts
Introduction to flutter's basic concepts
 
Flutter workshop
Flutter workshopFlutter workshop
Flutter workshop
 
GitHub Actions with Node.js
GitHub Actions with Node.jsGitHub Actions with Node.js
GitHub Actions with Node.js
 
Getting Started With Cypress
Getting Started With CypressGetting Started With Cypress
Getting Started With Cypress
 
[Public] gerrit concepts and workflows
[Public] gerrit   concepts and workflows[Public] gerrit   concepts and workflows
[Public] gerrit concepts and workflows
 
Swift勉強会
Swift勉強会Swift勉強会
Swift勉強会
 
React native
React nativeReact native
React native
 
Version control
Version controlVersion control
Version control
 
Allure framework
Allure frameworkAllure framework
Allure framework
 
Selenium test automation
Selenium test automationSelenium test automation
Selenium test automation
 
BDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVABDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVA
 

Similar a Given When Then

How to build twitter bot using golang from scratch
How to build twitter bot using golang from scratchHow to build twitter bot using golang from scratch
How to build twitter bot using golang from scratchKaty Slemon
 
J developer 11g components ppt
J developer 11g components pptJ developer 11g components ppt
J developer 11g components pptTUSHAR VARSHNEY
 
Ivanti Cheat Sheet by Traversys Limited
Ivanti Cheat Sheet by Traversys LimitedIvanti Cheat Sheet by Traversys Limited
Ivanti Cheat Sheet by Traversys LimitedTim Read
 
jBPM5 Community Training Module #5: Domain Specific Processes
jBPM5 Community Training Module #5: Domain Specific ProcessesjBPM5 Community Training Module #5: Domain Specific Processes
jBPM5 Community Training Module #5: Domain Specific ProcessesMauricio (Salaboy) Salatino
 
Using prime[31] to connect your unity game to azure mobile services
Using prime[31] to connect your unity game to azure mobile servicesUsing prime[31] to connect your unity game to azure mobile services
Using prime[31] to connect your unity game to azure mobile servicesDavid Voyles
 
Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008Jonas Follesø
 
13. session 13 introduction to dhtml
13. session 13   introduction to dhtml13. session 13   introduction to dhtml
13. session 13 introduction to dhtmlPhúc Đỗ
 
Appcelerator Titanium Kinetic practices part 1
Appcelerator Titanium Kinetic practices part 1Appcelerator Titanium Kinetic practices part 1
Appcelerator Titanium Kinetic practices part 1フ乇丂ひ丂
 
Architecting single-page front-end apps
Architecting single-page front-end appsArchitecting single-page front-end apps
Architecting single-page front-end appsZohar Arad
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event HandlingWebStackAcademy
 
Automating Workflows Through Bullhorn and Partners
Automating Workflows Through Bullhorn and PartnersAutomating Workflows Through Bullhorn and Partners
Automating Workflows Through Bullhorn and PartnersJeremyOtt5
 
Build a game with javascript (april 2017)
Build a game with javascript (april 2017)Build a game with javascript (april 2017)
Build a game with javascript (april 2017)Thinkful
 
]project-open[ Workflow Developer Tutorial Part 2
]project-open[ Workflow Developer Tutorial Part 2]project-open[ Workflow Developer Tutorial Part 2
]project-open[ Workflow Developer Tutorial Part 2Klaus Hofeditz
 
]project-open[ Workflow Developer Tutorial Part 3
]project-open[ Workflow Developer Tutorial Part 3]project-open[ Workflow Developer Tutorial Part 3
]project-open[ Workflow Developer Tutorial Part 3Klaus Hofeditz
 
Acceptance Testing With Selenium
Acceptance Testing With SeleniumAcceptance Testing With Selenium
Acceptance Testing With Seleniumelliando dias
 
Agile methodologies based on BDD and CI by Nikolai Shevchenko
Agile methodologies based on BDD and CI by Nikolai ShevchenkoAgile methodologies based on BDD and CI by Nikolai Shevchenko
Agile methodologies based on BDD and CI by Nikolai ShevchenkoMoldova ICT Summit
 
Creating azure logic app for salesforce integration | Webner
Creating azure logic app for salesforce integration | WebnerCreating azure logic app for salesforce integration | Webner
Creating azure logic app for salesforce integration | WebnerChandanWebner
 

Similar a Given When Then (20)

How to build twitter bot using golang from scratch
How to build twitter bot using golang from scratchHow to build twitter bot using golang from scratch
How to build twitter bot using golang from scratch
 
J developer 11g components ppt
J developer 11g components pptJ developer 11g components ppt
J developer 11g components ppt
 
Ivanti Cheat Sheet by Traversys Limited
Ivanti Cheat Sheet by Traversys LimitedIvanti Cheat Sheet by Traversys Limited
Ivanti Cheat Sheet by Traversys Limited
 
jBPM5 Community Training Module #5: Domain Specific Processes
jBPM5 Community Training Module #5: Domain Specific ProcessesjBPM5 Community Training Module #5: Domain Specific Processes
jBPM5 Community Training Module #5: Domain Specific Processes
 
Using prime[31] to connect your unity game to azure mobile services
Using prime[31] to connect your unity game to azure mobile servicesUsing prime[31] to connect your unity game to azure mobile services
Using prime[31] to connect your unity game to azure mobile services
 
Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008
 
Dojo1.0_Tutorials
Dojo1.0_TutorialsDojo1.0_Tutorials
Dojo1.0_Tutorials
 
Dojo1.0_Tutorials
Dojo1.0_TutorialsDojo1.0_Tutorials
Dojo1.0_Tutorials
 
13. session 13 introduction to dhtml
13. session 13   introduction to dhtml13. session 13   introduction to dhtml
13. session 13 introduction to dhtml
 
Appcelerator Titanium Kinetic practices part 1
Appcelerator Titanium Kinetic practices part 1Appcelerator Titanium Kinetic practices part 1
Appcelerator Titanium Kinetic practices part 1
 
Javascript session 1
Javascript session 1Javascript session 1
Javascript session 1
 
Architecting single-page front-end apps
Architecting single-page front-end appsArchitecting single-page front-end apps
Architecting single-page front-end apps
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event Handling
 
Automating Workflows Through Bullhorn and Partners
Automating Workflows Through Bullhorn and PartnersAutomating Workflows Through Bullhorn and Partners
Automating Workflows Through Bullhorn and Partners
 
Build a game with javascript (april 2017)
Build a game with javascript (april 2017)Build a game with javascript (april 2017)
Build a game with javascript (april 2017)
 
]project-open[ Workflow Developer Tutorial Part 2
]project-open[ Workflow Developer Tutorial Part 2]project-open[ Workflow Developer Tutorial Part 2
]project-open[ Workflow Developer Tutorial Part 2
 
]project-open[ Workflow Developer Tutorial Part 3
]project-open[ Workflow Developer Tutorial Part 3]project-open[ Workflow Developer Tutorial Part 3
]project-open[ Workflow Developer Tutorial Part 3
 
Acceptance Testing With Selenium
Acceptance Testing With SeleniumAcceptance Testing With Selenium
Acceptance Testing With Selenium
 
Agile methodologies based on BDD and CI by Nikolai Shevchenko
Agile methodologies based on BDD and CI by Nikolai ShevchenkoAgile methodologies based on BDD and CI by Nikolai Shevchenko
Agile methodologies based on BDD and CI by Nikolai Shevchenko
 
Creating azure logic app for salesforce integration | Webner
Creating azure logic app for salesforce integration | WebnerCreating azure logic app for salesforce integration | Webner
Creating azure logic app for salesforce integration | Webner
 

Más de Richard Green

Inventing The Next Business Programming Language
Inventing The Next Business Programming LanguageInventing The Next Business Programming Language
Inventing The Next Business Programming LanguageRichard Green
 
Agile SOA - Agile EAI
Agile SOA - Agile EAIAgile SOA - Agile EAI
Agile SOA - Agile EAIRichard Green
 
Practical Ontology For Enterprise Data Management
Practical Ontology For Enterprise Data ManagementPractical Ontology For Enterprise Data Management
Practical Ontology For Enterprise Data ManagementRichard Green
 
Zen and Enterprise Architecture
Zen and Enterprise ArchitectureZen and Enterprise Architecture
Zen and Enterprise ArchitectureRichard Green
 
Agile Architecture (MAE slides)
Agile Architecture (MAE slides)Agile Architecture (MAE slides)
Agile Architecture (MAE slides)Richard Green
 
Agile Architecture (MAE slides with speaker notes)
Agile Architecture (MAE slides with speaker notes)Agile Architecture (MAE slides with speaker notes)
Agile Architecture (MAE slides with speaker notes)Richard Green
 

Más de Richard Green (8)

Inventing The Next Business Programming Language
Inventing The Next Business Programming LanguageInventing The Next Business Programming Language
Inventing The Next Business Programming Language
 
User stories
User storiesUser stories
User stories
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithms
 
Agile SOA - Agile EAI
Agile SOA - Agile EAIAgile SOA - Agile EAI
Agile SOA - Agile EAI
 
Practical Ontology For Enterprise Data Management
Practical Ontology For Enterprise Data ManagementPractical Ontology For Enterprise Data Management
Practical Ontology For Enterprise Data Management
 
Zen and Enterprise Architecture
Zen and Enterprise ArchitectureZen and Enterprise Architecture
Zen and Enterprise Architecture
 
Agile Architecture (MAE slides)
Agile Architecture (MAE slides)Agile Architecture (MAE slides)
Agile Architecture (MAE slides)
 
Agile Architecture (MAE slides with speaker notes)
Agile Architecture (MAE slides with speaker notes)Agile Architecture (MAE slides with speaker notes)
Agile Architecture (MAE slides with speaker notes)
 

Último

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 

Último (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 

Given When Then

  • 1. Given When Then and other styles for documenting (testable) requirements
  • 2. The Given-When-Then style of writing requirements clarifies thinking. "Given" defines the preconditions that hold before an event or operation. • "When" identifies an event or operation • "Then" identifies the post conditions that hold after the event or operation.
  • 3. We can apply Given-When-Then at three levels of requirements writing to document intended 1. business events (business behavior) involved at the highest level (organization/user actor) 2. user interface for business process proxies 3. code behavior at the unit-test level (robot actor).
  • 4. Business Process Level: Given:[business goal / strategy] When: [business process / event] Then: [desired business behavior] (This can be tested by a process audit.)
  • 5. User Interface Level: Given: [user-interface context / mode] When: [user action] Then: [system response] (This can be tested through the UI. )
  • 6. Robot / Computer Level: Given: [system state] When: [system event / input / additional state ] Then: [expected system post-condition] (This can be automated via xUnit framework.)
  • 7. At the business process level, our focus is on describing the business context of a set of requirements. Given: The survey (ballot) is published (on-line); and, the survey (voting) period is in-progress. When: A respondent (voter) enters a vote on a ballot item. Then: That vote is tallied. Then: The vote is secret. (It can be authenticated. But, it cannot be traced.) Then: The voter can audit (verify that their entry is in the collection).
  • 8. The interface level requirement identifies the interaction between actors. Typically, one actor is a user and the second actor is the system. (In an Enterprise Integration scenario, it might be two robots.) Given: The user is signed-in and authenticated and has navigated to the survey (ballot) panel. When: Some question is a proposal. Then: The allowed responses are Yes, No, and Abstain. Abstain is the default value.
  • 9. But we cannot write an automated test without knowing a great deal about the design. However, the design can be indicated with Given-When-Then also. Given: A ballot or survey represented in XML. When: The ballot contains a proposal. Then: The XML representation includes the pattern:"<proposal>text</proposal>". Then: The interface-builder (component) will generate user interface code (HTML) from the XML.
  • 10. At this point, a competent programmer can write code that conforms to this design. The executable test might look like this (Smalltalk): test1234ballotProposalXMLGeneratesHTML "The allowed responses for a proposal are Yes, No, and Abstain." | ballot ballotElement proposalElement html | self given: [ ballot := XML element: 'ballot' with: [ XML element: 'proposal' with: ['proposal text']. ]. "configuration comes from setUp" builder := configuration interfaceBuilder. ] when: [ ballotElement := ballot nextElement. proposalElement := ballotElement content at: 1. self assert: ( proposalElement isTag: 'proposal' ). html := builder buildHTMLfrom: proposalElement. ] then: [ self assert: ( html includes: 'Yes' ). self assert: ( html includes: 'No' ). self assert: ( html includes: 'Abstain' ). ].
  • 11. Some things cannot be completely automated. • We cannot prove that HTML will execute properly. • We cannot prove that generated code is conceptually correct. • The previous Given-When-Then’s did not specify if widgets would be radio-buttons or pull-downs. But that is probably a good thing.
  • 12. Compare: User Story • Template: As a <role name>, I need <business capability>, in order to <business benefit statement>. • A user story is a reminder to have a deeper conversation with the user (or user rep). • It provides a place-holder in the backlog.
  • 13. Compare: Use Case Title: (Identify the situation or end-use.) Preconditions: (Specify context. “Given”) Scenario: (Describe interaction / steps. “When-Then”) Post Conditions: (Expected effects. “Then”) Business Rules: (Identify policy constraints.)
  • 14. Given When Then clarifies thinking because: Given clause makes context and assumptions more explicit. When clause indicates when/where new behavior is expected. Then clauses indicate expected results (actions / end-states).
  • 15. GitHub Resources • https://github.com/RichardAlexanderGreen/ GivenWhenThen • See also: • https://github.com/KentBeck/TDD-Tyrant • https://github.com/pivotal/jasmine

Notas del editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n