TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Sleipnir: BDD-style framework for Swift

27 pointsby AlexDenisovalmost 11 years ago

5 comments

zackmorrisalmost 11 years ago
For anyone curious: Behavior-Driven Development (BDD) is a business logic alternative to Test-Driven Development (TDD). It uses more of a conversational tone to spell out tests, so you write what you would like the app to do rather than sitting there scratching your head trying to figure out which tests to write. So it places emphasis on the &quot;what&quot; you want the program to do, and fill in the &quot;how&quot; behind the scenes. You can actually write all of your BDD gherkin and test fly your app with known inputs and outputs and then add the logic for arbitrary input and output later. Here is an example implementation for PHP:<p><a href="http://codeception.com" rel="nofollow">http:&#x2F;&#x2F;codeception.com</a>
评论 #7990169 未加载
The_Pherocityalmost 11 years ago
I wouldn&#x27;t call this a BDD framework yet. It&#x27;s speckled with both standard assertions and semantic assertions, and an &quot;It&quot; function that simply takes a block and a string. I can replicate this with using underscores in my test function names and avoid the complexity. Not trying to be a jerk, but what we should be driving for is something closer to:<p><pre><code> func Describe(&quot;The system I want to Test&quot;){ When(&quot;I click the red button&quot;) Then(&quot;I should see the light turn on&quot;) And(&quot;I should see 4 lights&quot;) } func Step(&quot;I click the red button&quot;){ buttons[&quot;red&quot;].click } func Step(&quot;I should see the light turn on&quot;){ lights.on.should().be_true } func Step(&quot;I should see (\d+) lights&quot;){ lights.count.should().be(4) }</code></pre>
评论 #7990795 未加载
dmurdochalmost 11 years ago
Typo in the page title of &quot;BDD-style framerwork for swift <a href="http://railsware.com/blog/2014/07/04/bdd-style-testing-in-swift-with-sleipnir/&quot;" rel="nofollow">http:&#x2F;&#x2F;railsware.com&#x2F;blog&#x2F;2014&#x2F;07&#x2F;04&#x2F;bdd-style-testing-in-sw...</a><p>Should be &quot;BDD-style framework for swift <a href="http://railsware.com/blog/2014/07/04/bdd-style-testing-in-swift-with-sleipnir/&quot;" rel="nofollow">http:&#x2F;&#x2F;railsware.com&#x2F;blog&#x2F;2014&#x2F;07&#x2F;04&#x2F;bdd-style-testing-in-sw...</a>
评论 #7990017 未加载
tsenkovalmost 11 years ago
It&#x27;s so nice to see how new ecosystems emerge. Looking forward to many more frameworks and tools for Swift.
woahalmost 11 years ago
I just want to say: Awesome logo.
评论 #7990713 未加载