The Braidy Tester interviews me about software testing on Dr. Dobb’s blog

Michael Hunter, our very own Braidy Tester, interviews me about software testing.  Yep, it has been a while, well over a year, since i’ve done pure software testing.  But fortunately, he let me pick the 5 questions i wanted to answer =)

http://www.ddj.com/blog/debugblog/archives/2007/05/five_questions_17.html

In the intro, he talks about my custom-built motorcycle.  I wish i were that cool.  The story is i had a custom-built bicycle made from the motorcycle accident i was in.  The rest of the money went to student loans.  Every now and then, i think about getting a motorcycle, but then i put my hand into a fist and hit my leg where after 6 years still hurts from getting hit by the car.  Then i remember why in the ambulance, and the year afterwards, i swore i would never ride a motorcycle again

What we’ve learned about testing open source projects

John, our only SDET (tester) on the team, has written a couple of blog entries on what we’ve learned (sometimes the hard way) about testing open source projects:

What’s different about testing open source projects?  (Part 1)

Recommendations for corporate teams developing Community Based Open Source projects (Part 2)

We hope you find this information useful.  Feedback and discussions are always more than welcomed.

Pop Quiz: How good are you at technical support?

I enjoy telling this story of these unfortunate events as a technical support quiz.  Makes me feel a little better about myself.

The game is you have to guess what happened or what set of questions you would ask to narrow down the problem space.  There are no prizes for figuring it out, besides the sense of satisfaction of getting it right and maybe having me come to you for tech support in the future ::grins::

The Situation

(note: this is the exact info i would have given tech support / helpdesk)

I install Vista on my Toshiba M4 Tablet Friday night at the office (yes, exciting Friday night)  I immediately install the required apps from IT, change the desktop wallpaper to the bamboo theme (green is my favorite color and i love bamboo), and make a few other user appearance tweaks.  Over the weekend, I read a few blogs via IE7, download some family pics of the house being rebuilt, and change my desktop wallpaper to this picture of red leaves. 

On Monday morning, i dock my tablet and wait the appropriate amount of time for my monitor to come on.  To my surprise, i see the old bamboo wallpaper from Friday night.  I think "weird, my desktop customizations weren’t saved from Saturday."  So, i open IE when i realize that nothing is found in the history.  Now this is getting weird, almost alarming.  Now i realize that i can’t find anything from using the laptop on Saturday.  There are no pictures of the house on the laptop at all. 

I’m asking around, as this is the first real time i’ve used Vista.  I installed it the week before on both my desktop machines, but didn’t do much with it besides personal tweaks, like changing the wallpaper.  My laptop is my primary machine.  I’ve checked file versioning, file redirection, nothing.  There’s no trace of my session.

The Hint

Then i realize i’m late for my team’s morning meeting.  So, i’m going to make you click here for the next part of this saga, since i think this may be a clear give-away.  I don’t want to spoil the fun.

Happy Technical Supporting!

The Answer

Click here for the answer

Tips for Reporting Issues at Product Feedback Center

I’ve worked with my teammates on VS Core to come up with this list of tips on writing good bug reports.  Take it from me as a tester, the better the bug report, the easier it is to get the issue resolved quickly and adequately. 

Tip #1 – Clear, but minimum Steps to Repro

Let us know what are the minimum steps needed to reproduce your issue, but be clear as possible what the steps are.  When in doubt, include whatever information you think will be helpful.  Better too much info than not enough.  And if we can’t repro, we’ll be in touch =)

The fewer steps required to reproduce an issue, the clearer the root cause becomes for us.  For example, make sure a project is required to reproduce the issue.  If you are running into an issue docking a tool window to a certain location, an open project may not be needed to reproduce the issue.

Also, be as clear as possible when providing repro steps.  Instead of saying, “now reset VS settings”, let us know exactly how you reset the settings, for example, did you use Tools – Import Export Settings, delete registry keys, run devenv /resetusersettings? 

More information on providing solid bug report can be found at http://blogs.msdn.com/productfeedback/archive/2004/07/01/171229.aspx

Examples

Note: I’m just making up these examples.  To the best of my knowledge, these do not exist on any blog, forum, or Product Feedback Center bug.

Not-so-clear bug report

Title:  Tool Window Dragging Issue
Body:  Whenever I try to dock my Tool Window with another tool window, the docking targets never appear.

Clearer bug report

Title:  Tool Window fails to dock with other Tool Windows
Body: 
<version type, build #, general default settings, etc.>
Whenever I try to dock any Tool Window with the Find and Replace tool window, the docking targets never appear.  I can dock tool windows with other tool windows, but just not with this File and Replace tool window.  I verified that I don’t need to have a project opened for this to occur.

Resolution

