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
167
votes
12 answers

Override Java System.currentTimeMillis for testing time sensitive code

Is there a way, either in code or with JVM arguments, to override the current time, as presented via System.currentTimeMillis, other than manually changing the system clock on the host machine? A little background: We have a system that runs a…
Mike Clark
  • 11,769
  • 6
  • 39
  • 43
167
votes
7 answers

How to get started on TDD with Ruby on Rails?

I am familiar with the concepts (took testing classes in college), but I am not sure how to really use them yet since I never worked on a "real" TDD project. I am about to start the development of a project using Ruby on Rails (most likely using…
marcgg
  • 65,020
  • 52
  • 178
  • 231
166
votes
11 answers

What is the difference between integration testing and functional testing?

Are functional testing and integration testing the same? You begin your testing through unit testing, then after completing unit testing you go for integration testing where you test the system as a whole. Is functional testing the same as…
Mishthi
  • 1,947
  • 5
  • 16
  • 12
163
votes
4 answers

How do I read an Istanbul Coverage Report?

I've always used Jasmine for my unit tests, but recently I started using Istanbul to give me code coverage reports. I mean I get the gist of what they are trying to tell me, but I don't really know what each of these percentages represent (Stmts,…
Scott Sword
  • 4,648
  • 6
  • 32
  • 37
161
votes
4 answers

Set up RSpec to test a gem (not Rails)

It is pretty easy with the added generator of rspec-rails to set up RSpec for testing a Rails application. But how about adding RSpec for testing a gem in development? I am not using jeweler or such tools. I just used Bundler (bundle gem my_gem) to…
medihack
  • 16,045
  • 21
  • 90
  • 134
160
votes
5 answers

What is the difference between 'toBe' and 'toEqual' in Jest?

Jest documentation reads: toBe just checks that a value is what you expect. It uses === to check strict equality. And for toEqual: Use .toEqual when you want to check that two objects have the same value. This matcher recursively checks the…
sshh
  • 5,964
  • 4
  • 17
  • 20
160
votes
16 answers

Unit testing Bash scripts

We have a system that has some Bash scripts running besides Java code. Since we are trying to test everything that could possibly break, and those Bash scripts may break, we want to test them. The problem is it is hard to test Bash scripts. Is there…
nimcap
  • 10,062
  • 15
  • 61
  • 69
155
votes
6 answers

How do I run a single test with Nose in Pylons

I have a Pylons 1.0 app with a bunch of tests in the test/functional directory. I'm getting weird test results and I want to just run a single test. The nose documentation says I should be able to pass in a test name at the command line but I get…
Ben
  • 10,931
  • 9
  • 38
  • 47
153
votes
23 answers

Can unit testing be successfully added into an existing production project? If so, how and is it worth it?

I'm strongly considering adding unit testing to an existing project that is in production. It was started 18 months ago before I could really see any benefit of TDD (face palm), so now it's a rather large solution with a number of projects and I…
djdd87
  • 67,346
  • 27
  • 156
  • 195
152
votes
6 answers

What is a "Stub"?

So, carrying on with my new years resolution to get more in to TDD, I am now starting to work more with Rhino Mocks. One thing I am keen to do is to make sure I really grok what I am getting into, so I wanted to check my understanding of what I have…
Rob Cooper
  • 28,567
  • 26
  • 103
  • 142
152
votes
8 answers

python: how to send mail with TO, CC and BCC?

I need for testing purposes to populate few hundred email boxes with various messages, and was going to use smtplib for that. But among other things I need to be able to send messages not only TO specific mailboxes, but CC and BCC them as well. It…
user63503
  • 6,243
  • 14
  • 41
  • 44
151
votes
14 answers

How to Unit test with different settings in Django?

Is there any simple mechanism for overriding Django settings for a unit test? I have a manager on one of my models that returns a specific number of the latest objects. The number of objects it returns is defined by a NUM_LATEST setting. This has…
Soviut
  • 88,194
  • 49
  • 192
  • 260
151
votes
6 answers

Git branching strategy integated with testing/QA process

Our development team has been using the GitFlow branching strategy and it has been great ! Recently we recruited a couple testers to improve our software quality. The idea is that every feature should be tested/QA by a tester. In the past,…
David Lin
  • 13,168
  • 5
  • 46
  • 46
148
votes
4 answers

What's the difference between src/androidtest and src/test folders?

In a project, in Android Studio, by default, there are two test folders. The first is src/androidTest. This folder already existed in the previous version of Android Studio. Nevertheless, there is now a new test folder, by default, src/test, and new…
lopez.mikhael
  • 9,943
  • 19
  • 67
  • 110
147
votes
12 answers

Test expected exceptions in Kotlin

In Java, the programmer can specify expected exceptions for JUnit test cases like this: @Test(expected = ArithmeticException.class) public void omg() { int blackHole = 1 / 0; } How would I do this in Kotlin? I have tried two syntax variations,…
fredoverflow
  • 256,549
  • 94
  • 388
  • 662