All Questions
Tagged with integration-testing or integration-tests
347 questions
0
votes
2
answers
125
views
Is integration-testing all services the best approach?
I am building an API project, where I have a controller called C1, which calls service S1. Within this service, there are multiple method invocations to services S2and S3 and S4, as well as a call to ...
0
votes
1
answer
84
views
Automated Testing classes with an injected DbContext [duplicate]
I've been working on an implementation of a service, and have found that there are a number of operations where I need to read from a database to provide a caller with certain data or objects.
In-line ...
2
votes
3
answers
1k
views
Scope of integration tests
I'm programming a .NET WebApi application from services.
What is the scope of an integration test within the following schema?
Order creation scenario:
Order is created
-> stored in db
-&...
3
votes
3
answers
207
views
Automation of workflow for automated testing
What are your opinions on writing "production" code to facilitate testing?
Specifically, the use case is this: we have a system with a multiple step workflow, where a few stages are done by ...
0
votes
5
answers
504
views
Simulating different times of day when running integration tests, .NET/XUnit
I work on an organization's internal .NET Core 8 application where various dates are stored in different canonical formats, and some comparisons (checking that the current moment falls between a data ...
0
votes
2
answers
241
views
Is Spring Boot Unit Test Coverage with Integration tests only a bad practice?
I have recently come across a few codebases at work where the previous developers chose to reach the >80% coverage criteria by writing only integration tests with the @SpringBootTest annotation ...
13
votes
10
answers
4k
views
Does unit testing spot bugs that QA testing typically does not?
By QA testing I mean like say integration testing, system testing, regression testing, user acceptance testing and the like. If unit testing is skipped altogether would bugs that typically are spotted ...
3
votes
2
answers
233
views
Ensuring unit test data stays accurate
Say I have a method that expects data to be in some form to perform accurately. In the actual service/application flow, that data is formed upstream in other methods or services. How can I ensure the ...
-1
votes
1
answer
220
views
Why was integration tests using Spring Test framework designed to need @Transactional annotation in the @Test method by default?
Based on the documentation on Spring testing: https://docs.spring.io/spring-framework/reference/testing/testcontext-framework/tx.html#testcontext-tx-enabling-transactions
Annotating a test method ...
18
votes
10
answers
8k
views
Would a middle ground between unit and integration tests be optimal
I've read many posts about unit tests only testing one object/class and mocking of objects should only be for direct dependencies of the object under tests. The only other option discussed for ...
-1
votes
2
answers
162
views
Approach for implementing access permission tests for a large number of actions and multiple affiliations
I'm obviously having trouble creating a question that fits StackExchange guidelines in regard of opinions vs metrics. Any help to improve this question is highly appreciated.
I'm searching for a ...
1
vote
2
answers
154
views
Integration testing strategy for a volatile domain
Imagine following scenario:
Our team is working on a mobile project in biometrics. The team delivers a client facing SDK. Our work relies on another internal team, that is delivering algorithms in a ...
0
votes
1
answer
560
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
603
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
498
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
106
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
335
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
784
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
358
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
112
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
690
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
106
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. ...
6
votes
5
answers
8k
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 ...
-3
votes
2
answers
401
views
Why are logs not used for testing? [closed]
In tests, state verification or collaboration verification is usually undertaken. One of the drawbacks of this approach is the coupling of tests to the design of constructs. Consequently, when ...
1
vote
2
answers
245
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
2k
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 ...
0
votes
1
answer
477
views
Best practice when it comes to using XUnit and prepping/ rolling back test accounts before and after running tests
I am writing integration tests via unit tests by using Xunit. (the specific testing framework is not set in stone, Xunit is being used simply because it has been used before in this project team)
The ...
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
835
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
109
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
131
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
225
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; ...
3
votes
2
answers
430
views
the actual notion of an integration and end to end testing
I want to know how rigid do we have to stick to the notion of end to end testing, please consider the following explanation:
Basically, when we talk about end to end test we send a request and expect ...
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
848
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 ...
6
votes
1
answer
3k
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
429
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
107
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
745
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
535
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
331
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
103
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 ...
37
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
286
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 ...