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.

For better answers, any questions about Software Quality Assurance & Testing should be asked on SQA - https://sqa.stackexchange.com/. You can ask only programming related questions on Stack Overflow and that too can be asked on SQA

From Wikipedia:

Software testing is an investigation conducted to provide developers and stakeholders with information about the quality of the product or service under test. Software testing can also provide an objective, independent view of the software to allow the business to appreciate and understand the risks of software implementation.

Test techniques include, but are not limited to, the process of executing a program or application with the intent of finding software bugs (errors or other defects).

Software testing can be stated as the process of validating and verifying that a software program/application/product:

  1. meets the requirements that guided its design and development;
  2. works as expected;
  3. can be implemented with the same characteristics.

There are white-box-tests and black-box-tests.

A white-box test verifies the structure of a software product whereas the block-box test validates the requirements.

Software testing, depending on the testing method employed, can be implemented at any time in the development process. However, most of the test effort occurs after the requirements have been defined and the coding process has been completed. As such, the methodology of the test is governed by the software development methodology adopted.

The following types of tests are commonly used to denote the level of detail the tests are focused on:

Agile and Test Driven Development

Agile development model places added emphasis on testing. Test driven development advocates writing a test for a feature before developing the actual feature. Additional information:

Shift-left testing

Shift-left testing is an approach to software testing and system testing in which testing is performed earlier in the lifecycle (i.e. moved left on the project timeline).

49776 questions
17
votes
5 answers

using enzyme.mount().setProps with a react-redux Provider

I have a test which is setting props, to observe some changes in the component. The only complication is that I'm wrapping the rendered element in a because there are some connected components further down the tree. I'm rendering…
GTF
  • 8,031
  • 5
  • 36
  • 59
17
votes
3 answers

testing that an activity called setResult

I'm writing tests for an activity (my test class extends ActivityInstrumentationTestCase2), I've got some basic tests written and working fine. However my activity when it completes returns extra data to the calling activity via…
superfell
  • 18,780
  • 4
  • 59
  • 81
17
votes
2 answers

Error when using @WebMvcTest annotation on a Spring Boot test class

I've written a test class for a Spring MVC controller by following the "Testing the Spring MVC slice" section described here. The class looks like this: @RunWith(SpringRunner.class) @WebMvcTest(controllers=OurController.class) public class…
pacoverflow
  • 3,726
  • 11
  • 41
  • 71
17
votes
3 answers

Spring-boot-starter-test cannot run database integration test

I'm running a spring test, but sadly I still keep getting this error . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____|…
tecnocrata
  • 901
  • 1
  • 8
  • 19
17
votes
2 answers

Stripe: can I copy production data to test?

I'm working on a script that uses the Strip REST api with the PHP SDK. I was hoping to be able to replicate the production data in the test environment. Is this possible? Thanks, Andrew
Andrew Hughes
  • 311
  • 3
  • 5
17
votes
1 answer

Why the 'Moq.Proxy.CastleProxyFactory' type initializer exception when using NET40-NoCastle?

So I copied the sample code from the Moq home page pretty much verbatim, and am getting a castle proxy exception. Here's my code (as a console app for an easier sample) using System; using System.Collections.Generic; using System.Linq; using…
John MacIntyre
  • 12,910
  • 13
  • 67
  • 106
17
votes
3 answers

No coverage report for inlined Kotlin methods

Kotlin functions marked with inline keyword are, well, inlined during the compilation and it seems that code coverage tools (like JaCoCo) fail to properly calculate code coverage. What is the usual approach to overcoming this issue? Is there a way…
Czyzby
  • 2,999
  • 1
  • 22
  • 40
17
votes
4 answers

Install old version via TestFlight

For internal testing we want to install an old version on a device of someone who's UDID is not in the list. Via TestFlight I can add the email of this person in order for him to download the newest version (via internal testing), but I was…
CorneeldH
  • 593
  • 1
  • 8
  • 21
17
votes
4 answers

What is the proper way of testing throttling in DRF?

What is the proper way of testing throttling in DRF? I coulnd't find out any answer to this question on the net. I want to have separate tests for each endpoint since each one has custom requests limits (ScopedRateThrottle). The important thing is…
jmolinski
  • 173
  • 2
  • 6
17
votes
2 answers

Testing EditText errors with Espresso on Android

I want to test if an EditText field has an error (set with editText.setError("Cannot be blank!")). I've created an Espresso test case with the new AndroidStudio 2.2 feature, to record Espresso tests. So the code is pretty much auto-generated. But…
Michael Woywod
  • 448
  • 4
  • 12
17
votes
5 answers

Testing in Python - how can I use assertRaises in testing using 'unittest'?

I am trying to do a simple test in Python using 'unittest', to see if a class throws an exception if it gets an unsuitable input for the constructor. The class looks like this: class SummaryFormula: def __init__( self, summaryFormula): …
Tomas Novotny
  • 7,547
  • 9
  • 26
  • 23
17
votes
9 answers

TDD: Which methods do you expose for unit testing?

There is one aspect of TDD which I never fully understood. Suppose somebody asked you to implement a simple Stack object. If you've done your design properly, you will come to a very minimal and clean API. Suppose: push(), pop() and isEmpty().…
Yuval Adam
  • 161,610
  • 92
  • 305
  • 395
17
votes
2 answers

"Almost Equal" in Jasmine

The Story: In Python built-in unittest framework, there is an "approximate equality" assertion implemented via assertAlmostEqual() method: x = 0.1234567890 y = 0.1234567891 self.assertAlmostEqual(x, y) Which has the number of decimal places to…
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
17
votes
5 answers

One of strings in array to match an expression

The Problem: I have an array of promises which is resolved to an array of strings. Now the test should pass if at least one of the strings matches a regular expression. Currently, I solve it using simple string…
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
17
votes
1 answer

How to test a Node API that uses JWT Authentication (with User login to get token)

TL;DR - What is the way to test the resources in a Node API (Express) that uses JWT for Authentication with the token itself only granted to a username/password login? I’m kinda new to testing and wanted to get some advice. The end goal is to have…
nodenoob
  • 369
  • 4
  • 12