Saturday, December 12, 2009

Term for "non-cloud" software application?

What do you call a "non-cloud" offering? In particular, if it is your offering, and especially if you also have a cloud offering but don't want to assign a negative connotation to the non-cloud version? I'm looking for a short adjective here -- one that ideally would satisfy programmers and marketing folks alike. The term must fairly clear -- that is, it should suggest non-cloud. Of course, a wide consensus on a term would essentially solve that problem.

I'm kinda hoping someone has already figured this out, but I haven't seen a good answer yet. In the mean time, perhaps we can discuss alternatives in a community fashion.

Potential but (in my view) problematic terms:
  • Traditional, fixed, bound, grounded: too negative connotation
  • Local: not necessarily accurate
  • Static: overloaded already
  • Stationary: unclear
  • Determinate: unclear
  • Server: incomplete, unclear, overloaded
That's not to say that I'd reject one of the above terms if chosen; they just don't quite sound right to my ears (yet).

Monday, August 24, 2009

Selenium troubleshooting

Problem 1: Something on the page isn't found because it isn't ready yet
Solution: Use clickAndWait

Problem 2: It won't record my password or another text field
Solution: Click off the text field (in other words, click elsewhere) after you type it. Usually Selenium will successfully record at that point. If you are still having trouble, try entering the command yourself directly into the Selenium script.

Problem 3: I can't get a dropdown menu to appear for a type-ahead field, perhaps because it's JavaScript
Solution: Use the "fireEvent" command on the HTML field. The value "focus" will cause, for example, the JavaScript focus event to be triggered. If the dropdown menu looks for that event, then firing it will cause the dropdown to appear. Also, use the "typeKeys" command to enter the text in the type-ahead field that informs the dropdown.

Problem 4: I can't figure out how to identify an element (link, button, table cell...) reliably
Solution: Ask a developer if there is a way to include an id or name for the element that can be uniquely identified (i.e. this is a "testability" issue). Failing that, use XPath targets. For example, use clickAndWait with a target that looks like //a[@href='myurl'] (that is an XPath query). You can even use Firebug to locate XPath for a given element. With Firebug installed and enabled (on Windows press F12 to enable), click Inspect, highlight the HTML element on the page, click it to select it, right-click its representation in the script windows in the debugger, and click Copy XPath. You may need to edit the XPath before entering it into the Selenium target. Selenium always requires an extra / (frontslash) at the beginning of XPath targets.

Problem 5: Running Java Selenium tests via Selenium RC, clicking my link doesn't work in IE (or vice versa, in Firefox)
Solution: Firefox and IE handle ampersands (&) differently, among other things. Don't use the "click" command on links that contain ampersands.

Selenium scripting conventions

Conventions
These are suggested guidelines, or rules of thumb, for writing or editing Selenium scripts, based on real-world experience.

Base URL
Set a standard Base URL for your scripts. Assuming you have multiple environments, such as development, test, staging, and production, you may wish to configure your Base URL with an environment-specific variable.

Record but Edit
Selenium recording is great but does not do everything we need to do. After you record your script, be prepared to edit it some by hand.

HTML Format
Maintain each test in HTML format. This should be the "gold" copy of the test. The idea here is that you can edit HTML tests in Selenium IDE. The other formats, such as Java, can be generated automatically from HTML, but there is no robust automated way to go the other direction, for example from Java to HTML. Therefore once you leave HTML, there is no easy way back. If you modify your tests after translating them to Java or another language, you may be able to automate that process in order to make the entire system work easier for you.

Create Examples or Templates
Create some initial example or template tests and have the entire automation team vet them. Once best practices are in place, it will be easier for all to maintain tests, regardless of the original author. Just as with general programming, communication is key. Even with templates, hold regular code reviews, especially at the beginning of your automation effort.

Feature IDs
At the top of each script, where applicable, enter a comment "FeatureID=Xxxxx" where Xxxxx is a unique identifier of the main feature covered. This sort of convention will make it easier for you to integrate with test coverage reporting tools in the future.

