Archive for December, 2009

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.

Making “Nice”

December 10, 2009

Since I have recently been accused of not being “nice” I figured it was time to write something “positive”. As I have stated here too many times to count – I’m no fan of “A”. There are parts I really like. Other parts – not so much. My position is, and always has been, that software testing is not something we can apply a standard (or for the Context Driven school) a “best practice” to. This includes A. In the early days, that is what A was all about – flexibility! Sadly, those days are over. But back on track. Many A practices use Test Driven Development (TDD) as one of the key components. I whole-heartedly agree!

When I was in the Air Force, I spent a number of years in Technical Training as an Instructor, Instructional Designer/Developer and Curriculum/Course Supervisor. By far my favorite position was Instructional Designer/Developer. As an Instructional Designer/Developers we analyzed the training needs of active duty U.S. Air Force, Air Force Reserve, Air National Guard, and foreign military services on complex F-16 avionics systems.We then built the courses, both initial skills and advanced, to support all the various customers. Back then we used the Instructional Systems Design (ISD) process to create the curriculum.

A major piece of the ISD process is writing objectives and tests. We would write an objective to define an expected training out come and then write the test or measurement to validate that the student successfully met the objective. All other training materials or “content” – lectures, workbooks, student texts, practical exercises, etc., were then written to prepare the students to be able to “pass the test”. The tests may be written tests or practical “hands-on” tests of a given process – like testing a Flight Control Computer. Each course had hundreds of objectives and individual test items. All in all it was a great process. Universal? No. We sometimes had to tweak a few things here and there – but it worked! It was a standard, but allowed flexibility. Like A, many tried to make the rules extremely rigid. It rarely worked. They may still use the process today but I retired from the Air Force 10 years ago so I don’t know.

OK – I told you that to tell you this…

When I was first thrown into Software Test Development (yes, thrown) I quickly found that there is little to no training available. So I applied what I already knew. I had my team write test objectives and then write the test case or test script needed to validate it. The only piece we had no direct control over was the development (content). After a while we learned that if we gave the developers the test objectives and test cases before the code was written we were much more successful. The best part – we could review, verify, and approve the objectives and tests as a team (customers, managers, developers, etc.) before the first line of code was written. We found literally hundreds of areas where blocks of code or tests could be either reused multiple times or simply modified rather than written from scratch. We ended up writing libraries of code blocks and test cases that we could call or reuse as needed. We were doing TDD and didn’t even know it!

The result – the project was delivered on time, within budget, and virtually error free. More importantly – the customer loved it!

Now – we didn’t have 2 week “sprints” or a lot of the other A stuff. We actually did 3 “iterations”. No pigs or chickens – or whatever they’re called. No burn-down charts. None of that stuff. We did have daily 15 minute stand-ups – another practice I love and use universally. We were highly collaborative. It was by far the best project I ever worked on! Were we an “A” team? I think so, but the A purists will tell you no!

Was there a down side? Yep. We did daily builds and ran a daily smoke test. If the smoke test failed, the developer that broke the build bought donuts the next day. If it passed, QA bought the donuts. I gained 20 pounds!

The Scarlet Letter

December 9, 2009

Pilloried and stoned.

I told you so!

Much like a nonbeliever in the 17th century, I dared to question the common religion of the day and was sent to the pillory of the software testing town center, racked, and publically stoned by the true believers.

My crime – I made a wise crack to a collegue in what I thought was a personal email – it wasn’t. I made a joke about her discussing the “A” word (Agile).

Within minutes my cell phone was pinging endlessly with unsolicited inputs from the A Puritans. “How dare I!” In fact one person even told me I was allowed to pick on specific A implementations but not the A process as a whole. What!?

Four of them eventually lined up and threw stones at me all night. The sad part is, I don’t believe I was disparaging anyone personally. I was just expressing my opinion about the “rigid rules” of A. My discenting opinion was not welcome at all. I was essentially told to get in line and drink the Kool-Aid with everyone else. NO!

My comments apparently drove the owner of the site to implement a new censorship policy of all unfriendly, anti-A posts. Is it 1939? Anyway, I think they were trying to disuade me from posting or sharing my non-conformist beliefs. They achieved just the opposite. Not only did they completely validate everything I had said previously, I am now driven to oppose them even harder.

