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
48 views

How can I write integration tests if I need dynamically generated values from a javscript file?

We have a react website that, as part of it's process, loads a dynamically generated javascript file from a third party. It uses some of the scripts in this javascript file to generate values, which ...
-1
votes
2answers
66 views

When writing tests against the database, should the test to create a resource also retrieve the resource to check the values were correctly inserted?

Where I work, we have some integration tests which spin up a new SQL database instance in Docker, so that we can test the repository logic for write actions as well as read actions. We have a test for ...
4
votes
2answers
240 views

Doesn't “Always test through the public interface” contradict testing of individual composed functions?

I'm currently reading "Composing Software" by Eric Elliott, which is about functional programming in JavaScript. He states that if you compose multiple functions together, and that these ...
-1
votes
1answer
44 views

Are DB integration tests relevant to test DB schema (and worth being impl.) when being run in a CI pipeline? If not when are they?

This is something that is puzzling me a bit. I am seeing some people who like to implement DB-related integration tests (in the case of BLOBAs) to test the insertion with a Legacy DB in a CI pipeline, ...
0
votes
2answers
177 views

What is the correct way to unit test methods that mix dependencies and business logic?

I'm struggling to come to a consensus on the right approach that can be used somewhat consistently to balance integration and unit testing. Take the following method, that is extremely common to find ...
15
votes
1answer
4k views

Is it possible/advisable to combine unit testing and integration testing?

I've built a Python script that consists of about 20 functions that extract data from MySQL via .sql files (I'm currently trying to learn SQLAlchemy ORM), do something to it and then put it back in ...
-4
votes
1answer
67 views

Are google tests used only for unit tests?

The current system I am working on uses google tests for unit tests and pytest for system tests. Are google tests appropriate only for unit tests? Or can you write system tests with it? (or are pytest ...
-2
votes
2answers
104 views

Should you write integration tests at every level?

Suppose I have some code as such: function1() { function2() } function2() { function3() } function3() { function4() } function4() { ... } Do I have to write integration tests for ...
41
votes
7answers
8k views

How do I really write tests without mocking/stubbing?

I have been using TDD when developing some of my side projects and have been loving it. The issue, however, is that stubbing classes for unit tests is a pain and makes you afraid of refactoring. I ...
-3
votes
1answer
83 views

Is splitting unit tests from integration test with mocks worth the effort (in nodejs)?

Well consider a relative simple server for a SPA application. Written in nodejs with express and knex as backends. Now if we do it properly each function will have unit tests (as they are always all ...
1
vote
2answers
188 views

Ease testing with complex setup scenarios

Within our codebase we have integration tests like these: func TestActivateSuspendedFoo() { // setup all dependencies baz := jsonToStruct( "baz": { "a": ...
3
votes
1answer
212 views

What do you unit test in your angular applications?

I am currently working in a team, which, when I joined them did not do any sort of unit or integration testing. Over the last 2 years I have bit by bit pushed dotnet unit testing to a point where it ...
-2
votes
1answer
61 views

Testing function that return objects

My web app is built around classes that I call widgets. Their goal is to be reusable and modular, to suit different scenarios. For example, I have a widget called BreadcrumbWidget which has two ...
-2
votes
3answers
49 views

How to identify scope of end-to-end automation testing?

We are struggling in deciding scope of end-to-end tests. As per our understanding, we have automated the form exactly the way users interact with it. below are the steps user perform while submitting ...
-2
votes
6answers
196 views

Why don't packages formally specify (and repositories verify) their contracts

So, most software depends upon third-party libraries, to some extent or another. Specifications of such libraries' behaviour usually takes the form of human-readable documentation. We write ...
3
votes
1answer
226 views

End to end email tests

In short: are email end-to-end tests a thing? As part of my CI I would like to run email integration/end-to-end tests: the app would send it to some SMTP server and then hits maybe an endpoint where ...
1
vote
2answers
101 views

Is it a best practice or anti-pattern to export mock versions of functions for a library?

Context We are creating a library that makes an API (HTTP) request to a 3rd party. During testing we have written mock versions of the functions that make external requests so that we can test the ...
1
vote
2answers
425 views

Are in-memory database a form of integration tests?

I have looked through most of the answers given regarding using in-memory database for unit test, but I could not find one that was clear to me. I am writing some unit tests to cover some of our ...
2
votes
1answer
164 views

Why should I write unit test for my example instead of (or with) my integration test

I have a repository function on my repository layer. I use sequelize as data access. I will write tests for my function. Here is the logic I want in English: My function should save a user to ...
1
vote
1answer
171 views

How to Mock Test Data for complicated Integration/GUI automated tests

General overview We recently had lots of problems with automated tests in our team. Part of it was that the people designated to writing them had little experience. After this failed, we incorporated ...
1
vote
1answer
65 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
109 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
67 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
59 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 ...
2
votes
4answers
199 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
556 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
245 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
614 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
709 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
296 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
182 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 it'...
0
votes
1answer
51 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
223 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
177 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
522 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
290 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
116 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
620 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
802 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
196 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 ...
4
votes
5answers
3k 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
350 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
707 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
209 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
60 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
461 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 ...
3
votes
2answers
8k 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 ...
93
votes
9answers
25k 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
2k 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 ...

1
2 3 4 5