Custom Search

Tuesday, July 14, 2009

General Testing Interview Questions

1.What is 'Software Quality Assurance'?

Software QA involves the entire software development Process - monitoring and improving the process, making sure that any agreed-upon standards and procedures are followed, and ensuring that problems are found and dealt with.

It is oriented to 'prevention'. (See the Books section for a list of useful books on Software Quality Assurance.)



2.What is 'Software Testing'?

Testing involves operation of a system or application under controlled conditions and evaluating the results (eg, 'if the user is in interface A of the application while using hardware B, and does C, then D should happen'). The controlled conditions should include both normal and abnormal conditions. Testing should intentionally attempt to make things go wrong to determine if things happen when they shouldn't or things don't happen when they should. It is oriented to 'detection'.

Organizations vary considerably in how they assign responsibility for QA and testing. Sometimes they're the combined responsibility of one group or individual. Also common are project teams that include a mix of testers and developers who work closely together, with overall QA processes monitored by project managers. It will depend on what best fits an organization's size and business structure.



3. What are some recent major computer system failures caused by software bugs?

* Media reports in January of 2005 detailed severe problems with a $170 million high-profile U.S. government IT systems project. Software testing was one of the five major problem areas according to a report of the commission reviewing the project. Studies were under way to determine which, if any, portions of the project could be salvaged.

* In July 2004 newspapers reported that a new government welfare management system in Canada costing several hundred million dollars was unable to handle a simple benefits rate increase after being put into live operation. Reportedly the original contract allowed for only 6 weeks of acceptance testing and the system was never tested for its ability to handle a rate increase.

* Millions of bank accounts were impacted by errors due to installation of inadequately tested software code in the transaction processing system of a major North American bank, according to mid-2004 news reports. Articles about the incident stated that it took two weeks to fix all the resulting errors, that additional problems resulted when the incident drew a large number of e-mail phishing attacks against the bank's customers, and that the total cost of the incident could exceed $100 million.

* A bug in site management software utilized by companies with a significant percentage of worldwide web traffic was reported in May of 2004. The bug resulted in performance problems for many of the sites simultaneously and required disabling of the software until the bug was fixed.

* According to news reports in April of 2004, a software bug was determined to be a major contributor to the 2003 Northeast blackout, the worst power system failure in North American history. The failure involved loss of electrical power to 50 million customers, forced shutdown of 100 power plants, and economic losses estimated at $6 billion. The bug was reportedly in one utility company's vendor-supplied power monitoring and management system, which was unable to correctly handle and report on an unusual confluence of initially localized events. The error was found and corrected after examining millions of lines of code.

* In early 2004, news reports revealed the intentional use of a software bug as a counter-espionage tool. According to the report, in the early 1980's one nation surreptitiously allowed a hostile nation's espionage service to steal a version of sophisticated industrial software that had intentionally-added flaws. This eventually resulted in major industrial disruption in the country that used the stolen flawed software.

* A major U.S. retailer was reportedly hit with a large government fine in October of 2003 due to web site errors that enabled customers to view one anothers' online orders.

* News stories in the fall of 2003 stated that a manufacturing company recalled all their transportation products in order to fix a software problem causing instability in certain circumstances. The company found and reported the bug itself and initiated the recall procedure in which a software upgrade fixed the problems.

* In January of 2001 newspapers reported that a major European railroad was hit by the aftereffects of the Y2K bug. The company found that many of their newer trains would not run due to their inability to recognize the date '31/12/2000'; the trains were started by altering the control system's date settings.

* News reports in September of 2000 told of a software vendor settling a lawsuit with a large mortgage lender; the vendor had reportedly delivered an online mortgage

* In early 2000, major problems were reported with a new computer system in a large suburban U.S. public school district with 100,000+ students; problems included 10,000 erroneous report cards and students left stranded by failed class registration systems; the district's CIO was fired. The school district decided to reinstate it's original 25-year old system for at least a year until the bugs were worked out of the new system by the software vendors.


* In October of 1999 the $125 million NASA Mars Climate Orbiter spacecraft was believed to be lost in space due to a simple data conversion error. It was determined that spacecraft software used certain data in English units that should have been in metric units. Among other tasks, the orbiter was to serve as a communications relay for the Mars Polar Lander mission, which failed for unknown reasons in December 1999. Several investigating panels were convened to determine the process failures that allowed the error to go undetected.

* Bugs in software supporting a large commercial high-speed data network affected 70,000 business customers over a period of 8 days in August of 1999. Among those affected was the electronic trading system of the largest U.S. futures exchange, which was shut down for most of a week as a result of the outages.