For those of you that don’t follow my posts, I will repeat what I have often said – it is not the A process I disagree with, its the inflexibility of the Church of A and it’s true believers. I actually like and use much of the A process. But there are parts I don’t. I like to tailor my approach to the company, schedules, staff, etc. Which brands me as a non-believer – with them it’s all or nothin’ (name the movie/show). You see, I assumed A was synonymous with flexibility. I guess not.

Who Tested This?

December 4, 2009

I had a stroke 4-1/2 years ago (minor – I’m 100% recovered)  I have to go see my doctor once a month to have my blood tested to monitor my blood and hopefully prevent another stroke.  They prick my finger.  I bleed into this little receptical.  The receptical is inserted into a hand-held blood reader thingy and -Viola – after about 5 minutes we have the results.  Based on what the hand-held blood reader thingy says, my medication may or may not be adjusted.  About 50% of the time the test fails –  it reads high.  My doctor, skeptical of the test results, has my blood drawn and sends it to the lab where the test passes everytime.

As I was sitting in the doctor’s office yesterday awaiting my test results I was pondering comments I made recently about Exploratory Testing and Agile.  I started to wonder – who tested this machine and the software that runs it.  If it was tested, a key test was over-looked.

The part that really scares me – if it reads “correctly” (within range), my doctor trusts the results.  If it reads incorrectly (out of range) she doesn’t trust the results and does the lab work.

The tester in me is concerned.  If you can’t trust the bad results, what makes you believe the good results are valid.  I explained my concerns to the doctor.  She gave me a perscription for Valium.  Look at all the pretty colors!

I’m Skeptical

December 3, 2009

If there is any one, single trait that I value in any tester it is Skepticism!

True Story…

I recently attended a twice-weekly operations meeting for a payroll system. Since my involvement with this system, it has always been an over-night process that, to my knowledge, has never run without “issues” (data issues not code issues). The person responsible for running the monthly payroll process reported last week that the typical all-night process ran in less than an hour – without error. The entire operations team was elated – well everyone but me anyway. It just sounded way too good to be true. It may be. It has been a week and as far as I know no one has reported a payroll problem. No one was under-paid anyway. They may have been over-paid – and it IS the last payroll before the holidays. Hmmmmmm? Stay tuned!

Yo ho, yo ho, a pirate’s life for me.
Drink up me ‘earties, yo ho.

Cults!

December 2, 2009

Don’t Drink The Kool-Aid!

If there is one subject that is sure to get me philosophizing (is that a word?) or writing it’s Agile.  As I have stated publically (a number of times and in many forums) I think Agile is a cult – almost a religion.  Notice that I said “I think…”  

It’s not the process that I disagree with, it’s the motives and actions of the ”true believers”.   Like most cults, if anyone dares to have a different opinion or refuses to drink the Agile Kool-Aid, the true-believers will rally their masses and crucify you for having the audacity to have an opinion that challenges their beliefs.  Don’t get me wrong – I like Agile.  It’s a great process.  It works well in SOME, very narrowly defined, situations.  NOT every situation!

But that’s OK.  you are entitled to your opinion, and although I may not share it, I respect your point of view.  Sadly – like most religions – while I repect their opinions – the true believers have no respect for mine. 

Yo ho, yo ho, a pirate’s life for me.  Drink up me ‘earties, yo ho.

Ugly Baby Syndrome!

December 1, 2009

Ugly babies.

While I’m not a huge fan of American Idol, I’m a big fan of Simon Cowell!  Do you think if one of the Idol winners ever gets an award, like a Grammy, they will thank Simon?  I doubt it.  He’s lucky.  He can be open and say what he feels.  Sure people are angry at him.  But you know what?  He’s usually right.  It’s just the message delivery that upsets most people.  Deep down, they know.  Unfortunately, for software testers, that’s not a luxury we have.

I think Simon would be a great software tester.  A desirable attribute for any good software tester is to tell people what we think – tactfully.  Software developers, Project Managers, Product Managers, and anyone else on a software project, spend countless hours designing and developing software applications for customers.  They’re proud parents.  It’s their baby.  Then they show it to us, and essentially ask:  “What do you think?”  More often than not we have to tell them they have an ugly baby!