In the case of the clearer bug report, I could quickly reset to the general default settings and open the Find and Replace tool window.  Since the issue is specific to just the Find and Replace tool window, I can limit my investigation to just it.  In the Default Settings, the Find and Replace tool window is set to “Floating” by default.  In order to dock another tool window to it in this state, you need to first change the Find and Replace tool window to “Dockable” by either Right-Clicking on the title bar or going to the Window menu.

Tip #2 – Version Info

Let us know which version of Visual Studio you are using.  For example, Visual Studio Team Suite, Professional Edition, Standard Edition, or an Express Edition?

Tip #3 – Default Settings Selection

Which default settings did you select on first launch or last reset to?  Don’t remember?  Go to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\Profile and look at the LastResetSettingsFile value. 

For example, if you selected the General Development Settings, you’ll see “General.vssettings”.

Tip #4 – Build #

Are you using the official released version of Visual Studio 2005 (build 50727.42)?  If you’re not sure, go to Help – About to check.  You can also use the “Copy Info” button to paste in this info.

Also, let us know if you had a previous version of Visual Studio 2005 installed on your machine.

Tip #5 – Solution Configuration

The more details we know about your solution, the closer we can setup our machines to reproduce the issue.  This information is imperative to reproducing your issue on our machines.

What sort of projects do you have in your solution?

What language is your project(s)? 

What project template(s) are you using? 

Are you using any Web projects? 

For example, here’s what a solution could look like:

MySolution
– WindowsApplication (C#)
– ClassLibrary (C#)
– <Solution Folder>
— ClassLibrary (C#)

Tip #6 – Reporting Crashes

If you happen to encounter a crash, please send the report to Microsoft to help us investigate.  Then let us know the crash ID number you sent in the report.  To find this information, please do the following:

1.  From Start – Run dialog, run "eventvwr.msc"
2.  Open the "Application Log" node.
3.  Look for the newest event with Source="Microsoft Development Environment" and Event="1–1"
4.  Open that event and you’ll see "Bucket" followed by the crash ID number we’re looking for

Tip #7 – Consistent Repro

Let us know if you are consistently running into the issue or if it just happens once in a while.

Also, let us know if the issue reproduces using different projects, if you shut down and restart Visual Studio, etc.

Thanks again for your help making Visual Studio better than ever!

Happy Visual Studio’ing!

5 Tips for surviving as a Tester

These tips apply for all testers, not just Microsofties.  What other tips would you include in this list?

Bend over backwards to help your dev
You’re going to be breaking his/her code for the rest of your careers together, so you want to have a great working relationship between each other.  First off, establish trust with your dev.  If you say you’re going to buddy test something by such-and-such time, get it done.  Actively seek feedback from your dev on what features are lacking testing, how you can do more testing, etc.  And whatever your dev needs from you, like ad-hoc machines in the lab, status of nightly runs, get that info to him/her asap.  It won’t take long for you to see the benefits of going out of your way to help your dev.  And it’s not just about using common sense, it’s about making sure you’re doing your part in helping the team succeed and how you would want your team to help you out when you need it.

Leave appropriate comments in every bug you verify and close
1 year, 6 months, or even just 3 months down the road you won’t remember how you verified that bug fix.  If you can no longer follow the original bug repro instructions (sometimes bugs morph, other times the fix doesn’t allow you to get to the end of the repro), leave comment explaining exactly what you did to verify the fix.  And once again as common sense would dictate, make sure the build number that you verified the fix on is written some where in your bug tracking database.

Never Assume Anything
Never assume that

  • Someone else is covering that scenario – Test everything you think of.  A little overlap never hurts.
  • Triage (or whoever is reading your bug) will “just get” the bug.  Always be explicit with repros, even when it’s completely obvious (to you) in the attached repro picture.
  • A simple scenario could never be broken.  Always, always, always test – even if it is the simplest feature or part of the feature in the world.

Don’t just get it in writing
Email just isn’t enough.  If you’re not going to cover an explicit scenario, get it in writing in your test plan.  If you’ve discovered an issue and the issue isn’t going to be fixed as stated in an email thread, make sure it is in your bug database.  Email is like leaves on a tree.  You get a lot of new email in, you save a lot of email off to the side (like leaves in a large trash bag which makes for excellent tree house furniture), but after a while, saved old email just gets older and unneeded, just like your furniture that is now collecting spiders, so you throw it out.  Make sure any major decisions involving your test strategy or test bed or written in the appropriate document / database / forum, etc.  And yes, that was my worst analogy ever.

Learn from the bugs you missed
Ask yourself why someone filed a bug report in your feature area that was later fixed?  What could you learn from this bug?  Are you missing other similar tests?  This process is actually called “Root Case Analysis”, but you don’t have to do the formal RCA work to learn from bugs that got away from you.  So many times, I find myself staring at my monitor just wondering what I’m missing.  The answer to that question is just doing a query of fixed bugs not opened by me.  Surprise yourself by seeing just how much you can learn by doing this.

Got a tip?  Add it to the list!

View original comments

Blame me if you don’t see Brief or Emacs keybindings in the Beta 2 Standard SKU

Update:  Sean has a much better workaround at http://blogs.msdn.com/vseditor/archive/2005/04/26/412307.aspx

Sometimes being a QA reminds me of when I was a soccer referee – you’re only as good as your last call or the last bug you missed. 

I’ve seen a couple of MSDN forum posts now about missing Brief and Emacs keybindings, so I figured this issue merits a post here.

It’s a known issue that the Brief and Emacs keybindings are missing from the Beta 2 Standard SKU.  The workaround, as stated in the Beta 2 Readme is as follow:
Install Visual C++ Express SKU to the same folder as Visual Studio Standard SKU

Let’s see how transparency works here about how this bug came to pass.  Can’t wait to view the comments.  We have lots of different runs on lots of different builds, Skus, platforms, different applied vssettings files, different operating systems, and different languages.  At some point in time, we had a run against the Standard SKU, where the Brief and Emacs nightlies failed because the keybindings were not present.  I incorrectly analyzed the failure as a lab/installation issue, because there was only one machine available, so I couldn’t compare it to anything else.  First lesson learned is that I should have installed the Standard SKU on an ad-hoc machine and verified it, but I was swamped for those couple of months (very very swamped).  We were supposed to have another Standard SKU run the next week or the week after that, but the run schedule was trimmed back, and I forgot about the Standard SKU issue with everything going on.  Second lesson learned is that I should have setup a reminder to double-check such issues after a week or two.

Cry your pardon, sai, I have forgotten the face of my father…

I don’t think I can talk (yet) about how many bugs I’ve found during the last full test pass, or how many test cases I executed per day for those weeks, or how many bugs I found that did make the beta 2 bar to justify missing this bug.  I’m hoping this is the worst bug that got though. I’m pretty confident you’ll find a high quality Beta 2 release for the Editor.  And if not, you know where to find me =)

What are Test Hooks?

Finally, the promised post.

Types of Controls

There are three types of controls you’ll discover when automating UI

  1. Standard Windows controls
  2. Owner-drawn controls – controls that have the functionality of Standard Windows controls, but have custom drawing. These controls will have to implement IAccessible to describe the custom paint job
  3. Painted controls – I’ve asked around what the term was, and everyone I asked responded with “they are just painted”. This is where there’s only one window, but within the window, numerous controls are painted.

How automation typically works

Automating UI requires three critical aspects:

  1. Capturing controls
  2. Manipulating controls
  3. Acquiring data from controls

These tasks can usually be achieved via Win32 API calls, MSAA, or in some cases, from the application’s object model when dealing with Standard Windows controls and Owner-drawn controls.

For example, consider capturing a regular button to verify its caption and what it does when clicked. You would first use a tool like Spy to find the control and to get information on the control, like its classname. From the automation framework, you would search for the window with this particular classname among all available windows to get its handle. Using the handle, you’ll be able to use Win32 API calls and MSAA calls to either manipulate the control, ie pressing the button using IAccessible::DoDefaultAction() or acquiring data from it, ie getting the button’s caption using GetWindowText().

But what happens if the control doesn’t have its own window?

Consider File Tabs on the File Tab Channel. See my post on the File Tab Channel for a picture of what this looks like. If you were to use Spy on the File Tab Channel, the first thing you’ll notice is that the individual file tabs do not have their own windows. There’s only one window (the File Tab Channel itself) that hosts the File Tabs. How does one capture the File Tabs if all of them are contained within the same window?

Use Test Hooks

Test hooks are “hidden” messages the developer will write into the application. I call these hidden because you have to ask the developer what messages to send to which window (or look at the code). The tester supplies the developer with a list of requirements, like being able to press the button or get the caption. And the developer in returns gives you back a set of messages to send to a given window that will produce the desired effect, like click the button or return the button’s caption.

Here’s how an automation framework might use the test hook to get the caption of a particular File Tab on the File Tab Channel.

Several things to note:

  1. SendMessage() is used to send messages to a control
  2. The WM_USER range is typically used to define custom messages to a particular custom control.
  3. ATOMs are useful when a string is needed by an external process, which is usually the case in an automation framework. ATOMs are global to Windows.

Const FileTabMessage As Integer = &H8000 + &H1001 ‘ WM_USER + test message app is expecting – note: this is just a number I made up

Const Text As Integer = 1

Const Click As Integer = 2

 

Private Function GetFileTabText(ByVal fileTabIndex As Integer) As String

‘ send message to test hook requesting the ATOM for the requested file tab’s caption

      Dim atom As IntPtr = SendMessage(MainWindowHwnd, FileTabMessage, fileTabIndex, Text)

 

      ‘ convert ATOM to String

      Dim buffer As New String(" "c, 255)

      GlobalGetAtomName(atom.ToInt32, buffer, buffer.Length)

      Return buffer.Substring(0, buffer.IndexOf(Nothing))

End Function

 

View original comments

Automation Testing versus Manual Testing Guidelines

I met with my team’s automation experts a few weeks back to get their input on when to automate and when to manually test. The general rule of thumb has always been to use common sense. If you’re only going to run the test one or two times or the test is really expensive to automation, it is most likely a manual test. But then again, what good is saying “use common sense” when you need to come up with deterministic set of guidelines on how and when to automate?

Pros of Automation

  • If you have to run a set of tests repeatedly, automation is a huge win for you
  • It gives you the ability to run automation against code that frequently changes to catch regressions in a timely manner
  • It gives you the ability to run automation in mainstream scenarios to catch regressions in a timely manner (see What is a Nightly)
  • Aids in testing a large test matrix (different languages on different OS platforms). Automated tests can be run at the same time on different machines, whereas the manual tests would have to be run sequentially.

Cons of Automation

  • It costs more to automate. Writing the test cases and writing or configuring the automate framework you’re using costs more initially than running the test manually.
  • Can’t automate visual references, for example, if you can’t tell the font color via code or the automation tool, it is a manual test.

Pros of Manual

  • If the test case only runs twice a coding milestone, it most likely should be a manual test. Less cost than automating it.
  • It allows the tester to perform more ad-hoc (random testing). In my experiences, more bugs are found via ad-hoc than via automation. And, the more time a tester spends playing with the feature, the greater the odds of finding real user bugs.

Cons of Manual

  • Running tests manually can be very time consuming
  • Each time there is a new build, the tester must rerun all required tests – which after a while would become very mundane and tiresome.

Other deciding factors

  • What you automate depends on the tools you use. If the tools have any limitations, those tests are manual.
  • Is the return on investment worth automating? Is what you get out of automation worth the cost of setting up and supporting the test cases, the automation framework, and the system that runs the test cases?

Criteria for automating

There are two sets of questions to determine whether automation is right for your test case:

Is this test scenario automatable?

  1. Yes, and it will cost a little
  2. Yes, but it will cost a lot
  3. No, it is no possible to automate

How important is this test scenario?

  1. I must absolutely test this scenario whenever possible
  2. I need to test this scenario regularly
  3. I only need to test this scenario once in a while

If you answered #1 to both questions – definitely automate that test

If you answered #1 or #2 to both questions – you should automate that test

If you answered #2 to both questions – you need to consider if it is really worth the investment to automate

What happens if you can’t automate?

Let’s say that you have a test that you absolutely need to run whenever possible, but it isn’t possible to automate. Your options are

  • Reevaluate – do I really need to run this test this often?
  • What’s the cost of doing this test manually?
  • Look for new testing tools
  • Consider test hooks

View original comments

Channel 9 videos of me talking about our Test Case Management System (Maddog) and analyzing failures in a run

By popular demand, I asked Josh about doing a live video segment of Maddog to bring to live the Maddog concepts ScottGu had posted about one Friday morning. That afternoon, Josh shot these videos of what was supposed to be me teaching Marie the basics of software testing in DevDiv, but I looked at the camera a little too much instead of at her (my rational was that I was responding to Sheeshers request to hear more about testing activities). And, I promise I talk much slower in person, when I’m not nervous – It’s a N’awlins thing. =)

The first three videos are

Introduction to DevDiv’s Test Case Management System (Part 1)

Investigating a test case failure in the lab (Maddog Part 2)

Analyzing a Test Case Failure (Maddog Part 3)

There’s a fourth video (in my opinion, it’s the best of the 4 videos) along the lines of The Proper Steps to Logging a Bug, including finding the exact repro (minimizing the repro steps), including a good title, and searching for duplicates. I’ll let you know when Josh posts it.

update:  The video has been updated at http://download.microsoft.com/download/0/8/d/08d8ebd7-a2d4-442e-abb8-8a0eae19f120/josh_ledgard_05_tour_devdiv_logabug.wmv, but it just doesn’t have a blog entry at Channel 9 yet.

View original comments

What software testing topics do you want to hear more about?

Do you have any software testing topics you want to hear more about? Here are a few suggestions that I’ve already received from readers:

  • How do you go about automating?
  • How much is automated and how much is manual?
  • How does QA fit into the product lifecycle at MS?

Let me know what other topics you’re interested in and I’ll see what I can do…

View original comments