Author's Name
Also at the top of each script, enter a comment "Author=Name" where Name is your name or handle. This makes it easier to resolve questions about how the script works or what its purpose is.

Setup and Cleanup
Test independence helps ensure the robustness of the execution environment. Therefore it is a good idea to have each script attempt to setup any environment it needs and likewise clean up after itself when finished. One example of such behavior is to start with a logout and end with a logout. Likewise, the script should also undo any data changes it makes. However, this approach is still no substitute for "harder" data cleanup and preparation. Before any test suite executes, the entire test environment should always begin with a known configuration and data set. That is generally something you will have to do outside Selenium.

Minimize Assumptions
Even though scripts should clean up after themselves, it is also wise not to assume the system is in the exact state that it was last time you recorded the script. Try to minimize the assumptions the script makes. For example, only sign in as a user you know will be available at all times.

Use clickAndWait
Instead of the "click" command, use the "clickAndWait" command. This waits for the new page to load fully before continuing. Unfortunately when recording scripts, Selenium usually places the "click" command everywhere, so you have to change them by hand.

Use check and uncheck
Selenium, by default, also uses the "click" command for interacting with checkboxes. Unless you specifically want a test that toggles a checkbox and doesn't care what specific value it ends up with, use the "check" and "uncheck" commands instead of "click".

Test Something
It's important to include "assertXxxxXxxx" statements in your script. These are the actual meat of the test. "assertTextPresent", "assertTextNotPresent", and "assertElementPresent", are your friends.

Test the Test
Run your script a couple times after you record (and edit) it to make sure it runs repeatedly. If you have difficulty making your script repeatable, you may wish to raise the issue with your team to see if anyone else has discovered a solution.

If and when you convert your test from HTML to Java, especially if you run it remotely via Selenium RC on a different browser, test again. Browser differences can easily break tests if you are not careful.

Basics of web test automation using Selenium

What is Selenium?
Selenium is a JavaScript-based framework for recording and running automated tests in a web browser.

Why Selenium?
Use Selenium to automate functional regression tests.

Functional means user-facing tests, not just back-end or code-level tests. Regression tests means tests that can be used to measure the progress of the product against past behavior, to make sure it does not regress (worsen in quality for core features). To put it in other terms, Selenium can help save time and/or improve quality (including predictability).

Two Approaches
There are two general approaches for using Selenium to improve testing:
  1. Manual testing: You can simply run Selenium scripts as part of a manual, or semi-automated, testing process, using just the Selenium IDE (available for Firefox only). If you don't have an automated build, this approach may be a good way to get started testing faster right away.
  2. Automated testing: Selenium test scripts can also be launched programmatically, from a first-class programming language such as Java. They can run in the context of a JUnit test suite, for example as part of a build process. This is the more automated approach. In the long run, it is a good idea to transition tests to become more automated. Another advantage of this approach is it enables using Selenium RC, a remote-control test execution environment that lets you run tests on remote machines in essentially any browser.
Automate Which Tests?
Which tests should you automate with Selenium? The answer is not always obvious. A high-level answer is that you should automate tests that give the biggest bang for the buck. Good reasons to automate a certain test include:
  • The test has identified bugs in the past.
  • The test should be run frequently.
  • The test is boring or difficult to run manually.
  • The test is for a high-priority part of the application under test (AUT).
  • Leaving a bug in this particular area of the application would be costly.
Especially at the beginning of product development or automated test development, automating core feature tests probably makes more sense than very new, unusual, or experimental features.

Download IDE
Selenium IDE is a plugin for Firefox that you use to create and run Selenium tests. It is one of several tools that can work together. It makes sense to start with Selenium IDE because you can record, edit, and run tests using it. Download here:
http://seleniumhq.org/download/

Generally the version at the top is best.

Tuesday, July 21, 2009

How to make money from games

There are an increasing number of lightweight ways to make money from producing computer and video games. Many of these are suitable for indie (independent) or small developers. Here is a sampling for comparison:

