Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 930583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:21:35+00:00 2026-05-15T20:21:35+00:00

I’ve just come across BBD and specflow and it looks very interesting. When writing

  • 0

I’ve just come across BBD and specflow and it looks very interesting. When writing user stories they are typically on a high-level and the actor users the GUI. So when writing scenarios they will typically be GUI test or integration test from a high level of the system. But what about unit test further down in the solution? E.g. service endpoints, business objects, etc. Should I write new scenarios for those or is there a way to reuse the same scenarios for low level testing (unit tests) or should I copy and past the scenarios?

Please let me know if I have got it all wrong.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T20:21:35+00:00Added an answer on May 15, 2026 at 8:21 pm

    BDD frameworks like SpecFlow are designed to help technical team members communicate more easily with non-technical stakeholders of a project.

    The English-language specs aren’t easy to maintain or refactor. Since the only people who read unit-level tests or examples are technical and able to read code, I prefer to use unit-testing frameworks such as NUnit at that level.

    Scenarios often have far more complexity in them than unit tests. Normally I find that they cover a number of combinations of internal business logic, and each aspect which makes up a combination will be the responsibility of a different unit of code. The logic in the scenarios will therefore be split up amongst a number of different unit tests, and you won’t be able to copy them.

    Sometimes I use the scenarios to guide my unit tests. I might find that a bit of logic ends up being the responsibility of a particular unit of code, and then I can copy just the relevant steps from the scenario into the unit tests as a comment.

    // Given I have $100 in my account
    var account = new Mock<Account>();
    account.SetupGet(a => a.Balance).Returns(100);
    
    var accountProvider = new Mock<AccountProvider>();
    accountProvider.Setup(ap => ap.AccountFor("lunivore")).Returns(account);
    
    // When I ask for $20
    var atm = new ATM(accountProvider);
    atm.PutInCardFor("lunivore");
    int money = atm.RequestMoney(20);
    
    // Then I should get $20
    Assert.AreEqual(20, money);
    
    // And my account should have paid out $20
    account.verify(a => a.PayOut(20));
    

    I encourage you to copy the language in which the scenarios are written (eg: PayOut). This is aligned with Domain Driven Design’s “ubiquitous language”. Carrying that language into both unit tests and code also helps a team converse with stakeholders, because you won’t have to do the translation over and over.

    Putting Given / When / Then into comments also really helps me focus on delivering code that’s actually going to be used, instead of trying to guess at all the edge cases. The best quality code is the stuff you don’t write.

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have an autohotkey script which looks up a word in a bilingual dictionary
I am writing an app with both english and french support. The app requests
I need to clean up various Word 'smart' characters in user input, including but
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
For some reason, after submitting a string like this Jack’s Spindle from a text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.