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
16
votes
5 answers

Jest TypeError: fetch is not a function

I have the following Jest test code to test a fetch to an endpoint: import MovieApiService from 'services/MovieApiService'; import movies from '../constants/movies'; describe('MovieApiService', () => { test('if jest work correctly', () => { …
Jean
  • 5,201
  • 11
  • 51
  • 87
16
votes
2 answers

Test methods fail using Storage. Illuminate\Http\Testing\imagepng() in Laravel

Hello, I'm doing TDD to test my development, my tests were passing until I decided to reinstall php to repair the sqlite driver for testing (the main driver is mysql). So when I run my hole suite of tests this error shows in every method that uses…
Kenny Horna
  • 13,485
  • 4
  • 44
  • 71
16
votes
3 answers

Django testing how to assert Redirect

With the folliwing code I get this wrong result : nose.proxy.AssertionError: 302 != 200 : Couldn't retrieve redirection page '/mes_dossiers/': response code was 302 (expected 200) what is wrong with my code ? #test.py from django.test import…
Brigitte Maillère
  • 847
  • 1
  • 9
  • 27
16
votes
3 answers

Using Cucumber.js with Jest

I am using Jest for my unit tests and I'm in the process of integrating Cucumber.js for running specs written in Gherkin. I have it all set up and it's working, but I am running into one problem: How can I use Jest's expect? I could use chai's, but…
Johannes Fahrenkrug
  • 42,912
  • 19
  • 126
  • 165
16
votes
3 answers

How to tell Spring Boot to use another DB for test?

I'd like Spring Boot to use a MySQL test database that exists next to the application database for integration tests. At the moment, it's using a H2 database automatically because I added the H2 dependency in Gradle. This test for example now runs…
progonkpa
  • 3,590
  • 9
  • 31
  • 50
16
votes
6 answers

Unwanted symbol to string conversion of hash key

When I assign in my controller @my_hash = { :my_key => :my_value } and test that controller by doing get 'index' assigns(:my_hash).should == { :my_key => :my_value } then I get the following error message: expected: {:my_key=>:my_value}, got:…
medihack
  • 16,045
  • 21
  • 90
  • 134
16
votes
11 answers

User Interface Testing

We are working on a large project with a measure of new/modified GUI functionality. We've found in the past that we often introduced new problems in related code when adding new functionality. We have non-technical users perform testing, but they…
Niki
  • 1,173
  • 1
  • 14
  • 19
16
votes
7 answers

How to migrate stored procedures to testing db?

I have an issue with stored procedures and the test database in Rails 3.0.7. When running rake db:test:prepare it migrates the db tables from schema.rb and not from migrations directly. The procedures are created within migrations by calling the…
16
votes
1 answer

How come Node.js Assert doesn't have a notOk() method?

I am learning about testing in Node.js using mocha and the assert module. assert has these types of methods: assert.equal(); assert.deepEqual(); assert.deepStrict(); assert.strict(); assert.ok(); // Is the value true? And then there are some…
Jake Wilson
  • 88,616
  • 93
  • 252
  • 370
16
votes
2 answers

Gradle custom test sourceSet

I have a gradle project and have main and test as sourceSets. I do want test-main not to be part of test source sets. Now the issue I encounter is that when projects are build, the test-main is marked as Sources Root instead of Test Sources…
Maxime
  • 239
  • 1
  • 2
  • 6
16
votes
5 answers

nock is not intercepting my request

I'm trying to create some basic tests using karma server and nock. It seems like nock is not intercepting my requests at all, does anyone have idea? I can't figure out what is missing. I still getting real data. nock('https://api.github.com/users/'…
nico.amabile
  • 465
  • 1
  • 3
  • 12
16
votes
5 answers

ModelState.IsValid always true when testing Controller in Asp.Net MVC Web Api

I have tried to make this work and made many google/stackoverflow searches with no luck at all. I have a simple Model: public class MovieModel { public string Id { get; set; } [Required] [StringLength(100)] public string Name { get;…
André Baptista
  • 490
  • 8
  • 23
16
votes
0 answers

What causes Error -25204 getting snapshot for element during iOS app UI test

I am getting following error during a UI test (using simulator for iPhone 6): Assertion Failure: UI Testing Failure - Failure getting snapshot Error Domain=XCTestManagerErrorDomain Code=9 "Error -25204 getting snapshot for element
Hasaa2 Khidala
  • 161
  • 1
  • 3
16
votes
5 answers

How to integrate Sikuli scripts into Selenium?

I'm extensively using Selenium for integration testing. Works great for all normal stuff (HTML/AJAX), but no go when I'm trying to test third party ActiveX, Java applets and Flash components. The solution I've found for this is Sikuli. Works great…
vartec
  • 131,205
  • 36
  • 218
  • 244
16
votes
4 answers

Can't get ApplicationContext in Espresso tests

I keep getting the following error when running my Espresso tests: Attempt to invoke virtual method 'android.content.Context android.app.Instrumentation.getTargetContext()' on a null object reference @RunWith(AndroidJUnit4.class) public class…
Nxt3
  • 1,970
  • 4
  • 30
  • 52