Sell Apps Directly:
Sell Access to Online Game Service:
  • Multiverse: online 3-d game platform including billing and transaction processing; you pay a fixed percentage of earnings for a license, plus relatively low collection fees; if you charge nothing, you pay nothing
Make Money from Advertising:
  • Mochi Media: advertising revenue platform for Flash
  • AdMob: advertising revenue platform for mobile devices
  • Google AdSense: advertising revenue platform for the web; could be incorporated into any web-based game, or your game company's website, for example
Sell Other Things:
  • You can also sell schwag or devices or other things in addition to your game revenue. T-shirts, mugs, related hardware, website subscriptions, and all other manner of goods and services can supplement what your game makes by itself.

Wednesday, July 1, 2009

IT syndrome: symptoms and recovery for sedentary work and RSI

Many people in the IT profession suffer from unhealthy weight, back pain, neck pain, or stomach pain. Too many of us don't make time to exercise regularly, and we compound the problem by not eating healthy food. The stress and rigors of IT and spending endless hours in a seated position crouched over a computer can make the situation particular difficult to remedy.

Quick disclaimer: I am not a doctor. This is not medical advice. Consult a physician before changing your exercise routine or diet.

For those suffering any or all of these symptoms, here is some advice:

First, consider both priorities and resources. That is, the goals you want to achieve and the means you have to achieve them.

Questions to ask yourself regarding priorities:

  • Do I need and want this job?
  • What will happen if I keep working like this?
  • How much money can/will I spend to improve the situation?
  • How much would it cost me in the long run not to address the problems I'm facing?
  • Am I willing to enlist friends/others to help?
  • Who can help me, professionally and otherwise?
  • What times of the day are the most under my control?

Specific ideas for using your resources:

  • Blog/twitter to all your friends that you are changing your lifestyle significantly to become healthier; ask for their support and to hold you accountable.
  • Visit a doctor for ~$25 co-pay to generate ideas.
  • Visit a personal trainer for ~$100 to generate additional ideas.
  • Have time to exercise in the morning or evening? Walk 2 miles or swim for 30 minutes every day, or workout on an elliptical trainer or treadmill for an hour twice a week.
  • Do a cardiovascular workout during lunch at your company or close-by gym or hotel; arrange for showers in remote location if necessary; working out will decrease the amount of sleep and food you crave/desire.
  • Get a core exercise ball for ~$8 and sit 10-20 minutes of every hour on it at work: http://exercise.about.com/cs/abs/l/bl_core.htm
  • Or upgrade to a Swopper office chair for ~$800: http://www.relaxtheback.com/wheeled-swopper-office-chair-product-6390350-6389773
  • Increase raw green vegetables, lean meat, tofu/beans, non-wheat whole grains, raw fruit.
  • Eliminate/reduce sugar/fructose in all forms, fried food, caffeine, aspartame, soda, refined flour, wheat, spicy food, tomatoes, juice, citrus, ibuprofen and other drugs.
  • Take a food allergy test for ~$500; this alone may completely solve a weight problem.
  • Take a thyroid test; this also affects metabolism.
  • For neck and back pain, visit a massage therapist, physical therapist, Rolfer, or yoga therapist. Students working in these fields at internships in their schools are usually cheaper than experienced professionals, although experience tends to improve treatment ability.
  • Thailand and other countries with relatively inexpensive labor costs offer massage for very affordable rates and can be good choices for rejuvenating vacations.

Monday, June 29, 2009

Computation on encrypted data: IBM breakthrough

IBM made a discovery that allows computations to be performed on encrypted data without decrypting it first. That could open up the possibility for some very interesting services. It would be easier to calculate, for example, aggregate statistics on sensitive data (such as financial or medical) regarding an individual, without requiring certain sensitive information (such as account numbers, specific balances, DNA sequences) to be leaked. There are almost certainly applications for this technology that have not even been dreamed of yet. The biggest downside so far is that the CPU performance hit is enormous.

http://www-03.ibm.com/press/us/en/pressrelease/27840.wss

