testing interview questions
Top testing frequently asked interview questions
I completed my first proper project in Python and now my task is to write tests for it.
Since this is the first time I did a project, this is the first time I would be writing tests for it.
The question is, how do I start? I have absolutely no idea. Can anyone point me to some documentation/ tutorial/ link/ book that I can use to start with writing tests (and I guess unit testing in particular)
Any advice will be welcomed on this topic.
Source: (StackOverflow)
I am looking to get started building a project and want to use RSpec from day one. My Ruby background is limited; however, I do have a good understanding of MVC and the structure within Ruby.
In doing some research for books and tutorials, I've found no currently published books, and have found no tutorials that give a good "hello world" type write up. And the documentation on the RSpec site is sparse to say the least.
Do any of you have links that you'd like to share of good tutorials of getting started with roR and RSpec?
Source: (StackOverflow)
I was wondering how to unit test abstract classes, and classes that extend abstract classes.
Should I test the abstract class by extending it, stubbing out the abstract methods, and then test all the concrete methods? Then only test the methods I override, and test the abstract methods in the unit tests for objects that extend my abstract class?
Should I have an abstract test case that can be used to test the methods of the abstract class, and extend this class in my test case for objects that extend the abstract class?
Note that my abstract class has some concrete methods.
Source: (StackOverflow)
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)
What do I lose by adopting test driven design?
List only negatives; do not list benefits written in a negative form.
Source: (StackOverflow)
What is the difference between unit tests and functional tests? Can a unit test also test a function?
Source: (StackOverflow)
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)
I want to be able to run a single spec file's tests — for the one file I'm editing, for example. rake spec
executes all the specs. My project is not a Rails project, so rake spec:doc
doesn't work.
Don't know if this matters, but here is my directory structure.
./Rakefile
./lib
./lib/cushion.rb
./lib/cushion
./lib/cushion/doc.rb
./lib/cushion/db.rb
./spec
./spec/spec.opts
./spec/spec_helper.rb
./spec/db_spec.rb
Source: (StackOverflow)
I have read this post about how to test private methods. I usually do not test them, because I always thought it's faster to test only public methods that will be called from outside the object. Do you test private methods? Should I always test them?
Source: (StackOverflow)
It is pretty easy with the added generator of rspec-rails to setup RSpec for testing a Rails application. But how about adding RSpec for testing a gem in development?
I am not using jeweler or such tools. I just used Bundler (bundle gem my_gem
) to setup the structure for the new gem and edit the *.gemspec manually.
I also added s.add_development_dependency "rspec", ">= 2.0.0"
to gemspec and did a bundle install
.
Is there some nice tutorial what to do next to get RSpec working?
Source: (StackOverflow)
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)
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:
#to_set
For example:
array.to_set.should == another_array.to_set
This fails when the arrays contain duplicate items.
#sort
For example:
array.sort.should == another_array.sort
This fails when the arrays elements don't implement #<=>
Source: (StackOverflow)
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);
or
if ( val == null )
throw new exception();
Source: (StackOverflow)