Archive for the ‘Tester's Toolbox’ Category

Essential Test Tools

December 28, 2009

People often ask me what I think is the best “Test Tool”.  I give them my usual less than concrete answer- “It depends.”  There are some – a few – that I personally like.  Sadly, there are a lot of bad ones.  In my opinion, there are more bad than good.  I recently finished a project with an exceptionally bad one.  I won’t name names here.  Sometimes I wonder if they have ever talked to an actual tester.  I’m hearing and seeing good things about the new test tools in Microsoft’s Visual Studio 2010, but I’ll withhold any judgement until I have had a chance to use it. 

There is one tool, however, that I absolutely cannot live without, and it’s not even a “test tool” - Microsoft Excel.

I have found Excel to be one of the most versatile pieces of software that I have ever used.  I’m always finding new and fascinating ways to use Excel to improve, and in many cases, accelerate my testing.  I have used it to manage defects, build and manage test cases, produce test metrics, compare expected results to actual results and report any differences, and much more!

I’ll expand more on using Excel in future entries, with more specific examples.  Until then I HIGHLY RECOMMEND you take a look at “Favorite Excel 2007 Tips & Tricks” by John Walkenbach (there is a book for the previous version of Excel as well).  It is by far the most used and most borrowed book in my test library.  Also, check out John’s Web site at http://spreadsheetpage.com/

Take a look – you won’t be disappointed!

If A=B and B=C, then A=C

December 18, 2009

Software Testing Rule #1: We can’t test everything!

Well I guess in theory we could. But is it practical or feasible? Typically not. We rarely have the time or resources needed to do it. Even if we did, the product would be so expensive that no one could afford it. So how do we strike that delicate balance of testing “enough”?

Using Equivalence Class Testing or Equivalency Class Partitioning is one technique we can implement to reduce test times, and the number of test cases needed, to a more resonable number while still ensuring adequate test coverage.

Let’s look at a simple test – a web-based form. The first text box on the form is a text field that is supposed to accept 5 upper-case alpha characters – capital letters (English only). If we were to fully test this text field, using every possible combination of valid characters, there would be more than 11 million possible combinations (26 x 26 x 26 x 26 x 26). Over 11 million test cases – for a single field on a form! Even with an automated test tool, and a really fast system, the task is virtually impossible (and really boring). If the field were supposed to allow both upper and lower case letters, the number of possible combinations is now exponentially higher (in the range of about 380 million). The more valid characters, the more impossible the task becomes. And that’s for just one field on a form! Equivalence classes to the rescue!

Simply stated, an Equivalence Class is a set of data that we can assume will be treated the exact same way by the system. For any system input there are esentially 2 types or sets of data – valid data, and invalid data. We refer to these sets of data as “classes” In the above example, we can reasonably expect that the system will treat ABCDE as valid as well as any other 5 upper-case characters. As long as the data meets the rules of the class – it should be treated as valid. Any data that does not meet the rules of the class is invalid. The assumption is that if the system accepts any one valid member of a class, it will accept all of them. This is the valid equivalence class (Ve). Conversely, if the system rejects an invalid class member – it will reject all invalid class members. This is the invalid equivalence class (Ie). A good test uses both valid and invalid data. Sounds simple, right? Let’s look at an example:

The test scenario: The test object is a simple user registration form, with the basic user information form fields (last name, first name, street address, city, state, zip code). Let’s take a look at the last name field. Upon reviewing the system requirements we learn that this is a 15 character text field that allows only upper case characters. The valid equivalence class is:

Ve = {Any 15 upper case alpha characters}

Ve1 = {ABCDEFGHIJKLMNO}, Ve2 = {BCDEFGHIJKLMONP}…..and so on, Eleventy-jillion possible combinations – Pick one, any one! Basically, any set of 15 upper-case characters will meet the rules of the valid class. Pick any one set of data that meets the class rules and you have designed your first test case. You may have multiple valid classes. See, I told you it was simple. Now let’s look at invalid classes.

An invalid class consists of any data that does not meet the rules of the valid class. In addition to valid data, a good test will also use invalid data. Like the valid equivalency class, the are millions of possible invalid data combinations. Are we going to test all of them? Of course not. In our example, invalid classes would include any lower-case characters, numbers, or special characters. You may, as in this case, have multiple invalid classes.

