Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.

Questions tagged [testing]

Verifying the behavior of a software system against the expected behavior of that system.

Filter by
Sorted by
Tagged with
0 votes
2 answers
125 views

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 ...
Héctor Iglesias's user avatar
7 votes
3 answers
387 views

I'm working on a program that runs as a sort of plugin to the Windows UAC prompt (and other similarly difficult environments). The testing situation is a bit abysmal. End-to-end tests are not possible,...
jetm's user avatar
  • 81
1 vote
2 answers
256 views

Suppose you have a panel with a table, which I will call a pane. The table has a toolbar above it, including an edit button. Editing involves showing an editing dialog. It allows the user to edit the ...
Sergey Zolotarev's user avatar
-2 votes
4 answers
423 views

I'm testing writing 10 MB of data to a server. The expected result echoed back is 10485760 bytes. 160 writes of 65336 bytes. Approximately 1 of 5 tests I get back 10420224 bytes in the test. 65536 ...
guest271314's user avatar
2 votes
2 answers
163 views

I regularly write scripts and small tools that read data from external servers. I am still not sure what is the most efficient and effective way to test them: Probably the most effective way would be ...
JF Meier's user avatar
  • 700
14 votes
10 answers
4k views

Dependecy Injection makes mostly sense when using interfaces, since one of DI's strengths is to switch out implementations. It also decouples classes, since the consumer of the dependency does not ...
Hans's user avatar
  • 572
2 votes
3 answers
1k views

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 -&...
Petr Klekner's user avatar
4 votes
4 answers
865 views

All programming languages have some method of referencing the current date and time. Examples... now() sysdate DateTime.Now() current_timestamp Get-Date In a professional or semi-professional ...
ConanTheGerbil's user avatar
4 votes
1 answer
432 views

As we know, determining the semantic properties of programs is an undecidable problem (e.g. Halting, commonly attributed to Turing). But tools such as static analysis (notably that of Clang/LLVM) are ...
DannyNiu's user avatar
  • 374
3 votes
3 answers
207 views

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 ...
Kramer's user avatar
  • 147
1 vote
1 answer
191 views

Our product is almost fully deployed in CI, however one remaining part that we have to wrap up is still the regression (update: characterization / golden master) testing: So considering we have a blue/...
glades's user avatar
  • 493
4 votes
3 answers
869 views

