testing

TDD: Which methods do you expose for unit testing?

There is one aspect of TDD which I never fully understood. Suppose somebody asked you to implement a simple Stack object. If you've done your design properly, you will come to a very minimal and clean API. Suppose: push(), pop() and isEmpty(). Anything more than that is over-killing the demand, and allowing the user too much room to mes...

Multiple Apps in Multiple Languages on different OS's. Should I attempt a unified Test Harness ?

I am the newest member of a project that is an amalgam of various Applications written in various Programming Languages on both Unix and Windows operating systems. I get the 'honor' of figuring out how to implement a nightly Regression Build/Test for all these various Apps. Unfortunately, these Apps were NOT built with TDD principles a...

Verifying protected abstract methods are called using Moq

Suppose I have the following class: public class TestBase { public bool runMethod1 { get; set; } public void BaseMethod() { if (runMethod1) ChildMethod1(); else ChildMethod2(); } protected abstract void ChildMethod1(); protected abstract void ChildMethod2(); } I also have the class public class Chi...

Oracle: How can I programmatically arrange to have my current connection killed?

For testing exception handling in the case of a broken connection it is useful to be able to programmatically request the database to kill a connection. What's the best way to do that? ...

How to test a hash function?

Is there a way to test the quality of a hash function? I want to have a good spread when used in the hash table, and it would be great if this is verifyable in a unit test. EDIT: For clarification, my problem was that I have used long values in Java in such a way that the first 32 bit encoded an ID and the second 32 bit encoded another ...

Mocking HTTP Server

Hello, I would like to write tests for my client code, which accesses HTTP Server. I am looking for simple HTTP Server, which would simulate responses from real server. Such HTTP Server (mock server :-)) should verify all requests really came from my client code verify that requests had all required parameters send response, ideally...

How to write an automated test for thread safety

I have a class which is not thread safe: class Foo { /* Abstract base class, code which is not thread safe */ }; Moreover, if you have foo1 and foo2 objects, you cannot call foo1->someFunc() until foo2->anotherFunc() has returned (this can happen with two threads). This is the situation and it can't be changed (a Foo subclass is...

Is there a (free) windows test/dummy print device?

We are creating a batch application which sends its documents (Java Jasperreports) directly to a printer device, running on a Windows server. To test the application and measure the performace, we where looking for a test or dummy windows print device. This device would not print to an actual printer but simulate a printer device in suc...

How do I disable the 'Debug / Close Application' dialog on Windows Vista?

When an application crashes on Windows and a debugger such as Visual Studio is installed the following modal dialog appears: [Title: Microsoft Windows] X has stopped working A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available. [Debug][Cl...

Strategies for Using Mock Objects when Unit Testing DAOs

I am curious what strategies folks have found for unit testing a data access class that does not involve loading (and presumably unloading) a real database for each test method? Are you using mock objects to represent the database connection? If so, are you required to pass the mock object into every method-under-test, and thus forcing t...

Do you write your unit tests first, after a bit of coding or not at all?

I was wondering when most people wrote their unit tests, if at all. I usually write tests after writing my initial code to make sure it works like its supposed to. I then fix what is broken. I have been pretty successful with this method but have been wondering if maybe switching to writing the test first would be advantageous. ...

How to get a positive mental attitude towards testing?

I want to write tests for my app, though each time I look at rspec.info, I really don't see a definite path to take towards "doing things right" and testing first. I watched the peepcode videos on rspec more than once, yet it doesn't take. I want to take more pride in my work, and I think that testing will help. How can I break throug...

Tool for testing using parameter permutations

I remember there existed a testing program/library that will run your code and/or unit tests, creating all kinds of permutations of the parameters (null values, random integers, strings and so on). I just can't remember what it was called and searching google doesn't seem to come up with anything. I know it was created for Java code and...

How integration tests are performed on your company/job/project?

Hello, I want to improve integration tests methods where I work and I would like to know how this process happens in other places. Things like: - When test plans writing begin - Proportion between testers, developers and stuff (entire applications or modifications) to be tested - What kind of methods are used for integration testing....

QuickTest Pro automated testing

Hi All -- I have three easy questions. Does anybody use QuickTest Pro for automated testing? Any other automated testing applications that you recommend? Is automated testing a good idea? Thanks ...

Black box vs White box Testing

Which type of testing would you say should be the emphasis (for testers/QAs), and why? A quick set of definitions from wikipedia: Black box testing takes an external perspective of the test object to derive test cases. These tests can be functional or non-functional, though usually functional. The test designer selects valid and inv...

Security Testing Types

What are the different types of Security Testing? ...

What are the current best practices for load testing and profiling ASP.NET web applications?

I am tasked with improving the performance of a particular page of the website that has an extremely high response time as reported by google analytics. Doing a few google searches reveals a product that came with VS2003 called ACT (Application Center Test) that did load testing. This doesn't seem to be distributed any longer I'd lik...

Good Ruby/Rails testing tutorial?

Can someone recommend a good, up-to-date tutorial for a complete beginner on one of the major testing frameworks for Ruby, such as Rspec or Shoulda? I'd like to find something that doesn't assume any knowledge about the framework or about testing in general. For example, if the tutorial explained the distinction between TDD and BDD, that...

Stupefied by RSpec

I'm sorry, but this is beginning to feel like kicking myself in the head. I'm completely baffled by RSpec. Have watched video after video, read tutorial after tutorial, and still I'm just stuck on square one. === here is what I'm working with http://github.com/fudgestudios/bort/tree/master === Errors F 1) NoMethodError in 'biddin...