random mumblings

Thursday, June 16, 2011

http://blog.stevensanderson.com/2009/03/27/first-steps-with-lightweight-test-automation-framework/

...the difference between unit testing and integration testing:
  • Unit tests work against the API of a particular component in your code. Ideally, they test only that single isolated unit (hence the name), which allows them to pinpoint any problems exactly where they occur. Unit testing tools for .NET include NUnit, mbUnit, and xUnit.
  • Integrations tests combine multiple components. Typically, they work at the UI level to test that your JavaScript, your HTML, your controller code, your model code, and your database all work together. Integration testing tools for .NET include Selenium, Watin, and Lightweight Test Automation Framework.

...Lightweight Test Automation Framework is very similar to Selenium RC. There is a significant architectural difference, though. Selenium RC integrates with any traditional unit test runner – it does not use the browser as a test runner. Selenium RC gives you a browser automation API which works by making remote procedure calls (RPCs) to a Java-based “test server” running on your development workstation. The Java-based test server then in turn hosts a browser instance (Firefox, IE, or Safari) and uses the browser’s API to run your commands in the browser. There’s no Ajax involved.

My scenario was automating tests for xVal’s client-side code. For every possible type of validation rule, we have a test to check certain inputs that should trigger a validation error message and other inputs that should be accepted. This implicitly tests all parts of xVal:
  • The system of defining and detecting each type of rule
  • The system of describing each type of rule to the client
  • The system of detecting and configuring the active client-side validation engine (e.g., jQuery Validator)
  • The system of customising validation error messages
  • The client-side validation engine itself
If any of these stop working, an integration test should detect it.
Selenium RC was doing a perfectly fine job of this, but the critical fault is that you have to run a “test server” on your workstation, and that test server is written in Java. Now I’m perfectly happy with Java, but this setup added a lot of unwanted friction in an open source .NET project. Most .NET developers don’t even have the Java runtime on their PCs, and even those that do wouldn’t realise that they have to install the Selenium RC server and run it before the unit tests could pass.
Lightweight Test Automation Framework eliminates the Java test server and makes it far easier for people to contribute to xVal. That’s why I’m switching to it. The main disadvantage is that client-side tests now take longer to run, but as I pointed out before, Lightweight Test Automation Framework has the extra benefit of supporting Google Chrome, which itself is so fast that the speed loss is hardly noticeable.

Tuesday, February 27, 2007

Problems with Java in Firefox on Linux

Always get the prompt to download Java for Firefox? Does the manual install also fail to work? Just the FAQs please:

http://plugindoc.mozdev.org/faqs/java.html
http://java.com/en/download/linux_manual.jsp

Firefox 2.0.0.2
JRE 1.5
Linux 2.6.9-42.0.2.ELsmp
CentOS 4

Thursday, February 01, 2007

RSS Reader Usage Statistics

The article was dated July 06, 2005. Taking into consideration the release of Google Reader, I wonder what recent statistics look like.

http://rssdiary.marketingstudies.net/content/surprising_rss_reader_usage_stats_what_do_they_mean_for_marketers.php

Tuesday, September 05, 2006

practice what you preach

i've been telling people they should start blogging and i haven't even blogged yet. well, not seriously yet. oh i started to a few times. gave up after trying to pick a username that wasnt already taken and became distracted by something on another website. so this is the first entry of the rest of my story.