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.
285
questions
0
votes
1
answer
114
views
How to avoid too much mocking in unit tests in a database-heavy method?
I have a service method, acceptOrDenyJoinRequest, which follows a fairly complex flow (as depicted in this diagram):
In my unit tests, the implementation details of this method are heavily reflected. ...
1
vote
1
answer
138
views
Should I skip unit tests if integration tests cover the same scenarios?
I have a service method called acceptOrDenyJoinRequest that follows a logic similar to this flowchart (green boxes are ignored in code, and the light gray box calls an external service). According to ...
2
votes
5
answers
422
views
How to follow Outside-In TDD with Micro-services and Micro-frontends?
I was exploring TDD, specifically the Outside-In TDD pattern, where we need to write the acceptance (integration) test and then jump on to granular unit tests to implement the feature and make the ...
0
votes
0
answers
73
views
Is it really difficult to test these “Service” methods in this Rust Clean Architecture proposal? Is there some other catch I'm not considering?
I reproduced a small example of kerkour's Rust Clean Architecture on the Rust Playground.
The code is just an example and the methods code makes no sense at all.
This architecture leaks DB information ...
0
votes
4
answers
270
views
TDD and code reusability
Let's say that I've been iterating over my feature A with TDD. After several red-green-refactor cycles, I ended up with a nicely polished implementation with a part of the SUT encapsulated into some ...
2
votes
1
answer
731
views
Approach to software testing with docker
When discussing the testing approach, we had disagreements.
We develop software that we package into an image and distribute. We have two suggestions for testing:
Build a separate image with a test ...
1
vote
2
answers
104
views
End2End/integration Testing in Java with Selenium - how to get a good test structure - looking for experiences [closed]
At work I am currently tasked to implement End2End/integration Tests for one application using Selenium.
we have an project consisting of a frontend and multiple backends (spring-boot apis). The ...
3
votes
3
answers
1k
views
TDD when removing long lived feature
Suppose I had some Manager class that I need to change in regards to existing functionality by removing code.
The Manager always sends an initial message after a connection was established to do an ...
-3
votes
1
answer
90
views
Testablilty of setup with builder pattern for configuration
We have built a library which can handle RESTful requests based on configured endpoints.
A fluent builder is being used to create endpoint definitions (configurations). These definitions are bound to ...
1
vote
2
answers
258
views
How to do integration testing with ServiceBus?
Generally speaking, the basic flow is:
http triggered service method puts request on service bus
service bus triggered method executes request
and in this specific scenario:
method from 2) sends ...
1
vote
1
answer
85
views
How to test integration with an infinite generator
I'm struggling to (integration) test a component that makes use of an infinite generator.
Background:
At a really high level, this component is essentially a "middleman" in a kafka workflow. ...
5
votes
5
answers
5k
views
What to cover with integration tests?
I'm working on adding unit/integration tests to an existing project (Java/Spring Boot) and I've been investigating on how they are "separated" in order to cover the test cases and how to ...
1
vote
2
answers
201
views
Is it possible to prove mathematically that unit testing reduces test effort as compared to integration testing? [closed]
I took out the request for a paper, thank you for spending so much time on this.
hopefully this edit is better.
I use the word "complexity" meaning "cyclomatic complexity" so if ...
0
votes
4
answers
1k
views
Testing for exception thrown, unit or integration test?
In a test, asserting if a simple method throws an exception under a certain circumstance, is such a test considered a unit or integration test when the exception object thrown is from the standard ...
9
votes
5
answers
4k
views
Which comes first: CD/Trunk-based development or microservices?
My company* wants
to move from using long-running feature branching (~up to a few weeks) to continuous integration with trunk-based development, and
to break up our monolith into microservices.
We'...
2
votes
2
answers
626
views
Where do unit tests stop and integration tests begin according to the classical school of unit testing?
There are two schools of thought on how unit tests should be written. The first is the Classical/Chicago school, which focuses on the isolation of unit tests, describes a unit as a class or set of ...
0
votes
1
answer
89
views
Do we need to test an integration of units if each unit has been tested against collaborator (mocks) and interface contracts?
Given:
Let's say I have 3 objects A, B, C that form a cluster. Each unit (A,B,C) is independently tested with mocked collaborators. The "integration" is the call to A that calls out to B and ...
1
vote
0
answers
98
views
How to structure an ERP system in a modular way, with module hierarchy and where do application layers stand in this?
I built an asset management system (a web application) using C# ASP.NET in MVC structure. My project is built upon the ASP.NET Boilerplate template, which includes 5 layers by default. These layers ...
0
votes
3
answers
185
views
Tests of 1-Dependency VS Tests of 0-Dependency
How many dependencies does a unit test have (that are not mocked)?
My understanding is that a true "unit test" has zero dependencies, with all of them mocked (or none in the first place; ...
0
votes
0
answers
79
views
Unit test coverage and abundant glue code [duplicate]
How do I solve this riddle of contradicting "good practices" to properly cover my app with unit-tests?
These are principles I found about writing unit-tests:
Pyramid of testing says unit-...
0
votes
4
answers
703
views
Should i write tests if it takes more time than testing manually?
Im making a website and trying to learn Test Driven Development (TDD)
I'm doing one of CS50 projects, were we need to make a website to trade stocks. I decided to use this oportunity to learn TDD. I ...
5
votes
1
answer
2k
views
Is performing integration tests on a production DB a bad practice?
I'm writing integration tests for an already existing product.
I'm using the Spring Integration Testing suite for this purpose, which allows testing a real DB connection by creating a transaction and ...
0
votes
1
answer
1k
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();
...
}
}
@...
4
votes
2
answers
408
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 ...
0
votes
3
answers
1k
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 ...
-3
votes
1
answer
84
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 ...
2
votes
1
answer
665
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 ...
0
votes
2
answers
1k
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 ...
1
vote
1
answer
497
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 ...
0
votes
2
answers
274
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);
...
-2
votes
2
answers
93
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 ...
36
votes
3
answers
6k
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 ...
0
votes
1
answer
232
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 ...
0
votes
1
answer
947
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:
...
1
vote
2
answers
168
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 ...
0
votes
2
answers
144
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) ...
3
votes
1
answer
618
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 ...
0
votes
0
answers
148
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 ...
2
votes
3
answers
243
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 ...
1
vote
1
answer
1k
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 ...
1
vote
2
answers
104
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)
...
66
votes
5
answers
22k
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 ...
0
votes
1
answer
90
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 ...
-2
votes
1
answer
2k
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 ...
2
votes
2
answers
580
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: ...
5
votes
3
answers
1k
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 ...
2
votes
3
answers
2k
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 ...
4
votes
1
answer
404
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 ...
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 ...
3
votes
1
answer
126
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 ...