bdd

How to avoid anemic domain models, or when to move methods from the entities into services

孤者浪人 提交于 2019-12-03 00:23:50
问题 I have a common scenario that I am looking for some guidance from people more experienced with DDD and Domain Modeling in general. Say I start out building a blog engine, and the first requirement is that after an Article is posted, users can start posting Comments on it. This starts fine, and leads to the following design: public class Article { public int Id { get; set; } public void AddComment(Comment comment) { // Add Comment } } My MVC Controller is designed like this: public class

TDD/BDD screencast/video resources [closed]

被刻印的时光 ゝ 提交于 2019-12-02 23:56:58
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I've recently finished watching the Autumn of Agile screencasts and I'm looking for more material of similar scope. Basically, I'm

How to Load a File for Testing with Jasmine Node?

这一生的挚爱 提交于 2019-12-02 22:12:43
I have a simple JavaScript file, color.js , and a matching spec file, colorSpec.js . color.js: function Color() { } colorSpec.js: require('./color.js'); describe("color", function() { it("should work", function() { new Color(255, 255, 255); }); }); When I run jasmine-node colorSpec.js , I get the following exception: ReferenceError: Color is not defined How can I get Jasmine to load my color.js file before running colorSpec.js ? you could load your color.js in the colorSpec.js with a require(). I dont see how jasmine can guess all the dependencies without you telling jasmine what they are

First Shot at Testing Laravel 4 apps (PHPSpec/BDD vs. PHPUnit/TDD)

删除回忆录丶 提交于 2019-12-02 20:47:47
I have been wrestling with this question for far too long now. I know I need to just jump into one or the other since they are both obviously viable/useful tools, but have been stuck on the fence, researching both, for weeks. PHPUnit vs. PHPSpec - Which one may lead to better long-term maintainability and programming practices? I have talked to several seasoned PHPUnit -> PHPspec converts/users who now swear by PHPspec, claiming that it promotes better design thanks to its BDD approach. However, since it is a much newer tool there is a lack of community/tutorials in comparison with PHPUnit.

How would I make a fake signature with behat

为君一笑 提交于 2019-12-02 20:23:13
问题 Picture of tested code / Picture of working signature Hello I am using behat with the selenium driver integrated with mink and I am trying to write a test that inputs a fake signature. We use the mouse to draw the signature on the screen so I want to be able to have selenium do that for me. I tried grabbing the Id of the field and using dragTo('another element on my page'), but it only clicks inside the signature box and doesnt do anything else. The framework I am using is laravel for php.

Checking object equality in Jasmine

三世轮回 提交于 2019-12-02 19:53:25
Jasmine has built-in matchers toBe and toEqual . If I have an object like this: function Money(amount, currency){ this.amount = amount; this.currency = currency; this.sum = function (money){ return new Money(200, "USD"); } } and try to compare new Money(200, "USD") and the result of sum, these built-in matchers will not work as expected. I have managed to implement a work-around based on a custom equals method and custom matcher, but it just seems to much work. What is the standard way to compare objects in Jasmine? lukas.pukenis I was looking for the same thing and found an existing way to do

Is it possible to use DDD and BDD together?

[亡魂溺海] 提交于 2019-12-02 19:18:12
I like the middle-out development that is achieved with DDD. Development is driven by domain, the most solid part of application. We don't depend on infrastructure, persistence and presentation. That sounds good. But it has no business value. Here comes business-focused BDD with outside-in development. We have no upfront domain design (choosing entities, value objects, aggregates). We take user story, write some scenarios and implement them one-by-one. We start development from most changeable part of application - from presentation. I hate writing fragile acceptance tests. Do you? So, if

Good resource to learn BDD, TDD (ruby , C#, javascript)

早过忘川 提交于 2019-12-02 18:55:15
What are the good resource to learn BDD & TDD (ruby , C#, javascript). What are the good framework using now? Eugene Yokota See Why should I practice Test Driven Development and how should I start? Beginning TDD - Challenges? Solutions? Recommendations? Good C# Unit testing book Introducing BDD What is the Path to Learn BDD on Ruby On Rails? Jasmine Hanselminutes - Understanding BDD and NSpec I can't really speak with too much authority on this subject, nor will I speak with too greater vigour given how storongly people feel about those two acronyms but it seams as though you are new to BDD /

BDD framework for the frontend?

删除回忆录丶 提交于 2019-12-02 18:20:10
On the server side we have Rspec/Cucumber for BDD development (ruby) vowsjs (node.js) Is there a BDD frameworks to use on web browsers (not qUnit or YUI test since these are only for TDD)? Check out jasmine describe("Jasmine", function() { it("makes testing JavaScript awesome!", function() { expect(yourCode).toBeLotsBetter(); }); }); http://pivotal.github.com/jasmine/ https://github.com/pivotal/jasmine Should_be ( sic ) very familiar to a ruby person You could also look at Yadda . Rather than being a standalone test framework like CucumberJS, it enables to use a Gherkin like syntax from other

What are the differences between JBehave and Cucumber?

北城以北 提交于 2019-12-02 17:49:32
I have read somewhere that JBehave is actually the Java equivalent of Cucumber, whereas Cucumber is based on Ruby. Can someone describe the differences between them provide links that do? cgleissner JBehave and Cucumber are completely different frameworks, although meant for the same purpose: acceptance tests. They are based around stories (JBehave) or features (Cucumber). A feature is a collection of stories, expressed from the point of view of a specific project stakeholder. In your tests, you are referring to the stories, typically via regular expression matching. JBehave is a pure Java