integration-testing

PHPUnit for command line integration tests

Recently, I've started to working on Email2SMS feature in our product. When I joined the project this component had zero code coverage by unit-tests. Legacy code. Since I started to working on it, I was using test-first approach. But code quality was very low. It was very hard to split it and tests small chunks by unit-tests, so I decid...

Performance testing best practices when doing TDD?

I'm working on a project which is in serious need of some performance tuning. How do I write a test that fails if my optimizations do not in improve the speed of the program? To elaborate a bit: The problem is not discovering which parts to optimize. I can use various profiling and benchmarking tools for that. The problem is using au...

Setting up a diverse database testing environment

I'm writing some code that needs to work against an array of different database products. MySql Sql Server 2000 to 2008 PostgreSQL Oracle 9i & 10g Jet 4.0 (MS Access) MSDE Sybase Adaptive Server Anywhere Sybase Sql Anywhere Progress OpenEdge We have a set of generic integration tests that we need to run against each database produc...

Integration tests - what level do you test at and how do you setup?

I've just encountered an error in my app that probably could have been caught with some integration tests, so I think its high time I wrote some! My question relates to the setup of these tests, and at what layer of the code you run the tests against. Setup Considering I should have lots of integration tests, I don't want to be creati...

Rollback database after integration (Selenium) tests

Does anyone have any suggestions for a best practice or preferred way of rolling back database transactions made from an integration test framework such as Selenium? Here is our current situation: We have a .net web project with a number of unit tests which work fine in our unit test environment - each test inherits a parent class whic...

What are the pros and cons of automated Unit Tests vs automated Integration tests?

Recently we have been adding automated tests to our existing java applications. What we have The majority of these tests are integration tests, which may cover a stack of calls like:- HTTP post into a servlet The servlet validates the request and calls the business layer The business layer does a bunch of stuff via hibernate etc and ...

WatiN test data reset/clean up

I'm wondering how people are currently resetting their data / cleaning up test remnants for their WatiN/Wartir tests? For example, lets say there's a test to add a user into the system and the username has to be unique. Obviously the first run without any users should work fine, but the second run will fail without manual intervention. ...

How do I separate unit testing from integration testing?

I am new to testing and mocking. I'm trying to test a business logic class which performs calculations, calls into the DAL and updates the database, and manages transactions. I'm using mocks to do unit testing, but how does full integration testing fit into all of this. Do I basically have the exact same tests, but use the real DAL or do...

What is the best way to automate integration testing MSMQ with Visual Studio Test suite / NUnit?

I would like to create a series of automated unit tests for an MSMQ application I am writing. As I see it, the challenge is how to accommodate the event handlers from the test method. That is, I send a message from the test method and need to return a result back to that test method that the message has been received and handled. I ha...

Whats a great way to perfom integration testing!?

Hi All, We have written our own integration test harness where we can write a number of "operations" or tests, such as "GenerateOrders". We have a number of parameters we can use to configure the tests (such as the number of orders). We then write a second operation to confirm the test has passed/Failed (i.e. there are(nt) orders). T...

Should one test internal implementation, or only test public behaviour?

Given software where ... The system consists of a few subsystems Each subsystem consists of a few components Each component is implemented using many classes ... I like to write automated tests of each subsystem or component. I don't write a test for each internal class of a component (except inasmuch as each class contributes to th...

Are unit tests and acceptance tests enough?

If I have unit tests for each class and/or member function and acceptance tests for every user story do I have enough tests to ensure the project functions as expected? For instance if I have unit tests and acceptance tests for a feature do I still need integration tests or should the unit and acceptance tests cover the same ground? Is ...

How to run individual test in the integration-test target in maven.

Hello everyone, We have a hundreds of tests defined for our integration-test phase lifecycle in maven, and they take a long time to finish. What I want to do is run just one test in the integration-test. I tried doing : mvn -Dtest=<my-test> integration-test but that does not work. The -Dtest runs only the tests in the unit test goal...

Writing a testable "import data from database" class

I am tasked with pulling all the rows from a 3rd party vendor's SQLite data table, creating business objects from those records, and sending the new business objects off to another class. Pseudo-code: var databasePath = "%user profile%\application data\some3rdPartyVendor\vendor.sqlite" var connection = OpenSqliteConnection(databasePath...

Best Practices/Ideas for setting up system state when integration testing?

I have a number of C# integration tests written using the Given/When/Then style popularized by cucumber. I'm using a framework which basically works the same as NBehave. A recurring issue I'm facing is the issue of setup and wiring up all the application state necessary for the integration test. Most of my tests look something like this...

What constitutes an Integration test

I have my unit tests. Each test method tests a logical UNIT of functionality in my system. In my unit tests external dependencies (db, file etc) are dealt with by using Mocks and Fakes. Now iam not 100% sure how i should approach the integration test. Should i repeat the unit tests and replace then with the actual resources (DB, File...

How to avoid duplicating test code

I have written my units tests, and where external resources are needed it is dealt with by using fakes. All is good so far. Now i' am faced with the other test phases, mainly integration where i want to repeat the unit test methods against real external resources e.g The Database. So, What are the recommendations for structuring tes...

How can I stub or mock the request.subdomains method in Rails?

I am trying to write some functional tests in my rails app, and in the application_controller.rb I have this: before_filter :current_account def current_account @current_account ||= Account.find_by_subdomain!(request.subdomians.first) end When running tests, request.subdomains doesn't contain the valid subdomains I'm looking for and...

Test IDs for Test Automation in HTML Markup?

We use automated tests to verify functionality of our web application. In order to make assertions in test cases less complicated and more flexible, we are considering the introduction of 'TestIDs', i.e. IDs in the HTML markup that help testcases find and verify elements on the page. Additionally, these TestIDs would allow more specific ...

what are the Business cases for storage/backup industry?

Hi Can anybody explain the what are the business cases for storage regarding testing environment. Please provide any guidence regarding this. Thanks, ...