Relative Content

Tag Archive for integration-tests

Is BDD scalable for medium to large projects?

In every Website you read about BDD (Behaviour Driven Development) you find a very simple nice example showing you how obvious and easy is it to define your requirements. But trying to implement this process in a big product (not a calculator example) showed me that things can get (or will get) pretty complex and unreadable; especially changing requests at a later point means a lot of work to correct the Integration tests for this.

Why don’t I see many unit test projects that bring up and tear down a DB? (ASP.NET MVC)

I see all the examples that demonstrate unit testing code and mocking the calls to the DB since you are not suppose to touch the DB. But it seems to me having a set up tasks that uses the actually schema, loads the lookup tables and then populates it with data using the methods to be tested… This way it is more real world testing and all the stored procedures are tested as well.. But I never have seen any examples like this… Is there some reason I do not understand why using this technique is not as useful as it seems ?

Shared context: good or bad?

RSpec allows users to share context across tests / examples, which would reduce the number of code lines in my app by a significant amount.

Approaches to isolating tests that require a database? [duplicate]

This question already has answers here: Databases and Unit/Integration Testing (6 answers) Closed 11 years ago. Suppose I have component A,B,C that all put some data into a database. Each component depends on data in the database inserted by the previous component. How do I test these modules in isolation? I already have tests at […]

Is there a point to unit tests that stub and mock everything public?

When doing unit tests the “proper” way, i.e. stubbing every public call and return preset values or mocks, I feel like I’m not actually testing anything. I’m literally looking at my code and creating examples based on the flow of logic through my public methods. And every time the implementation changes, I have to go and change those tests, again, not really feeling that I’m accomplishing anything useful (be it mid- or long-term). I also do integration tests (including non-happy-paths) and I don’t really mind the increased testing times. With those, I feel like I’m actually testing for regressions, because they have caught multiple, while all that unit tests do is show me that the implementation of my public method changed, which I already know.

Integration test instead of unit test involving personal data?

I am trying to develop a series of unit tests for a production system that are dependent on a person’s social security number. While I am more than comfortable hard coding a clearly bad social security number to test for failure, I’m uneasy about including one that is good for proper (and passing) results. The following is a simplified test that I’m using: