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
2 answers

How can I run only a specific test in a Perl distribution?

This question is related to this question I asked before. I have multiple test files (A.t, B.t, C.t etc) created to test their respective module A, B, C & so on. But when I do a make test, it runs all the tests. But, when I'm working on a specific…
John
  • 1,681
  • 3
  • 20
  • 28
17
votes
4 answers

Selenium IDE - There was an unexpected Confirmation!

I have a button that displays Javascript confirmation popup. This is a part of my test case: clickAndWait buttonId verifyTextPresent Object has been deleted …
Ula Krukar
  • 12,549
  • 20
  • 51
  • 65
17
votes
2 answers

PowerMock: How to unmock a method?

I have a static method that is mocked using PowerMock to throw an exception. (It deletes files.) Unfortunately, during my @After (after-each-test) method, I need to call this method without the mocks. How can I umock a method? I don't see an…
kevinarpe
  • 20,319
  • 26
  • 127
  • 154
17
votes
6 answers

Testing GPS in Android

How do you test GPS applications in Android? Can we test it using the Android emulator?
Bharat Pawar
  • 1,867
  • 3
  • 18
  • 23
17
votes
1 answer

Angular testing: Protractor can't get input value

I'm new to Protractor..I think I understood the basic principles in spite of the lacking documentation, but I can't find a way to solve this problem. Given this code: ptor.findElement(protractor.By.input('canvas.description')).sendKeys('My…
Vito Schiavo
  • 223
  • 1
  • 2
  • 8
17
votes
10 answers

How To Simulate Lower CPU Processor Machines For Browser Testing

We have some users which are using lower-CPU powered machines and they're encountering slow response times using our web application. Is there any way for me to do testing so that I can simulate lower CPU rates? For example, I have 2.3 Ghz…
grassbl8d
  • 2,089
  • 4
  • 24
  • 34
17
votes
7 answers

WebApplicationContext doesn't autowire

I write this test class : @ContextConfiguration(locations = { "classpath:/test/BeanConfig.xml" }) public class CandidateControllerTest { @Mock(name = "candidateService") private CandidateService candidateService; …
gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
17
votes
8 answers

How to test a Singleton class?

I am using RSpec and want to test the constructor of a Singleton class more than one time. How can I do this? Best regards
brainfck
  • 9,286
  • 7
  • 28
  • 29
17
votes
5 answers

Mockito when().thenReturn calls the method unnecessarily

I'm working a bit on an inherited code. I've written a test that is supposed to catch NullPointerException (for it is trying to call a method from null object) @Test(expected=NullPointerException.class) public void…
Krzysztof Jarzyna
  • 227
  • 1
  • 3
  • 8
17
votes
3 answers

The 'right' way to run unit tests in Clojure

Currently, I define the following function in the REPL at the start of a coding session: (defn rt [] (let [tns 'my.namespace-test] (use tns :reload-all) (cojure.test/test-ns tns))) And everytime I make a change I rerun the…
Garrett Rowe
  • 1,205
  • 9
  • 13
17
votes
2 answers

Gradle Android testing

I'm new to gradle and Android Studio, and I'm trying to figure out how to run tests. I followed instructions in http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Testing and I'm able to run Instrument Tests but only executing…
LocoMike
  • 5,626
  • 5
  • 30
  • 43
17
votes
3 answers

How to use SmallCheck in Haskell?

I am trying to use SmallCheck to test a Haskell program, but I cannot understand how to use the library to test my own data types. Apparently, I need to use the Test.SmallCheck.Series. However, I find the documentation for it extremely confusing. I…
17
votes
5 answers

testing out of disk space in linux

I have a program that may be dying when it runs out of disk space writing a certain file, I am not sure if this is the case. I'd like to run it and see, but my test server is not going to run out of space any time soon. Is there any way I could mock…
Erix
  • 7,059
  • 2
  • 35
  • 61
17
votes
2 answers

How can I simulate ext3 filesystem corruption?

I would like to simulate filesystem corruption for the purpose of testing how our embedded systems react to it and ultimately have them fail as gracefully as possible. We use different kinds of block device emulated flash storage for data which is…
David Holm
  • 17,522
  • 8
  • 47
  • 47
17
votes
6 answers

To inject or to new?

With regards to using class objects within another class what is the best practice? To pass the class objects in the class _construct statement or create a new class object? Example 1: class Foo { private $bar; public function…
user1770717
  • 309
  • 1
  • 12