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
0answers
30 views

Best practices on reusing test inputs in JavaScript [closed]

I've written a fixed-point math library, which comes in two flavors: the signed and the unsigned flavor. The tests across the two flavors have lots of inputs in common. E.g. for the avg function: ...
4
votes
3answers
222 views

Where to specify mock behavior in Given-When-then syntax?

I am unsure where/how to specify the behavior of a mock in a test scenario when using the Given-When-Then syntax. It seems to me both Given and When could be correct. Consider the following example: ...
1
vote
1answer
79 views

Setting up tests and a continuous integration pipeline in a polyrepo environment

In the past I've mainly worked with monorepos, specifically a Vue.js app that was served by a rails backend. Setting up E2E/integration tests in the CI was simple, because all the required parts were ...
0
votes
1answer
44 views

ASPICE assessment: detail of test logs

The "VDA Automotive SPICE Guidelines" (excerpts: https://vda-qmc.de/fileadmin/redakteur/Software/Automotive_SPICE/Veroeffentlichungen/VDA_Guideline_Rules_and_Recommendations_2017.xlsx) tells ...
-1
votes
1answer
67 views

How to black-box test transaction atomicity?

Suppose we need to ensure that a sequence of database operations - currently implemented as A followed by B followed by C - executes either all together, or not at all. We can achieve this using a ...
1
vote
3answers
148 views

Etiquette / Leadership / Sharing Best Practices - How much should I try to influence?

I recently joined another team part time where I kinda know several of the people, and they know me for my design work mostly, but I'll be doing design and some development with them. There's a lot of ...
18
votes
3answers
2k views

How do you test and demonstrate that you have properly prevented a race condition? [duplicate]

Suppose I'm building a web application using Django. Some of the views need to touch multiple database tables or rows, and there is some kind of state consistency that I need to ensure among the ...
0
votes
2answers
223 views

With Kent Beck's "test && commit || revert" (TCR), do you skip the "red" of "red, green, refactor"?

If you haven't heard of Kent Beck's TCR, it can be summarized with this: any time your tests go green, you commit; anytime your tests go red, you git reset --hard. This post is about how to practice ...
-2
votes
2answers
250 views

How to Unit test a class that saves a file?

I am writing a class that has one function that I want to test. The function, textToPdf, takes a list of text files and creates and saves a PDF at the file path argument. In order to test that this ...
1
vote
2answers
124 views

If my API depends on a third party OAUTH2 provider (Microsoft) - how do I write tests to test my API endpoints?

this is a followup question to the following StackExchange question - If you had a medium size company, several developers - but zero tests written in your REST API's - where would you start? At the ...
5
votes
5answers
512 views

If you had a medium size company, several developers - but zero tests written in your REST API's - where would you start?

I am looking to identify a benchmark to shoot for, and to come up with a decent game plan for introducing tests into our systems before deploying new code. Just some backstory My employer is not a ...
1
vote
3answers
183 views

Given a function that has already been unit tested, but is present in another unit, should I bother testing it again?

Say, for instance, I have this simple function in my domain layer: function canCreateNewUsers (principal: User): boolean { return principal.isSuperAdmin || principal.isAdmin // || ... a bunch of ...
4
votes
9answers
397 views

Should I be enforcing lint rules on feature branches?

I am working on a project and I typically setup precompile git hooks for things like linting and testing. I recently had some consultants we use complain about requiring lint on every commit. Their ...
-1
votes
2answers
122 views

What is the current definition of continuous integration?

It seems that there are at least two possible definitions of continuous integration: Frequent merging of a codebase to a common codebase (e.g. daily merge to the main branch of a VCS server). ...
0
votes
0answers
22 views

How to test integration with third party libraries on the backend from the frontend?

What is the standard or recommended approach or architecture for testing integration to third party libraries? More specifically, for this post I am only concerned with one of the possible ways of ...
1
vote
2answers
93 views

Where shall we start mocking?

Scenario: Our CLI-script downloads data Therefore, amongst other things such as pre/postprocessing, it calls a function from another (internal) python package (which is maintained by another group) ...
0
votes
0answers
20 views

Design a multiple Asp.Net Core apps Solution

I am having an .Net Core Solution consisting of 3 Projects: The Site (Asp.Net Core MVC WebApp) The API (Asp.Net Core API) The "Common" library for shared functionality. The Common library ...
0
votes
4answers
298 views

How to effectively unit test code with lots of database dependencies?

I find myself writing a lot of boilerplate mocking code for my unit tests. I think there must be a better way. Background I am working on a project that relies on complex configuration that is stored ...
55
votes
5answers
7k views

Is the usage of random values in unit testing a good practice? [duplicate]

Having worked in complex solutions that had Unit Tests and Integration Test in the CI/CD pipeline, I recall having a tough time with tests that failed randomly (either due to random values being ...
3
votes
1answer
116 views

Simulation Testing: how to test something that depends on its previous state

I'm practicing test driven development while implementing a network simulator: devices communicate with each other and implement little bits of functionality that respond to messages. Each device has ...
0
votes
2answers
142 views

Does PUT need to be idempotent?

It has been said that "PUT is idempotent": The difference between PUT and POST is that PUT is idempotent: calling it once or several times successively has the same effect (that is no side ...
-1
votes
4answers
172 views

Change architecture design to API to reduce coupling

I was reading articles about TDD and I found the following one. https://blog.cleancoder.com/uncle-bob/2017/03/03/TDD-Harms-Architecture.html In order to answer this question I think someone should ...
0
votes
1answer
78 views

Best practices for seperating/designing classes and methods for use in testing

I run unit and integration tests on my system. These create, start, stop and delete Docker containers. I want the exact same state in my Docker environment at the end of the tests as I had at the ...
0
votes
2answers
105 views

How to check the output of a program in black-box testing?

As part of a black-box testing activity, I would like to check the executable I'm testing generates a binary file that responds to its specifications given a specific input. I'm wondering how I can ...
1
vote
0answers
77 views

Integration Testing Stripe Payments - stripe-mock or Stripe's test mode?

I'm building an automated test suite to integration/feature test my organization's Stripe implementation within a GitLab CI pipeline. We're running Laravel 8 and using phpunit for testing. Within this ...
-2
votes
1answer
68 views

Is it necessary to test a TDD-based API in 3rd party app like Postman?

I just finished my TDD-based REST API. And I would like to use Postman to document it for the frontend team until I realized it has its own test script. Now I'm wondering, is it necessary to double ...
1
vote
1answer
46 views

Page Object Model: Relationship between a page object and a driver

There's a question that struggles me for a long time already and so far I couldn't find or figure out a good answer. Hopefully, you will help me with that, folks. Before the story, a little background:...
0
votes
1answer
178 views

How to make the tests run faster?

I develop my current project with a very strict approach to TDD and try to make it as close to Kent Beck's TDD By Example book. So right now I've got code coverage of 93%, with 1290 unit test cases, ...
2
votes
2answers
83 views

How to increase confidence in changes without a great test suite?

I've worked on a few codebases without a great automated test suite, where changes that concern the whole platform have to be thoroughly tested by developers and there would be a high risk that a ...
-3
votes
1answer
105 views

Shall QA team share their Test Cases with Dev Team? [duplicate]

I am building the test process for my development team. Currently, we have multiple ping-pong scenarios between Dev and Test teams. to send the product to QA then QA find issues and return them to ...
0
votes
1answer
290 views

What's an edge case in email validation, and algorithms?

An edge case is usually defined as what Wikipedia would say, An edge case is a problem or situation that occurs only at an extreme (maximum or minimum) operating parameter. For example, a stereo ...
1
vote
2answers
76 views

Automating performance tests for python code in a CI

My apologies in advance for a question that might seem trivial - I am a mostly solo dev in academic environment and a lot of industry best practices don't necessarily make it here. Several of my ...
-3
votes
2answers
76 views

How much should a react frontend application be automated tested? [closed]

I'm backend developer working on a very backend heavy application. So most of the business logic is writen in the backend. In our project we are considering a full rewrite of the frontend. Currently ...
-3
votes
1answer
100 views

How to simulate test data to a database?

I've created a service application that import orders from an SQL database. Right now I'm manually entering the data into the database, but in release a 3rd party application will export orders to the ...
-1
votes
1answer
68 views

Best way to keep development and testing in synch

We have 1 frontend developer and 2 backend developers and 1 QA. QA is responsible for writing the end-to-end tests using Cypress. FE developer writes the unit tests. Backend developers write the unit ...
3
votes
1answer
155 views

Efficiently updating a common repository used by multiple other repositories

Suppose we have a project consisting of many microservices, all of which use a common library. The common library has been put into a separate git repository, and each microservice is also in its own ...
20
votes
5answers
2k views

How to test variable values which differ due to floating point inaccuracy caused by different DBMS types?

I am working on a program that needs to work on floating point values that are fetched from different database types: currently we support 12 different DBMS (for example, two of them are Sqlite3 and ...
0
votes
0answers
87 views

Idiomatic Golang Unit Testing

Currently I have some code which is structured like this: type Service struct { // some dependencies } func (s *Service) FindStuff(ctx Context) { // this signature cannot be changed // some ...
-2
votes
1answer
132 views

What should be the workflow for test management in JIRA

We are using Jira to track all our tickets and confluence for documentation. We intend to document the test cases covered on Confluence. Here are a couple requirements: Consider a development ticket ...
1
vote
1answer
198 views

Should I cover code that should not be able to fail with tests?

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 ...
-1
votes
2answers
218 views

How do you unit test methods with hard/impossible inputs to hardcode?

I have the following problem. I have a method which takes two other custom objects to work. This objects are required by the method because they have the information that the method requires to ...
-1
votes
1answer
37 views

Gitflow - Share release branch executable with tester before tagging it

I use GitFlow as a workflow for versionning for less than 1 month. I've just finished to develop a feature branch which has been merged to develop/. Now, I'm starting a release branch from develop. ...
1
vote
1answer
169 views

Which git workflow for micro-services and testing

I would like to know what best practices exists out there with regard to micro services, CI/CD, testing and Git workflow, especially the way of working given the constraints that a) nothing should ...
0
votes
2answers
95 views

How to address a common problem with automated testing on remote machine

CI/CD options such as bitbucket pipelines and github actions make use of virtual machines called runners. Changes in source code trigger the runners, which in turn trigger a set of commands. The ...
-4
votes
2answers
104 views

What is the most complete way to test an imperative function?

What is the most complete way to test an imperative function? By "complete" I mean, something that is robust, that tests all the edge cases of the function, that so much as "proves"...
-4
votes
1answer
56 views

How to classify White-box/black-box, systematic selection and random selection of test case strategies

While writing my thesis, I am facing the problem of how to classify the testing strategies. Following section 1.5 of this thesis: If black-box and white-box are test case selection methodologies to ...
-3
votes
3answers
106 views

How do you test that an API wasn't broken by a change?

I have an infrastructure package that multiple projects depend upon. This package is supposed to be a stable API shared by those projects. I want to know if a change made in the package has broken ...
13
votes
3answers
2k views

How would you test a lexer?

I'm wondering how to effectively test a lexer (tokenizer). The number of combinations of tokens in a source file can be huge, and the only way I've found is to make a batch of representative source ...
6
votes
3answers
326 views

Is there a better way to run sequential tests?

I'm using unittest framework to run Python tests. Some system tests consist of a series of steps for a given scenario, and they need to run in a specific order. For example, I have a client ...
-2
votes
1answer
69 views

Does the higher-level testing mentioned in the book "Working Effectively with Legacy Code" belong to integration tests?

In the book Working Effectively with Legacy Code , there is section Higher-Level Testing in Chapter 2 Working with Feedback: Unit tests are great, but there is a place for higher-level tests , tests ...

1
2 3 4 5
28