Questions tagged [testing]

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

Filter by
Sorted by
Tagged with
6
votes
4answers
284 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 ...
1
vote
1answer
177 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
24 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 ...
-3
votes
1answer
21 views

Angular FormBuilders and Unit Testing Practice

What is the unit testing best practice of testing Angular Forms and Formbuilders? Should I validate the formbuilder testing every member, by patching values onto it, test min/max validators by ...
2
votes
2answers
201 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 ...
3
votes
2answers
185 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
vote
2answers
85 views

Testing Environment Variables Strategies

I am in the process of implementing an API for the OPTIONS request for a pre-flight check on CORS calls. The Allowed-Origins host between local, test and prod will all be different so I moved this to ...
10
votes
2answers
364 views

Is it possible to test if/else trees properly without coding to the implementation?

I have been writing tests for a lot of long if/else trees recently, and I'm finding it a little discouraging. I want to speak in concrete terms, so consider the following example (I'll write in Ruby ...
0
votes
1answer
108 views

Architectural pattern for testable C code [closed]

I wrote a lot of software in C# and Python. I tried to make the overall architecture testable by using the "Clean Architecture" and Dependency Injection. This works well for C# (and python). Now I ...
1
vote
1answer
52 views

How can you do integration tests when launching multiple REST API instances of the same server?

Here's a simple scenario: a REST API of which you launch multiple, load-balanced replicas of the same service with Gunicorn. Unit and integration tests are run in single-instance cases, but how can ...
2
votes
0answers
56 views

A question about cyclomatic complexity

Assume the flow graph of a function is below (sorry I have forgotten the code of the function): And when I try to calculate the cyclomatic complexity: When I use the edge and node to calculate it, V(...
-1
votes
2answers
107 views

Why don't people usually use asserts throughout their application?

I usually do Javascript and I like putting console.assert liberally in my application. It throws an error if the first argument is falsey. E.g.: console.assert(price > 0, 'Price isn\'t above 0') ...
1
vote
1answer
65 views

Are integration tests for only the topmost level of a hierarchy of object compositions? Or for each level except the bottom?

Suppose we have a hierarchy like the following, where each thing under it means it is composed of that type: CarCompany | CarFactory | Car | Engine | +------+-----+ | ...
2
votes
3answers
234 views

How to maintain XML/JSON serialization tests?

It is quite common to test JSON / XML producing methods against file-stored expected output (at least in Java world, but probably in other environments, too). For instance there's a method that ...
0
votes
0answers
29 views

Test a Spring @Service that uses Specifications?

I defined a User entity as follows. @Data @Entity @EqualsAndHashcode(of = {"id"}) @NoArgsConstructor public class User { public User(@NonNull String username) { this.id = UUID.randomUUID....
5
votes
3answers
494 views

How to comprehensively test software that doesn't play well with testing?

I'm currently working in a project that aims to implement automatic testing of a software package. You can imagine this software is a bit like Excel in that it has a workspace that contains all the ...
-2
votes
1answer
57 views

A Question regarding many testing criteria

We know that there exists many testing criterions . As an examples : 1) Statement criterion 2) Branching Criterion 3) Path Criterion. My questions are : 1) Where do we just use these measures I ...
-3
votes
1answer
77 views

How to properly self test a testing framework?

I saw the code of a few testing frameworks and most of the times it contained self-tests. I mean they used the framework to test itself, not a different testing framework to test theirs. I always ...
-1
votes
2answers
248 views

Testing can detect the presence of error but not the absence of error, why?

I hear and see this statement almost in every academic book related to software engineering Testing can detect the presence of errors and not the absence of errors. But I do not get it clear. ...
1
vote
3answers
275 views

In TDD, is it bad practice to write helper class for unit tests?

Sometimes when writing a unit test using Test Driven Development (TDD) one may find that checking if the result is the correct one is "more complicated than one line of code", probably deserving its ...
-1
votes
2answers
143 views

In TDD, should returning class of public method be unit tested independently?

Suppose that I have a class that is returned only as a byproduct of another "main" class. I am using a Test Driven Development (TDD) workflow. Should this byproduct class be unit tested independently ...
1
vote
0answers
23 views

Preventing setting regression with configuration tied to a build

I have inherited a distributed application with a lot of legacy configuration management. Currently the application does not get it's settings updated with an application update. The flow looks ...
4
votes
2answers
135 views

Testable documentation

I'm creating a library, and I would like to provide a tutorial on how to use the library. Such a tutorial will contain code snippets as usage examples; therefore, I would like to test these snippets ...
0
votes
1answer
47 views

How can we better maintain a large amount of DbUnit datasets?

The project I'm currently working on a Spring Boot project, and I have a question regarding testing against the database. Our testing tech is currently JUnit 4, Mockito and DbUnit, and we test ...
1
vote
2answers
120 views

How to convert from TDD scripts to BDD?

There are TDD automation scripts ready and running. TDD tests are written in granular level(class, functions, module) and BDD is written in Behavior level. Is it feasible convert this TDD script to ...
3
votes
4answers
215 views

Should operating system configuration parameters, like disabled automatic updates or sleep timer, be part of the software specifications?

Our application needs to run in a locked-down operating system. Due to quality and regulatory concerns, all updates shall be prevented or blocked. Therefore, our deployment includes the pre-configured ...
-1
votes
1answer
237 views

How do sites like LeetCode & HackerRank test your code for correctness?

Not sure if this question belongs here, but I've always wondered how exactly sites like Leetcode & HackerRank test your code. Say you code in Java for a question like, Find all the duplicates in ...
2
votes
4answers
476 views

How to test a complex method (without rewriting it in the test)?

When writing tests, I often struggle with a conceptual issue, and maybe I am missing something major here. For many classes, the test writing is straight forward and simple, often tests (and their ...
0
votes
2answers
75 views

What does automated test pass percentage measure and how is it used in DevOps?

I'm researching DevOps metrics for school. One metric is called "automated test pass percentage." I found one article that says this metric is useful because it is good to know how often code changes ...
2
votes
5answers
425 views

Is it acceptable to accept multiple results in a unit test?

I've noticed this while implementing a Rest-API today. We first define interfaces for each API method and the api contract for one endpoint allows (amongst others) two status codes: 200 and 204. Both ...
0
votes
2answers
64 views

Design Java Testing class for hierarchical objects

Consider the following POJO structure in my main code. I want to create some testing framework for this kind of hierarchical classes, where the calling test method can specify if they want to modify a ...
3
votes
3answers
268 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
40 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
156 views

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

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
22 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
144 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
60 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
172 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
131 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
180 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
102 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
222 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
115 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
375 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
74 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
447 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
95 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
71 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
324 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 ...

1 2 3 4 5 26