My SUT class depends on external static state (which generally should be avoided, I know). How do I make sure my tests do not depend on their order of execution? I mean other by introducing some reset(...
Sergey Zolotarev's user avatar
0 votes
2 answers
241 views

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 ...
Mary's user avatar
  • 3
3 votes
2 answers
233 views

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 ...
Jason's user avatar
  • 33
2 votes
4 answers
888 views

Introduction I am reading Building Microservices (second edition) by Sam Newman. In chapter 9 the author highlights 2 problems when desiging end-to-end testing for microservices: Which version of the ...
BARJ's user avatar
  • 131
1 vote
1 answer
176 views

What are the use cases of TestOf? I'm new to NUnit testing and from what I have seen, most people don't use this attribute that much. From my experience, TestOf helped me to quickly identify what ...
LNTR's user avatar
  • 43
2 votes
1 answer
514 views

I got assigned with writing unit tests for a class that instantiate a Worker inside in it's constructor. The code looks simmilar to this, class SomeClass { private _worker: Worker; constructor(...
LNTR's user avatar
  • 43
3 votes
3 answers
977 views

I am designing a fluent builder pattern API that branches and allows different options based on what has already been called. For example: Build().Foo().Bar() is valid code, but Build().Baz().Bar() ...
starikcetin's user avatar
6 votes
3 answers
326 views

I'm often releasing large SQL scripts for projects and minor works - my problem is that there's nothing (except the logs) to indicate that the release was successful. There could be an object missing, ...
user1567453's user avatar
0 votes
1 answer
109 views

As many, we use microservices in my company and there's some debate in my group whether a microservice has e2e tests on it's own. I know e2e tests by definition are user flow tests. Lets take for ...
omriman12's user avatar
  • 109
0 votes
2 answers
444 views

According to the Wikipedia entry for Unit Testing, it is defined as a technique for testing components of a system in strict isolation from each other, and it is described as having been expressly ...
Mike Nakis's user avatar
  • 32.8k
18 votes
10 answers
8k views

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 ...
Thor's user avatar
  • 307
-1 votes
2 answers
162 views

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 ...
DarkTrick's user avatar
  • 286
-2 votes
3 answers
275 views

We have third party software being tested. Our software has to interface with this, hence my involvement. There are some things I consider serious technical flaws. I'd like to communicate these things ...
Dan's user avatar
  • 301
1 vote
5 answers
1k views

There's a (mis)conception that you don't have to test configuration But what if your configuration is in the form of runnable code? What if it's not just static values? I wrote an abstraction for ...
Sergey Zolotarev's user avatar
-1 votes
1 answer
186 views

Recently, I spoke to an Engineering Manager about some work I've done: I had to implement a micro-service to a third party API contract (that they will call). Part of the requirement is to ...
Ahmed Tawfik's user avatar
1 vote
2 answers
299 views

Suppose you have a class that accesses a property (perhaps, it's a GUI class) How do you test it in Java? You can inject (and mock) a ResourceBundle import javax.swing.JLabel; import java.util....
Sergey Zolotarev's user avatar
0 votes
1 answer
560 views

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. ...
Saimur Rahman's user avatar
1 vote
1 answer
603 views

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 ...
Saimur Rahman's user avatar
0 votes
3 answers
483 views

I'm writing tests to check if validation rules are working for my CRUD app. I have constants defining stuff like max length of each String field. I'm unsure if within tests I should create test data ...
Domin0's user avatar
  • 111
8 votes
5 answers
3k views

To test that your program deletes the correct files, you run it first in a logging-only mode (by commenting-out delete lines or overriding your delete method to be a logging method). for file_path in ...
user avatar
1 vote
1 answer
135 views

I'm looking for general testing strategies for writing tests to expose bugs that only appear for very large inputs. As an example I will look at the "binary search midpoint bug". In binary ...
JKaerts's user avatar
  • 31
18 votes
11 answers
6k views

According to Why is Global State so Evil?, I know one of the disadvantages of "global state" is that it makes code "harder to test". I do not disagree with this, but what I don't ...
wcminipgasker2023's user avatar
0 votes
0 answers
106 views

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 ...
Fred Hors's user avatar
  • 139
0 votes
4 answers
335 views

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 ...
Maciek Czarnik's user avatar
4 votes
8 answers
3k views

For example, if the change is "return users' full names instead of just last names", is it worth it to add a test for it? Would it make the test suit fragmented and confusing? Context: My ...
imcoding's user avatar
0 votes
3 answers
180 views

I have a task to develop a test framework - or a test suite, if it makes more sense - that aims to validate properties over a large set of XML files. Our codebase is basically like this: JSON input ...
Incognitex's user avatar
2 votes
1 answer
784 views

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 ...
Vladimir's user avatar
0 votes
1 answer
263 views

note: here library means a package that is installed from some wheel/egg/tar file. as opposed to a regular package which is just a container of modules basically. package usually is used for both as ...
gnarlyninja's user avatar
1 vote
2 answers
358 views

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 ...
KilledByCheese's user avatar
0 votes
2 answers
1k views

After reading about Value Objects, I think they're pretty cool and should be used, but I am not sure if I am doing it the right way. Let's assume that I have a simple DTO to create a user, which ...
Mercury's user avatar
  • 81
3 votes
3 answers
1k views

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 ...
Late347's user avatar
  • 55
0 votes
3 answers
471 views

We have a piece of code that decorates an interface to transparently add retry logic. Inversion of Control configuration service.AddOurRestApiClient() .AddResilienceHandler("Retry", ...
LostInComputer's user avatar
0 votes
2 answers
121 views

I have in project linq repository unit tests. [Fact] public async Task Get_FromTreeEntitiesUnsorted_RetunsOrderByDescending() { //Arrange _contextReadonly.Entity.Add(new ...
cargt4's user avatar
  • 19
-1 votes
1 answer
170 views

Let's say that I have a class with a service that is going to be injected at runtime: class Thing { private magic: IMagic; // Magically injected service public doStuff(){ // Do a lot ...
Tizio Fittizio's user avatar
1 vote
2 answers
216 views

If I'm not mistaken, a major part of testing software is deploying and using it on your platform of choice. For critical system software such as UNIX utils, package managers, desktop environments/...
Bunabyte's user avatar
  • 643
21 votes
6 answers
7k views

Let's say you are running a query on your database. In development and staging, where the amount of data is small, everything looks good. Unit and integration tests are also fine and the logic is ...
riorio's user avatar
  • 519
2 votes
1 answer
115 views

I have a repository which reads and writes to Firestore, and some tests to make sure data is sent and comes back in the correct way. In order to test this I added a protected function which returns ...
Adam's user avatar
  • 272
6 votes
5 answers
8k views

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 ...
leugimlenipse's user avatar
6 votes
1 answer
361 views

TL;DR: Given a repo with a lot of big fixture tests, when should I look for a solution where the golden files are not part of the repo anymore? Where should they be stored? The setup Testing a ...
Turion's user avatar
  • 169

1
2 3 4 5
31