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
128
votes
7 answers

How to test the equivalence of maps in Golang?

I have a table-driven test case like this one: func CountWords(s string) map[string]int func TestCountWords(t *testing.T) { var tests = []struct { input string want map[string]int }{ {"foo", map[string]int{"foo":1}}, {"foo bar…
andras
  • 6,339
  • 6
  • 26
  • 22
128
votes
10 answers

How to test an SQL Update statement before running it?

In some cases, running an UPDATE statement in production can save the day. However a borked update can be worse than the initial problem. Short of using a test database, what are options to tell what an update statement will do before running it?
static_rtti
  • 53,760
  • 47
  • 136
  • 192
127
votes
6 answers

Unit Test? Integration Test? Regression Test? Acceptance Test?

Is there anyone that can clearly define these levels of testing as I find it difficult to differentiate when doing TDD or unit testing. Please if anyone can elaborate how, when to implement these?
127
votes
10 answers

How to pass arguments in pytest by command line

I have a code and I need to pass the arguments like name from terminal. Here is my code and how to pass the arguments. I am getting a "File not found" kind error that I don't understand. I have tried the command in the terminal: pytest .py…
ashish sarkar
  • 1,289
  • 2
  • 9
  • 7
127
votes
2 answers

Run a single Maven plugin execution?

I thought I was an experienced Maven user, but I am having a mental block on how to do this! I've been able to use the Maven sql plugin to drop, create, and install a schema in a database via plugin executions I've defined and bound to the…
Dave
  • 21,524
  • 28
  • 141
  • 221
127
votes
8 answers

Golang testing: "no test files"

I'm creating a simple test within my package directory called reverseTest.go package main import "testing" func TestReverse(t *testing.T) { cases := []struct { in, want string }{ {"Hello, world", "dlrow ,olleH"}, …
Juan M
  • 4,063
  • 4
  • 19
  • 28
127
votes
10 answers

How can I measure the speed of code written in PHP?

How can I say which class of many (which all do the same job) execute faster? is there a software to measure that?
M. A. Kishawy
  • 5,001
  • 11
  • 47
  • 72
126
votes
12 answers

JUnit vs TestNG

At work we are currently still using JUnit 3 to run our tests. We have been considering switching over to JUnit 4 for new tests being written but I have been keeping an eye on TestNG for a while now. What experiences have you all had with either…
Sam Merrell
  • 2,352
  • 2
  • 16
  • 14
126
votes
34 answers

How to select option in drop down protractorjs e2e tests

I am trying to select an option from a drop down for the angular e2e tests using protractor. Here is the code snippet of the select option: