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

learn more… | top users | synonyms

128
votes
45answers
39k views

Does giving a developer a slower development machine result in faster/more efficient code?

Suppose I give my developers a screaming fast machine. WPF-based VS2010 loads very quickly. The developer then creates a WPF or WPF/e application that runs fine on his box, but much slower in the ...
68
votes
11answers
6k views

Is there a reason that tests aren't written inline with the code that they test?

I've been reading a bit about Literate Programming recently, and it got me thinking... Well-written tests, especially BDD-style specs can do a better job at explaining what code does than prose does, ...
66
votes
19answers
7k views

Why does TDD work?

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 ...
66
votes
16answers
9k 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 ...
60
votes
27answers
7k 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 ...
58
votes
21answers
5k views

“It was working yesterday, I swear!” What can you do?

When you arrive in the morning, you find that your software does not work anymore, even though it did when you left yesterday evening. What do you do? What do you check first? What do you do to stop ...
57
votes
11answers
6k 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 ...
54
votes
12answers
5k 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 ...
53
votes
14answers
3k views

Is it reasonable to insist on reproducing every defect before diagnosing and fixing it?

I work for a software product company. We have large enterprise customers who implement our product and we provide support to them. For example, if there is a defect, we provide patches, etc. In other ...
46
votes
6answers
4k views

65.000.000.000 tests to run

I was asked about how to run a suite of 65.000.000.000 tests and I wonder if it is normal to have a project with such a huge amount of tests. Have you worked in projects with this characteristic?
45
votes
10answers
5k 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 ...
44
votes
14answers
2k views

How to get better at testing your own code

I am a relatively new software developer, and one of the things I think I should improve is my ability to test my own code. Whenever I develop a new functionality, I find it really difficult to follow ...
43
votes
19answers
3k 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 ...
41
votes
10answers
5k 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 ...
41
votes
6answers
5k views

How to deal with static utility classes when designing for testability

We are trying to design our system to be testable and in most parts developed using TDD. Currently we are trying to solve the following problem: In various places it is necessary for us to use static ...
39
votes
8answers
2k views

Does software testing methodology rely on flawed data?

It’s a well-known fact in software engineering that the cost of fixing a bug increases exponentially the later in development that bug is discovered. This is supported by data published in Code ...
37
votes
11answers
9k 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 ...
36
votes
14answers
2k views

If you had two projects with the same specification and only one was developed using TDD how could you tell?

I was asked this question in an interview and it has been bugging me ever since. You have two projects, both with the same specification but only one of these projects was developed using Test ...
36
votes
8answers
3k views

Should a developer also act as a tester?

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 ...
34
votes
11answers
1k 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 ...
33
votes
9answers
2k views

How baby are your baby-steps in TDD?

