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
0 votes
1 answer
104 views

Mock a bean with 10 methods when I only use one?

I face some situations similar to the following simplified one: @Component class ServiceOne { @Autowired ServiceTwo two; void act() { ... two.a(); ... } } @...
user avatar
  • 181
3 votes
2 answers
352 views

Testing interaction with proprietary software without a license

First a bit of context: My company develops a software and middlewares to make our software interacts with other software. One of a client has a proprietary software we should interact with, he gave ...
user avatar
  • 944
0 votes
3 answers
87 views

Improve CI process by testing against docker image and fail docker build if test fails

Our CI process goes as this cycle (I think it is quite normal), unit test => build docker image => run function test against the image => if test fails remove the failed docker image, figure ...
user avatar
-3 votes
1 answer
42 views

Registration feature integration testing(Acceptance Testing) [closed]

I would like to add integration testing/automated acceptance testing for a mobile app calling a registration API from the backend. I will register a sample user on the test feature then delete the ...
user avatar
2 votes
1 answer
93 views

Should integration tests of a repository pattern use low-level ORM calls

Problem summary: In an application with wrapper methods over SQLAlchemy add() and query() methods, can integration tests that use the add() method wrapper use the query() method wrapper to validate ...
user avatar
  • 131
0 votes
2 answers
89 views

Should integration tests run after updating the feature branch from master?

We have a suite of integration tests that take about 2 hours to complete. Currently our flow is that each feature branch runs the integration tests, and only if the branch is updated from master and ...
user avatar
1 vote
1 answer
48 views

Testing API with Auth0-enabled user authentication and authorization

I have a REST API and a SPA application, with Auth0 server issuing access tokens and enabling end users to login with their social identity provider. The API expects to receive a JWT access token with ...
user avatar
  • 113
0 votes
2 answers
119 views

Automated testing: should I check a sub-function was called, or should I check it's result?