Ie = {Any 15 character combination with either a lower-case alpha character, number, or special character
Ie1 = {ABCDEFGHIJKLMNo}, Ie2 = {ABCDEFGHIJKLMN1}, Ie3 = {ABCDEFGHIJKLMN%}….

So how do we use this in testing our application? Simple. Create a positive test case for each valid class that you discover. Create a negative test case for each invalid class. In our very simple example above, if testing only this one field on a form, we have found 4 test cases to run – 1 positive, 3 negative. See I told you it was simple!

Try some on your own – what are the valid and invalid classes for:
- First Name
- Zip(Postal) Code
- Phone Number

Class dismissed! :)

Feel free to contact me if you have any questions – dwhalen14@gmail.com!

Next: Boundary Value Analysis & Testing.

Help! I Need Somebody…..

December 15, 2009

Sorry – too much Beatles Rockband :)

Anyway…

I’ve got some downtime coming up and I want to take advantage of my idle hours to work on Dave’s Perfect Defect Management System (DPDMS), code named “Unicorn”

I am currently in the “Requirements” or project definition stage. If anyone has any inputs as far as what they think Unicorn should look like, what features you would like to see, etc., please feel free to contact me at: dwhalen14@gmail.com.

Here’s kind of a broad scope….

Unicorn is a project-based, customizable defect management system. The system will allow user organizations to create a customized solution that may be applied across numerous software development projects. Each project may have a customized defect work flow. User Actions will be based on the current state of the defect record and may be limited based on User/Owner role. The defect workflow will be based on a fully customizable State-Owner-Action Transtion model. The actions available to a given user/owner may be limited based on the current state of the defect and the user/owner’s role – or not.

I’m also looking at Unicorn to be a Web-based application vs. a Client/Server model. I’m building it in .NET with a SQL Server back-end

Feel free to contact me if you have any questions.

Cap’n Dave
Pirate Tester
Yo Ho, Yo Ho, A Pirate’s Life For Me!

Saved By Zero…..

December 14, 2009

It’s not just a song by the Fixx!

If there is a single concept in software testing that I always have difficulty teaching to new testers, it is the concept of “null” vs. zero or blank.  Even seasoned developers will sometimes argue with me.  But it is a key concept.  Null is NOT zero, and null is NOT a blank. Zeros and blanks are actual data.  A VALUE is available or stored.  A null is NO DATA – Empty!  To paraphrase John Cleese, a null is like a dead parrot:  ”It has NO data!  Nothing is stored.  It is sans data.  Empty.  It does not exist.”  You can’t sort on it, and you can’t do arithmetic operations on it. 

According to the Wikipedia….

Null means ‘nothing’ or without value or consequence.

So how does this affect our testing?  A good programmer will typically ensure the all relevant values are initialized.  For a numeric value this may be zero.  For character data it may be a blank.  Regardless, the field/data is not left empty.  There is a HUGE difference between a value – even if it is zero – and empty (without value).  Most database systems, when the database is created, will leave a field empty, or null, on creation unless a “not null” constraint is added or initial data is specified.

The easiest way to identify the problem (in a black box environment anyway) is to try to sort the data or do some type of arithmetic operation.  I usually find it in a table of data where a column sort is allowed.  Try sorting every field.  A null will sometimes produce an error (for Oracle its a “NaN” error).  Some systems will sort the data but the result will look strange.  For example, if we are sorting numeric data (ascending order) - null values may appear first, followed by zeros, ones, etc.  Sometimes the code may convert nulls to zeros so both null data and zeros will appear together in the sort.  The output will look strange though and it can be a difficult error to find.  You will usually see a similar result with character data.

To my thinking – all data fields should contain some data value even if it is zero or null.  It can prevent a lot of potential processing problems down stream.  The simplest way to fix it is during database initialization.  Or during the data creation process.  So to my developer friends – if you are storing data, and the record includes “optional” fields, please send the optional fields a zero or a blank! 

You know what Smokey says – “Only you can prevent data errors!”  Or something like that.


Follow

Get every new post delivered to your Inbox.