Linked Questions

2 votes
3 answers
335 views

In most descriptions of unit testing as a methodology there's an idea of unit tests being as independent of implementation as possible. This is easy to understand and implement in cases when code does ...
Roman's user avatar
  • 139
9 votes
1 answer
2k views

In the case of unit testing, I'm testing as many cases as I can that when I do X, Y happens. I'm also concerned in some cases that when I do X, Z does not happen. But for the sake of protection, I ...
Gil Sand's user avatar
  • 2,193
1 vote
1 answer
5k views

The advantage is it protects your DTO against future "enhancements" ?
NimChimpsky's user avatar
  • 4,670
1 vote
4 answers
671 views

Having a component that represents the database is wonderful! You can use it from the business logic to read and write data. But should that component be unit-tested? I would argue that it should ...
Lefteris Eleftheriades's user avatar
0 votes
1 answer
2k views

For a method whose signature looks like this: public T Add<T>(T first, T second) where T : struct, IEquatable<T>, IComparable<T> which can work with all of the integral types, do I ...
user avatar
4 votes
1 answer
651 views

I'm working on a codebase with very little testing. The code is 90% an ETL pipeline with functions like def sort_data(df: pd.DataFrame, column: str = 'date') -> pd.DataFrame: return df....
MYK's user avatar
  • 343
0 votes
2 answers
940 views

For example, should I test like this: // it shouldn't even compile since I'm using a static type-checking expect(addTen('string')).toThrowError() when it is already type-checked like this: function ...
Christopher Regner's user avatar
2 votes
1 answer
886 views

I am under the impression that interaction testing (verifying mock invocations) in general should be avoided. When unit testing method postconditions should be asserted instead. However there are ...
Chad's user avatar
  • 307
1 vote
1 answer
236 views

I'm asking myself above question since I implemented an API that accesses a third-party API and currently write tests to increase my code coverage in the class that communicates with the third-party ...
hullunist's user avatar
  • 137
0 votes
4 answers
534 views

I'm currently scratching my and my colleagues head about whether and how we could test SyncService::syncFoo in any meaningful way that does not involve basically recreating the whole call tree as ...
gries's user avatar
  • 239
0 votes
3 answers
472 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
1 vote
2 answers
1k views

I am integrating an external library that declares a singleton, like this: public class External : MonoBehaviour { public static External Instance { get {/*setup inner stuff*/} } public void ...
M R's user avatar
  • 21
0 votes
2 answers
227 views

In front-end projects(made in frameworks like Angular or React), when we correctly encapsulate complex functionalities, the components that really have some relation to the business logic normally ...
Vitor Figueredo Marques's user avatar
0 votes
1 answer
506 views

I have a following class in my PHP code: <?php declare(strict_types=1); use function Http\Response\send; use Psr\Http\Message\ResponseInterface; class ResponseSender implements ...
Michael Tsang's user avatar
0 votes
1 answer
240 views

There are strings and each string has a weight in a data structure. The getRandom() method should return a string randomly with its weight/total weight probability. There is already a question on how ...
rocky's user avatar
  • 21

15 30 50 per page
1
2