Questions tagged [testing]

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

Filter by
Sorted by
Tagged with
-1
votes
1answer
104 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 ...
-1
votes
2answers
1k 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 ...
0
votes
2answers
1k 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
101 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
80 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 ...
2
votes
1answer
138 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
147 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
88 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
413 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
170 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 ...
43
votes
7answers
10k 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
227 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 ...
4
votes
1answer
2k 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
912 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
96 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
298 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
51 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 ...
2
votes
3answers
396 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
289 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
275 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
198 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
412 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
442 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
106 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
167 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
222 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
429 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
62 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 ...
1
vote
1answer
205 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 ...
-2
votes
2answers
156 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
76 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
43 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
174 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 ...
4
votes
3answers
954 views

Testing unexpected inputs for unit tests and loops?

I'm working on an enterprise that has some Angular/Typescript projects and to avoid repeating code (basically copying and pasting) between them, we decided to go for Monorepo and start write an util ...
-4
votes
3answers
111 views

What can an assertion test that running the actual code cannot?

I'm currently learning Jest, Enzyme, Detox and testing in general, but I'm still trying to grasp the benefit of testing. From what I understand, testing is about creating hypothetical situations. Let'...
-1
votes
1answer
62 views

How to execute a proper comparative performance testing?

There are two compatible versions of the same Product (e.g. database engine) that I want to compare to each other for the same input scenario (SQL query). The problems that I want to address at first ...
2
votes
2answers
181 views

Is it a best practice or anti-pattern to export mock versions of functions for a library?

Context We are creating a library that makes an API (HTTP) request to a 3rd party. During testing we have written mock versions of the functions that make external requests so that we can test the ...
49
votes
15answers
8k views

Company outsourced testing; how can we encourage programmers to stop overly relying on testers?

A friend of mine is working in a 200-employee company. The company's business has nothing to do with IT, but they do have an IT department to work, among others, on their website, used by the ...
-4
votes
2answers
175 views

An idea about cooperation between development engineers and test engineers

Suppose we want to develop a small module (time needed: two weeks of one developer). Then what about this new (maybe?) pipeline: The test engineer starts working: Think about all cases (including ...
7
votes
2answers
282 views

Should examples for functions be unit tests?

I'm writing a python function to replace all the non-alphanumeric characters in the keys of this dictionary with underscores. To make sure it's working as expected as I don't have a ton of ...
1
vote
3answers
174 views

How to write Given/When/Then Scenarios without Given and When being the same

Given that I want to write a Given/When/Then scenario When I write a Given/When/Then scenario Then my Given and When are generally the same thing I've been trying to practice writing user stories in ...
1
vote
2answers
83 views

Is "one representative" enough or need to have many same-type things in testing?

This is (again) a question of methodology... Suppose we are testing a service that returns Articles given ids, i.e. List<Article> getArticles(List<Integer> ids);. In addition, the ...
1
vote
1answer
462 views

How to Mock Test Data for complicated Integration/GUI automated tests

General overview We recently had lots of problems with automated tests in our team. Part of it was that the people designated to writing them had little experience. After this failed, we incorporated ...
-3
votes
4answers
370 views

How to break the vicious cycle of test-writing preceding an initial release?

I'm developing a FOSS library which I am pretty fond of. More specific details probably don't matter. I've already "finished" a feature set sufficient for an initial release IMHO. However - some of ...
6
votes
4answers
616 views

Exposing implementation details to tests

I have created a class that implements behavior which is difficult to test without some intimate knowledge of internal state. I'd like not to clutter the class's public API with accessors for this ...
2
votes
1answer
599 views

What is the origin of TDD?

I have seen people point me to many different "origins" of TDD. Some will point me to Kent Beck's rediscovery in the late 1990s with XP. Others will mention the 1960s best practice of annotating the ...
1
vote
1answer
271 views

E2E testing with third party services

I'm actually building an application that relies on multiple third parties (like 10-12) and I'm wondering if I should test my application with its third parties integrations. I had a discussion with ...
2
votes
2answers
242 views

Should powershell be used to develop a whole application?

We are automating the testing on an Web ERP solution (Dynamics) through a tool (RSAT, which uses selenium) provided by the developer of the ERP (Microsoft). The RSAT has a list of instructions to do ...
4
votes
2answers
671 views

Unit tests vs Automation testing

I'm a C# developer & never worked before on either unit tests or Selenium browser test automation. For a current assignment, there is an existing Visual Studio solution that has a project that ...

1 2
3
4 5
28