testing

How do you test code that is not a model or controller

I have a class defined in a file my Rails project's lib dir that will implement a bunch of utility functions as class methods. I'd like to write tests against those methods using Test::Unit and have them run as part of the project's regular testing routine. I tried sticking a file at the top level of the test dir... require 'test_helpe...

Simulating "faster time" in linux

I have a Java app that runs on linux that has a lots of events and business logic that revolve around times and dates. For testing, is it possible to tweak something into time going faster. Let's say, make a whole computer-year finish in one hour wall time? ...

How to test vista compatiblity for web applications?

I don't have microsoft vista installed. Is there some kind of trial edition windows vista install in a vmware that can let us test for web application compatilibty? Thanks ...

How do I pipe the Java console output to a file?

I found a bug in an application that completely freezes the JVM. The produced stacktrace would provide valuable information for the developers and I would like to retrieve it from the Java console. When the JVM crashes, the console is frozen and I cannot copy the contained text anymore. Is there way to pipe the Java console directly to ...

Stubbing objects with input arguments

So, I'm trying to stub a database connector in order to write tests for it. The problem is that the database connector is a pretty thin layer, and the queries to it are somewhat open-ended. I want my code to be able to ask for a variable from the database, and the connector should be OK with this. The signature for this call looks someth...

How to automate a Java GUI ?

Is there a way to write a script on windows to automatically run a Java GUI and place a file name in the text box? I don't have access to the source code of this GUI, so need an external tool to be able to automate this process. I would appreciate any recommendations for free tools or scripts which I can use. ...

Is it a bad practice to randomly-generate test data?

Since I've started using rspec, I've had a problem with the notion of fixtures. My primary concerns are this: I use testing to reveal surprising behavior. I'm not always clever enough to enumerate every possible edge case for the examples I'm testing. Using hard-coded fixtures seems limiting because it only tests my code with the ve...

How can I change the directory holding the test files in ExtUtils::Makemaker?

How can you change the default tests path in Makefile.PL from the default value t/*.t? There's an attribute mentioned in the documentation but it does not work. Anybody know how to that? Thanks! ...

Test Probabilistic Functions

I need a function which returns an array in random order. I want to ensure that it is randomish but I have no idea how one would go about writing the tests to ensure that the array really is random. I can run the code a bunch of times and see if I have the same answer more than once. While collisions are unlikely for large arrays it i...

Regression Testing for dummies

Hi, I'm looking to implement regression testing of my web apps before I release them. Simply put, I'm looking for something that could do the following: record tests via a web browser using something like selenium load those tests into an app make my required logic/feature changes run test scripts view test status (pass/fail) fix bro...

What is the best automation tool for localization testing?

Can anybody help me out for what is the best automation tool for localization testing (testing languages German, French, Chinese, Italian, Spanish). Means, i want to test one product in different languages and need to log bugs if any truncation or spelling errors in that language. If you have any links please provide that would be grea...

What's your favorite way of testing javascript code snippets?

What's your favorite way of testing javascript code snippets? I like to use the browser's address field directly: javascript:void(document.getElementById("textbox").style.display='none')) javascript:void(document.write("Testing")) javascript:alert(parseFloat("33.33")) If using the latter trick, don't forget to wrap everything in a vo...

Does anyone use QuickTest Professional's Web Extensibility?

In QTP 9.5 HP presented Web Extensibility which provides the ability to create new test objects that better model your application. I found very little on the web about this feature. Is it really useful? Does anyone here have any experience in using it? ...

How do I find out the code coverage of the JDK caused by my tests?

I am currently using Emma as the code coverage tool for my project. I know how to get the code coverage analysis of running a sample Java test case. This will give me the code coverage details of the Java test case code, but, what I want to know is how much JDK code was covered in running the sample Java test case. For example, if my t...

Automating Internet Explorer

Can anyone offer any suggestions for "something" that an end-user could use to put together macros that automate some CRM forms in Internet Explorer? I was originally going to suggest iMacro, but then found out (i) they only have Internet Explorer and (ii) to make things even worse, it's version 6 :-( it has to be fairly simple, so I c...

Zend Framework: Getting started with Zend_Test

Has anyone had any success setting up Zend_Test? What was your method/approach and how do you run your tests/test suites? I already have PHPUnit installed and working. Now I'm trying to write some simple controller tests. The Zend Framework documentation assumes that autoloading is setup, which I haven't done. What method do you use to ...

A simple freeze behavior decorator

Hi, I'm trying to write a freeze decorator for Python. The idea is as follows : (In response to the two comments) I might be wrong but I think there is two main use of test case. One is the test-driven development : Ideally , developers are writing case before writing the code. It usually helps defining the architecture because t...

WCF Service invoking - without any reference added

I want to invoke a wcf service for testing on the http layer. I do not want to add a service reference and create a proxy and invoke. I want to create a new web test(VSTS) which sends a http request to the service and posts(Http post) the request in http body as an xml. I have service metadata, with which I can see the datacontracts, bu...

Data layer testing

Trying to wrap my head around test driven development. Unit testing is already in place and works fine from business layer up to and including web UI. Now I’m trying to solve question how to test data layer and underlined database. In the past, data layer had more code than in business layer and UI, and keeping the layer untested really ...

Refactoring and Test Driven Development

I'm Currently reading two excellent books "Working Effectively with Legacy Code" and "Clean Code". They are making me think about the way I write and work with code in completely new ways but one theme that is common among them is test driven development and the idea of smothering everything with tests and having tests in place before ...