Verifying the behavior of a software system against the expected behavior of that system.

learn more… | top users | synonyms

52
votes
9answers
7k views

Should a developer also act as a tester? [closed]

We're a scrum team of 3 developers, 1 designer, the scrum master, and the product owner. However, we don't have official tester in our team. A problem that is always with us, is that, testing the ...
9
votes
8answers
2k views

Functional testing must be done by external party to avoid bias? [duplicate]

Our developers demand that someone external to the development team completes the functional testing. Their argument is that they are biased and cannot test their own code as they are too close to it. ...
74
votes
16answers
15k views

When is unit testing inappropriate or unnecessary? [duplicate]

It seems to be generally assumed (on Stack Overflow at least) that there should always be unit tests, and they should be kept up to date. But I suspect the programmers making these assertions ...
23
votes
5answers
3k views

Do I need unit test if I already have integration test?

If I already have integration test for my program, and they all passed, then I have a good feel that it will work. Then what are the reasons to write/add unit tests? Since I already have to write ...
29
votes
5answers
5k views

Why is it often said that the test cases need to be made before we start coding? [duplicate]

Why is it often said that the test cases need to be made before we start coding? What are its pros and what the cons if we don't listen to this advice? Moreover, does that advice refer to black box ...
62
votes
10answers
10k views

(Why) is it important that a unit test not test dependencies?

I understand the value of automated testing and use it wherever the problem is well-specified enough that I can come up with good test cases. I've noticed, though, that some people here and on ...
15
votes
2answers
861 views

Software Testing Techniques or Categories [closed]

What kinds of software testing do you know? I've heard about Test-Driven Development, Unit tests etc, but can't understand their importance and difference. For example, why are we using regression ...
13
votes
4answers
527 views

How to structure tests where one test is another test's setup?

I'm integration testing a system, by using only the public APIs. I have a test that looks something like this: def testAllTheThings(): email = create_random_email() password = ...
37
votes
10answers
5k views

Should we test all our methods?