Today we were training TDD and found the following point of misunderstanding. The task is for the input "1,2" return sum of numbers which is 3. What I have written (in C#) was: numbers = ...
32
votes
9answers
2k 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 ...
31
votes
21answers
5k views

Is Software Testing Really Needed?

I'm a student working on my B.E(CS) and my question is the following: Is testing in the software field needed? If we create a software with great care, then why should we test? After testing can ...
31
votes
10answers
2k 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 ...
30
votes
5answers
7k views

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

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 ...
27
votes
11answers
2k views

Do I need to test everything?

I'm going to start my first real project in Ruby on Rails, and I'm forcing myself to write TDD tests. I don't see real advantages in writing tests, but since it seems very important, I'll try. Is it ...
27
votes
7answers
2k views

Is it sufficient to use acceptance and integration tests instead of unit test?

Short introduction to this question. I have used now TDD and lately BDD for over one year now. I use techniques like mocking to make writing my tests more efficiently. Lately I have started a ...
27
votes
15answers
474 views

Staying Relevant As a Programmer

I am interested in hearing how various people remain in the Software Engineering industry for so long in their careers. I am at a crossroads myself as I have worked with Network Engineering, ...
26
votes
5answers
2k 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 ...
26
votes
5answers
3k 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 ...
25
votes
4answers
1k views

Why it is not recommended to post several defects in the same issue / ticket?

I am not sure if this is the place to ask the following conceptual question (Stackoverflow is definitely not). I saw this question in a multiple choice exam (single answer), similar to the ISTQB ...
25
votes
3answers
2k views

What is the term for a 'decoy' feature or intentional bug? [closed]

I have forgotten a slang programming term. This thing is an intentional bug or a decoy feature used as a distraction. An example usage, "Hey Bob, QA is doing a review today. Put a $THING into the ...
24
votes
4answers
1k views

How to efficiently troubleshoot or test new code when hardware setup to reproduce bugs is difficult or impossible to obtain?

I work at a mid-sized company (150ish employees, ~10 size engineering team), and most of my projects involve interfacing with lab equipment (oscilloscopes, optical spectrum analyzers, etc) for the ...
24
votes
7answers
885 views

Is a programmer supposed to be self-sufficient?

At my current workplace, we don't have any testers, the rationale for that from the management being: "if we had testers, you wouldn't test your own code at all". This kind of thinking seems to be ...
24
votes
3answers
2k 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 ...
23
votes
11answers
1k views

Is it possible to write software that doesn't need to be continually modified?

I have written a lot of software in many different languages, and I've also "written" hardware for use with FPGAs using Verilog and VHDL. I tend to enjoy writing hardware more than software, and I ...
23
votes
5answers
17k views

What is an integration test exactly?

My friends and I have been struggling to classify exactly what is an integration test. Now, on my way home, I just realised, that every time I try to give a real world example of an integration ...
23
votes
14answers
960 views

Is software testing actually done on professional projects?

I've been involved with many projects in several companies because I've been a developer for a long time and I'm a contractor. I estimate that less than 20% of projects are methodically tested. With ...
22
votes
11answers
2k views

Why it is necessary to to test my iPhone app on actual iPhone device

I developed one application for iPhone and now I want it on App Store. So many my iOS geek friends told me to test it on actual device i.e. on iPhone. So I wonder that why it is necessary to to test ...
21
votes
5answers
2k views

Do unit tests sometimes break encapsulation? [duplicate]

I very often hear the following: "If you want to test private methods, you'd better put that in another class and expose it." While sometimes that's the case and we have a hiding concept inside our ...
20
votes
14answers
2k views

When is it okay to ship a product with a known bug?

When is it okay to ship a product with a known bug?
20
votes
8answers
1k 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 ...
20
votes
5answers
943 views

Should testers approve releases, or just report on tests?

Does it make sense to give signoff authority to testers? Should a test team Just test features, issues, etc, and simply report on a pass/fail basis, leaving it up to others to act on those results, ...
20
votes
7answers
4k 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 ...
20
votes
2answers
593 views

How do I create an environment where fixing tests is seen as a priority?

I am a software engineer at a medium sized company. We have a fairly robust testing platform running on TeamCity. It does unit tests on every checkin, and a daily unit test/BVT run. The problem is ...
20
votes
4answers
1k 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 ...
19
votes
7answers
1k views

Should I test inherited methods?

Suppose I have a class Manager derived from a base class Employee, and that Employee has a method getEmail() that is inherited by Manager. Should I test that the behaviour of a manager's getEmail() ...
19
votes
9answers
2k 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 ...
18
votes
9answers
2k views

What should come first: testing or code review?

I'm quite new to programming design patterns and life cycles and I was wondering, what should come first, code review or testing, regarding that those are done by separate people? From the one side, ...
18
votes
4answers
4k views

What is the correct way to handle debug output in Java?

As my current Java projects grow bigger and bigger, I feel a likewise growing need to insert debug output in several points of my code. To enable or disable this feature appropriately, depending on ...