* January 1998 news reports told of software problems at a major U.S. telecommunications company that resulted in no charges for long distance calls for a month for 400,000 customers. The problem went undetected until customers called up with questions about their bills. processing system that did not meet specifications, was delivered late, and didn't work.



4.Why is it often hard for management to get serious about quality assurance?

* Solving problems is a high-visibility process; preventing problems is low-visibility. This is illustrated by an old parable: In ancient China there was a family of healers, one of whom was known throughout the land and employed as a physician to a great lord.

5.Why does software have bugs?

* Miscommunication or no communication - as to specifics of what an application should or shouldn't do (the application's requirements).

* Software complexity - the complexity of current software applications can be difficult to comprehend for anyone without experience in modern-day software development. Multi-tiered applications, client-server and distributed applications, data communications, enormous relational databases, and sheer size of applications have all contributed to the exponential growth in software/system complexity.

* Programming errors - programmers, like anyone else, can make mistakes.

* Changing requirements (whether documented or undocumented) - the end-user may not understand the effects of changes, or may understand and request them anyway - redesign, rescheduling of engineers, effects on other projects, work already completed that may have to be redone or thrown out, hardware requirements that may be affected, etc. If there are many minor changes or any major changes, known and unknown dependencies among parts of the project are likely to interact and cause problems, and the complexity of coordinating changes may result in errors. Enthusiasm of engineering staff may be affected. In some fast-changing business environments, continuously modified requirements may be a fact of life. In this case, management must understand the resulting risks, and QA and test engineers must adapt and plan for continuous extensive testing to keep the inevitable bugs from running out of control - see 'What can be done if requirements are changing continuously?' in Part 2 of the FAQ. Also see information about 'agile' approaches such as XP, also in Part 2 of the FAQ.

* Time pressures - scheduling of software projects is difficult at best, often requiring a lot of guesswork. When deadlines loom and the crunch comes, mistakes will be made.

* egos - people prefer to say things like:

* * 'no problem'

* * 'piece of cake'

* * 'I can whip that out in a few hours'

* * 'it should be easy to update that old code'

* instead of:

* * 'that adds a lot of complexity and we could end up making a lot of mistakes'

* * 'we have no idea if we can do that; we'll wing it'

* * 'I can't estimate how long it will take, until I take a close look at it'

* * 'we can't figure out what that old spaghetti code did in the first place'

If there are too many unrealistic 'no problem's', the result is bugs.

* Poorly documented code - it's tough to maintain and modify code that is badly written or poorly documented; the result is bugs. In many organizations management provides no incentive for programmers to document their code or write clear, understandable, maintainable code. In fact, it's usually the opposite: they get points mostly for quickly turning out code, and there's job security if nobody else can understand it ('if it was hard to write, it should be hard to read').

* Software development tools - visual tools, class libraries, compilers, scripting tools, etc. often introduce their own bugs or are poorly documented, resulting in added bugs.



6.How can new Software QA processes be introduced in an existing organization?

* A lot depends on the size of the organization and the risks involved. For large organizations with high-risk (in terms of lives or property) projects, serious management buy-in is required and a formalized QA process is necessary.

* Where the risk is lower, management and organizational buy-in and QA implementation may be a slower, step-at-a-time process. QA processes should be balanced with productivity so as to keep bureaucracy from getting out of hand.

* For small groups or projects, a more ad-hoc process may be appropriate, depending on the type of customers and projects. A lot will depend on team leads or managers, feedback to developers, and ensuring adequate communications among customers, managers, developers, and testers.

* The most value for effort will often be in (a) requirements management processes, with a goal of clear, complete, testable requirement specifications embodied in requirements or design documentation, or in 'agile'-type environments extensive continuous coordination with end-users, (b) design inspections and code inspections, and (c) post-mortems/retrospectives.



7.What is verification? validation?

* Verification typically involves reviews and meetings to evaluate documents, plans, code, requirements, and specifications. This can be done with checklists, issues lists, walkthroughs, and inspection meetings. Validation typically involves actual testing and takes place after verifications are completed. The term 'IV & V' refers to Independent Verification and Validation.

8.What is a 'walkthrough'?

* A 'walkthrough' is an informal meeting for evaluation or informational purposes. Little or no preparation is usually required.

Friday, July 10, 2009

Priority and Severity of the Bug

Let’s peek in on a discussion in a bug triage meeting.

Tim, the marketing manager, is shaking his head. “That’s a high on the severity scale. It’s really bad, guys. You have to make it a high.”

