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
1answer
33 views

Properly testing UI presenters without duplicating tests of subcomponents

I am writing the embedded firmware for an effect pedal. The pedal's ui consists of a few knobs a few buttons and a few leds and it consists of various control modes each corresponding to a seperate ...
-5
votes
0answers
39 views

Advice for alternatives to unit testing when no expected value is known [closed]

I am writing several functions that I want to test. But, I have no way of knowing the true expected value, so I guess unit testing can't be done here. Any alternatives/solutions, or just expect to ...
2
votes
2answers
64 views

What's the best way to get GitLab Docker runners and Python tox to work together?

I'm trying to get a better understanding of how tox and GitLab CI (with docker runners) would work together, as they seem to have a bit of overlap in what each does. I think I may be missing something ...
2
votes
1answer
77 views

Do kotlin libraries with inline APIs encourage high coupling and discourage unit testing?

As an example, let's assume our application needs some way to communicate with other systems using HTTP. interface HttpClient { fun <T> get(url: String, returnType: Class<T>): T fun ...
1
vote
2answers
170 views

Can a build system be used effectively as a unit test runner?

The way of running automated tests (specifically, a large number of small, «atomic» unit and regression checks) that I am used to is to maintain a monolithic executable built on top of a test ...
-1
votes
1answer
107 views

Java: Splitting a large unit test class

The project (Java/Spring) I currently work on has a rather large unit-test class for one of its services : more than 1000 lines, several Nested class (one per big functionality), some tests without a ...
0
votes
2answers
84 views

Unit testing multiple features in one test

I'm writing a small utility class to create an abstraction for addEventListener (JavaScript/DOM) Let's say I have to test for these features: Single event target with a single event Multiple events ...
51
votes
11answers
10k views

If two individual branches pass unit tests, once they're merged, is the result also guaranteed to pass unit tests?

Suppose we have two branches A and B which have been forked from master. Both branches A and B make some changes and implement some unit tests. They pass all current and new tests, then are merged ...
1
vote
0answers
128 views

Should I mock ObjectMapper in my unit tests?

I have different services in a spring application that have a dependency on Jackson ObjectMapper, the unit tests rely on @InjectMocks to inject all the various dependencies to the class that is under ...
0
votes
1answer
45 views

Draw Data Flow Graph with Constructor and Functions

I am new to software testing and would like to know whether it's appropriate to draw a data flow graph that flows from initiation of variables to constructor and method. Is there something wrong with ...
1
vote
2answers
104 views

C++ Organizing classes for easy unit testing (but with some restrictions)

