Skip to main content

Questions tagged [unit-testing]

Unit testing is a method by which individual units of source code are tested to determine if they are fit for use.

0 votes
2 answers
151 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
5 votes
5 answers
616 views

Imagine I have a function like this (written in Java): void sayHello(String firstName, String lastName) { if (firstName == null) { throw new IllegalArgumentException("first name is ...
J-bob's user avatar
  • 357
0 votes
1 answer
87 views

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 ...
Lily Smith's user avatar
1 vote
1 answer
257 views

We have a CAD software extension, where you can draw products like walls, doors, windows, etc., and you can export the drawing as an order, which contains the parts and costs. As part of this export, ...
Divan's user avatar
  • 369
0 votes
3 answers
206 views

When writing unit tests, I always doubt whether I should put preconditions into the unit test itself (as the "arrange" step) or in a fixture. Is there a difference between the two? When ...
PieterV's user avatar
  • 233
4 votes
3 answers
320 views

Not long ago while I was exploring for solutions to test without mocks I've found out about the functional core, imperative shell architecture. It sounds great, I also think that it would play nicely ...
 sentientbottleofwine's user avatar
2 votes
2 answers
164 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
4 votes
4 answers
249 views

I am designing an analytics application using domain driven design and test driven development. I am having difficulty modeling the following requirement: The application shows a workitem's state. ...
Afelium's user avatar
  • 51
9 votes
10 answers
2k views

My team is going to add unit tests to old code without modifying it, to pave way for future design improvements. One of the short term goals is to also reduce the number of newly introduced bugs, ...
Johan Thiborg-Ericson's user avatar
1 vote
5 answers
561 views

Say I have a bunch of classes that imitate cars: SportsCar, Truck, and SUV. All of these classes share some public methods like start() and stop() which they inherit from an abstract class Car. While ...
Ruben Rundström's user avatar
2 votes
4 answers
201 views

This is my case. I have a class in which I inject a service as dependency, an IService. I want to test one method of this class. This method use one of the methods of the service. Now I want to test ...
Álvaro García's user avatar
4 votes
3 answers
909 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
1 vote
2 answers
252 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
  • 13
13 votes
10 answers
4k views

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 ...
Wes's user avatar
  • 335
0 votes
2 answers
239 views

I am new to C#, and Windows (coming from Python, Linux background). I need to add tests to an existing C# codebase, which relies on a MSSQL database and Entity Framework. In my old days when testing ...
mguijarr's user avatar
  • 226

15 30 50 per page
1
2 3 4 5
121