One thing I did in my last position was bring in a new programming language to the group in order to generate a test harness that would help us out with some of the sore points we had, but while I did that I brought other people into the test harness project to help out. Adding in new people and a language, Ruby in this case, meant that there were going to be things people did not understand, no matter how much I could document in all the scripts we had there were some that had little information in them. So how to handle this?
Well I could have documented it on a wiki, and I had. Of course the first place most of the documentation on the scripts should be is in the scripts themselves, but I inherited about 95% of the code that had built up over years and as I said, I tried to document when I could.
I could give people books and web sites to learn what they needed to know, this was really done without my interaction as everyone took it upon themselves to learn what they needed and I also made my library open.
The third way I saw was to help people learn, so I needed to mentor people. I took time on occasion to show people how to write certain scripts, I did monthly talks about some parts of coding (but that was already a long standing practice in this company). Sitting down and taking time to go over small scripts with my co-workers, I sometimes gave them easy projects to do to get them used to the coding, giving advice and answering questions about how things happened. I learned a few things in the process as well, which is always a bonus, but it worked out well for my colleagues who were able to come up to speed quick and make an impact to the coding needed to transition to a new test harness.
So why are you never too old? Because the people joining me on the project were Senior and Principal level QA staff who were coming from testing the GUI to writing scripts that they could use to make their own testing better. None of us were Junior level people, or interns, so no matter what level you may be there is always something new to learn.
I'm old. I'm cranky and think the Luddites were on to something.
Tuesday, June 23, 2009
Monday, June 15, 2009
Entering Defect Reports
Its something we do all the time, and I've been doing it in various incarnations of software for years now, but I rarely just give detailed thought to it until I went into an interview recently and was asked - "What do you put into a Defect Report?"
At first I was thinking, sure I know this and could easily list off many items that should be in there, but then I started wondering what is the purpose of some of these things I do and write down. Sure I do them because I know it gets the right detail on the problems listed, it also makes it easy for Developers or anyone else to read the reports, I have been doing them for a long time, and I have evolved certain things over time. So in order to put it down, and to have some place to also answer people who seem to ask this time and time again in the forums I give you my List Of Things To Be Included In A Defect Report.
At first I was thinking, sure I know this and could easily list off many items that should be in there, but then I started wondering what is the purpose of some of these things I do and write down. Sure I do them because I know it gets the right detail on the problems listed, it also makes it easy for Developers or anyone else to read the reports, I have been doing them for a long time, and I have evolved certain things over time. So in order to put it down, and to have some place to also answer people who seem to ask this time and time again in the forums I give you my List Of Things To Be Included In A Defect Report.
- Title - the title should be 20 or 25 words, in some cases its about the length of the title field in certain software, but its also good to be concise. Make the title useful in case you are searching for defects and the title is a field that is returned, you want to be able to find old defects easy and know by the title what they are about. It's also useful to other people who may be searching old or open defects, if they can tell what the defect is for then so much the better, it avoids much opening of defects to review. Usually I put in error messages, if short, or a small description of what the error is.
- Description - this can be a lengthy overview of what the issue is, sometimes its useful for detailed defects so there is something to check over before getting into the nitty gritty, but the description also contains many other things which shall be noted shortly.
- Steps to Reproduce - this is vital. If you want someone to be able to fix the defect they may need to reproduce it, without knowing how you'll get visits by people who want to know what you did. Or it may just be closed as unreproducible, or sent back to you for more information. Make sure you run through the steps a few times, make sure nothing is missed and that other people can do it on the same machine, or a different one if that is your company's environment. This should be included in the description.
- External Files - screenshots, core files, dumps or whatever else may help someone triage the issue should be included in the report, if possible, or note a location on a publicly accessible area, or at least an area accessible by your co-workers, where the files can be found. These are necessary to determine where issues have come from, or may be needed for someone to see the error messages, of UI issues, you report. This should be included in the description if not attached to the report, its often nice to note this information is attached.
- Platform, machine type, operating system - anything else specific about where the issue occurred. Many defect systems have this as pull down information available when entering the defect, if not put this in the description, and sometimes its useful in the Title as well.
- Why its not a duplicate - if this is similar to an existing issue but not the same, note why in the Description. If its related to an existing one, make sure to link the new one to the exisitng defect so there is a trail for people to follow, many defect systems allow this otherwise add it to the Description.
Tuesday, June 2, 2009
Review: How We Test Software at Microsoft
Although I will never work at microsoft, although definitely not at the main campus since I have no intention of moving off the East Coast of the US, it was interesting to get a glimpse at how the company looks at Testing and Testers. Considering that they are often used as an example of how not to make software and release, considering the bugginess of some of their releases, I found the evolution of the QA positions in the company to be illuminating. I never thought they put this much thought into it.
The examples were nice, sort of like Lessons Learned From Software Testing, another of my favorites, and in some cases were pretty funny. Seeing how software is made behind the scenes is not as messy as sausages, but it can be as interesting.
One of my favorite chapters was Chapter 5 - Functional Testing Techniques, not just because I saw Bj Rollison give part of the chapter as a talk to the STPCon in 2008, but because I like the detail of examples and clear definitions of Equivalence Partitioning and Combinatorial Analysis; subjects I sometimes I forget about. I'll be rereading this chapter now and again to catch up on those testing techniques, as they are not ones I have done a lot of during system testing in the past.
It's not often I find a test book that gives me material I can look at now and in the future, this book is one that has found a fast place on my bookshelf at work.
The examples were nice, sort of like Lessons Learned From Software Testing, another of my favorites, and in some cases were pretty funny. Seeing how software is made behind the scenes is not as messy as sausages, but it can be as interesting.
One of my favorite chapters was Chapter 5 - Functional Testing Techniques, not just because I saw Bj Rollison give part of the chapter as a talk to the STPCon in 2008, but because I like the detail of examples and clear definitions of Equivalence Partitioning and Combinatorial Analysis; subjects I sometimes I forget about. I'll be rereading this chapter now and again to catch up on those testing techniques, as they are not ones I have done a lot of during system testing in the past.
It's not often I find a test book that gives me material I can look at now and in the future, this book is one that has found a fast place on my bookshelf at work.
Tuesday, May 26, 2009
When buying a tool...
...or pretty much anything to bring into your group there are some basic things to consider. Now most of this can be found in many of the automation books out there, or in the QA Forums if you search for it, but I wanted to put down my own personal checklist.
If you can't talk about why the change will help, then you haven't done your work.
- Consider who is going to use the tool - if its just you, and only ever you, then whatever fits your skillset is fine. If other people are going to use this, not everyone will have the same experience, and some people like using detail-driven tools, others do not. Make sure it fits the audience.
- Don't go for whizz-bang cool stuff - there is always a hot tool out there but it may not be a fit. Picking something just because it looks cool, or is going to be resume fodder, is not the way to make a wise decision. Go for a tool that works, not a tool that sounds neat.
- Make sure it fits the project - not every tool is simple and easy to use, in the midst of a project bringing in a tool that requires a lot of focus and start-up time, such as training and installation, is not wise.
- Plan for future needs - again, focusing on the here and now is fine to get you through the immediate needs, but at some point all you end up with is a bunch of tools that get you through a defined set of problems. Thinking ahead, what will be other platforms that will be supported, other technologies coming in the next project, all of this should be taken under consideration.
- Do a demo - take a small subset of what will work and run a prototype, or a demo of the tool. Open Source projects can be used at any time without issue, but if its a commercial product see if they will allow you to demo it against your tool yourself, many will give you 30 days or so to check things out. If you build your own, do small prototypes that you can expand on or gain the knowledge you need to be able to do full builds.
- Check more than one tool - don't decide on the first one that works, do some due diligence. This is the hard part, because it often when you find one that looks like its the best thing ever, and will do everything you want its good to take off. Do your research and check every item on your list, sometimes you will come up with more than one, then its a matter of what will fit the team, environment and needs. You can often end up with a better candidate this way.
- Talk to people - while we all have our own ideas of what the needs are, others who may need to use the tool will also have requirements. Sometimes something at the back of their minds that is hard to use, or do or something that would make work easier, get all these items into a requirements list and document them.
If you can't talk about why the change will help, then you haven't done your work.
Tuesday, May 12, 2009
Rethinking the Test Harness
Recently I went through the exercise of updating the test harness I was using, and I was glad to see that I did it very similarly to Elfriede Dustin's recent book, I did get the book after I was done and read it as I was going through my coding but the important part that set me up for everything was the planning. I already knew the test harness we had was inadequate for the tasks we were adding onto it, this was one of those organic harnesses that grew over time in the company, a lot of people used it and added what they needed to it. Starting from seeds (scripts) it blossomed over time into a very complex organism with lost of scripts, branches (directories of new tests) that were linked into others and eventually its own library of functions to pass among the various scripts. At one point I helped in added some object orientation to the scripts, which at this point were 90% in Perl, this helped us have more reuse and there was a lot of reuse, that is calling, of scripts that were previously written.
Then there was an adjustment in the projects and the test harness needed some adjustment, there were some options that were needed, such as more remote access into scripts being run, especially if they locked up a machine's resources. Also logging was something I wanted for a long time, not just for the scripts that generated output, but also for any script run I was looking to having a database maintain some results so we can have a more permanent record, and review times when the scripts would on occasion fail without any real understanding of why. So I slimmed down the directories, removed scripts that were no longer called and decided it was no longer a good idea to check in compiled binaries, I never liked that anyway. Of course to do this required keeping the current harness working, while redoing everything we had, and we had a project lull so I stepped back and took a look at what we had.
What we had was a large organism that had grown through acquisition of tests by anyone who wanted to contribute, some tests added just to meet a specific condition a customer encountered long ago and was now tested by something else. Also, there were scripts that were no longer called and basically wanted to run in directories of people who had not worked at the company for years. So I stepped back further and said, if I was going to do this over again, what would I do?
So I started looking at other open source options, I like toolsmithing and the exploration process so this was a good fit for my needs, plus it fit the budget and there was already plenty of information on the internet from other people who had tried the tools. So rather than redo everything myself I was going to use a tool to help us organize everything, with open source we had an option to meet the company budget for tools at the time ($0) and there was support in forums and on websites. Next I had to look at what we needed to run it on, at the time we were supporting Windows and Unix (Linux, AIX, HPUX and Solaris) with multiple versions of each platform, so any tool needed to run on all those - a tall order, and eventually in a reorganization the platforms got pulled down to Windows and Linux and finally Windows. Always a good idea to know what platforms you are supporting, and since it was not going to be just Windows forever, I kept all the platforms under consideration. Once that was done I looked at the pros and cons of each tool I came across, made myself a matrix on each tool then wrote out what I wanted to have the test harness do, I could have written the harness document first but I wanted to get some influence first on what the capabilities of other tools can do. That way I was not making a hard to reach design, knowing I wanted logging, a database, a UI for the database and reuse existing scripts was enough to do my research.
At the end I had a document specifying what I wanted the harness to do, a matrix of possible tools and having meetings with other people in the group, and in Development, I got together everyone who might possibly use the tool and solicited opinions. In particular I asked the Architect of the product for opinions, having a high level thinker add even more to the document helped me generate a good tool, I did need to explain what it was that I designed, but it was good practice to be able to talk out what the harness was and should do. In the end I think these steps helped me create a very solid foundation to create the harness on, and before the company folded I had the structure in place with a database, a UI to the database, some agents and clients running to do tests and check results and store them. Very nice, sadly I won't see the design come to fruition but I think the experience was time well served so when I have to do this again I know all the steps I need to do.
Then there was an adjustment in the projects and the test harness needed some adjustment, there were some options that were needed, such as more remote access into scripts being run, especially if they locked up a machine's resources. Also logging was something I wanted for a long time, not just for the scripts that generated output, but also for any script run I was looking to having a database maintain some results so we can have a more permanent record, and review times when the scripts would on occasion fail without any real understanding of why. So I slimmed down the directories, removed scripts that were no longer called and decided it was no longer a good idea to check in compiled binaries, I never liked that anyway. Of course to do this required keeping the current harness working, while redoing everything we had, and we had a project lull so I stepped back and took a look at what we had.
What we had was a large organism that had grown through acquisition of tests by anyone who wanted to contribute, some tests added just to meet a specific condition a customer encountered long ago and was now tested by something else. Also, there were scripts that were no longer called and basically wanted to run in directories of people who had not worked at the company for years. So I stepped back further and said, if I was going to do this over again, what would I do?
So I started looking at other open source options, I like toolsmithing and the exploration process so this was a good fit for my needs, plus it fit the budget and there was already plenty of information on the internet from other people who had tried the tools. So rather than redo everything myself I was going to use a tool to help us organize everything, with open source we had an option to meet the company budget for tools at the time ($0) and there was support in forums and on websites. Next I had to look at what we needed to run it on, at the time we were supporting Windows and Unix (Linux, AIX, HPUX and Solaris) with multiple versions of each platform, so any tool needed to run on all those - a tall order, and eventually in a reorganization the platforms got pulled down to Windows and Linux and finally Windows. Always a good idea to know what platforms you are supporting, and since it was not going to be just Windows forever, I kept all the platforms under consideration. Once that was done I looked at the pros and cons of each tool I came across, made myself a matrix on each tool then wrote out what I wanted to have the test harness do, I could have written the harness document first but I wanted to get some influence first on what the capabilities of other tools can do. That way I was not making a hard to reach design, knowing I wanted logging, a database, a UI for the database and reuse existing scripts was enough to do my research.
At the end I had a document specifying what I wanted the harness to do, a matrix of possible tools and having meetings with other people in the group, and in Development, I got together everyone who might possibly use the tool and solicited opinions. In particular I asked the Architect of the product for opinions, having a high level thinker add even more to the document helped me generate a good tool, I did need to explain what it was that I designed, but it was good practice to be able to talk out what the harness was and should do. In the end I think these steps helped me create a very solid foundation to create the harness on, and before the company folded I had the structure in place with a database, a UI to the database, some agents and clients running to do tests and check results and store them. Very nice, sadly I won't see the design come to fruition but I think the experience was time well served so when I have to do this again I know all the steps I need to do.
Monday, April 27, 2009
Ruby CLI Example
This took me awhile to go through and write but this is the main class I am using for my test Harness command line argument parser.
class TestCLI
# This is the main CLI for the Test Harness, all
# test options should be listed here
OPTIONS ={
:agent => ['-ag', '--agent'],
:driver => ['-dri', '--driver'],
:help => ['-h', '--help'],
}
USAGE =< This program understands the following options:
-ag, --agent : Run agent based tests
-dri, --driver : Run driver based tests
-h, --help : Displays a message with usage instructions
With no command line flags, this message is displayed.
END_OF_USAGE
def parse_opts(args)
return option_by_args(args[0]) if understand_args?(args)
# options are not understandable, so display Usage
puts "Options are not understandable."
display(USAGE)
end
def display(content)
puts content
end
def do_default()
puts "This is the default section."
end
def option_by_args(arg)
return agent_tests if OPTIONS[:agent].include?(arg)
return driver_tests if OPTIONS[:driver].include?(arg)
return display(USAGE) if OPTIONS[:help].include?(arg)
do_default()
end
def understand_args?(args)
OPTIONS.keys.any? { |key| OPTIONS[key].include?(args[0]) }
end
def agent_tests
agt = system("rutemax -c conf\\agent.rutema all >> logs\\agent_tst.log")
puts "Ran agent tests.\n#{agt}"
end
def driver_tests
# Probably need something like this
# rutemax -c conf\driver.rutema all
drt = system("rutemax -c conf\\driver.rutema all >> logs\\drv_tst.log")
puts "Ran driver tests.\n#{drt}"
end
end
I am running two major test types right now, for the Agent that we produce and the filter driver that is mainly what I test, I utilize Rutema, an open source test execution and management tool to run my scripted tests. I am using HEREDOC to get the options text out because its multi-line, something I need to convert in another script due to its use of multiple puts lines. Basically this class parses through each option and then goes to the appropriate function when it finds one it uses, the de_default is a placeholder until I figure out what I want to have there.
All in all I think its pretty good, considering I have only been doing stuff in Ruby for a few months and basically jumped into doing this project to rewrite our Test Harness into something with more reporting and stability. I'm also not a trained programmer, so if I can do it, so can you.
class TestCLI
# This is the main CLI for the Test Harness, all
# test options should be listed here
OPTIONS ={
:agent => ['-ag', '--agent'],
:driver => ['-dri', '--driver'],
:help => ['-h', '--help'],
}
USAGE =<
-ag, --agent : Run agent based tests
-dri, --driver : Run driver based tests
-h, --help : Displays a message with usage instructions
With no command line flags, this message is displayed.
END_OF_USAGE
def parse_opts(args)
return option_by_args(args[0]) if understand_args?(args)
# options are not understandable, so display Usage
puts "Options are not understandable."
display(USAGE)
end
def display(content)
puts content
end
def do_default()
puts "This is the default section."
end
def option_by_args(arg)
return agent_tests if OPTIONS[:agent].include?(arg)
return driver_tests if OPTIONS[:driver].include?(arg)
return display(USAGE) if OPTIONS[:help].include?(arg)
do_default()
end
def understand_args?(args)
OPTIONS.keys.any? { |key| OPTIONS[key].include?(args[0]) }
end
def agent_tests
agt = system("rutemax -c conf\\agent.rutema all >> logs\\agent_tst.log")
puts "Ran agent tests.\n#{agt}"
end
def driver_tests
# Probably need something like this
# rutemax -c conf\driver.rutema all
drt = system("rutemax -c conf\\driver.rutema all >> logs\\drv_tst.log")
puts "Ran driver tests.\n#{drt}"
end
end
I am running two major test types right now, for the Agent that we produce and the filter driver that is mainly what I test, I utilize Rutema, an open source test execution and management tool to run my scripted tests. I am using HEREDOC to get the options text out because its multi-line, something I need to convert in another script due to its use of multiple puts lines. Basically this class parses through each option and then goes to the appropriate function when it finds one it uses, the de_default is a placeholder until I figure out what I want to have there.
All in all I think its pretty good, considering I have only been doing stuff in Ruby for a few months and basically jumped into doing this project to rewrite our Test Harness into something with more reporting and stability. I'm also not a trained programmer, so if I can do it, so can you.
Thursday, April 23, 2009
Ruby Backtick Capabilities
Ruby can run some programs as if on the command line, the mechanisms are pretty much the same as Perl would run them, backticks are a blessing in many respects. It took some finding but the main three mechanisms are:
- Kernel.system
- Kernel.exec
- %x[]
Subscribe to:
Posts (Atom)