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

Can Selenium verify text inside a PDF loaded by the browser?

My web application loads a pdf in the browser. I have figured out how to check that the pdf has loaded correctly using: verifyAttribute xpath=//embed/@src {URL of PDF goes here} It would be really nice to be able to check the contents of the pdf…
Daniel Alexiuc
  • 13,078
  • 9
  • 58
  • 73
17
votes
2 answers

Expect all array elements to be of the same class

I want to check that an array contains only objects of a specific class, let's say Float. A working example at the moment: it "tests array_to_test class of elements" do expect(array_to_test.count).to eq(2) expect(array_to_test[0]).to…
Chris Lontos
  • 175
  • 2
  • 9
17
votes
3 answers

Is it possible to watch variables at runtime?

I know the basics of debugging, and I know I can add watches to a variable that stop the program's execution on a given condition. But I didn't want to stop the program every time I need to see the value of a variable. Neither I want to log the…
Ortiz
  • 294
  • 1
  • 4
  • 14
17
votes
2 answers

How to make xUnit to run a Theory parallel?

I've got a test (Theory) which is slow and a bunch of test cases for it. So I want them to run simultaneously. I've created a simple example: [Theory] [MyTestData] public void MyTheory(int num, int sleep) { Console.WriteLine("{0:HH:mm:ss.ffff} -…
17
votes
2 answers

How to pass a value from a fixture to a test with clojure.test?

When using clojure.test's use-fixture, is there a way to pass a value from the fixture function to the test function?
Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622
17
votes
2 answers

How to use Jasmine and CucumberJS with Protractor

I'm looking to use Protractor, CucumberJS, and Jasmine for testing my project. How do I use both Jasmine and CucumberJS with Protractor? Here's the project setup I've created: /path/to/myproj/protractor.conf.js exports.config = { …
Aristarkh Artemiy
  • 347
  • 1
  • 4
  • 10
17
votes
7 answers

Understanding how software testing works and what to test

Intro: I've seen lots of topics here on SO about software testing and other terms I don't understand. Problem: As a beginner developer I, unfortunately, have no idea how software testing works, not even how to test a simple function. This is a…
RHaguiuda
  • 3,207
  • 9
  • 37
  • 55
17
votes
1 answer

Mocha Test Fails with AssertionError

In JUnit (Java) the result of a unit test is either a succes, failure or error. When i try to run a test with Mocha i either get a succes or assertion error. Is is normally to get an AssertionError for failure tests? (shouldn't it just be called…
user3452075
  • 411
  • 1
  • 6
  • 17
17
votes
10 answers

How to Test Web Code?

Does anyone have some good hints for writing test code for database-backend development where there is a heavy dependency on state? Specifically, I want to write tests for code that retrieve records from the database, but the answers will depend on…
kaybenleroll
  • 16,794
  • 16
  • 54
  • 66
17
votes
2 answers

How to select an element in protractor having multiple classes?

I have a div like this:
When I am trying to get the element in Protractor by…
Jyotirmoy Pan
  • 837
  • 2
  • 10
  • 28
17
votes
5 answers

Do you have any SQL Injection Testing "Ammo"?

When reading about SQL Injection and XSS i was wondering if you guys have a single string that could be used to identify those vulnerabilities and others. A string that could be thrown into a website database to black box check if that field is safe…
Ólafur Waage
  • 68,817
  • 22
  • 142
  • 198
17
votes
4 answers

Checking ActiveRecord Associations in RSpec

I am learning how to write test cases using Rspec. I have a simple Post Comments Scaffold where a Post can have many Comments. I am testing this using Rspec. How should i go about checking for Post :has_many :comments. Should I stub Post.comments…
Alok Swain
  • 6,409
  • 5
  • 36
  • 57
17
votes
3 answers

What's the idea behind pytest-cache?

pytest-cache It seems to be a tool to cache func/args->result pairs and even persist them between testsuite-runs. Which seems like a great idea to speed things up. However I haven't noticed any mention of automatically detecting a change of a…
user257754
  • 318
  • 1
  • 2
  • 6
17
votes
2 answers

RSpec can't find nested formatter

I am trying to run rspec only for Ruby (not Rails), for a simple Ruby file. I'm following Tut+ TDD Testing with Ruby. I have a competition directory with a lib folder and spec folder. ├── lib │   ├── competition.rb │   └── team.rb └── spec …
17
votes
3 answers

Testing a confirm dialog with Protractor

This seems to be a pretty simple question, but I really can't find an answer online and I was not able to find an answer myself. I'm using AngularJS for my application and at some point, I have a native JavaScript confirmation box/dialog which asks…
redwulf
  • 1,317
  • 3
  • 13
  • 35