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
4 answers
265 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 ...
Kid Diamond's user avatar
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'...
Jacob Archambault's user avatar
2 votes
2 answers
326 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 ...
B-Rad's user avatar
  • 203
0 votes
1 answer
81 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 ...
PhD's user avatar
  • 2,531
1 vote
0 answers
56 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 ...
Emre Can Serteli's user avatar
0 votes
0 answers
63 views

Best practices to integration test a CLI app that makes REST calls to a downstream service

I'm writing some integration tests for a spring application that makes REST calls to another app that controls access to a database. The flow for this CLI app is: CLI app is kicked off by a cron job -...
Astrum's user avatar
  • 151
0 votes
3 answers
173 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; ...
Dave Cousineau's user avatar
0 votes
0 answers
78 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-...
Gherman's user avatar
  • 945
0 votes
4 answers
410 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 ...
Portho Games BR's user avatar
3 votes
1 answer
1k 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 ...
Christian Vincenzo Traina's user avatar
0 votes
1 answer
761 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(); ... } } @...
ch271828n's user avatar
  • 181
4 votes
2 answers
400 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 ...
f222's user avatar
  • 1,020
0 votes
3 answers
622 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 ...
Qiulang 邱朗's user avatar
-3 votes
1 answer
59 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 ...
xitnesscomplex's user avatar
2 votes
1 answer
527 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 ...
Ash's user avatar
  • 131
0 votes
2 answers
746 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 ...
Moshe Shaham's user avatar
1 vote
1 answer
395 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 ...
0lt's user avatar
  • 113
0 votes
2 answers
207 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); ...
MGOwen's user avatar
  • 744
-2 votes
2 answers
89 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 ...
Rami ZK's user avatar
  • 113
35 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 ...
Nikolas Charalambidis's user avatar
0 votes
1 answer
153 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 ...
memoricab's user avatar
  • 109
0 votes
1 answer
715 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: ...
pob's user avatar
  • 109
1 vote
2 answers
129 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 ...
tarstevs's user avatar
0 votes
2 answers
139 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) ...
aronchick's user avatar
  • 127
3 votes
1 answer
481 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 ...
Johannes Stricker's user avatar
0 votes
0 answers
121 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 ...
Lerenn's user avatar
  • 101
2 votes
3 answers
205 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 ...
kibe's user avatar
  • 738
0 votes
1 answer
692 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 ...
Peter Dongan's user avatar
1 vote
2 answers
103 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) ...
gebbissimo's user avatar
64 votes
5 answers
17k 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 ...
Vinicius Scheidegger's user avatar
0 votes
1 answer
88 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 ...
slashleo's user avatar
-2 votes
1 answer
1k 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 ...
HellishHeat's user avatar
2 votes
2 answers
302 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: ...
Claire Nielsen's user avatar
5 votes
3 answers
793 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 ...
George T's user avatar
  • 295
1 vote
3 answers
1k 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 ...
cjones's user avatar
  • 121
3 votes
1 answer
302 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 ...
Robin Green's user avatar
  • 1,233
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 ...
Gofrette's user avatar
  • 333
3 votes
1 answer
120 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 ...
writzlpfrimpft's user avatar
-2 votes
1 answer
79 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 ...
Rui's user avatar
  • 1,569
1 vote
1 answer
128 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 ...
David Jacobsen's user avatar
0 votes
2 answers
256 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 ...
mft25's user avatar
  • 161
5 votes
2 answers
364 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 ...
user1474326's user avatar
-1 votes
1 answer
104 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, ...
Natalie Perret's user avatar
1 vote
2 answers
736 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 ...
Stephen Vernyi's user avatar
18 votes
1 answer
6k 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 ...
Jossy's user avatar
  • 311
-4 votes
1 answer
414 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 ...
KansaiRobot's user avatar
-2 votes
2 answers
279 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 ...
Ryn's user avatar
  • 125
50 votes
8 answers
12k 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 ...
kibe's user avatar
  • 738
-3 votes
1 answer
207 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 ...
paul23's user avatar
  • 1,071
1 vote
2 answers
203 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": ...
Filipe Gorges Reuwsaat's user avatar

1
2 3 4 5 6