Questions tagged [testing]

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

Filter by
Sorted by
Tagged with
3
votes
2answers
158 views

Why are test frameworks like JUnit or TestNG not more “object-oriented”?

By "more object-oriented", I mean, it appears to me testing frameworks like TestNG and JUnit could encourage testers to write implementations of Test and TestSuite interfaces. The current approach ...
0
votes
1answer
20 views

How to test and what kinds of test to write for Request Handlers that use Repository layer?

Consider class below: class FillTestBySerialHandler { /** * * @var FillTestBySerialRepository */ private $fillTestBySerialRepository; function __construct(...
-3
votes
1answer
82 views

How to do regression testing on a machine learning based application?

This question is different from What are best practices for testing programs with stochastic behavior? be cause it's particular to Regression testing. We are building a chat bot, and for regression ...
0
votes
0answers
9 views

Jest + Puppeteer : Testing E2E javascript component

Prelude: I have a tags input component, (in vanilla javascript), which triggers callbacks for different scenarios such as: adding a tag, removing, editing etc. The problem: Jest+Puppeteer doesn't ...
0
votes
2answers
133 views

How do unit tests and integration tests actually run?

There are plenty of resources that explain what unit and integration testing are and why they are important. That is not what I am asking here. I am trying to understand how unit/integration tests ...
0
votes
0answers
29 views

Setup tests that use the Azure storage emulator in Azure DevOps

I have a project with the code hosted in Azure DevOps and I'd like to start using the Pipelines feature to handle the builds. My first problem is that I have a set of tests that use Azure storage ...
2
votes
1answer
144 views

Testable class/interface in embedded software written in C++

I would like to collect feedback on possible solutions for creating testable classes/interfaces. In a normal C++ development we can use references/pointers and forward declarations to achieve dynamic ...
1
vote
1answer
123 views

How to remove redundant tested code?

Say I have a controller public function someAction(){ $something = Helper::something(); } And I have a test to check Helper::something()returns/does whatever it should. Down the line I refactor ...
0
votes
1answer
58 views

Testing a message queue worker process?

Say you have an AWS SQS queue. Your Publisher class and Receiver class is already unit tested. Now you have a worker process that uses the Receiver class to actually receive the messages from SQS. My ...
0
votes
1answer
88 views

Does it make sense to write one unit test and loop it through similar components?

I have a situation where I have different forms, each with 4 or 5 steps (components), and I decided to write one unit test per step. After doing it, I noticed they were very similar and I could just ...
0
votes
1answer
46 views

What's the best kind of test for complex calculations without access to external resources?

I have two libraries that handle the mapping from one family of objects to another one. I had to create a middle set of objects for other transformations. So, the NativeConverters libray converts ...
2
votes
4answers
213 views

Finding Feature Bugs As Quickly As Possible

Currently, whenever I am developing a feature, I write the behaviour tests for it using mocks for our downstream services. These mocks are dumb always serve the same output. I faced something grave ...
0
votes
1answer
102 views

How do I test a method which interacts with a database?

So I have a database class which has methods dedicated to specific actions. For example I have below method which accesses and writes to a table in the database: def trackUserPerformance(self, ...
6
votes
3answers
351 views

Should tests perform a single assertion, or are multiple related assertions acceptable

Assume a client is making a request to an API endpoint that returns a JSON response where the structure and data change depending on whether the request was successful or not. Possible responses may ...
-3
votes
3answers
71 views

How to know if I need a unit test? [duplicate]

Do I need unit testing for everything? I know that Unit testing is not necessary for really small tasks, but what about for bigger stuff? How do I know I need a unit test?
10
votes
5answers
434 views

When do you have enough automatic testing to be confident in your continuous integration pipeline?

Continuous integration with testing is useful for making sure that you have "shippable" code checked in all the time. However, it is really difficult to keep up a comprehensive suite of tests and ...
0
votes
3answers
88 views

Unit Tests vs System Tests

I've always know Unit Tests to be something you do in code. You write functions to test other functions. Our team has been working with the same project manager for a while now and he's always ...
-2
votes
2answers
70 views

How do I model all the different states of a widget for testing?

Say I am a QA person so I have no control over the complexity of the code in the following example. I have a datatable widget with many different filtering and searching options. All the columns on ...
0
votes
2answers
150 views

Big Bang Integration Testing vs System Testing

In Big Bang Integration Testing, we combine all the modules we have together after unit testing immediately as one whole to see if there are errors. In System Testing, we basically test the whole ...
8
votes
3answers
571 views

How do I write unit tests for legacy code (that I don't understand)?

Forward I've read a lot of things before asking this question, including many relevant questions right here on SE: (Software Engineering SE) Writing tests for code whose purpose I don't understand (...
1
vote
4answers
304 views

Is it bad practice to repeat logic being tested in unit tests?

Often I find myself writing a unit test for code and repeating some or a lot of the logic in the unit test to make the unit test DRY. For example, consider the following piece of code: function ...
3
votes
5answers
307 views

Should I add additional unit tests for this helper method that simply aids in refactoring of code?

I have a method: public static void AddPersonToPeopleList(List<PersonModel> people, PersonModel person) { CheckWhiteSpace(person.FirstName, "FirstName"); ...
5
votes
3answers
301 views

How should a derived class be tested?

I have a question regarding proper design of tests. Suppose that there is a class A class A{ public: virtual int methodA(); virtual int methodB(); virtual int methodC(); ...
3
votes
3answers
122 views

Testing new feature in existing test?

A new feature is being developed. I want to test this feature in different scenarios. We have existing tests that correspond to this scenario (but they test other features). Should I : insert new ...
2
votes
2answers
243 views

How important is sprint test plan in agile?

I have been preparing a test plan for every sprint even if I have a master test plan just to plan the test for the current sprint. I am including topics like: Introduction Purpose Feature Overview ...
3
votes
4answers
514 views

Should test code be treated as normal code? [duplicate]

I remember reading on someone else's post that test code should not be treated as normal code but as small whole programs and that is an idea I really like and would like to refer to when discussing ...
2
votes
3answers
481 views

How to test required but accidental functionality?

For example, let's say I write a container class, which supports 2 kinds of operations: insert(x): inserts an element get_all(): retrieves all previously inserted elements Maybe it has some kind of ...
0
votes
2answers
70 views

What to test when testing an API? [closed]

When testing an API (with, for example, Java), what parts should I actually be testing when calling methods of my Controller class (e.g. a Spring RestController)? For example, lets say I've got a ...
4
votes
2answers
103 views

What is the relationship between IV&V professionals, Testers and QA engineers?

In the context of SDLC, I know that Verification and Validation is about verifying the deliverable input from previous phase and validating the output of the current one. And that testing is a phase ...
2
votes
4answers
344 views

Managing QA testing when there's pressure to merge things at the earliest possible

I'm working in a team of 12 where we have around 8 developers and a QA. We do not follow a git flow model but we do have feature branches where individual feature developments take place and then ...
2
votes
2answers
111 views

Methods of automated frontend tests

I am working on a Rails + React application and investigating frontend testing. Unlike the backend tests this doesn't seem to be a straightforward process with one obvious path. There are a list of ...
1
vote
2answers
104 views

How to write unit tests a method with a result that is highly based on another method [duplicate]

How to write unit tests a method with a result that is highly based on another method ? async function getStatus( session, correlationId, data ) { const client = new SomeAPIWrapperClient({ ...
1
vote
4answers
339 views

Is it still TDD if I follow the cycle for each method alone?

The question is not very expressive, anyway what I was wondering is if, if I follow the red-green-refactor cycle for each method is still TDD or if it has to be done globally. I mean, let's say I have ...
2
votes
1answer
73 views

Best practices on testing a function based on third party service

I'm trying to figure out how to create unit tests for a function, which behavior is based on a third party service. Suppose a function like this: def sync_check(): delta_secs = 90 now = ...
2
votes
4answers
137 views

Valid use-cases for white-box testing? [duplicate]

White-box testing focuses on testing implementation details of a component. Black-box testing sees a component as a black box accessible only via its API. Both Lean and Agile software development ...
9
votes
7answers
686 views

Are end-to-end and integration tests worth it for non-mission critical stuff?

It's well known that end-to-end and integration tests are costly. Of course if we develop applications where people might die if things go wrong it's a worthwhile investment. However in applications ...
1
vote
1answer
168 views

Are automated UI tests necessary? What should be tested?

Our small team writes desktop apps using WPF + Prism. Most of the team members are not so familiar with professional software developing process. I'm trying to adopt some agile techniques to make the ...
1
vote
0answers
45 views

Better approach of testing groups of small services with or without dependency injection

Let's assume, that frameworks I use, provide some kind of dependency injection automatically available in testing environment. Let's also assume, that I have a lot of micro services in my application....
3
votes
2answers
141 views

How to improve code quality in database driven applications

I'm working for a company with a big ass legacy codebase. Changing existing code is like a guarantee to break things. Most functions are a few thousand lines, using some global flags, having different ...
5
votes
3answers
178 views

Is checking for unexpected types in dynamic languages in an untyped project necessary?

In statically typed languages or dynamically typed languages that use a type checking system you can guarantee that the input type is the type that you specified in the contract. However, in ...
-1
votes
1answer
129 views

Best practice - Single or Multiple source code repository

As mentioned here: The main aim of CI is to prevent integration problems, referred to as "integration hell" Our project is a 3-tier web application, with frontend(Angular 6), backend(Springboot) &...
1
vote
0answers
135 views

Write integration tests with React using Jest

Let's imagine that we have this Page component: const Page = () => <> <Topbar /> <Drawer /> <Content /> </> I'd like to test some interaction within ...
1
vote
2answers
83 views

Integration Testing: Should a test check every validation?

I am somewhat new to writing tests and I want to build that habit into my workflow. So for example I might write a test that a user can create a blog post however I'm not sure on how to do that ...
-2
votes
1answer
97 views

What in practical-stupid-childish terms a mutation testing indicates?

Whlist browsing on github I came across the following project: https://github.com/infection/infection and according to the project's website https://infection.github.io/guide/#What-is-Mutation-Testing ...
0
votes
2answers
277 views

Creating a list of functions in java [closed]

I have a list of functions which need to be tested against a list of inputs to measure their relative performance. I have already create a test function like below: public static String testFunction(...
1
vote
1answer
132 views

Storing test results in a Git repo?

At my company, we use a distributed pool of virtual machines to run our UI and API tests. These machines are all connected to an onsite server which the pool uses for publishing the test results and ...
0
votes
3answers
129 views

Is is worth the time to create a list of manual regression tests for a legacy application?

I am part of a new dev team that is assigned to work on a legacy app. The app currently has no regression or automated unit, integration and system tests. Due to technical debt and convoluted ...
2
votes
2answers
185 views

How to organize my test functions? (Part II: Keepin' it classy)

What are the best practices to organize your unit tests in classes? I see different possibilities: 1) One would be to write one "container" class for each function you want test and then ...
1
vote
0answers
40 views

Perspective based reading - Artifact created

From what I have learned, in Perspective based reading, the document/code/etc., is inspected from different perspectives. We consider roles like software designer, tester or user. Each role follows ...
-1
votes
1answer
135 views

static, dynamic analysis - what mistakes were made in the code?

A software company develops software packages for commercial animal farming. A special function in C calculates the daily amount of feed for different kind of animals dependent on their bodyweight....