So today I had a talk with my teammate about unit testing. The whole thing started when he asked me "hey, where are the tests for that class, I see only one?". The whole class was a manager (or a ...
38
votes
6answers
7k views

Testing multi-threaded race conditions

Reading the comments to this answer, specifically: Just because you can't write a test doesn't mean it's not broken. Undefined behaviour which usually happens to work as expected (C and C++ are ...
11
votes
4answers
712 views

Unit testing internal components

To what extent do you unit test internal/private components of a class/module/package/etc? Do you test them at all or do you just test the interface to the outside world? An example of these internal ...
60
votes
11answers
7k views

Is it a bad practice to modify code strictly for testing purposes

I have a debate with a programmer colleague about whether it is a good or bad practice to modify a working piece of code only to make it testable (via unit tests for example). My opinion is that it ...
21
votes
6answers
2k views

How to explain the value of unit testing

I want to introduce the concept of unit tests (and testing in general) to my co-workers; right now there are no tests at all and things are tested by actually performing the tasks via the UI to see ...
32
votes
9answers
3k views

Are programmers bad testers?

I know this sounds a lot like other questions which have already being asked, but it is actually slightly different. It seems to be generally considered that programmers are not good at performing the ...
19
votes
4answers
4k views

Best practices for retrofitting legacy code with automated tests

I'm about to take on the task of reimplementing an already defined interface (a set of C++ header files) in a relatively large and old code base. Before doing this, I would like to have as complete ...
76
votes
10answers
20k views

How should I test randomness?

Consider a method to randomly shuffle elements in an array. How would you write a simple yet robust unit test to make sure that this is working? I've come up with two ideas, both of which have ...
67
votes
27answers
14k views

Why to let / not let developers test their own work

I want to gather some arguments as to why letting a developer testing his/her own work as the last step before the product goes into production is a bad idea, because unfortunately, my place of work ...
26
votes
7answers
8k views

Automated unit testing, integration testing or acceptance testing [closed]

TDD and unit testing seems to be the big rave at the moment. But it is really that useful compared to other forms of automated testing? Intuitively I would guess that automated integration testing is ...
25
votes
4answers
2k views

Unit testing best practices for a unit testing newbie

In recent years, I have only written small components for people in larger projects or small tools. I have never written a unit test and it always seems like learning how to write them and actually ...
20
votes
5answers
4k views

What is a normal “functional lines of code” to “test lines of code” ratio?

I'm pretty new to TDD approach and my first experiments say that writing 1 line of functional code means writing about 2-3 lines of testing code. So, in case I'm going to write 1000 LOC, the whole ...
5
votes
1answer
1k views

Is there an established or defined best practice for source control branching between development and production builds?

I struggled in how to phrase my question, so let me give an example in hopes of making more clear what I am after: I currently work on a dev team responsible for maintaining and adding features to a ...
1
vote
3answers
502 views

How do I test my code in Python other than by doing it by hand?

I am used to user testing in Java, and I also manually test each section of code I write, but now, I want to automate it. There is no GUI for this project, so user testing is not required and I can ...
80
votes
20answers
10k views

Why does TDD work? [closed]

Test-driven development (TDD) is big these days. I often see it recommended as a solution for a wide range of problems here in Programmers SE and other venues. I wonder why it works. From an ...
70
votes
12answers
12k views

New to TDD. Should I avoid private methods now?

I'm just now learning TDD. It's my understanding that private methods are untestable and shouldn't be worried about because the public API will provide enough information for verifying an object's ...
44
votes
11answers
19k views

What are the disadvantages of automated testing?

There are a number of questions on this site that give plenty of information about the benefits that can be gained from automated testing. But I didn't see anything that represented the other side of ...
31
votes
10answers
3k views

Should developers be responsible for tests other than unit tests, if so which ones are the most common?

I am currently working on a rather large project, and I have used JUnit and EasyMock to fairly extensively unit test functionality. I am now interested in what other types of testing I should worry ...
20
votes
10answers
3k views

What to do with bugs that do not repro?

I have a tester that while testing will have an error occur (ok so far), but then he frequently reports it right away. We (the developers) then later find that the tester has not tried to reproduce ...
8
votes
3answers
20k views

How to test the data access layer?

I have a DAO method that utilizes Spring for JDBC access. It calculates a seller's success rate of selling an item. Here is the code: public BigDecimal getSellingSuccessRate(long seller_id) { ...
16
votes
7answers
5k views

Coding and testing in the same sprint

How is testing handled within the same sprint as coding, if all or most of the coding is not done until the end of the sprint? (I'm referring to the "soup-to-nuts" development and testing of a single ...
8
votes
5answers
714 views

In functional programming how does one achieve modularity through mathematical laws?

I read in this question that functional programmers tend to use mathematical proofs to ensure that their program is working correctly. This sounds alot easier and faster than unit testing, but coming ...
12
votes
2answers
577 views

How to open-source a project whose git repository has copyrighted media in the history?

I want to release an audio fingerprinting software project under a free license, but the repository contains copyrighted audio files. The test cases also currently use these files. How do I release ...
9
votes
5answers
5k views

What is a good measure of testing/tester efficiency?

I am about to participate in a discussion with management regarding measuring our testing efficiency as a QA organization. The main reason behind this is that half of our team is contracted out and ...
6
votes
3answers
621 views

Functional testing before code checkin

I am working on a project with legacy code where it does not have much code coverage. One of the idea to improve that is to enforce a rule that each code check-in must have test, not only test but ...
6
votes
2answers
1k views

Unit test SHA256 wrapper queries

I have the following SHA256 wrapper. public static string SHA256(string plainText) { StringBuilder sb = new StringBuilder(); SHA256CryptoServiceProvider provider = new ...
5
votes
2answers
3k views

How much time/money should be spent on software QA/QC? [closed]

Any non-trivial commercial application/program/system/what-have-you requires testing (QA/QC). Not counting things like automated tests, how much time/money relative to the development investment in ...
4
votes
4answers
891 views

What is the benefit of the MoSCoW technique?

I do not see how the MoSCoW Method's "Must, Should, Could, Would" prioritisation is better that simply 1,2,3,4? If I receive the requirements from the customer, they already are prioritised, usually ...
1
vote
1answer
600 views

How do we structure our JavaScript so that it is easily editable, testable, and can make calls to render a view without knowing specifics about it?

I am working on a web application that displays some data and uses JavaScript. Right now, we are serving up parts of our JavaScript code (to display certain types of information, that is, "Render a ...
9
votes
2answers
333 views

Strategies to troubleshoot an error that only happens on a specific device

As an Android developer, the target market I create apps for is very fragmented. While I can specify certain requirements - e.g. my app only supports Android version x.x or above, sometimes errors may ...
4
votes
2answers
892 views

How can I test an application that depends on specific hardware

I have written an Android application. The application requires a Bluetooth connection to a very specific piece of hardware, currently a prototype. The only way I can test the app at present is to ...
243
votes
21answers
34k views

Leaving intentional bugs in code for testers to find

We don't do this at our firm, but one of my friends says that his project manager asked every developer to add intentional bugs just before the product goes to QA. This is how it works: Just before ...
74
votes
5answers
20k views

What are the key points of Working Effectively with Legacy Code? [closed]

I've seen the book Working Effectively with Legacy Code recommended a few times. What are the key points of this book? Is there much more to dealing with legacy code than adding unit/integration ...
48
votes
11answers
7k views

How is software used in critical life-or-death systems tested?

An airplane, as opposed to, for example, a website, is a system where any failure in certain systems is completely unacceptable, since errors in e.g. flight monitoring can cause the autopilot to ...
72
votes
10answers
8k views

Are (database) integration tests bad?

Some people maintain that integration tests are all kinds of bad and wrong - everything must be unit-tested, which means you have to mock dependencies; an option which, for various reasons, I'm not ...
35
votes
3answers
5k views

Are asserts or unit tests more important?

Both asserts and unit tests serve as documentation for a codebase, and a means of discovering bugs. The main differences are that asserts function as sanity checks and see real inputs, whereas unit ...
52
votes
19answers
6k views

How come compilers are so reliable?

We use compilers on a daily basis as if their correctness is a given, but compilers are programs too, and can potentially contain bugs. I always wondered about this infallible robustness. Have you ...
50
votes
8answers
7k views

Is it good that testers are competing to see who opens more bugs?

I'm a software developer. There is a team of testers who follow and run test cases written by the analyst, but also perform exploratory testing. It seems like the testers have been competing to see ...
15
votes
7answers
3k views

How do big companies of software developers check for bugs in their programs?

I was wondering how big companies of software developers check for bugs in their programs. Do they just test it on several computers?
13
votes
4answers
4k views

Should each unit test be able to be run independently of other tests?

Say you have tests for two methods of a class. The first method gathers data from another tier and puts it into some sort of storage independent of the runtime (such as a SQL table), so all of the ...
8
votes
5answers
412 views

Solving which bugs will give greatest cost benefit [closed]

I wanted to get an idea of categorizing bugs based on how easy is it to solve and how much benefit it will give me. for e.g., if there is a bug which will take say an hour (double file close etc.) to ...
28
votes
9answers
3k views

What are the disadvantages of writing code before writing unit tests?

I have always seen the recommendation that we should first write unit tests and then start writing code. But I feel that going the other way is much more comfortable (for me) - write code and then the ...