Все вопросы: [bdd]

77 вопросов

похожие теги: cedar-bdd
7
голосов
8ответов
1311 просмотров

BDD on Rails - Is the community more behind Shoulda or RSpec?

For a new application I want to start dabbling in BDD and I'm trying to decide between using RSpec or Thoughtbot's Shoulda. I like the macros that Shoulda uses, and the fact that it doesn't seem to reinvent the way Ruby/Rails does testing, but simply provides an add-on. On the other hand, the m...

0
голосов
2ответов
308 просмотров

MD5 code kata and BDD

I was thinking to implement MD5 as a code kata and wanted to use BDD to drive the design (I am a BDD newb). However, the only test I can think of starting with is to pass in an empty string, and the simplest thing that will work is embedding the hash in my program and returning that. The logica...

15
голосов
12ответов
4287 просмотров

How to unit test private methods in BDD / TDD?

I am trying to program according to Behavior Driven Development, which states that no line of code should be written without writing failing unit test first. My question is, how to use BDD with private methods? How can I unit test private methods? Is there better solution than: - making priva...

2
голосов
3ответов
665 просмотров

Practicing BDD with integration tests -- do I need unit tests too?

At present, my development process flows like this: I describe the expected behaviour as an integration test using using WebRat I write the Ruby on Rails code to provide that behaviour, so passing the test I refactor, ensuring the tests still pass at the end of the process I write the next inte...

10
голосов
2ответов
3232 просмотров

check for (the absence of) `puts` in RSpec

I am using rspec for my test in a ruby project, and I want to spec that my program should not output anything when the -q option is used. I tried: Kernel.should_not_receive :puts That did not result in a failed test when there was output to the console. How do I verify the absents of text ou...

0
голосов
1ответов
333 просмотров

Test::Unit tests passing on OS X, erroring out on CentOS

I have a set of Test::Unit tests for a Rails application. It was developed on OS X under Ruby 1.8.6, Rails 2.3.4. I'm also using thoughtbot-shoulda 2.10.2. I'm using standard Rails fixtures, not factories. I've checked out the project onto a CentOS Linux 5 workstation for another developer to ...

3
голосов
1ответов
2958 просмотров

Testing Pagination Features with Cucumber

I am learning and liking cucumber, and now have a feature I'm not sure of the best way to proceed on via BDD: pagination. I have scenarios (in my mind) where there are zero pages, one page, several pages, etc. and where I want to make sure certain records are on certain pages, make sure the "next...

3
голосов
2ответов
1215 просмотров

How (strategy) to unit test properties (get/set) in BDD style?

I have a class (of many) that have properties. Some have logic in them and some don't. Assuming I want to test these properties, how do I go about doing that? Recently, I've been interested in BDD style for creating unit tests. see here and here. So I'd do a setup of the context - basically ...

1
голосов
3ответов
221 просмотров

Tell me what is stupid about my Entity Validation (and how to improve it)

