Questions tagged [integration-tests]

Integration testing is the phase in software testing in which individual software modules are combined and tested as a group. No mocks or stubs are required; everything is tested as in production.

Filter by
Sorted by
Tagged with
1
vote
1answer
50 views

How can you do integration tests when launching multiple REST API instances of the same server?

Here's a simple scenario: a REST API of which you launch multiple, load-balanced replicas of the same service with Gunicorn. Unit and integration tests are run in single-instance cases, but how can ...
2
votes
1answer
72 views

Testing Queries Themselves with Test data is a Unit test or an Integration test?

In a php project that I maintain I have a database structure without migrations, hence no way to reproduce it or make on the fly a test database. And the queries used to be performed on them are ...
1
vote
1answer
65 views

Are integration tests for only the topmost level of a hierarchy of object compositions? Or for each level except the bottom?

Suppose we have a hierarchy like the following, where each thing under it means it is composed of that type: CarCompany | CarFactory | Car | Engine | +------+-----+ | ...
-2
votes
1answer
57 views

A Question regarding many testing criteria

We know that there exists many testing criterions . As an examples : 1) Statement criterion 2) Branching Criterion 3) Path Criterion. My questions are : 1) Where do we just use these measures I ...
3
votes
4answers
194 views

Should automatic tests interact with the outer world?

Interacting with an external server is a major part of the functionality of an app I have to write. I've always been told that automatic tests are not supposed to interact with the outside world. ...
5
votes
6answers
412 views

Is testing behavior of many classes in one test still unit testing?

Our project's policy is to write unit tests for single classes only. All dependencies are mocked. Recently we've noticed that this approach makes us vulnerable in such cases: Originally class A looks ...
0
votes
2answers
142 views

How do unit tests and integration tests actually run?

There are plenty of resources that explain what unit and integration testing are and why they are important. That is not what I am asking here. I am trying to understand how unit/integration tests ...
0
votes
1answer
244 views

Gradle build interdependence between compilation and integration test

Scenario After having written an integration test in in JUnit 5, that executes the compiled project.jar, I used to manually compile the project after modifications, then manually execute the ...
0
votes
1answer
151 views

Testing a message queue worker process?

Say you have an AWS SQS queue. Your Publisher class and Receiver class is already unit tested. Now you have a worker process that uses the Receiver class to actually receive the messages from SQS. My ...
0
votes
1answer
149 views

Should you clean up your DB after integration tests?

Is it good practice to clean up your DB after running integration tests (which tests APIs that put data into that DB)? I want to have a cleanup method after my integration tests run which will access ...
1
vote
2answers
147 views

Where should I start with an Integration Test for a Legacy Software in .NET? [closed]

Currently, I'm planning a new project of CI/CD with Azure DevOps (with Git, already committed) for an old Solution, which contains 17 C# projects. Technically, we have access to the source code and ...
0
votes
1answer
46 views

What's the best kind of test for complex calculations without access to external resources?

I have two libraries that handle the mapping from one family of objects to another one. I had to create a middle set of objects for other transformations. So, the NativeConverters libray converts ...
2
votes
4answers
221 views

Finding Feature Bugs As Quickly As Possible

Currently, whenever I am developing a feature, I write the behaviour tests for it using mocks for our downstream services. These mocks are dumb always serve the same output. I faced something grave ...
1
vote
1answer
132 views

Is bad idea to utilize helper functions on integration tests?

In my job I have a small disagreement on whether we should utilize helper functions for making datasets especially in laravel framework. A sample for the test is: namespace Tests\MyAppTests; use ...
1
vote
4answers
327 views

Is it bad practice to repeat logic being tested in unit tests?

Often I find myself writing a unit test for code and repeating some or a lot of the logic in the unit test to make the unit test DRY. For example, consider the following piece of code: function ...
3
votes
2answers
240 views

How to test database dependent functionalities?