Jordan, the development manager, is barely containing her frustration. Her eye is starting to twitch as she replies, “No, Tim. That’s not all that bad. It’s an inconvenience, I agree, but there’s an easy workaround.”

“Inconvenience?!?” Tim says a bit more loudly than he intended. “You call not being able to print an inconvenience?!? That’s a disaster!”
“Yes, I call not being able to print from one particular type of printer without installing an upgraded driver from the vendor’s website an inconvenience. The user just needs…”

“I know what the user needs,” Tim cut in. “The user needs to be able to print out of the box! You can fix this in our code, right?”

Jordan nods, “Yes, but we’d just be working around the vendor’s…”

“Then fix it.” Tim stood over Jordan, glaring.

“But it’s a medium at best!” Jordan objected. “The user isn’t losing any data, doesn’t have to reboot, isn’t crashing. They just have to update a driver.”

This argument could continue forever. I’ve seen many arguments like this go on and on. What’s really happening here? Why are Tim and Jordan about to be at each other’s throats?


Priority is Business; Severity is Technical
Tim is looking at business priority:

“How important is it to the business that we fix the bug?” Jordan is looking at technical severity: “How nasty is the bug from a technical perspective?” These two questions sometimes arrive at the same answer: a high severity bug is often also high priority, but not always. Allow me to suggest some definitions.
Severity is levels:
* Critical: the software

will not run
* High: unexpected fatal errors (includes crashes and data corruption)
* Medium: a feature is malfunctioning
* Low: a cosmetic issue

Now you see why Jordan was arguing that the Print bug was a medium: a feature was malfunctioning.

Priority levels:
* Now: drop everything and take care of it as soon as you see this (usually for blocking bugs)
* P1: fix before next build to test
* P2: fix before final release
* P3: we probably won’t get to these, but we want to track them anyway

And now you can see why Tim was so adamant that the issue was a high. From his perspective, it was a P1 matter.

They’re both right. It’s of medium severity, but P1 to fix.


Priority and Severity Don’t Mix
In response to Johanna’s column last week, some people suggested using both severity and priority to come up with a composite risk number.

While this intuitively sounds like a way to resolve the priority-severity divide, I suggest using such an approach with extreme caution. It’s multiplying apples by oranges in an attempt to quantify bananas. Risk is yet a third type of information.

The risk associated with any bug depends on the severity of the issue, certainly. But it also depends on the likelihood that the user will run into it as well as the possible losses that might occur. I don’t attempt to quantify all this when assessing the severity of an issue. In fact, I think that in most cases assessing the risk of a single issue takes more time than it’s worth. Only for potentially poisonous bugs involving dangerous fixes do I really want to weigh the risk of fixing it against the risk of not fixing it.

Establish Work Precedence
The best way to avoid confusion about what comes first is to ensure everyone in the organization takes their cues for work precedence from priority and nowhere else. Developers fix P1 defects first. Testers verify P1 fixes first. Technical writers document P1 issues first. Everyone works in priority order: the priority reflects importance to the business. Saying, “This bug is more severe than that one so I’ll work on it first” is as bad as saying, “I like this bug more, so I’ll work on it first.” The severity rating is technical information used by managers as a piece of the formula in determining the priority rating. The priority rating is the final word on the order in which the work is done by programmers, testers, and everyone else.

The ultimate lesson here, regardless of the terms or levels you use to categorize your bugs, is that any classification scheme will only be effective if everyone agrees on definitions. So perhaps that’s the very first question to ask when an argument is brewing about severity, priority, or risk: “Help me understand exactly what information you’re using from each defect record and how you’re using it?”

Thursday, July 9, 2009

Software Bugs And Spec Bugs

Let's assume that the error message wasn't displayed. In this case, we have a classic case of a software bug; i.e., a bug born because of a mismatch between the actual behavior of the software and the expected behavior (which is usually specified in the spec).

If you paid a little bit of attention when you read item 2.1., you surely noticed (joke) that it wasn't clear what kind of error message is expected to be displayed-i.e., the decision on the actual text of error message is up to the programmer, and he or she can write code that will produce:

- a NONinformative, irritating message: "Error", leaving the user to wonder what he or she has done wrong and cultivating a feeling of guilt in him or her, OR

- an easy-to-understand message: "Oops, error on page. ZIP code should have 5 digits".

Formally, the programmer will be right in both cases, because the specification doesn't elaborate about the text of the error message.


In early days of start-up when software changes very often, there is no need
to include precise text of error messages into the spec. The idea about error
message will do. For example: "Error message should state that ZIP code should
consist of 5 digits".

Here we have a situation where the spec itself is buggy, because

- we reasonably expect that spec to give us details about the error message, and