I have an IEntity interface that implements an interface, IValidatable public interface IValidatable { bool IsValid { get; } bool IsValidForPersistence { get; } // Rules applied at UI time (please enter your name, etc) IEnumerable<RuleViolation> GetRuleViolations(); // ...

2
голосов
2ответов
2423 просмотров

What is the definition of BDD?

BBD is referenced in this thread (Karl Seguin's answer). What is BDD?

3
голосов
5ответов
4231 просмотров

How to write unit tests in spec form?

I have difficulty in many situations to come up with a good unit test names for classes and methods. Typically, I try to follow the form: public class TestContext { [Fact] public void WhenThis_DoThat() { } } Some put words Given, When, and Then on the parts to be explicit. I ...

12
голосов
4ответов
1639 просмотров

What are the good frameworks for unit-testing and mock objects in Perl?

What frameworks and tools would you recommend for unit-testing and mock objects in Perl? I have an existing Perl application, that mainly does database access, reading and writing files. The application is basically a batch job type of application, it reads in bunch of stuff from files and datab...

1
голосов
1ответов
3017 просмотров

Fluent NHibernate HasMany Collection Problems

Update: It appears that changing my mapping from Cascade.All() to Cascade.AllDeleteOrphan() fixes most of my issues. I still have to explicitly set the Company property on the OperatingState, which seems unnecessary as it's being added to the Company entity, but at least I can work with that duri...

3
голосов
2ответов
1449 просмотров

BDD/DDD Where to put specifications for basic entity validation?

Alternatively, is basic entity validation considered a specification(s)? In general, is it better to keep basic entity validation (name cannot be null or empty, date must be greater than xxx) in the actual entity, or outside of it in a specification? If in a specification, what would that look...

5
голосов
2ответов
2236 просмотров

Domain Driven Design: When to make an Aggregate Root?

I'm attempting to implement DDD for the first time with a ASP.NET MVC project and I'm struggling with a few things. I have 2 related entities, a Company and a Supplier. My initial thought was that Company was an aggregate root and that Supplier was a value object for Company. So I have a Reposit...

7
голосов
5ответов
832 просмотров

ASP.net MVC RTM Test naming conventions

I am working on an asp.net mvc application and writing my unit tests BDD style. Eg. GetResource_WhenResourceFileExists_ShouldReturnResources() But when I am writing tests for my controllers, I usually have two Methods with the same name. One without parameters for get requests and one with ...

2
голосов
1ответов
281 просмотров

Repository of "standard" BDD specs

Do you know of any resources or libraries of BDD specs? For example, almost every web app has a login process. Some "standard" features might be handling of forgotten passwords, reset password, etc. I'm thinking of something like a code snippet archive of BDD specs so we don't all have to writ...

48
голосов
5ответов
2720 просмотров

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

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 l...

10
голосов
1ответов
2538 просмотров

How do I check that a form is pre-populated with values using Cucumber and Webrat?

I am learning Cucumber and Webrat with Rails and would like some advice on the best way to test an "edit" form. When I browse to a user's profile I am presented with an edit form with the user's information pre-populated in the form fields. I would like to be able to test that the fields do in fa...

0
голосов
3ответов
215 просмотров

How much do you test your controllers?

I am currently beginning with BDD - I have not written any tests before. I always try to keep my models fat and my controllers skinny. What do you think - are controller specs necessary? Best regards

37
голосов
7ответов
10611 просмотров

Best way to implement Repository Pattern?

I've been exploring BDD/DDD and as a consequence trying to come up with a proper implementation of the Repository pattern. So far, it's been hard to find a consensus over the best way to implement this. I've tried to boil it down to the following variations, but I'm unsure which is the best appro...

0
голосов
1ответов
1245 просмотров

Specification Pattern vs Spec in BDD

I'm trying to explore Behavior Driven Design and Domain Driven Design. I'm getting that written specifications drive the tests in BDD, but also that business logic can be encapsulated using the specification pattern for re-use in domain objects and repositories, etc. Are these basically the sam...

19
голосов
6ответов
11239 просмотров

Cucumber for PHP application

Is it possible to use Cucumber outside Rails? I'd like to start using it for testing some of my PHP applications, but I really don't know how to start. Probably the easiest way would be creating a Rails project only to run Cucumber features, but that seems like to me as overkill. What is the si...

1
голосов
2ответов
552 просмотров

How to integrate Cucumber into Code to Test Ratio?

When I use "rake stats" I can get to know how many lines of code I have written for my RSpec tests. And my RSpec tests influences also the Code to Test Ratio. But can I list my lines of code from the Cucumber steps there, too? Best regards

2
голосов
2ответов
520 просмотров

Can I aim for TDD or BDD in my started project?

I have decided to give a try to TDD and BDD on my already started project, encouraged by answers to questions like this: Should I start using TDD on a project that doesn't use it already I am struggling to really start with it. My project (opensource, hosted in http://gitorious.org/rubots) is ga...

2
голосов
4ответов
693 просмотров

BDD or TDD? Which do you prefer? and why?

I see many developers disagree on which style of test to use while starting a new project. I'd like to know why you choose this particular style over the other.

28
голосов
6ответов
5897 просмотров

BDD in Objective-C

I have recently started to learn Objective-C and write my tests using OCUnit that comes bundled with Xcode. I'm a long time Ruby programmer and I'm used to RSpec and Cucumber - nice BDD frameworks. Is there a decent BDD framework to use in Objective-C? I'm missing my 'should's :)

2
голосов
3ответов
809 просмотров

Starting BDD resources?

What would you recommend to start learning and applying BDD on a casual game development studio?

1
голосов
2ответов
801 просмотров

autospec with cucumber in rails app

I have cucumber features working fine and rspec spec working fine i can run both cucumber features and spec spec and they all work but now im looking at getting autospec to run but running does the produces the following Warning: $KCODE is NONE. /opt/local/lib/ruby/gems/1.8/gems/cucumber-0.3.90/...

1
голосов
1ответов
697 просмотров

testing objects using DAO

Continuing another but similar question about testing (see here). I'll use a similare example (pseudocode) class LinkDisplayer method constructor(LinkStorage) method displayLatestLinksByCategory(number_of_them) class LinkStorage method saveLink(Link) method retrieveLatestLinksBy...