http://www.forbes.com/2009/06/24/encryption-rsa-privacy-technology-breakthroughs-ibm.html

http://www.eweek.com/c/a/Security/IBM-Uncovers-Encryption-Scheme-That-Could-Improve-Cloud-Security-Spam-Filtering-135413/

Tuesday, June 23, 2009

Cross-platform ways to develop for iPhone

Irrlicht
Engine, SDK, basic editor
License: Free
Runtime platforms: Windows 98, ME, NT 4, 2000, XP, XP64, Vista, CE, Linux, Mac OSX, Solaris, iPhone
http://irrlicht.sourceforge.net/index.html
http://irrlicht.sourceforge.net/phpBB2/viewtopic.php?t=32494

Rhodes
Ruby-based engine, SDK
License: Commercial with GPL option for GPL apps
Runtime platforms: iPhone, Windows Mobile, BlackBerry (RIM), Symbian, Android (Google)
http://www.rhomobile.com/

Game Salad
Beta engine, rich editor
License: Commercial (at least for iPhone)
Runtime platforms: web, iPhone
http://gamesalad.com/

Torque
Highly polished engine, SDK, rich editor
License: Commercial
Runtime platforms: Windows, Mac, Xbox 360, Wii, iPhone, web
http://www.garagegames.com/products/torque-2d/iphone

Monday, June 8, 2009

Jumpstart on iPhone with Objective-C in Windows

Eager to learn about building an iPhone app but not quite ready to set aside the money for a Mac? That's okay, you can still get started using the Objective-C programming language right away. Objective-C is the language used to write iPhone, iPod Touch, and Mac applications. Luckily it is supported by gcc (GNU Compiler Collection), which is available on many platforms.

If you have a Windows box handy, then you just need gcc with Objective-C support. The easiest way to do that in Windows is with MinGW, Minimalist GNU for Windows. The download page should have an Automated MinGW Installer for Windows.

Once you've installed MinGW, you can add the binaries to your path or use a build file of sorts; there are lots of options depending on your taste.

Let's see a basic Hello World app; we'll call it Main.m (m is the preferred file extension for Objective-C programs):
// From http://codewandering.blogspot.com/
// Main.m
int main(void)
{
printf("Hello, world!\n");
}
Look familiar? Objective-C is a proper superset of the C language, so valid C code is valid Objective-C code. Of course, to get the full power of Objective-C you'll want to use the object-oriented programming aspects of Objective-C as well.

A simple batch file like this will compile the program:
@rem From http://codewandering.blogspot.com/
setlocal
set path=%path%;c:\MinGW\bin\
gcc.exe -x objective-c Main.m -lobjc
endlocal
You may need to modify the set path command if you specified a different home folder for MinGW.

Now just run the batch file from a command line, which produces a.exe, your executable program. If you run that, you should see:
Hello, world!
Ready for more? Check out these great resources:

Tuesday, April 21, 2009

Forcing WebLogic to run in debug mode

I was working with a WebLogic installation the other day that I simply could not get to start in debug mode from Eclipse. This story is to share that experience in case anyone else runs into a similar problem. The initial symptom was that Eclipse (i.e. Workshop) would not recognize WebLogic as running in debug mode; it complained of a port not being open (the debug port).

Well, here is what the WebLogic server console was giving me:
WLS Start Mode=Production
.

Starting WLS with line:
C:\bea\JROCKI~1\bin\java -jrockit [missing some parameters] -Xms256m -Xmx512m…
That's never going to start in debug mode, because Production mode precludes debug mode. I needed to get the server to start in Development mode first.

I ended up having to go through my server startup (*.cmd or *.sh) and config (*.xml) files looking for things like this:
set PRODUCTION_MODE=true
...or this:
<setenv name="PRODUCTION_MODE">
<value>true</value>
</setenv>
...and changing them from true to false. I had used a customized installer which probably had set them to true.

That finally did the trick; now when I started the server in debug mode in Eclipse, I got the following in the server console:
WLS Start Mode=Development
.

