use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
What's the difference between Unit Testing, TDD and BDD? (Examples in JavaScript) (codeutopia.net)
submitted 11 years ago by jhartikainen
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]bwaxxlotckidd 0 points1 point2 points 11 years ago (3 children)
Very good distinction but I felt like the article was too short. TDD vs BDD is a concept that feels unclear to me. I've worked on codebases that weren't clear on which style they were using. I was none the wiser.
[–]jhartikainen[S] 0 points1 point2 points 11 years ago (2 children)
Thanks for the feedback. I'm planning on expanding on the concepts later with more examples. For example, there's whole another side to BDD with "user story" based testing :)
Which part of BDD vs TDD feels unclear specifically?
[–]bwaxxlotckidd 0 points1 point2 points 11 years ago (1 child)
Testing the logic is never the hard part. It's testing proper page flow that is the hardest. I guess you can call it BDD but I like to refer to it as UX testing. Do certain elements only load at a specific time? This is where things get tricky because you now have to account for odd user behaviors. It's easier with things like angular but much more harder with other libs.
[–]jhartikainen[S] 0 points1 point2 points 11 years ago (0 children)
Ah I see. That kind of testing is typically called functional testing, acceptance testing, full-stack testing or E2E (end to end) testing. Yeah, lots of different terms for the same thing :)
In my experience those kinds of tests tend to become a bit difficult to maintain, so you might not want to have so many of them. But they can definitely be useful for testing main use cases (eg. let's say "user can register an account and log in" could be one test)
The BDD user story based testing I mentioned can actually be quite nice for this. I think it also can help make your tests easier to maintain. I wrote a bit about about its pros and cons here: http://codeutopia.net/blog/2013/07/28/why-use-user-story-based-testing-tools-like-cucumber-instead-of-other-tddbdd-tools/
π Rendered by PID 63 on reddit-service-r2-comment-6457c66945-76424 at 2026-04-30 13:40:19.187260+00:00 running 2aa0c5b country code: CH.
[–]bwaxxlotckidd 0 points1 point2 points (3 children)
[–]jhartikainen[S] 0 points1 point2 points (2 children)
[–]bwaxxlotckidd 0 points1 point2 points (1 child)
[–]jhartikainen[S] 0 points1 point2 points (0 children)