SlideShare uma empresa 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

Mais conteúdo relacionado

Mais procurados

Scrum Testing Methodology
Scrum Testing MethodologyScrum Testing Methodology
Scrum Testing MethodologyGaya1985
 
Workshop - Writing Good User Stories
Workshop - Writing Good User Stories Workshop - Writing Good User Stories
Workshop - Writing Good User Stories Easy Agile
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumberNibu Baby
 
Scrum gathering Paris 2013 - test automation strategy for Scrum Projects
Scrum gathering Paris 2013 -  test automation strategy for Scrum ProjectsScrum gathering Paris 2013 -  test automation strategy for Scrum Projects
Scrum gathering Paris 2013 - test automation strategy for Scrum ProjectsEliane Collins
 
Como criar testes rápidos e robustos com Cypress
Como criar testes rápidos e robustos com CypressComo criar testes rápidos e robustos com Cypress
Como criar testes rápidos e robustos com CypressWalmyr Lima e Silva Filho
 
An introduction to agile estimation and release planning
An introduction to agile estimation and release planningAn introduction to agile estimation and release planning
An introduction to agile estimation and release planningJames Whitehead
 
Seminar on Software Testing
Seminar on Software TestingSeminar on Software Testing
Seminar on Software TestingBeat Fluri
 
Design System & Atomic Design
Design System & Atomic DesignDesign System & Atomic Design
Design System & Atomic Designeggcellent
 
Ruin your life using robot framework
Ruin your life using robot frameworkRuin your life using robot framework
Ruin your life using robot frameworkPrayoch Rujira
 
Istqb 5-테스트관리-2015-배포
Istqb 5-테스트관리-2015-배포Istqb 5-테스트관리-2015-배포
Istqb 5-테스트관리-2015-배포Jongwon Lee
 
Viewpoint-based Test Requirement Analysis Modeling and Test Architectural D...
Viewpoint-based Test Requirement Analysis Modelingand Test Architectural D...Viewpoint-based Test Requirement Analysis Modelingand Test Architectural D...
Viewpoint-based Test Requirement Analysis Modeling and Test Architectural D...Yasuharu Nishi
 
Automation testing introduction for FujiNet
Automation testing introduction for FujiNetAutomation testing introduction for FujiNet
Automation testing introduction for FujiNetHai Tran Son
 
Automação e virtualização de serviços
Automação e virtualização de serviçosAutomação e virtualização de serviços
Automação e virtualização de serviçosElias Nogueira
 

Mais procurados (20)

Scrum Testing Methodology
Scrum Testing MethodologyScrum Testing Methodology
Scrum Testing Methodology
 
Azure DevOps
Azure DevOpsAzure DevOps
Azure DevOps
 
Workshop - Writing Good User Stories
Workshop - Writing Good User Stories Workshop - Writing Good User Stories
Workshop - Writing Good User Stories
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumber
 
Scrum gathering Paris 2013 - test automation strategy for Scrum Projects
Scrum gathering Paris 2013 -  test automation strategy for Scrum ProjectsScrum gathering Paris 2013 -  test automation strategy for Scrum Projects
Scrum gathering Paris 2013 - test automation strategy for Scrum Projects
 
Como criar testes rápidos e robustos com Cypress
Como criar testes rápidos e robustos com CypressComo criar testes rápidos e robustos com Cypress
Como criar testes rápidos e robustos com Cypress
 
Agile Metrics
Agile MetricsAgile Metrics
Agile Metrics
 
An introduction to agile estimation and release planning
An introduction to agile estimation and release planningAn introduction to agile estimation and release planning
An introduction to agile estimation and release planning
 
Seminar on Software Testing
Seminar on Software TestingSeminar on Software Testing
Seminar on Software Testing
 
Design System & Atomic Design
Design System & Atomic DesignDesign System & Atomic Design
Design System & Atomic Design
 
Ruin your life using robot framework
Ruin your life using robot frameworkRuin your life using robot framework
Ruin your life using robot framework
 
Intro to Azure DevOps
Intro to Azure DevOpsIntro to Azure DevOps
Intro to Azure DevOps
 
Istqb 5-테스트관리-2015-배포
Istqb 5-테스트관리-2015-배포Istqb 5-테스트관리-2015-배포
Istqb 5-테스트관리-2015-배포
 
Viewpoint-based Test Requirement Analysis Modeling and Test Architectural D...
Viewpoint-based Test Requirement Analysis Modelingand Test Architectural D...Viewpoint-based Test Requirement Analysis Modelingand Test Architectural D...
Viewpoint-based Test Requirement Analysis Modeling and Test Architectural D...
 
DevOps for beginners
DevOps for beginnersDevOps for beginners
DevOps for beginners
 
Automation testing introduction for FujiNet
Automation testing introduction for FujiNetAutomation testing introduction for FujiNet
Automation testing introduction for FujiNet
 
TDD and BDD and ATDD
TDD and BDD and ATDDTDD and BDD and ATDD
TDD and BDD and ATDD
 
Test automation proposal
Test automation proposalTest automation proposal
Test automation proposal
 
Automação e virtualização de serviços
Automação e virtualização de serviçosAutomação e virtualização de serviços
Automação e virtualização de serviços
 
Presentation on Agile Testing
Presentation on Agile TestingPresentation on Agile Testing
Presentation on Agile Testing
 

Semelhante 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
 
Java script ppt from students in internet technology
Java script ppt from students in internet technologyJava script ppt from students in internet technology
Java script ppt from students in internet technologySherinRappai
 
Writing automation tests with python selenium behave pageobjects
Writing automation tests with python selenium behave pageobjectsWriting automation tests with python selenium behave pageobjects
Writing automation tests with python selenium behave pageobjectsLeticia Rss
 
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
 

Semelhante 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
 
Java script ppt from students in internet technology
Java script ppt from students in internet technologyJava script ppt from students in internet technology
Java script ppt from students in internet technology
 
Writing automation tests with python selenium behave pageobjects
Writing automation tests with python selenium behave pageobjectsWriting automation tests with python selenium behave pageobjects
Writing automation tests with python selenium behave pageobjects
 
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
 

Mais 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
 

Mais 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

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 

Último (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

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 do 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