testing interview questions

Top 15 testing interview questions

12950 Jobs openings for testing

How to emulate GPS location in the Android Emulator?

I want to get longitude and latitude in Android emulator for testing.

Can any one guide me how to achieve this?

How do I set the location of the emulator to a test position?

Source: (StackOverflow)

Rspec: "array.should == another_array" but without concern for order

I often want to compare arrays and make sure that they contain the same elements, in any order. Is there a concise way to do this in RSpec?

Here are methods that aren't acceptable:


For example:

array.to_set.should == another_array.to_set

This fails when the arrays contain duplicate items.


For example:

array.sort.should == another_array.sort

This fails when the arrays elements don't implement #<=>

Source: (StackOverflow)

When should I use Debug.Assert()?

I've been a professional software engineer for about a year now, having graduated with a CS degree. I've known about assertions for a while in C++ and C, but had no idea they existed in C# and .NET at all until recently.

Our production code contains no asserts whatsoever and my question is this...

Should I begin using Asserts in our production code? And if so, When is its use most appropriate? Would it make more sense to do

Debug.Assert(val != null);


if ( val == null )
    throw new exception();

Source: (StackOverflow)

Exact time measurement for performance testing [duplicate]

This question already has an answer here:

What is the most exact way of seeing how long something, for example a method call, took in code?

The easiest and quickest I would guess is this:

DateTime start = DateTime.Now;
    // Do some work
TimeSpan timeItTook = DateTime.Now - start;

But how exact is this? Are there better ways?

Source: (StackOverflow)

javascript test for existence of nested object key

If I have a reference to an object -

var test = {};

that will potentially (but not immediately) have nested objects, something like -

{ level1:{level2:{level3:'level3'}} };

what is the best way to test for the existence of keys in the most deeply nested objects?

This -


returns 'undefined', but this -



I'm currently doing something like this -

if(test.level1 && test.level1.level2 && test.level1.level2.level3) {

but I was wondering if there's a better way.

Source: (StackOverflow)

Jasmine - How to write a test which expects an Error to be thrown

I'm trying to write a test for the Jasmine Test Framework which expects an error. At the moment I'm using a Jasmine Node.js integration from GitHub.

In my Node module I have the following code:

throw new Error("Parsing is not possible");

Now I try to write a test which expects this error:

describe('my suite...', function() {
    it('should not parse foo', function() {
        expect(parser.parse(raw)).toThrow(new Error("Parsing is not possible"));

I tried also Error() and some other variants and just can't figure out how to make it work.

Source: (StackOverflow)

How to develop and test an app that sends emails (without filling someone's mailbox with test data)? [closed]

I have a lot of apps that send email. Sometimes it's one or two messages at a time. Sometimes it's thousands of messages.

In development, I usually test by substituting my own address for any recipient addresses. I'm sure that's what everybody else does, until they get fed up with it and find a better solution.

I was thinking about creating a dummy SMTP server that just catches the messages and dumps them in a SQLLite database, or an mbox file, or whatever.

But surely such a tool already exists? How do you test sending email?

Source: (StackOverflow)

What is Unit test, Integration Test, Smoke test, Regression Test?

What is Unit test, Integration Test, Smoke test, Regression Test and what are the differences between them? And Which tools can I use for each of them?

For example I use JUnit and NUnit for Unit testing and Integration Testing. Are there any Smoke Test or Regression Test tools?

Source: (StackOverflow)

What's the difference between unit, functional, acceptance, and integration tests? [closed]

What is the difference between unit, functional, acceptance, and integration testing (and any other types of tests that I failed to mention)?

Source: (StackOverflow)

Unit Testing C Code [closed]

I worked on an embedded system this summer written in straight C. It was an existing project that the company I work for had taken over. I have become quite accustomed to writing unit tests in Java using JUnit but was at a loss as to the best way to write unit tests for existing code (which needed refactoring) as well as new code added to the system.

Are there any projects out there that make unit testing plain C code as easy as unit testing Java code with JUnit? Any insight that would apply specifically to embedded development (cross-compiling to arm-linux platform) would be greatly appreciated.

Source: (StackOverflow)

Making the Android emulator run faster

The Android emulator is a bit sluggish. For some devices, like the Motorola Droid and the Nexus One, the app runs faster in the actual device than the emulator. This is a problem when testing games and visual effects.

How do you make the emulator run as fast as possible? I've been toying with its parameters but haven't found a configuration that shows a noticeable improvement yet.

Source: (StackOverflow)

Practicing BDD with python [closed]

Which are the most advanced frameworks and tools there are available for python for practicing Behavior Driven Development? Especially finding similar tools as rspec and mocha for ruby would be great.

Source: (StackOverflow)

Unit tests vs Functional tests

What is the difference between unit tests and functional tests? Can a unit test also test a function?

Source: (StackOverflow)

Disadvantages of Test Driven Development? [closed]

What do I lose by adopting test driven design?

List only negatives; do not list benefits written in a negative form.

Source: (StackOverflow)

How do I simulate a low bandwidth, high latency environment?

I need to simulate a low bandwidth, high latency connection to a server in order to emulate the conditions of a VPN at a remote site. The bandwidth and latency should be tweakable so I can discover the best combination in order to run our software package.

Source: (StackOverflow)