Newest 'testing' Questions - Stack Overflow

Questions tagged [testing]

Software testing is any activity aimed at evaluating an attribute or capability of a program or system and determining that it meets its required results.

0
votes
1answer
20 views

What is the point of mocking the method of an external library when unit testing?

What is the point of mocking the method of an external library when unit testing? Let's say that I have a function that uses XYZ library to get the current user using a given authorization token, and ...
0
votes
1answer
7 views

Why does notNullValue() not compile when used with everyItem in Hamcrest

In Hamcrest the matcher notNullValue() can be used to check that a value is not null: String string = "Foo"; assertThat(string, notNullValue()); However, this pattern cannot be used for collections: ...
0
votes
0answers
14 views

How to reduce the fragility of jasmine unit tests in angular?

Angular recommends using Jasmine for their testing framework, but the more I work with Jasmine the more I worry about the fragility of my unit tests. Currently, I am using stubs and spies to provide ...
0
votes
0answers
20 views

Testing with fake model data in Ruby on Rails

Let's say I have a simple function on a class that takes a model object, transforms the data, and then returns a hash. Something like: def model_to_hash(some_model) # transform model data into new ...
0
votes
0answers
2 views

Class consideration in Equivalence class Testing [on hold]

I have some doubts while studying Equivalence class testing. The class consideration in some textbook didn't help me. Can anyone help me? How to identify the equivalence classes in Equivalence class ...
0
votes
0answers
6 views

Dynamic asynchronous mocha tests