I have written this function which checks if a user already exists in the application: async function ValidateUserExists(username, email){ if(!username || !email) throw new Error('Invalid number ...
1
vote
2answers
112 views

Can strict assertions at application startup omit or replace integration tests?

I wrote a startup-pipeline where definitions are passed via environment variables and are used together with (unit-tested) methods to create suite of several publications (for subscriptions) by some ...
1
vote
1answer
487 views

Mock a PART of EF DbContext with Moq and/or InMemoryDbSet

This question is NOT about what's here: https://stackoverflow.com/questions/25960192/mocking-ef-dbcontext-with-moq and/or similar questions. I am well aware of that. Please, read the question before ...
0
votes
2answers
83 views

Integration Testing - Units of measure

A SW-Component "SWC-A" is integrated with a SW-Component "SWC-B". The SWC-A has an output interface which provides "Distance in meters". The SWC-B receives this value and does some calculation. If in ...
-1
votes
1answer
297 views

Best practice - Single or Multiple source code repository

As mentioned here: The main aim of CI is to prevent integration problems, referred to as "integration hell" Our project is a 3-tier web application, with frontend(Angular 6), backend(Springboot) &...
1
vote
0answers
182 views

Write integration tests with React using Jest

Let's imagine that we have this Page component: const Page = () => <> <Topbar /> <Drawer /> <Content /> </> I'd like to test some interaction within ...
3
votes
5answers
1k views

How to Differentiate Unit Tests from Integration Tests?

In my C# solution, I have a Tests project containing unit tests (xUnit) that can run on every build. So far so good. I also want to add integration tests, which won't run on every build but can run ...
1
vote
0answers
259 views

Integration Testing on AWS

I have a AWS pipeline connecting multiple resources to do 1 task which looks like as follows: The data is listened from a SNS topic and then moved to Lambda where it is processed. From lambda, step ...
0
votes
2answers
345 views

Unit testing about API endpoints and parameters

Consider a simple web application, I'll use a Python(ish) example, but i think the question is relevant for other languages as well. The user is trying to fetch a page, and in order to render that ...
2
votes
4answers
151 views

Testing database insertion, removal, and modification from program code (i.e., rather than test code)

I want to ensure that my program code is correctly inserting, removing, and modifying data in my database. Full integration testing can be slow, and I have concerns about keeping mock objects and data ...
0
votes
2answers
56 views

Setting up data for integration tests: using SQL queries or APIs calls

We a have test repo outside of the app repo and we can generate data by either having direct SQL queries or through API calls (http requests). We've been entertaining the idea of switching over to ...
6
votes
3answers
407 views

How to run long (>10 hours running time) verification test for continuous integration of scientific software

This question continues on a previous question asked here about continuous integration for scientific software. Like the poster of that question, I am developing software for numerical simulations and ...
0
votes
2answers
4k views

Should integration tests use database? [closed]

I know that integration tests test parts of project that interaction with each other somehow. And I need to test this interaction. And there is the question: 1)Should these tests use real database ...
81
votes
8answers
17k views

How exactly should unit tests be written without mocking extensively?

As I understand, the point of unit tests is to test units of code in isolation. This means, that: They should not break by any unrelated code change elsewhere in the codebase. Only one unit test ...
0
votes
2answers
1k views

Unit Test a CRUD Controller MVC

I have looked through answers related to this but they don't seem to solve my problem. I am fairly new unit testing and testing as a whole. I just finished a small web application using ASP.NET Core ...
3
votes
4answers
322 views

Should outgoing messages from object under test be tested?

I was watching a recording of a conference by Sandi Metz on testing. One of the things that I struggled with was that she said not to test outputs of the object under test (her example was query ...
38
votes
3answers
5k views

How do integration tests criticize design?

I'm having a read at J.B. Rainsberger's blog post on integrated tests and wonder in which way an integration test is more harsh with our design? We write more integrated tests, which are bigger and ...
0
votes
2answers
103 views

How to tackle long process system tests?

My service has long running processes. For example - user can signup, but if email not verified after 7 days, we send a reminder email. I need my system test to cover this scenario as well. ...
3
votes
0answers
55 views

Designing a test system on server/message level for large legacy application

I am working on introducing tests to an old system. Because of the amound of technical debt, we have landed on component/interface testing. The system is a servies of servers which sends messages in ...
0
votes
1answer
182 views

How do I create an integration test that tests multiple microservices without mocking?

I understand the concept of mocking API responses and their uses in unit testing, but in functional/integration testing, I actually don't want to mock because that defeats the purpose. For example, ...
0
votes
1answer
429 views

If I am mocking API responses in my unit/integration tests, how do I guarantee that the contract between Service A and B are valid?

Let's say I have microservice A and B. Microservice A calls microservice B for some piece of information. Microservice B requires parameters 1, 2, and 4 for the request to be valid. If I'm simply ...
0
votes
4answers
270 views

Should NullPointerExceptions be avoided in Integration Tests?

While writing Integration tests for spring applications, I tend to come across checks for different Multilevel Data Objects For Eg: AssertNotNull("Node 10 is null", getNode1().getNode8().getNode10()....
1
vote
1answer
95 views

Keeping Stubs in Sync?

If I want to test frontend code (e.g. react SPA) that queries the backend and I stub out the responses from the backend using sinon fake server/fake XHR, then what happens if the backend code changes? ...
0
votes
1answer
104 views

Client-Side TDD Tests?

More specifically, with regards to ATDD (sort of BDD flavored, or some could argue what was actually intended in the first place by TDD) should be there much UI testing? As I have been testing my UI ...
1
vote
1answer
113 views

Test RESTful APIs?

When testing RESTful JSON APIs with ATDD/BDD practices in mind is it good practice to test the structure of the response? I'm thinking that it could too easily change, thus making for a brittle test. ...
-1
votes
1answer
39 views

Testing Application Helper that Depends on Controller

I am working on practicing TDD/BDD/ATDD and I am working on a rails application. I created a helper method that depends conditionally on the type of controller being tested. module ApplicationHelper ...
2
votes
1answer
383 views

Fixtures, Tests, and Preconditions

When using factories, although more work is required up front, you know that you will be setting the correct pre-conditions for your test (up to what you have written.) However, when you use fixtures, ...
0
votes
1answer
111 views

UI Integration test boundaries - nested api calls

I am developing the UI of an e-commerce. Actually it is the checkout page only. The entrance URL looks like this: myEcomerce.com/{orderGuid} On load The ui takes the orderGuid as parameter to call ...
1
vote
2answers
633 views

TDD workflow with integration testing

I'm having troubles with using the right workflow with TDD. Some people say we should design before writing any code, some say we should make a test, make it pass, then refactor the code and that ...
0
votes
1answer
890 views

How to store large test data sets. Git? [duplicate]

We have a camera application that does measurements on pictures. We have a feature for saving a "demo" containing the pictures/data used, and to replay this for test purposes. We use such data sets ...
0
votes
2answers
207 views

How should I structure an automated test with a dependency on an HTTP endpoint?

I'm trying to better understand unit tests and integration tests. I understand unit tests should be in isolation and their dependencies should be mocked. But I'm slightly unclear on the best approach ...
6
votes
6answers
1k views

Why wouldn't my team want to run unit tests automatically?

I'm managing a team in .net. They are writing unit tests, use them locally on a regular basis, and love it. However, they keep pushing to have the unit tests kept as a separate project and only want ...
3
votes
1answer
734 views

Does using fixtures make a unit test an integration test?

Does using touching a database mean a unit test is an integration test even if you are using fixtures? If so, what are the alternatives to write a unit test when you need to use models as a part of a ...
3
votes
2answers
354 views

Test Internals with TDD?

I'm new to TDD, and relatively new to software development in general (e.g. < 4 years experience), but I am trying to learn. I have been toying with TDD but ran into what I know realize is a ...
1
vote
2answers
300 views

Should I write integration test that test my code with real-network servers, before I start writing my code?

I am trying to write integration tests for a client-server app. The client app runs on a user's machine and connects to the server app running on a specific Windows server, network-serverA. The ...