- the actual spec doesn't give us those details.

Let's call this situation "spec bug."

Brain positioning

Each found bug (both in software and in specs) must be filed into the bug tracking system.

There should be no exceptions. Bug reporting is one of the most important parts of our profession.

We'll have a separate lecture to talk about bug reporting and tracking.

Brain positioning

From the start, you must understand one very important thing: when

you file a bug against someone, it doesn't mean that you hate

or disrespect that person. It simply means: "I have found mismatch

between actual and expected. Please, fix the problem."

If somebody takes a bug personally, you must have the respect and

patience to explain to him or her that there is nothing personal here -

this is just a part of your job.


Three Conditions Of A Bug's Existence

A bug exists only if ALL of the following three conditions are met:

1. We know the expected result

2. We know the actual result

3. We know that the actual result deviates from the expected result


Every time you see a mismatch between the actual and expected, label that situation with the word "bug." As time goes on, you'll develop a habit, which will gradually grow into a reflex. Please note that for the sake of this training, it doesn't matter how futile, cheap, or temporary your expectations are - the main thing here is to gain the skill of automatic bug recognition.

Example

Here are some more bugs from real life:

1. A nice face backed by an ugly personality.

2. Parrots say the nastiest words at absolutely inappropriate times.

3. Hollywood story: reach fame and drink yourself to rehab.


Wednesday, July 8, 2009

The Big Bang Model


The Big Bang is built upon three main tenets:
  1. the universe used to be very hot
  2. the universe used to be very dense
  3. the universe is expanding (which is why it isn't so hot or dense anymore)

Note that the basic Big Bang Model does NOT say anything about the following questions:

  • will the universe collapse again, or expand forever?
  • is space curved or flat?
  • how old is the universe?
  • what is the matter density in the universe?
  • what about dark matter?
  • is there some mysterious "repulsive" force on large scales?
  • how did galaxies form?

Some of these questions all depend upon the values of certain parameters in the model, which we may derive from observations. Others have nothing to do with the Big Bang itself.

Our understanding of the laws of nature permit us to track the physical state of the universe back to a certain point, when the density and temperature were REALLY high. Beyond that point, we don't know exactly how matter and radiation behave. Let's call that moment the starting point. It doesn't mean that the universe "began" at that time, it just means that we don't know what happened before that point.

One of the primary successes of the Big Bang theory is its explanation for the chemical composition of the universe. Recall that the universe is mostly hydrogen and helium, with very small amounts of heavier elements. How does this relate to the Big Bang?

Well, a long time ago, the universe was hot and dense. When the temperature is high enough (a few thousand degrees), atoms lose all their electrons; we call this state of matter, a mix of nuclei and electrons, a fully-ionized plasma. If the temperature is even higher (millions of degrees), then the nuclei break up into fundamental particles, and one is left with a "soup" of fundamental particles:

  • protons
  • neutrons
  • electrons

Now, if the "soup" is very dense, then these particles will collide with each other frequently. Occasionally, groups of protons and neutrons will stick together to form nuclei of light elements ... but under extremely high pressure and temperature, the nuclei are broken up by subsequent collisions. The Big Bang theory postulates that the entire universe was so hot at one time that it was filled with this proton-neutron-electron "soup."

But the Big Bang theory then states that, as the universe expanded, both the density and temperature dropped. As the temperature and density fell, collisions between particles became less violent, and less frequent. There was a brief "window of opportunity" when protons and neutrons could collide hard enough to stick together and form light nuclei, yet not suffer so many subsequent collisions that the nuclei would be destroyed. This "window" appeared about three minutes after the starting point, and lasted for a bit less than a minute.

Which nuclei would form under these conditions? Experiments with particle colliders have shown us that most of the possible nuclei are unstable, meaning they break up all by themselves, or fragile, meaning they are easily broken by collisions





Helium (the ordinary sort, with 2 protons and 2 neutrons) is by far the most stable and robust compound nucleus. Deuterium (one proton and one neutron) is easily destroyed, and so is helium-3 (2 protons, one neutron).

So, it seems that this period of hot, dense plasma would create a lot of helium. Could it create other, heavier elements, too?






Detailed models of Big Bang nucleosynthesis predict that the brief "window of opportunity" lasted only a minute or two. After that, about three and a half minutes after the starting point, the temperature and density dropped so much that collisions between particles were rare, and of such low energy that the electric forces of repulsion between positively-charged nuclei prevented fusion. The result is

  • lots of hydrogen
  • some helium (ordinary helium-4)
  • tiny bits of deuterium
  • tiny bits of lithium
  • not much else