Mild pickle. I have a project which has components that are difficult to test/mock. It might look something like this: class Contenxt; class Server : public SomeOtherClass { public: ServerPlugin(...
1
vote
1answer
98 views

An effective way of finding regressions

There is a rather large data flow engine - more than 2000 different flow definitions of "what to do with inbound data". The engine deals with various data formats (flat-file, CSV, JSON, XML, ...
0
votes
2answers
158 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 ...
2
votes
2answers
234 views

Unit Testing Controllers without Mocks

I've done a lot of test writing using Mocks, and so I've learned that it makes refactoring difficult due to implementation coupling inherent with Mocks. I've done a lot of reading on the topic tonight,...
0
votes
0answers
34 views

How to create input data for unit tests for an API client?

I am building the initial set of unit tests for my team's legacy API client system. We have been writing integration tests, but have no unit tests. It's a Sinatra server that accepts requests from our ...
-2
votes
2answers
151 views

In unit testing should I check if a method is being called or just check the result?

Suppose I have similar function: Helper2 helper2; public void myFunc(Helper helper) { if (....) helper.mySecondFunc(); else helper2.myThirdFunc(); } In my unit test should I ...
-1
votes
2answers
185 views

Unit testing private methods

preface: I know this topic has been asked about a lot on here in the past. Hopefully I will make it clear that I've read a fair amount of the questions/answers on the topic, and other literature, too. ...
3
votes
1answer
51 views

How to test channel pipelines in Go

I use the "channel pipeline" pattern quite a lot in Go, which looks something like this: // getSomeNums spits out ints onto a channel. Temperatures, pressures, doesn't matter func ...
27
votes
8answers
5k views

Does software which implements scientific models require unit tests?

I work in a field where lots of code is written, but hardly ever tested. This is because we are foremost scientists who try to solve problems with code. The few coding courses we had, focused on the ...
0
votes
3answers
63 views

How to arrange expected result model for test in a cleaner,readable way when the model contains many properties

In one of my projects I saw wrapping the expected results as a static variable in non static class. The reason for doing so is to make the code more readable, so that the massive expected result model ...
1
vote
1answer
42 views

Store OAuth 2.0 tokens for use in testing and CI/CD

I have a web application where users must authenticate with a 3rd-party OAuth 2.0 service in order to do what they need to do in the app. On initial registration/login, they will connect with the ...
1
vote
2answers
144 views

What do I call “unit tests” that are specifically developed during tinkering?

When developing a new section of code functionality with modules I'm not familiar, I'll often create a set of unit tests that are for "tinkering" and interactively analyzing the results in ...
-3
votes
1answer
45 views

REST API Testing best strategy

I'm currently developing a personal project using Django REST + React and as it grows more complex, I want to add unit testing to ensure that changes don't affect previous functionality. However, I'm ...
0
votes
2answers
210 views

Who should describe the testing procedure of a bug?

I used to work for a software development company, and there they had following way of solving bugs and the according testing: The bug ticket is analysed by the developer. The developer solves the ...
-2
votes
2answers
77 views

Testable architecture of micro-services

Into: There are mutliple ways to test code: unit tests /e2e / manual testing /.. I'm developing a project that it's implementation details changes very quickly (and sometimes the core functions as ...
41
votes
7answers
8k 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 ...
1
vote
5answers
200 views

Hypothetically if every scenario were covered by an end-to-end tests, would unit tests still have any value?

Note: I'm asking about the strategy behind unit / integration / end-to-end tests, not about classifying tests as one or the other. More so in the past than present, it was expensive to write and run ...
3
votes
1answer
763 views

Clean Architecture use case testing

Use case interactors in the Clean Architecture consists of the application specific business rules. Interactors uses the Data Access Interface to fetch the required data from the data access layer. ...
1
vote
2answers
291 views

How to respond to a customer when their bug can't be reproduced

A customer has reported a bug that neither them nor us have been able to reproduce. This is the only report of this bug happening so far. We've spent a lot of time trying to replicate the issue (...
1
vote
1answer
85 views

What is better way to track mistakes in error-prone part of a feature?

That is quite specific circumstances I've come across, and I somewhat struggle to find proper way how to approach this. I'm given a class written in swift-language, which has a control property, like ...
2
votes
4answers
275 views

How do I deal with the fact that I am forced to make helper functions public for testing purposes?

I've encountered several scenarios that require me to mock certain helper methods because they call outside resources. As a result, I'm forced to convert all my helper methods from private into public....
-5
votes
1answer
44 views

Should code be refactored to be more unit testable or should a framework like PowerMock be used?

Assume there's some code that's already in production that needs some unit testing. Generally speaking, would you want to refactor this code that's already in production by adding things like adding ...
1
vote
3answers
111 views

Is it necessary to run tests in all environments?

In our project, we have DEV, STG and PRD environments that are configured to mirror each other (especially STG and PRD). We have unit tests that we run on DEV and, if they pass, are moved to STG when ...
0
votes
6answers
270 views

TDD - Make the test work quickly, committing whatever sins necessary in process

Red-Green-Refactor Green stage says, Make the test work quickly, committing whatever sins necessary in process Having an idea of writing a test & make it work quickly, does not look intuitive ...
-1
votes
1answer
97 views

Is the self-shunt pattern the same as stubbing in TDD?

I am reading the book TDD by Example and one of the patterns demonstrated was the self-shunt pattern. Basically, if I am not mistaken, if I have a test like this: test("list of users should receive ...
3
votes
3answers
188 views

Should you define an equality test solely for testing?

Assume you have a class C. C defines a public method (member function) C::m1. Calling c.m1() (c is an instance of C) can either Return after mutating the object c it was called on. Throw an ...
0
votes
5answers
182 views

How to reduce the merge-redundancy due to testing in our Git workflow?

We have are a small team of 6 people working with Scrum and Git. We are developing a quite complex webapplication with the ZK Framework. It uses Java and a MySQL database. We have adapted the "Git ...
-5
votes
1answer
99 views

Is it possible to derive a test suite to achieve 100% path coverage? [closed]

Here is an example with the function: Examining this I believe that it is possible to achieve 100% path coverage. My understanding of path coverage is that you need to design test cases such that ...
0
votes
3answers
72 views

How to control time with API testing?

I'm trying to test an API (see API testing). Some operations depend on time. Here are some examples: A post may only be edited within the first 5 minutes You may not try to login more than 10 times ...
2
votes
2answers
76 views

Should API tests depend on each other?

I have an API I wrote that I want to test at the API level. Given that I'm testing from an external point of view, how can I manage data sets for each tests? The simplest solution I could come up ...
3
votes
1answer
211 views

What do you unit test in your angular applications?

I am currently working in a team, which, when I joined them did not do any sort of unit or integration testing. Over the last 2 years I have bit by bit pushed dotnet unit testing to a point where it ...
5
votes
2answers
399 views

Is it a bad practice for a unit test to “trust” the other?

Assume I have the following two functions: function storeObject(object) { // Connect to database // Prepare query // Execute query } function retrieveObjectWith(id) { // Connect to ...
-2
votes
1answer
60 views

Testing function that return objects

My web app is built around classes that I call widgets. Their goal is to be reusable and modular, to suit different scenarios. For example, I have a widget called BreadcrumbWidget which has two ...
0
votes
0answers
35 views

Unit testing an inductive problem? [duplicate]

I am developing a function that produces an inherently inductive output (calculating periods based on a start and end date). E.g., period n depends on the calculation on period n-1 and so forth. ...
1
vote
1answer
94 views

Persistence layer in the automated testing of an API

The automated tests of an API should be stable and simple. When writing automated tests for an API, we often have to check that the data created with a program implementing this API is persistent. If ...
0
votes
0answers
18 views

Testing Proxy with its service

I have a program that contains client and api logic. In summary client works like this: 1) Client handles client code 2) Calling the API is surrounded in (lets call it ) ClientService 3) if client ...
-2
votes
2answers
131 views

Is it possible to write unit tests for embedded systems with no prior embedded programming knowledge?

I have this question for a long time that is it possible for someone with no prior embedded systems programming experience to write unit tests? I have good knowledge of other languages like JAVA, ...
-4
votes
1answer
69 views

Any problems if we test every things on E2E?

I'm working on Flutter a project. We've test cases on the server-side. On the client-side, We have an idea to only test every acceptance criteria on the E2E level? The question is What're the ...
0
votes
1answer
41 views

Test logging library

I've been designing and developing a very scalable logging library for a while. The main goal of this library is pretty simple. Like many others projects, a simple goal does not mean a simple way the ...
1
vote
1answer
79 views

Is it better to test with dynamically generated input data or static data?

I have a little React app and I'm ready to test it. The first thing I need to do is to create some input objects with random data. I can proceed in one of two ways: I can create my own fake data line ...

1
2 3 4 5
27