OK, so I work for a company who has openly adopted agile practices for development in recent years. Our unit tests and code quality are improving. One area we still are working on is to find what works best for us in the automated acceptance test arena. We want to take our well formed user stories and use these to drive the code in a test driven…
Hello,
I am running some unit tests on a WCF service. The service is configured to include exception details in the fault response (with the following in my service configuration file).
<serviceDebug includeExceptionDetailInFaults="true" />
If a test causes an unhandled exception on the server the fault is received by the client with a…
I'm in the process of designing an application that is part of a larger piece of work, depending on other people to build an API that the app can make use of to retrieve data.
While I was thinking about how to setup this project and design the architecture around it, something occurred to me, and I'm sure many people have been in similar…
In the following gcc.gnu.org post, Nathan Myers says that a C++ skills test at SANS Consulting Services contained three errors in nine questions:
Looking around, one of fthe first on-line C++ skills tests I ran across was:
http://www.geekinterview.com/question_details/13090
I looked at question 1...
find(int x,int y)
{ return…
I have a script that acts as a wrapper for some unit tests written using the Python unittest module. In addition to cleaning up some files, creating an output stream and generating some code, it loads testcases into a suite using
unittest.TestLoader().loadTestsFromTestCase()
I am already using optparse to pull out several…
I was using javascript to detect for specific key strokes and while writing the method I thought I'd try regular expressions and the test() method and came up with:
if (/8|9|37|38|46|47|48|49|50|51|52|53|54|55|56|57|96|97|98|99|100|101|102|103|104|105|110/.test(num)) {
// do something if there's a match
}
This doesn't…
I have written my basic models and defined their associations as well as the migrations to create the associated tables. I want to be able to test:
The associations are configured as intended
The table structures support the associations properly
I've written FG factories for all of my models in anticipation of having a…
Hello all,
I've inherited a load of Junit test, but these tests (apart from most not working) are a mixture of actual unit test and integration tests (requiring external systems, db etc).
So I'm trying to think of a way to actually separate them out, so that I can run the unit test nice and quickly and the integration…
I have a JUnit test class in which I have several static final ints that can be redefined at the top of the tester code to allow some variation in the test values. I have logic in my @BeforeClass method to ensure that the developer has entered values that won't break my tests.
I would like to improve variation further…
I'm doing some maintenance on an older web application written in Monorail v1.0.3. I want to unit test an action that uses RenderText(). How do I extract the content in my test? Reading from controller.Response.OutputStream doesn't work, since the response stream is either not setup properly in PrepareController(),…
Alright guys, i really hurt my brain over this one and i'm curious if you guys can give me any pointers towards the right direction i should be taking.
The situation is this:
Lets say, i have a collection of strings (let it be clear that the pattern of this strings is unknown. For a fact, i can say that the string…
Lets say I have a library, version 1.0.0, with the following contents:
public class Class1
{
public virtual void Test()
{
Console.WriteLine( "Library:Class1 - Test" );
Console.WriteLine( "" );
}
}
public class Class2 : Class1
{
}
and I reference this library in a console application…
I have the following class which is a decorator for an IDisposable object (I have omitted the stuff it adds) which itself implements IDisposable using a common pattern:
public class DisposableDecorator : IDisposable
{
private readonly IDisposable _innerDisposable;
public DisposableDecorator(IDisposable…
I posted this to the Cucumber group with no replies, which makes me wonder if this is actually a cucumber issue or not. I'm pretty new to cucumber, and there are a number of things I really don't quite understand about how the cucumber environment is set up and executed within the test environment.
I have a…
I have a database of names of people that has (currently) 35 million rows. I need to know what is the best method for quickly searching these names. The current system (not designed by me), simply has the first and last name columns indexed and uses "LIKE" queries with the additional option of using SOUNDEX…
What are some good automated tools for load testing (stress testing) web applications, that do not use record and replay of HTTP network packets?
I am aware that there are numerous load testing tools on the market that record and replay HTTP network packets. But these are unsuitable for my purpose, because…
I am writing some unit tests in Visual Studio 2010. I can run all tests by using "Run all Tests in Current Context".
However, if I write a new unit test, it does not get picked up by the environment - in other words, I am not able to find it in Test List Editor, by running all tests, or anywhere else. If I…
I'm looking at trying to optimise a particular function in a php app and foolishly assumed that a boolean lookup in a 'if' statement would be quicker than a string compare. But to check it I put together a short test (see below). To my surprise, the string lookup was quicker.
Is there anything wrong with…
Hi All,
I have the following table.
CREATE TABLE TEST(ID TINYINT NULL, COL1 CHAR(1))
INSERT INTO TEST(ID,COL1) VALUES (1,'A')
INSERT INTO TEST(ID,COL1) VALUES (2,'B')
INSERT INTO TEST(ID,COL1) VALUES (1,'A')
INSERT INTO TEST(ID,COL1) VALUES (1,'B')
INSERT INTO TEST(ID,COL1) VALUES (1,'B')
INSERT INTO…
I just wanted to start testing a Django view using the code below:
from django.test.client import Client
c = Client()
response = c.get('/search/keyword')
print response.content
It just throws out following error message:
"/usr/local/lib/python2.6/dist-packages/django/test/client.py", line 286, in…
Hey guys,
I'm trying to do a fixed effecs OLS regression, a random effects OLS Regression and a Hausman test to back up my choice for one of those models. Alas, there does not seem to be a lot of information of what the code looks like when you want to do this.
I found for the Hausman test that
…
I get the error in subj when I'm trying to run specs or generators in a fresh rails project.
This happens when I add shoulda to the mix.
I added the following in the config/environment.rb:
config.gem 'rspec', :version => '1.2.6', :lib => false
config.gem 'rspec-rails', :version =>…
I am trying to develop a rails application on postgresql using a sequence to increment a field instead of a default ruby approach based on validates_uniqueness_of.
This has proved challenging for a number of reasons:
1. This is a migration of an existing table, not a new table or column
2.…