I have a service class, which 50 other "services" extend. While each service has its own test, I would like to write a test suite for all of the services shared functionality (I have a method thing ...
-1
votes
0answers
7 views

How to use typescript in karma files

I am trying to provide some global function in my test cases, so that it will be available to all test cases. I have created on function file in type script and added it in karma.config.ts file ...
0
votes
0answers
8 views

_firebase.collections.collection.get.mockResolvedValue is not a function on vue

I'm trying to test the firebase collections, but I'm getting the following error: _firebase.collections.contacts.get.mockResolvedValue is not a function I'm using jest, and already tried using the ...
0
votes
0answers
14 views

How to make a Python script to print stdout directly? [duplicate]

When I call a Python unit test I can see all the stdout directly e.g. how remote APIs are called etc., if I use the -s switch. python3 -m pytest -s some_test.py However if I run a script with same ...
0
votes
1answer
28 views

How to determine number of tests required for a method?

By looking at a method, is there a rule of thumb or a way in which we can determine the statement coverage (or the number of tests) that would be required for a method? int v(int c, int d) { if (c &...
0
votes
0answers
19 views

Tests with Cucumber + Maven + TestNG not running

I have set up some Selenium tests with Cucumber + Maven. I used to use JUnit as testing framework, but as I want to run the tests multiple times with different parameters, I looked into using TestNG ...
-4
votes
0answers
10 views

Is there a software to detect software requirements for a web application?

We are using a web application developed by some local developers. It usually runs fine, but on some computers, a certain page would not work as intended. Is there a software that can tell us what ...
0
votes
1answer
25 views

How to access the resource files that are kept under resources folder

How to get the absolute path of the files(cacerts.pem,client.pem,client-key.pem) that are kept under the folders as below in the image This is in the eclipse and gradle environment
0
votes
0answers
34 views

How to test a websocket client-server interaction?

I'm writing an integration WebSocket layer for one service and would like to test the interaction between my code and the server by creating some integration type of tests. There's a project called ...
0
votes
0answers
8 views

Smallest database for testing

I'm working towards completing a search algorithm of a database, and need to test while working on it. However, the database needs to actually have something to search for. What is the smallest ...
0
votes
0answers
13 views

What are best practices for unit testing multiple functions that have very similar test scenarios?

Let's say I have two pure functions, pureFn1 and pureFn2. These functions must pass similar tests. describe("generic function", () => { it("should fulfill condition 1", testCondition1); it("...
0
votes
0answers
3 views

Is there a json file (Swagger) for the BNP Paribas Open Bank Project API to test on Postman or other tools? [on hold]

I want to test the BNP Paribas Open Bank Project API but I can't seem to find a json file or yaml to test with Swagger on some testing tools like Postman or SoapUI.
1
vote
1answer
18 views

How to define and code custom unit-test in raw PHP?

I am using some special PHP framework. I can't use any unit-test frameworks by some reasons like PHPunit or codeception. So i need to write my custom code to achieve that. Is there any examples could ...
0
votes
0answers
18 views

JUnit tests run separately but not all together using H2 database

I am running some JUnit tests that run perfectly separated one by one, but do not pass when they are all executed together. Here I show you some examples of the tests. I tried to close the connection ...
0
votes
1answer
31 views

How to Test Rest API of a website present inside a docker container? [on hold]

I've a website running in a localhost inside one docker container. I'm unable to hit the URI using Rest Assured from my eclipse. Not sure about the docker commands to use.
0
votes
0answers
15 views

How to run a Java application right after tests without Maven?

I have to do a test task and I am stuck at one point. It's said: 'The entry point of the whole application should lay through tests.' As I understand it: main(args[]) method should run right after the ...
0
votes
0answers
9 views

How to read .xcresult file to generate report

Can someone please help me to understand if there is a way I can read .xcresult file generated by executing KIF test from command prompt ? I want to read it outside of xcode to generate some reports ...
0
votes
1answer
17 views

Testing an abstracted if conditional

I'm trying to figure out the best way to test find_communities here without resorting to using polymorphism here to defeat the if statement staring at me. class CommunityFinder def initialize(...
0
votes
0answers
15 views

What is the difference between verification and validation?

General definitions On one hand, I've been working in embedded systems, specially in aeronautics (were DO178 applies to software) and i'm used to these definitions: validation: check with test, ...
0
votes
1answer
30 views

For new test cases, how to stop the Tester field automatically defaulting to the name of whoever created the card?

On creating a new test case in Azure DevOps, we've noticed the 'Tester' field is automatically set to the name of whoever created the card. This is incorrect, as testing on the card has not started ...
1
vote
1answer
44 views

Why does my test run in <1 second in single execution but 20+ seconds in maven build?

I am working on a project with several spring-boot-based integrationtests that take ~5 Minutes to run in total. Upon trying to reduce this runtime i noticed that one very small and simple test takes ~...
0
votes
1answer
14 views

Broken tests report with Composer

we are using Composer 0.6.0 and facing issues with the tests reports: no title nor screenshots appear, just the logcat, for each test. The following error appears in the console: Uncaught TypeError: ...
0
votes
1answer
37 views

How to make Task fail and then assert the exception

I am writing a lot of test to test negative scenarios so basically when a task fails I need to check that the right exception type is thrown and that the message is right. What I have tried by ...
0
votes
0answers
11 views

Trigger / execute another repo job (need only specific job triggered)

i'm currently setting up our qa team's repository yml file. so the dev team has their own repository, with it's own yml file, and so does the qa team. so what do i want to achieve is, when the dev ...
0
votes
0answers
37 views

Failed to load API definition.( Error Fetch errorundefined /swagger/v1/swagger.json)

Swagger is working fine for add and delete operation, but when I add one more method - UpdateProperty in PropertyController - then I get the error: Failed to load API definition Here is my ...
2
votes
1answer
31 views

How to mock service and test POST controller method

Expecting the controller method to return the newly created weather resource, but the response body is empty. Mocked the service to return a weather resource when the service method is called. POST ...
-8
votes
1answer
38 views

function parameters using uint32_t [on hold]

I am wanting to 'activate' an if else using a function's parameters. What I currently have is: int cpu(Level level, uint32_t function, std::vector<float> &output){ // stuff if (function ==...
-1
votes
0answers
30 views

How compatible are venv and virtualenv?

I have a lot of Python code tested in environments written with virtualenv and am starting to use venv since several people recommend it and some of my teammates are starting to use it. What are the ...
0
votes
0answers
15 views

Having trouble testing the if statement while testing Enzyme/Jest/React

I am trying to get the testing coverage above 80% and this line is preventing this from happening. I can't seem to get the if statement to fire when testing the application. The behavior is working as ...
1
vote
0answers
23 views

Laravel's Injected Request Object is different from one received by `request()`

Background: I am writing a feature test to test HMAC Authentication implementation. In my test, I set a header Authorization: Bearer {token} and send a simple GET request as such: $headers = ['...
3
votes
2answers
42 views

Jest Stateful component with async function failing test

I'm following along in this Jest test tutorial on Pluralsight here. And I've written code exactly like the author, but for some reason my test is not passing. My Pull request to the author's repo: ...
-2
votes
0answers
8 views

UAT test cases standards

Are there any standards defining if UAT test cases should be provided by IT or should be written by business users? Usually, each approach is based on the past experience of the stakeholders and a ...
0
votes
0answers
20 views

Matlab unable to plot validation and testing on neural network

I am working on time-series prediction using Recurrent Neural Network (matlab). I am using 'divideind' for RNN. But the problem I face is unable plotting the validation and testing data I have divided....
0
votes
0answers
29 views

if __name__ == “__main__”: not working when there is test function in the file (It works when running in terminal)

The problem is that the main.py has a test in it and I call the test within if __name__ == "__main__":. However, I keep getting the error 'missing arguments'. I give the arguments to the test function ...
0
votes
0answers
10 views

mock-fs readFileSync works but readFile throws

I'm currently using mock-fs to test a build script running on my project markdown files. // readIndex.test.js it('should reject if index.json doesn\'t returns an object', done => { mock(_mocks['...
0
votes
1answer
18 views

How can I know if something is a Integration Test or Unit Test

I'm adding tests to this function that is going to reach out my auth system and verify if the user has access to a specific resource. I'm confuse if this test is a unit test or integration test. I ...
0
votes
0answers
22 views

Testing a login form with Jest: Cannot read property 'value' of undefined

I am super new to testing with Jest, and I'm still having a really hard time with it. I'm trying to test my login form component, but I'm getting this error: TypeError: Cannot read property 'value' of ...
0
votes
1answer
32 views

Using Cypress select() When Select Contains Duplicate Values

I need to select a value in a select. The select is a list of countries, displaying their names, with a two-letter country code as the value for each option. We surface the most selected countries to ...
1
vote
3answers
42 views

Elixir best data structure for testing comparison

I have two array outputs where I need to iterate over each struct, and compare the counts where the source's match. The comparison needs to be less than or equal to. My output sources look like this: ...
1
vote
1answer
11 views

Why does TestGesture.moveBy fail to scroll in TabBarView?

I have ListView widgets within a TabBarView to allow users to scroll through the contents of each tab. I would like to test some of the widgets which are off screen. I followed this to scroll the ...
0
votes
1answer
9 views

How to retrieve current cest name in codeception?

I want to use the cest name in my tests, but are not able to retrieve it. According to the codeception documentation, it is possible to retrieve the function name. This is working for me: public ...
0
votes
0answers
21 views

how can I inject audio as input file to google assistant in android device using appium? [on hold]

I have an audio file present in internal memory of the device and need to pass to google assistant in android device programmatically.
0
votes
1answer
71 views

Testing a Redux login Action with fetch api

On my React-Native project, i tried to start unit testing, how to test on Redux action that involves a login fetch api call.I've looked at some examples of testing an async Action, but I haven't ...
0
votes
1answer
67 views

How to test a HTTP request

I have set up this simple http request, which simply returns a "hello world" response to my IDE terminal. I have been looking into testing and I am not quite sure how i would test what this method is ...
0
votes
1answer
23 views

React Native asynchronous Jest component testing

I have a component that dispatches a fetch request on mount, and displays the results. I am trying to create a test snapshot of this component after the request is completed. I've been banging my ...