Starting WLS with line:
C:\bea\JROCKI~1\bin\java -jrockit -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socke
t,address=8453,server=y,suspend=n -Djava.compiler=NONE -Xms256m -Xmx512m…
And the Eclipse debugger can now talk to the server.

Thursday, February 5, 2009

Careful w/ Java ME Screen Updates: Don't Trust Your Emulator

Be careful when updating a Screen (Alert, Form, List, TextBox) in Java ME (a.k.a. J2ME). I ran into a problem recently where I wanted to make a minor run-time adjustment to a Form in my app. I originally had the code update the Form while the old version of it (pre-update) was already displayed, then call setCurrent() to set the newly updated Form as the current Displayable. It worked fine in Sun's Wireless Toolkit emulator, but when I deployed to a real Sony Ericsson phone, the call to setCurrent() on the updated Form appeared to have no effect. In other words, the old, unchanged Form still showed. The problem lies with the fact that the specification does not define the behavior when a Displayable is changed while visible:

From http://java.sun.com/javame/reference/apis/jsr118/javax/microedition/lcdui/Screen.html:

"It is recommended that applications change the contents of a Screen only while it is not visible (that is, while another Displayable is current). Changing the contents of a Screen while it is visible may result in performance problems on some devices, and it may also be confusing if the Screen's contents changes while the user is interacting with it."

First I tried a couple alternatives like setCurrent(null), which helps neither according to the spec nor based on my own testing. The best solution appears to be to create a second Screen (or Form in my case) and setCurrent() on it when it's ready. I was hoping it wouldn't come to that, but sometimes you just gotta bite the bullet and use a new object.

Happy coding.

Friday, January 23, 2009

Choosing Between Agile and Waterfall: Indicators

How do you know how agile to be in your software development process? Or how rigid?

If you have developed any software, you are probably familiar with pros and cons of both agile and waterfall processes, and you probably understand that agile and waterfall are on a continuum of sorts -- that is, there are shades in between. Even a continuum may be simplistic, because human processes are complex and multidimensional.

Therefore I will write in terms of processes that are "more agile" vs. "more waterfall." To be clear, by a more agile process I mean one more likely to include iteration, lightweight requirements, automated testing, a flexible schedule, and emphasis on continual team communication. By a more waterfall process I mean one more likely to include rigid and detailed requirements, less automation, a predefined schedule, and more restrained communication.

My goal for this entry is to lay out some rules of thumb, or imperfect guidelines, to help you choose a process that is more agile or more waterfall, depending on the circumstances. Because these are rules of thumb, you may need to consider the various factors independently and weight them as appropriate for your project.

Indicators for Agile

In other words, you might want to use a more agile process if...
  • Your customer trusts you.
  • You are developing a service.
  • You are developing for multiple customers.
  • There is no single contract between you and your customer.
  • There is an expectation of maintenance.
  • Your customer is more flexible.
  • You have a flexible or unknown deadline.
  • You are developing a new or innovative sort of product or service.
  • Your customer doesn't know the requirements well.
Indicators for Waterfall

In other words, you might want to use a more waterfall process if...
  • Your customer doesn't trust you.
  • You are developing a one-off, shrink-wrapped product.
  • You are developing for a single customer.
  • You are developing for a single contract.
  • There is no expectation of maintenance.
  • Your customer is less flexible.
  • You have a rigid deadline.
  • You are developing a standard or well-known sort of product or service.
  • Your customer knows the requirements well.
Again, the indicators are not absolute. For example, a more agile process can still work very well, and sometimes better than waterfall, with a rigid deadline. But I list a rigid deadline as an indicator for waterfall because an agile process can be even more helpful when the deadline is flexible or unknown, whereas a waterfall process does not usually work well with a flexible deadline.

I list trust first because it can be a very powerful indicator. Even if most other indicators point to waterfall, a high degree of customer trust can enable a more agile process. I feel comfortable saying this because I have personal experience with it.
Copyright 2011 by William Cain