More on BDD and TDD with examples, Thanks to codeproject.com

User story- As a product owner, I would like to get an web based email program by which I can compose email on-line and can send email.

TDD- 
  1. This program should send email if To address is valid.
  2. This program should send email if CC address is valid even if To address is not valid
  3. This program should send email if BCC address is valid even if CC and To address is not valid.
  4. This program should send email even if the subject line is empty.
  5. This program should send email even if the body is empty.
Problem in this- There might be some more test cases if the option stated in 1, 2 and 3 are altered. Even there might be more test cases if he considers the format of the body of the email (like plain text, rich text or HTML). If the body is HTML, then he needs to think about the HTML encoding things.

BDD-

Given that a web based email module has been developed
And I am accessing it with proper authentication
When I shall write sender email address in To field
Or write sender email address in CC filed by not keeping empty the To field
Or write sender email address in BCC field by not keeping empty either To field
And keeping the subject field non empty
And write something in body text area which excepts rich text
And press or click send button
Then my email will be sent
And the event will be logged in log file.

BDD in .Net- SpecFlow
BDD in Java- JBehave

Comments

Popular posts from this blog

Scrum Answer to Top 10 Software Project Risks