I imagine, if you have an ugly baby, Simon would tell you so! 

Nobody wants to tell someone they have an ugly baby, but unfortunately, it’s our job.  The key is how you tell them.  Sadly, you will always run into a proud parent that will be hurt no matter how you tell them.  Different parents will respond differently depending on the way the message is delivered or received.

So how do we handle these delicate situations?  Having been a test consultant now for a few years, I’ve had to deal with a number of delicate parents.  Here are a few tips on the proper care and feeding of delicate parents:

  • Build a Rapport with the Team:  Get to know them.  Take them to lunch.  Buy them bagels or donuts.  Let them know that you are there to make them look good.  When a virtually flawless application is delivered to a customer, no one says how well tested it was.  Development teams will always get the credit.  However, if it is delivered with bugs, everyone will wonder who tested it!
  • Be Honest and Responsive:  One of the best compliments I ever received was:    “If Dave and I grew up together, I’d never let him touch my toys.  He breaks everything!”  Tell them up front, you’re going to do everything in your power to break their application.  It’s what you do!  Although a good magician never reveals their secrets, a good tester should.  If I have time, I will usually tell them what my attack plan will be.
  • Be Open and Available.  Want me to take a look at your requirements? – Absolutely!  I always let teams know, that if I’m available before formal testing begins, I will give them a free look at their requirements, specifications, code, whatever they have.  I won’t create a defect in the bug tracker.  I’ll just shoot them a quick email, and make a note to look at it later.  It ends up saving everyone time in the long run and, once again, makes them look good when formal testing begins.  It also helps me develop and refine my tests.
  • Let Them Review Your Tests.  If you’re going to look at and critique their stuff, it’s only fair to let them do the same to your stuff.
  • Don’t Rely on the Bug Tracker.  Never send a public ugly baby notice!  The last thing you want to do is rely on the bug tracker to deliver bad news.  There is nothing worse, or less productive, than flame wars in the bug tracker.  Talk to someone!  Let them know what you did and why you did it.  Show them.  Lead them towards a solution.  Tell them what your expectations are.  It may be a simple misunderstanding of a vague requirement.  Count to 10, then write it up.
  • Check Your Attitude.  This is my personal weakness.  You don’t want to come off badly.  What’s funny to you, or well meaning, can be completely misconstrued.  Be critical, but constructive.  You need an air of friendliness and support.  If you come off as arrogant or condescending, the ultimate message will be lost.
  • Don’t Take it Personally.  Tough to do?  Absolutely!  But you’re just the messenger.  Its’ usually not about you.  You’re just the closest and easiest target.  Grow a thick skin.
  • Be Prepared.  It’s going to happen.  Maybe it hasn’t happened yet, but if you do this long enough, it will.  Be ready for it.
  • Write an Article or Blog Post.  While it may not solve anything, you will feel better afterwards.  I know I do!

Unfortunately, while these tips tend to work well with in-house teams, it can be difficult with geographically distributed teams.  Since they don’t work with you face-to-face every day, and you can’t take them to lunch or buy them donuts or bagels, there is a tendency for the message to get distorted.  As I recently learned (the hard way).  Even though you may have good intentions, someone’s feelings may get hurt.  Unfortunately, attitudes don’t translate well over the phone or by email.  Don’t be afraid to apologize.  It’s typically a misunderstanding.  It’s more important to heal the relationship and move on than to stand on principle.  If you’re right – gloat to yourself.

Bottom line – no matter what you do, you’re going to hurt someone’s feelings.  Be prepared for it and don’t be afraid to make adjustments if you need to.  It may still be an ugly baby, but it’s never too late to do something about it!  Someone has to do it.  You don’t want the customer to do it. 

If you’re in this business for personal rewards or recognition, you probably need to rethink your career choice.  Not that they’re not there.  They’re just few and far between.  No, a good tester gains satisfaction by knowing, albeit silently, that they were the reason the application was virtually flawless.  Sure, no one else may notice, but I know, and that’s good enough for me!


Follow

Get every new post delivered to your Inbox.