I have a big function that does several things, including some database operations, and calling another smaller function. Something like: BigFunction() { DB.SomeTable.AddRow(newRow); ...
user avatar
  • 724
-2 votes
2 answers
78 views

Should application state be tested when testing Api?

I am trying to adpot a TDD process. I am a bit confused when it comes to testing an Api. I know for sure that the status and the response should be tested. But I am thinking if whether or not I should ...
user avatar
  • 113
34 votes
3 answers
5k views

What is the point of repeatedly executing the same test?

I have recently learned about the not-well-known and not-widely-used annotation @RepeatedTest that, as the name implies, repeats the very same test n-times. Baeldung provides a short guide to this ...
user avatar
0 votes
1 answer
55 views

Isolated Integration Tests in Layered Software Architecture Pattern

Let's say we have a simple application that uses a popular approach as Controller -> Service -> Repository pattern under a framework. We would like to write integration tests and start from ...
user avatar
  • 109
0 votes
1 answer
122 views

How to test a function with several conditional nested side effects

In Python, consider a function like the following: def main(*args): value1 = pure_function1(*args) if condition(value1): value = side_effect1(value1) if value: ...
user avatar
  • 109
1 vote
2 answers
67 views

Is the use of third party software and network requests the motivation for integration testing?

I'm wondering if the use of third party software and/or network requests is the motivation for integration testing? For the sake of keeping the code examples minimal, I'll define a unit test as ...
user avatar
0 votes
2 answers
124 views

Platform that converts Documentation into Unit/Integration Tests? [closed]

I've seen many SO questions around auto-generating unit tests, or documenting unit tests, but I'd like to go the reverse direction. What I'd REALLY like is to have folks (devs, tech writers, etc) ...
user avatar
  • 127
2 votes
1 answer
208 views

Setting up tests and a continuous integration pipeline in a polyrepo environment

In the past I've mainly worked with monorepos, specifically a Vue.js app that was served by a rails backend. Setting up E2E/integration tests in the CI was simple, because all the required parts were ...
user avatar
0 votes
0 answers
57 views

Mock/Reality consistency : unit test or integration test?

In a golang project, I have mocked external services. But in order to check that mocked services has the same behaviour as real services, I have done some common testing on the interface with both ...
user avatar
  • 101
2 votes
3 answers
199 views

Given a function that has already been unit tested, but is present in another unit, should I bother testing it again?

Say, for instance, I have this simple function in my domain layer: function canCreateNewUsers (principal: User): boolean { return principal.isSuperAdmin || principal.isAdmin // || ... a bunch of ...
user avatar
  • 668
0 votes
1 answer
70 views

Should integration tests cover calls from web app to API?

My solution consists of an API for data access and a web application that calls it. I have integration tests set up for the API. However, the actual Web application that calls the API is not a part of ...
user avatar
  • 103
0 votes
0 answers
25 views

How to test integration with third party libraries on the backend from the frontend?

What is the standard or recommended approach or architecture for testing integration to third party libraries? More specifically, for this post I am only concerned with one of the possible ways of ...
user avatar
  • 101
1 vote
2 answers
97 views

Where shall we start mocking?

Scenario: Our CLI-script downloads data Therefore, amongst other things such as pre/postprocessing, it calls a function from another (internal) python package (which is maintained by another group) ...
user avatar
60 votes
5 answers
9k views

Is the usage of random values in unit testing a good practice? [duplicate]

Having worked in complex solutions that had Unit Tests and Integration Test in the CI/CD pipeline, I recall having a tough time with tests that failed randomly (either due to random values being ...
user avatar
0 votes
1 answer
81 views

Best practices for seperating/designing classes and methods for use in testing

I run unit and integration tests on my system. These create, start, stop and delete Docker containers. I want the exact same state in my Docker environment at the end of the tests as I had at the ...
user avatar
-3 votes
1 answer
651 views

What's the reason for wiremock instead of Mockito in integration tests [closed]

I enjoyed the process of writing an integration test for a system that relies on http, by mocking such end-points with Wiremock, and I feel upskilled, having wrestled with Matchers. Now, Wiremock as a ...
user avatar
1 vote
2 answers
133 views

Integration test ordering vs. before/after style setup/cleanup when one test is a subset of another

I'm aware that it's generally considered bad style to write tests that have to run in a particular order. Let's say I'm testing an account-management API, and have the following two integration tests: ...
user avatar
4 votes
3 answers
424 views

Should unit tests assert the inputs to dependencies?

tl;dr: Is it a unit test or an integration test, to ensure that the inputs to a mocked dependency were correct? More details: Suppose I'm given a requirement like this: Create a function that returns ...
user avatar
  • 285
1 vote
3 answers
401 views

Clarifying the steps in a CI/CD, but namely if if unit testing should be done building a Docker image or before

I'm building at a Build and Deployment pipeline and looking for clarification on a couple points. In addition, I'm trying to implement Trunk Based Development with short-lived branches. The process I ...
user avatar
  • 121
3 votes
1 answer
168 views

Efficiently updating a common repository used by multiple other repositories

Suppose we have a project consisting of many microservices, all of which use a common library. The common library has been put into a separate git repository, and each microservice is also in its own ...
user avatar
  • 1,183
20 votes
5 answers
2k views

How to test variable values which differ due to floating point inaccuracy caused by different DBMS types?

I am working on a program that needs to work on floating point values that are fetched from different database types: currently we support 12 different DBMS (for example, two of them are Sqlite3 and ...
user avatar
  • 333
3 votes
1 answer
114 views

How to test UI frameworks

I am currently working on a library that provides functionality for interactive terminal applications. For now, I implemented functionality for reading an arbitrary keypress from the User to the ...
user avatar
-2 votes
1 answer
71 views

Does the higher-level testing mentioned in the book "Working Effectively with Legacy Code" belong to integration tests?

In the book Working Effectively with Legacy Code , there is section Higher-Level Testing in Chapter 2 Working with Feedback: Unit tests are great, but there is a place for higher-level tests , tests ...
user avatar
  • 1,467
1 vote
1 answer
59 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 ...
user avatar
0 votes
2 answers
85 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 ...
user avatar
  • 151
5 votes
2 answers
281 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 ...
user avatar
-1 votes
1 answer
57 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, ...
user avatar
  • 311
1 vote
2 answers
475 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 ...
user avatar
17 votes
1 answer
5k 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 ...
user avatar
  • 281
-4 votes
1 answer
177 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 ...
user avatar
-2 votes
2 answers
183 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 ...
user avatar
  • 25
43 votes
7 answers
10k 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 ...
user avatar
  • 668
-3 votes
1 answer
143 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 ...
user avatar
  • 1,021
1 vote
2 answers
193 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": ...
user avatar
3 votes
1 answer
225 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 ...
user avatar
  • 387
-2 votes
1 answer
62 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 ...
user avatar
-2 votes
3 answers
104 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 ...
user avatar
  • 169
-2 votes
6 answers
204 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 ...
user avatar
3 votes
1 answer
844 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 ...
user avatar
  • 149
2 votes
2 answers
214 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 ...
user avatar
  • 137
1 vote
2 answers
2k 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 ...
user avatar
  • 123
2 votes
1 answer
180 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 ...
user avatar
  • 223
1 vote
1 answer
514 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 ...
user avatar
  • 302

1
2 3 4 5 6