Tagged Questions

A unit is the smallest testable part of an application. In procedural programming, a unit may be an individual function or procedure. Unit tests are created by programmers or occasionally by white box testers.

learn more… | top users | synonyms (1)

1
vote
2answers
70 views

Looking for good testing in multithreaded C or C++ open source projects

I have read a lot about the importance of unit testing, and testing in general. In particular I have read about TDD which, in theory, seems like a good way to ensure effective test coverage for a ...
31
votes
10answers
859 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 ...
8
votes
5answers
219 views

switch statement - handling default case when it can't be reached

If I'm using a switch statement to handle values from an enum (which is owned by my class) and I have a case for each possible value - is it worth adding code to handle the "default" case? enum ...
4
votes
4answers
185 views

Unit testing: about easy- and hard-first strategies

I've never written a unit test. I'm reading The art of Unit Testing by Osherove, and he explains a way to choose where to start when you're writing tests for legacy code. Basically you end up with ...
32
votes
14answers
2k views

When is unit testing inappropriate or unnecessary?

It seems to be generally assumed (on SO 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 work on different ...
-3
votes
2answers
72 views

Systematic Testing

Can anyone please explain to me what is systematic testing? If say I'm developing a mobile application and need to do systematic testing; what would that be involved?
4
votes
6answers
261 views

Can the Strategy pattern be implemented without significant branching?

The Strategy pattern works well to avoid huge if...else constructs and make it easier to add or replace functionality. However, it still leaves one flaw in my opinion. It seems like in every ...
4
votes
1answer
71 views

What and how to unit test a django web application?

I am writing unit tests for a web frontend implemented in Django. I have written unit tests that check that all views return the correct status code (200, 302 etc) so that template errors (which give ...
16
votes
4answers
373 views

How do I write unit tests for robots (and other mechanical devices)?

I'm a member of my high school's robotics club, and am responsible for programming the robot. One suggestion I keep hearing from various adults is that I should be writing unit tests to help validate ...
2
votes
1answer
88 views

Virtual Machines And Unit/Integration Testing Web Application

I am in the process of adding unit testing to a project I am working on at work and a suggestion came up that I should use VMs to populate the database with good data. This was suggested as an ...
9
votes
3answers
229 views

Real-world examples of apps written with TDD and good test coverage?

Are there any open source applications that are developed using test driven development that serve as models of how good unit testing should work? I'd prefer to see examples in C# and .NET. (Note ...
0
votes
3answers
132 views

Is Debug.Assert obsolete if you write unit tests?

Just like the question asks, is there a need to add Debug.Assert into your code if you are writing unit tests (which has its own assertions)? I could see that this might make the code more obvious ...
-1
votes
2answers
121 views

any good short papers about TDD [closed]

I have so many years without coding with unit testing and I need a refresh to my acknowledgement about it so, If anybody could recommend me a couple of tutorials and papers about it, will be ...
4
votes
8answers
427 views

Testing loses its effectiveness if all programmers don't use them

Let's assume you are convinced that the extra time spent unit testing has merit and improves production. Does that still hold up when everyone working on the same code doesn't use them? This question ...
0
votes
1answer
43 views

Compatibility Test and other testing method to use while building software

I will be adding a feature to the software and have to update or modify some of public API of the present open source software. What are steps which could be taken to ensure the compatibility of the ...

1 2 3 4 5 19
15 30 50 per page