Testing Interview Questions
Testing Interview Questions
1
65. Once a new build comes to Quality Team, what they will do?
66.What is database testing?
Manual Testing Q & A Part 1
1. What is the testing process?
Verifying that an input data produce the expected output.
2. What is the difference between testing and debugging?
Big difference is that debugging is conducted by a programmer and the programmer fix the errors during debugging phase.
Tester never fixes the errors, but rather find them and return to programmer.
3. What is the difference between structural and functional testing?
Structural is a "white box" testing and based on the algorithm or code. Functional testing is a "black box" (behavioral) testing
where the tester verifies the functional specification.
4. What is a bug? What types of bugs do you know?
Bug is a error during execution of the program. There are two types of bugs: syntax and logical.
5. What is the difference between testing and quality assurance (QA)?
This question is surprisingly popular. However, the answer is quite simple. The goals of both are different: The goal of testing
is to find the errors. The goal of QA is to prevent the errors in the program.
6. What kinds of testing do you know? What is it system testing? What is it integration testing? What is a unit testing? What is
a regression testing?
You theoretical background and home work may shine in this question. System testing is a testing of the entire system as a
whole. This is what user see and feels about the product you provide. Integration testing is the testing of integration of different
modules of the system. Usually, the integration process is quite painful and this testing is the most serious one of all.
Integration testing comes before system testing. Unit testing is a testing of a single unit (module) of within system. It's
conducted before integration testing. Regression testing is a "backward check" testing. The idea to ensure that new
functionality added to the system did not break old, checked, functionality of the system.
7.What are all the major processes will involve in testing?
The major processes include:
1.Planning (test strategy, test objectives, risk management)
2.Design (functions to be tested, test scenario, test cases)
3Development (test procedures, test scripts, test environment)
4.Execution (execute test)
5.Evaluation (evaluate test results, compare actual results with expected results)
8.Could you test a program 100%? 90%? Why?
Definitely not! The major problem with testing that you cannot calculate how many error are in the code, functioning etc. There
are many factors involved such as experience of programmer, complexity of the system etc.
9.How would you test a mug (chair/table/gas station etc.)?
First of all you must demand requirements and functional specification and design document of the mug. There will find
requirements like ability to hold hot water, waterproof, stability, break ability and so on. Then you should test the mug
according to all documents.
10.How would you conduct your test?
Each test is based on the technical requirements of the software product.
Manual Testing Q & A Part 2
11.What is the other name for white box testing?
Clear box testing
12.What is other name for water fall model?
Linear sequential model
13.What is considered a good test?
It should cover most of the object's functionality
14.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.
15.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.
16.What are some recent major computer system failures caused by software bugs?
· In March of 2002 it was reported that software bugs in Britain's national tax system resulted in more than 100,000 erroneous
tax overcharges. The problem was partly attibuted to the difficulty of testing the integration of multiple systems.
· A newspaper columnist reported in July 2001 that a serious flaw was found in off-the-shelf software that had long been used
in systems for tracking certain U.S. nuclear materials. The same software had been recently donated to another country to be
used in tracking their own nuclear materials, and it was not until scientists in that country discovered the problem, and shared
the information, that U.S. officials became aware of the problems.
· According to newspaper stories in mid-2001, a major systems development contractor was fired and sued over problems with
a large retirement plan management system. According to the reports, the client claimed that system deliveries were late, the
software had excessive defects, and it caused other systems to crash.
· 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 processing system that did not meet specifications, was delivered late, and didn't
2
work.
· 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.
· In April of 1999 a software bug caused the failure of a $1.2 billion military satellite launch, the costliest unmanned accident in
the history of Cape Canaveral launches. The failure was the latest in a string of launch failures, triggering a complete military
and industry review of U.S. space launch programs, including software integration and testing processes. Congressional
oversight hearings were requested.
· A small town in Illinois received an unusually large monthly electric bill of $7 million in March of 1999. This was about 700
times larger than its normal bill. It turned out to be due to bugs in new software that had been purchased by the local power
company to deal with Y2K software issues.
· In early 1999 a major computer game company recalled all copies of a popular new product due to software problems. The
company made a public apology for releasing a product before it was ready.
· The computer system of a major online U.S. stock trading service failed during trading hours several times over a period of
days in February of 1999 according to nationwide news reports. The problem was reportedly due to bugs in a software
upgrade intended to speed online trade confirmations.
· In April of 1998 a major U.S. data communications network failed for 24 hours, crippling a large part of some U.S. credit card
transaction authorization systems as well as other large U.S. bank, retail, and government data systems. The cause was
eventually traced to a software bug.
· 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.
· In November of 1997 the stock of a major health industry company dropped 60% due to reports of failures in computer billing
systems, problems with a large database conversion, and inadequate software testing. It was reported that more than
$100,000,000 in receivables had to be written off and that multi-million dollar fines were levied on the company by government
agencies.
· A retail store chain filed suit in August of 1997 against a transaction processing system vendor (not a credit card company)
due to the software's inability to handle credit cards with year 2000 expiration dates.
· In August of 1997 one of the leading consumer credit reporting companies reportedly shut down their new public web site
after less than two days of operation due to software problems. The new site allowed web site visitors instant access, for a
small fee, to their personal credit reports. However, a number of initial users ended up viewing each others' reports instead of
their own, resulting in irate customers and nationwide publicity. The problem was attributed to "...unexpectedly high demand
from consumers and faulty software that routed the files to the wrong computers."
· In November of 1996, newspapers reported that software bugs caused the 411 telephone information system of one of the
U.S. RBOC's to fail for most of a day. Most of the 2000 operators had to search through phone books instead of using their
13,000,000-listing database. The bugs were introduced by new software modifications and the problem software had been
installed on both the production and backup systems. A spokesman for the software vendor reportedly stated that 'It had
nothing to do with the integrity of the software. It was human error.'
· On June 4 1996 the first flight of the European Space Agency's new Ariane 5 rocket failed shortly after launching, resulting in
an estimated uninsured loss of a half billion dollars. It was reportedly due to the lack of exception handling of a floating-point
error in a conversion from a 64-bit integer to a 16-bit signed integer.
· Software bugs caused the bank accounts of 823 customers of a major U.S. bank to be credited with $924,844,208.32 each in
May of 1996, according to newspaper reports. The American Bankers Association claimed it was the largest such error in
banking history. A bank spokesman said the programming errors were corrected and all funds were recovered.
· Software bugs in a Soviet early-warning monitoring system nearly brought on nuclear war in 1983, according to news reports
in early 1999. The software was supposed to filter out false missile detections caused by Soviet satellites picking up sunlight
reflections off cloud-tops, but failed to do so. Disaster was averted when a Soviet commander, based on a what he said was a
'...funny feeling in my gut', decided the apparent missile attack was a false alarm. The filtering software code was rewritten.
17.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. The physician was asked which of his family was the most skillful healer. He replied,
"I tend to the sick and dying with drastic and dramatic treatments, and on occasion someone is cured and my name gets out
among the lords."
"My elder brother cures sickness when it just begins to take root, and his skills are known among the local peasants and
neighbors."
"My eldest brother is able to sense the spirit of sickness and eradicate it before it takes form. His name is unknown outside our
home."
18.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
3
experience in modern-day software development. Windows-type interfaces, 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. And the use of object-oriented techniques can complicate instead of simplify a project unless it
is well-engineered.
·programming errors - programmers, like anyone else, can make mistakes.
· changing requirements - the customer 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
keeping track of 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 .
· 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 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.
19.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.
·In all cases the most value for effort will be in requirements management processes, with a goal of clear, complete, testable
requirement specifications or expectations.
20.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.
Manual Testing Q & A Part 3
21.What is a 'walkthrough'?
A 'walkthrough' is an informal meeting for evaluation or informational purposes. Little or no preparation is usually required.
22.What's an 'inspection'?
An inspection is more formalized than a 'walkthrough', typically with 3-8 people including a moderator, reader, and a recorder
to take notes. The subject of the inspection is typically a document such as a requirements spec or a test plan, and the
purpose is to find problems and see what's missing, not to fix anything. Attendees should prepare for this type of meeting by
reading thru the document; most problems will be found during this preparation. The result of the inspection meeting should be
a written report. Thorough preparation for inspections is difficult, painstaking work, but is one of the most cost effective
methods of ensuring quality. Employees who are most skilled at inspections are like the 'eldest brother' in the parable in Their
skill may have low visibility but they are extremely valuable to any software development organization, since bug prevention is
far more cost-effective than bug detection.
23.What kinds of testing should be considered?
·Black box testing - not based on any knowledge of internal design or code. Tests are based on requirements and functionality.
·White box testing - based on knowledge of the internal logic of an application's code. Tests are based on coverage of code
statements, branches, paths, conditions.
·unit testing - the most 'micro' scale of testing; to test particular functions or code modules. Typically done by the programmer
and not by testers, as it requires detailed knowledge of the internal program design and code. Not always easily done unless
the application has a well-designed architecture with tight code; may require developing test driver modules or test harnesses.
·incremental integration testing - continuous testing of an application as new functionality is added; requires that various
aspects of an application's functionality be independent enough to work separately before all parts of the program are
completed, or that test drivers be developed as needed; done by programmers or by testers.
4
·integration testing - testing of combined parts of an application to determine if they function together correctly. The 'parts' can
be code modules, individual applications, client and server applications on a network, etc. This type of testing is especially
relevant to client/server and distributed systems.
·functional testing - black-box type testing geared to functional requirements of an application; this type of testing should be
done by testers. This doesn't mean that the programmers shouldn't check that their code works before releasing it (which of
course applies to any stage of testing.)
·system testing - black-box type testing that is based on overall requirements specifications; covers all combined parts of a
system.
·end-to-end testing - similar to system testing; the 'macro' end of the test scale; involves testing of a complete application
environment in a situation that mimics real-world use, such as interacting with a database, using network communications, or
interacting with other hardware, applications, or systems if appropriate.
·sanity testing - typically an initial testing effort to determine if a new software version is performing
·well enough to accept it for a major testing effort. For example, if the new software is crashing systems every 5 minutes,
bogging down systems to a crawl, or destroying databases, the software may not be in a 'sane' enough condition to warrant
further testing in its current state.
·regression testing - re-testing after fixes or modifications of the software or its environment. It can be difficult to determine how
much re-testing is needed, especially near the end of the development cycle. Automated testing tools can be especially useful
for this type of testing.
·acceptance testing - final testing based on specifications of the end-user or customer, or based on use by end-
users/customers over some limited period of time.
·load testing - testing an application under heavy loads, such as testing of a web site under a range of loads to determine at
what point the system's response time degrades or fails.
·stress testing - term often used interchangeably with 'load' and 'performance' testing. Also used to describe such tests as
system functional testing while under unusually heavy loads, heavy repetition of certain actions or inputs, input of large
numerical values, large complex queries to a database system, etc.
·performance testing - term often used interchangeably with 'stress' and 'load' testing. Ideally 'performance' testing (and any
other 'type' of testing) is defined in requirements documentation or QA or Test Plans.
·usability testing - testing for 'user-friendliness'. Clearly this is subjective, and will depend on the targeted end-user or
customer. User interviews, surveys, video recording of user sessions, and other techniques can be used. Programmers and
testers are usually not appropriate as usability testers.
·install/uninstall testing - testing of full, partial, or upgrade install/uninstall processes.
·recovery testing - testing how well a system recovers from crashes, hardware failures, or other catastrophic problems.
·security testing - testing how well the system protects against unauthorized internal or external access, willful damage, etc;
may require sophisticated testing techniques.
·compatability testing - testing how well software performs in a particular hardware/software/operating system/network/etc.
environment.
·exploratory testing - often taken to mean a creative, informal software test that is not based on formal test plans or test cases;
testers may be learning the software as they test it.
·ad-hoc testing - similar to exploratory testing, but often taken to mean that the testers have significant understanding of the
software before testing it.
·user acceptance testing - determining if software is satisfactory to an end-user or customer.
·comparison testing - comparing software weaknesses and strengths to competing products.
·alpha testing - testing of an application when development is nearing completion; minor design changes may still be made as
a result of such testing. Typically done by end-users or others, not by programmers or testers.
·beta testing - testing when development and testing are essentially completed and final bugs and problems need to be found
before final release. Typically done by end-users or others, not by programmers or testers.
·mutation testing - a method for determining if a set of test data or test cases is useful, by deliberately introducing various code
changes ('bugs') and retesting with the original test data/cases to determine if the 'bugs' are detected. Proper implementation
requires large computational resources.
24.What are 5 common problems in the software development process?
·poor requirements - if requirements are unclear, incomplete, too general, or not testable, there will be problems.
·unrealistic schedule - if too much work is crammed in too little time, problems are inevitable.
·inadequate testing - no one will know whether or not the program is any good until the customer complains or systems crash.
·featuritis - requests to pile on new features after development is underway; extremely common.
·miscommunication - if developers don't know what's needed or customer's have erroneous expectations, problems are
guaranteed.
25.What are 5 common solutions to software development problems?
·solid requirements - clear, complete, detailed, cohesive, attainable, testable requirements that are agreed to by all players.
Use prototypes to help nail down requirements.
·realistic schedules - allow adequate time for planning, design, testing, bug fixing, re-testing, changes, and documentation;
personnel should be able to complete the project without burning out.
·adequate testing - start testing early on, re-test after fixes or changes, plan for adequate time for testing and bug-fixing.
·stick to initial requirements as much as possible - be prepared to defend against changes and additions once development
has begun, and be prepared to explain consequences. If changes are necessary, they should be adequately reflected in
related schedule changes. If possible, use rapid prototyping during the design phase so that customers can see what to
expect. This will provide them a higher comfort level with their requirements decisions and minimize changes later on.
·communication - require walkthroughs and inspections when appropriate; make extensive use of group communication tools -
e-mail, groupware, networked bug- tracking tools and change management tools, intranet capabilities, etc.; insure that
documentation is available and up-to-date - preferably electronic, not paper; promote teamwork and cooperation; use
protoypes early on so that customers' expectations are clarified.
26.What is software 'quality'?
5
Quality software is reasonably bug-free, delivered on time and within budget, meets requirements and/or expectations, and is
maintainable. However, quality is obviously a subjective term. It will depend on who the 'customer' is and their overall influence
in the scheme of things. A wide-angle view of the 'customers' of a software development project might include end-users,
customer acceptance testers, customer contract officers, customer management, the development organization's
management/accountants/testers/salespeople, future software maintenance engineers, stockholders, magazine columnists,
etc. Each type of 'customer' will have their own slant on 'quality' - the accounting department might define quality in terms of
profits while an end-user might define quality as user-friendly and bug-free.
27.What is 'good code'?
'Good code' is code that works, is bug free, and is readable and maintainable. Some organizations have coding 'standards'
that all developers are supposed to adhere to, but everyone has different ideas about what's best, or what is too many or too
few rules. There are also various theories and metrics, such as McCabe Complexity metrics. It should be kept in mind that
excessive use of standards and rules can stifle productivity and creativity. 'Peer reviews', 'buddy checks' code analysis tools,
etc. can be used to check for problems and enforce standards.
For C and C++ coding, here are some typical ideas to consider in setting rules/standards; these may or may not apply to a
particular situation:
·minimize or eliminate use of global variables.
·use descriptive function and method names - use both upper and lower case, avoid abbreviations, use as many characters as
necessary to be adequately descriptive (use of more than 20 characters is not out of line); be consistent in naming
conventions.
·use descriptive variable names - use both upper and lower case, avoid abbreviations, use as many characters as necessary
to be adequately descriptive (use of more than 20 characters is not out of line); be consistent in naming conventions.
·function and method sizes should be minimized; less than 100 lines of code is good, less than 50 lines is preferable.
·function descriptions should be clearly spelled out in comments preceding a function's code.
·organize code for readability.
·use whitespace generously - vertically and horizontally
·each line of code should contain 70 characters max.
·one code statement per line.
·coding style should be consistent throught a program (eg, use of brackets, indentations, naming conventions, etc.)
·in adding comments, err on the side of too many rather than too few comments; a common rule of thumb is that there should
be at least as many lines of comments (including header blocks) as lines of code.
·no matter how small, an application should include documentaion of the overall program function and flow (even a few
paragraphs is better than nothing); or if possible a separate flow chart and detailed program documentation.
·make extensive use of error handling procedures and status and error logging.
·for C++, to minimize complexity and increase maintainability, avoid too many levels of inheritance in class heirarchies (relative
to the size and complexity of the application). Minimize use of multiple inheritance, and minimize use of operator overloading
(note that the Java programming language eliminates multiple inheritance and operator overloading.)
· for C++, keep class methods small, less than 50 lines of code per method is preferable.
· for C++, make liberal use of exception handlers
28.What is 'good design'?
'Design' could refer to many things, but often refers to 'functional design' or 'internal design'. Good internal design is indicated
by software code whose overall structure is clear, understandable, easily modifiable, and maintainable; is robust with sufficient
error-handling and status logging capability; and works correctly when implemented. Good functional design is indicated by an
application whose functionality can be traced back to customer and end-user requirements.For programs that have a user
interface, it's often a good idea to assume that the end user will have little computer knowledge and may not read a user
manual or even the on-line help; some common rules-of-thumb include:
· the program should act in a way that least surprises the user
· it should always be evident to the user what can be done next and how to exit
· the program shouldn't let the users do something stupid without warning them.
29.What is SEI? CMM? ISO? IEEE? ANSI? Will it help?
·SEI = 'Software Engineering Institute' at Carnegie-Mellon University; initiated by the U.S. Defense Department to help improve
software development processes.
·CMM = 'Capability Maturity Model', developed by the SEI. It's a model of 5 levels of organizational 'maturity' that determine
effectiveness in delivering quality software. It is geared to large organizations such as large U.S. Defense Department
contractors. However, many of the QA processes involved are appropriate to any organization, and if reasonably applied can
be helpful. Organizations can receive CMM ratings by undergoing assessments by qualified auditors.
Level 1 - characterized by chaos, periodic panics, and heroic
efforts required by individuals to successfully
complete projects. Few if any processes in place;
successes may not be repeatable.
6
Level 4 - metrics are used to track productivity, processes,
and products. Project performance is predictable,
and quality is consistently high.
Level 5 - the focus is on continouous process improvement. The
impact of new processes and technologies can be
predicted and effectively implemented when required.
Perspective on CMM ratings: During 1997-2001, 1018 organizations
were assessed. Of those, 27% were rated at Level 1, 39% at 2,
23% at 3, 6% at 4, and 5% at 5. (For ratings during the period
1992-96, 62% were at Level 1, 23% at 2, 13% at 3, 2% at 4, and
0.4% at 5.) The median size of organizations was 100 software
engineering/maintenance personnel; 32% of organizations were
U.S. federal contractors or agencies. For those rated at
Level 1, the most problematical key process area was in
Software Quality Assurance.
· ISO = 'International Organisation for Standardization' - The ISO 9001:2000 standard (which replaces the previous standard of
1994) concerns quality systems that are assessed by outside auditors, and it applies to many kinds of production and
manufacturing organizations, not just software. It covers documentation, design, development, production, testing, installation,
servicing, and other processes. The full set of standards consists of: (a)Q9001-2000 - Quality Management Systems:
Requirements; (b)Q9000-2000 - Quality Management Systems: Fundamentals and Vocabulary; (c)Q9004-2000 - Quality
Management Systems: Guidelines for Performance Improvements. To be ISO 9001 certified, a third-party auditor assesses an
organization, and certification is typically good for about 3 years, after which a complete reassessment is required. Note that
ISO certification does not necessarily indicate quality products - it indicates only that documented processes are followed.
· IEEE = 'Institute of Electrical and Electronics Engineers' - among other things, creates standards such as 'IEEE Standard for
Software Test Documentation' (IEEE/ANSI Standard 829), 'IEEE Standard of Software Unit Testing (IEEE/ANSI Standard
1008), 'IEEE Standard for Software Quality Assurance Plans' (IEEE/ANSI Standard 730), and others.
· ANSI = 'American National Standards Institute', the primary industrial standards body in the U.S.; publishes some software-
related standards in conjunction with the IEEE and ASQ (American Society for Quality).
· Other software development process assessment methods besides CMM and ISO 9000 include SPICE, Trillium, TickIT. and
Bootstrap.
30. What is the 'software life cycle'?
The life cycle begins when an application is first conceived and ends when it is no longer in use. It includes aspects such as
initial concept, requirements analysis, functional design, internal design, documentation planning, test planning, coding,
document preparation, integration, testing, maintenance, updates, retesting, phase-out, and other aspects.
10
·What kinds of tests could easily cover multiple functionalities?
·Which tests will have the best high-risk-coverage to time-required ratio?
45.What if the project isn't big enough to justify extensive testing?
Consider the impact of project errors, not the size of the project. However, if extensive testing is still not justified, risk analysis
is again needed and the same considerations as described previously in 'What if there isn't enough time for thorough testing?'
apply. The tester might then do ad hoc testing, or write up a limited test plan based on the risk analysis.
46.What can be done if requirements are changing continuously?
A common problem and a major headache.
·Work with the project's stakeholders early on to understand how requirements might change so that alternate test plans and
strategies can be worked out in advance, if possible.
·It's helpful if the application's initial design allows for some adaptability so that later changes do not require redoing the
application from scratch.
·If the code is well-commented and well-documented this makes changes easier for the developers.
·Use rapid prototyping whenever possible to help customers feel sure of their requirements and minimize changes.
·The project's initial schedule should allow for some extra time commensurate with the possibility of changes.
·Try to move new requirements to a 'Phase 2' version of an application, while using the original requirements for the 'Phase 1'
version.
·Negotiate to allow only easily-implemented new requirements into the project, while moving more difficult new requirements
into future versions of the application.
·Be sure that customers and management understand the scheduling impacts, inherent risks, and costs of significant
requirements changes. Then let management or the customers (not the developers or testers) decide if the changes are
warranted - after all, that's their job.
·Balance the effort put into setting up automated testing with the expected effort required to re-do them to deal with changes.
·Try to design some flexibility into automated test scripts.
·Focus initial automated testing on application aspects that are most likely to remain unchanged.
·Devote appropriate effort to risk analysis of changes to minimize regression testing needs.
·Design some flexibility into test cases (this is not easily done; the best bet might be to minimize the detail in the test cases, or
set up only higher-level generic-type test plans)
· Focus less on detailed test plans and test cases and more on ad hoc testing (with an understanding of the added risk that
this entails).
47.What if the application has functionality that wasn't in the requirements?
It may take serious effort to determine if an application has significant unexpected or hidden functionality, and it would indicate
deeper problems in the software development process. If the functionality isn't necessary to the purpose of the application, it
should be removed, as it may have unknown impacts or dependencies that were not taken into account by the designer or the
customer. If not removed, design information will be needed to determine added testing needs or regression testing needs.
Management should be made aware of any significant added risks as a result of the unexpected functionality. If the
functionality only effects areas such as minor improvements in the user interface, for example, it may not be a significant risk.
48.How can Software QA processes be implemented without stifling productivity?
By implementing QA processes slowly over time, using consensus to reach agreement on processes, and adjusting and
experimenting as an organization grows and matures, productivity will be improved instead of stifled. Problem prevention will
lessen the need for problem detection, panics and burn-out will decrease, and there will be improved focus and less wasted
effort. At the same time, attempts should be made to keep processes simple and efficient, minimize paperwork, promote
computer-based processes and automated tracking and reporting, minimize time required in meetings, and promote training
as part of the QA process. However, no one - especially talented technical types - likes rules or bureacracy, and in the short
run things may slow down a bit. A typical scenario would be that more days of planning and development will be needed, but
less time will be required for late-night bug-fixing and calming of irate customers.
49.What if an organization is growing so fast that fixed QA processes are impossible?
This is a common problem in the software industry, especially in new technology areas. There is no easy solution in this
situation, other than:
· Hire good people
· Management should 'ruthlessly prioritize' quality issues and maintain focus on the customer
· Everyone in the organization should be clear on what 'quality' means to the customer
50.How does a client/server environment affect testing?
Client/server applications can be quite complex due to the multiple dependencies among clients, data communications,
hardware, and servers. Thus testing requirements can be extensive. When time is limited (as it usually is) the focus should be
on integration and system testing. Additionally, load/stress/performance testing may be useful in determining client/server
application limitations and capabilities. There are commercial tools to assist with such testing.
Manual Testing Q & A Part 6
51.How can World Wide Web sites be tested?
Web sites are essentially client/server applications - with web servers and 'browser' clients. Consideration should be given to
the interactions between html pages, TCP/IP communications, Internet connections, firewalls, applications that run in web
pages (such as applets, javascript, plug-in applications), and applications that run on the server side (such as cgi scripts,
database interfaces, logging applications, dynamic page generators, asp, etc.). Additionally, there are a wide variety of servers
and browsers, various versions of each, small but sometimes significant differences between them, variations in connection
speeds, rapidly changing technologies, and multiple standards and protocols. The end result is that testing for web sites can
become a major ongoing effort. Other considerations might include:
·What are the expected loads on the server (e.g., number of hits per unit time?), and what kind of performance is required
under such loads (such as web server response time, database query response times). What kinds of tools will be needed for
performance testing (such as web load testing tools, other tools already in house that can be adapted, web robot downloading
tools, etc.)?
·Who is the target audience? What kind of browsers will they be using? What kind of connection speeds will they by using?
11
Are they intra- organization (thus with likely high connection speeds and similar browsers) or Internet-wide (thus with a wide
variety of connection speeds and browser types)?
·What kind of performance is expected on the client side (e.g., how fast should pages appear, how fast should animations,
applets, etc. load and run)?
·Will down time for server and content maintenance/upgrades be allowed? how much?
·What kinds of security (firewalls, encryptions, passwords, etc.) will be required and what is it expected to do? How can it be
tested?
·How reliable are the site's Internet connections required to be? And how does that affect backup system or redundant
connection requirements and testing?
·What processes will be required to manage updates to the web site's content, and what are the requirements for maintaining,
tracking, and controlling page content, graphics, links, etc.?
·Which HTML specification will be adhered to? How strictly? What variations will be allowed for targeted browsers?
·Will there be any standards or requirements for page appearance and/or graphics throughout a site or parts of a site??
·How will internal and external links be validated and updated? how often?
·Can testing be done on the production system, or will a separate test system be required? How are browser caching,
variations in browser option settings, dial-up connection variabilities, and real-world internet 'traffic congestion' problems to be
accounted for in testing?
·How extensive or customized are the server logging and reporting requirements; are they considered an integral part of the
system and do they require testing?
· How are cgi programs, applets, javascripts, ActiveX components, etc. to be maintained, tracked, controlled, and tested? site
security information include the Usenet newsgroup 'comp.security.announce' and links concerning web site security Some
usability guidelines to consider - these are subjective and may or may not apply to a given situation
·Pages should be 3-5 screens max unless content is tightly focused on a single topic. If larger, provide internal links within the
page.
·The page layouts and design elements should be consistent throughout a site, so that it's clear to the user that they're still
within a site.
·Pages should be as browser-independent as possible, or pages should be provided or generated based on the browser-type.
·All pages should have links external to the page; there should be no dead-end pages.
· The page owner, revision date, and a link to a contact person or organization should be included on each page.
52.How is testing affected by object-oriented designs?
Well-engineered object-oriented design can make it easier to trace from code to internal design to functional design to
requirements. While there will be little affect on black box testing (where an understanding of the internal design of the
application is unnecessary), white-box testing can be oriented to the application's objects. If the application was well-designed
this can simplify test design.
53.What is Extreme Programming and what's it got to do with testing?
Extreme Programming (XP) is a software development approach for small teams on risk-prone projects with unstable
requirements. It was created by Kent Beck who described the approach in his book 'Extreme Programming Explained .Testing
('extreme testing') is a core aspect of Extreme Programming. Programmers are expected to write unit and functional test code
first - before the application is developed. Test code is under source control along with the rest of the code. Customers are
expected to be an integral part of the project team and to help develope scenarios for acceptance/black box testing.
Acceptance tests are preferably automated, and are modified and rerun for each of the frequent development iterations. QA
and test personnel are also required to be an integral part of the project team. Detailed requirements documentation is not
used, and frequent re-scheduling, re-estimating, and re-prioritizing is expected.
54.What are all the basic strategies for dealing with new code?
? Start with obvious and simple test
? Test each function sympathetically
? Test broadly before deeply
? Look for more powerful tests
? Expand your scope
? Do some freestyle exploratory testing
55.What is acceptance testing?
Its a formal testing conducted to determine whether a system satisfies its acceptance criteria -enables an end user to
determine whether or not to accept the system
56.What is functionality testing?
Its a mandatory part in black box testing and is also known as requirement testing. During this testing testing team will
validates the correctness of every functionality in terms of behavioral coverage,calculation coverage,input domain coverage
and back end coverage.
57.What is GUI testing?
This testing is done against the windows compliance standards such as each windows present in the application,text
boxes,options(radio buttons),check boxes,command buttons,drop down list boxes.
58.What is Retesting?
Testing of a particular test cases to check whether the bug is fixed or not.
59.What is the difference between functional testing and functionality testing?
Functional testing is a mandatory part in black box testing.
Functionality testing is also known as requirement testing,during this test testing validates the correctness of every
functionality in terms of behavioural coverage,calculation coverage,input domain coverage,back end coverage
60.How to log defects in manual testing?
When you find a bug u have to post it in your company's issue tracker(as discovery or open status).While post the bug do not
forget to mention the summary,description,build version,screen shot,step to reproduce,severity and reproducibility of the bug.
61.When to use regression testing and retesting?
12
Retesting:In retesting we are going to check whether the bug is fixed or not.
Regression: It means after getting conformation the bug is fixed,we are going to check the fixation is going to create any
problems in the application or not.
62.What are all the main actions which will be taken by the project manager for testing a product?
1) Assess risks for the project as a whole
2) Assess the risk associated with the testing sub-project
3) Lay out criteria for important milestones and stick to them
4) Develop a project plan for the testing sub project
5) Track testing progress against the plan
63.What are all the important factors want to be trade-off when building a product?
1. Time to market
2. Cost to market
3. Reliability of delivered product
4. Feature set
64.What are all the favorite risks will be arised during the project plan?
? Are there fixed dates that must be met for milestones or components of the product?
? How likely is it that the test group will get the software on schedule?
? What technical areas of the product do the current members of the test group not understand?
? Which areas of the program must be well tested?
? Are there regulatory or legal requirements that the product must meet?
65.What is Guerilla testing?
It involves ad hoc testing done by some one who is skilled at finding errors on the fly. It is one person's best shot at finding
bugs. This approach is typically time limited.
66.What is combinatorial testing?
The most comprehensive approach to testing program-input combinations is referred to as combinatorial testing. In this testing
all possible combinations of the test data values selected for the program inputs are tested
44. When do you feel you need to modify the logical name?
a) Changing the logical name of an object is useful when the assigned logical name is not sufficiently descriptive or is too long.
15
45. When it is appropriate to change physical description?
a) Changing the physical description is necessary when the property value of an object changes.
46. How WinRunner handles varying window labels?
a) We can handle varying window labels using regular expressions. WinRunner uses two “hidden” properties in order to use
regular expression in an object’s physical description. These properties are regexp_label and regexp_MSW_class.
i.The regexp_label property is used for windows only. It operates “behind the scenes” to insert a regular expression into a
window’s label description.
ii.The regexp_MSW_class property inserts a regular expression into an object’s MSW_class. It is obligatory for all types of
windows and for the object class object.
[
47. What is the purpose of regexp_label property and regexp_MSW_class property?
a) The regexp_label property is used for windows only. It operates “behind the scenes” to insert a regular expression into a
window’s label description.
b) The regexp_MSW_class property inserts a regular expression into an object’s MSW_class. It is obligatory for all types of
windows and for the object class object.
48. How do you suppress a regular expression?
a) We can suppress the regular expression of a window by replacing the regexp_label property with label property.
49. How do you copy and move objects between different GUI map files?
a) We can copy and move objects between different GUI Map files using the GUI Map Editor. The steps to be followed are:
i Choose Tools > GUI Map Editor to open the GUI Map Editor.
ii.Choose View > GUI Files.
iii.Click Expand in the GUI Map Editor. The dialog box expands to display two GUI map files simultaneously.
iv. View a different GUI map file on each side of the dialog box by clicking the file names in the GUI File lists.
v.In one file, select the objects you want to copy or move. Use the Shift key and/or Control key to select multiple objects. To
select all objects in a GUI map file, choose Edit > Select All.
vi.Click Copy or Move.
vii.To restore the GUI Map Editor to its original size, click Collapse.
50. How do you select multiple objects during merging the files?
a) Use the Shift key and/or Control key to select multiple objects. To select all objects in a GUI map file, choose Edit > Select
All.
Win Runner Q & A Part 6
51. How do you clear a GUI map files?
a) We can clear a GUI Map file using the “Clear All” option in the GUI Map Editor.
52. How do you filter the objects in the GUI map?
a) GUI Map Editor has a Filter option. This provides for filtering with 3 different types of options.
i. Logical name displays only objects with the specified logical name.
ii. Physical description displays only objects matching the specified physical description. Use any substring belonging to the
physical description.
iii. Class displays only objects of the specified class, such as all the push buttons.
53.How do you configure gui map?
a) When WinRunner learns the description of a GUI object, it does not learn all its properties. Instead, it learns the minimum
number of properties to provide a unique identification of the object.
b) Many applications also contain custom GUI objects. A custom object is any object not belonging to one of the standard
classes used by WinRunner. These objects are therefore assigned to the generic “object” class. When WinRunner records an
operation on a custom object, it generates obj_mouse_ statements in the test script.
c) If a custom object is similar to a standard object, you can map it to one of the standard classes. You can also configure the
properties WinRunner uses to identify a custom object during Context Sensitive testing. The mapping and the configuration
you set are valid only for the current WinRunner session. To make the mapping and the configuration permanent, you must
add configuration statements to your startup test script.
54.W hat is the purpose of GUI map configuration?
a) GUI Map configuration is used to map a custom object to a standard object.
55. How do you make the configuration and mappings permanent?
a) The mapping and the configuration you set are valid only for the current WinRunner session. To make the mapping and the
configuration permanent, you must add configuration statements to your startup test script.
56. What is the purpose of GUI spy?
a) Using the GUI Spy, you can view the properties of any GUI object on your desktop. You use the Spy pointer to point to an
object, and the GUI Spy displays the properties and their values in the GUI Spy dialog box. You can choose to view all the
properties of an object, or only the selected set of properties that WinRunner learns.
57. What is the purpose of obligatory and optional properties of the objects?
a) For each class, WinRunner learns a set of default properties. Each default property is classified “obligatory” or “optional”.
i. An obligatory property is always learned (if it exists).
ii.An optional property is used only if the obligatory properties do not provide unique identification of an object. These optional
properties are stored in a list. WinRunner selects the minimum number of properties from this list that are necessary to identify
the object. It begins with the first property in the list, and continues, if necessary, to add properties to the description until it
obtains unique identification for the object.
58. When the optional properties are learned?
a) An optional property is used only if the obligatory properties do not provide unique identification of an object.
59. What is the purpose of location indicator and index indicator in GUI map configuration?
a) In cases where the obligatory and optional properties do not uniquely identify an object, WinRunner uses a selector to
differentiate between them. Two types of selectors are available:
i. A location selector uses the spatial position of objects.
16
1. The location selector uses the spatial order of objects within the window, from the top left to the bottom right corners, to
differentiate among objects with the same description.
ii. An index selector uses a unique number to identify the object in a window.
1. The index selector uses numbers assigned at the time of creation of objects to identify the object in a window. Use this
selector if the location of objects with the same description may change within a window.
60. How do you handle custom objects?
a) A custom object is any GUI object not belonging to one of the standard classes used by WinRunner. WinRunner learns
such objects under the generic “object” class. WinRunner records operations on custom objects using obj_mouse_
statements.
b) If a custom object is similar to a standard object, you can map it to one of the standard classes. You can also configure the
properties WinRunner uses to identify a custom object during Context Sensitive testing.
17
ii.Analog recording records keyboard input, mouse clicks, and the precise x- and y-
coordinates traveled by the mouse pointer across the screen.
68. What is a checkpoint and what are different types of checkpoints?
a) Checkpoints allow you to compare the current behavior of the application being tested
to its behavior in an earlier version.
You can add four types of checkpoints to your test scripts:
i. GUI checkpoints verify information about GUI objects. For example, you can check that
a button is enabled or see which item is selected in a list.
ii. Bitmap checkpoints take a “snapshot” of a window or area of your application and
compare this to an image captured in an earlier version.
iii. Text checkpoints read text in GUI objects and in bitmaps and enable you to verify their
contents.
iv. Database checkpoints check the contents and the number of rows and columns of a
result set, which is based on a query you create on your database.
69. What are data driven tests?
a) When you test your application, you may want to check how it performs the same
operations with multiple sets of data. You can create a data-driven test with a loop that
runs ten times: each time the loop runs, it is driven by a different set of data. In order for
WinRunner to use data to drive the test, you must link the data to the test script which it
drives. This is called parameterizing your test. The data is stored in a data table. You can
perform these operations manually, or you can use the DataDriver Wizard to parameterize
your test and store the data in a data table.
70. What are the synchronization points?
a) Synchronization points enable you to solve anticipated timing problems between the
test and your application. For example, if you create a test that opens a database
application, you can add a synchronization point that causes the test to wait until the
database records are loaded on the screen.
b) For Analog testing, you can also use a synchronization point to ensure that WinRunner
repositions a window at a specific location. When you run a test, the mouse cursor travels
along exact coordinates. Repositioning the window enables the mouse pointer to make
contact with the correct elements in the window.
21
b) When creating a database checkpoint, you insert a db_check statement into your test script. When you parameterize the
SQL statement in your checkpoint, the db_check function has a fourth, optional, argument: the parameter_array argument. A
statement similar to the following is inserted into your test script:
db_check("list1.cdl", "dbvf1", NO_LIMIT, dbvf1_params);
The parameter_array argument will contain the values to substitute for the parameters in the parameterized checkpoint.
94. Explain the following commands:
a) db_connect
to connect to a database
db_connect(<session_name>, <connection_string>);
b) db_execute_query
to execute a query
db_execute_query ( session_name, SQL, record_number );
record_number is the out value.
c) db_get_field_value
returns the value of a single field in the specified row_index and column in the session_name database session.
db_get_field_value ( session_name, row_index, column );
d) db_get_headers
returns the number of column headers in a query and the content of the column headers, concatenated and delimited by tabs.
db_get_headers ( session_name, header_count, header_content );
e) db_get_row
returns the content of the row, concatenated and delimited by tabs.
db_get_row ( session_name, row_index, row_content );
f) db_write_records
writes the record set into a text file delimited by tabs.
db_write_records ( session_name, output_file [ , headers [ , record_limit ] ] );
g) db_get_last_error
returns the last error message of the last ODBC or Data Junction operation in the session_name database session.
db_get_last_error ( session_name, error );
h) db_disconnect
disconnects from the database and ends the database session.
db_disconnect ( session_name );
i) db_dj_convert
runs the djs_file Data Junction export file. When you run this file, the Data Junction Engine converts data from one spoke
(source) to another (target). The optional parameters enable you to override the settings in the Data Junction export file.
db_dj_convert ( djs_file [ , output_file [ , headers [ , record_limit ] ] ] );
95. What check points you will use to read and check text on the GUI and explain its syntax?
a) You can use text checkpoints in your test scripts to read and check text in GUI objects and in areas of the screen. While
creating a test you point to an object or a window containing text. WinRunner reads the text and writes a TSL statement to the
test script. You may then add simple programming elements to your test scripts to verify the contents of the text.
b) You can use a text checkpoint to:
i.Read text from a GUI object or window in your application, using obj_get_text and win_get_text
ii.Search for text in an object or window, using win_find_text and obj_find_text
iii. Move the mouse pointer to text in an object or window, using obj_move_locator_text and win_move_locator_text
iv. Click on text in an object or window, using obj_click_on_text and win_click_on_text
96. Explain Get Text checkpoint from object/window with syntax?
a) We use obj_get_text (<logical_name>, <out_text>) function to get the text from an object
b) We use win_get_text (window, out_text [, x1, y1, x2, y2]) function to get the text from a window.
97. Explain Get Text checkpoint from screen area with syntax?
a) We use win_get_text (window, out_text [, x1, y1, x2, y2]) function to get the text from a window.
98. Explain Get Text checkpoint from selection (web only) with syntax?
a) Returns a text string from an object.
web_obj_get_text (object, table_row, table_column, out_text [, text_before, text_after, index]);
i. object The logical name of the object.
ii. table_row If the object is a table, it specifies the location of the row within a table. The string is preceded by the # character.
iii. table_column If the object is a table, it specifies the location of the column within a table. The string is preceded by the #
character.
iv. out_text The output variable that stores the text string.
v. text_before Defines the start of the search area for a particular text string.
vi. text_after Defines the end of the search area for a particular text string.
vii. index The occurrence number to locate. (The default parameter number is numbered 1).
99. Explain Get Text checkpoint web text checkpoint with syntax?
a) We use web_obj_text_exists function for web text checkpoints.
web_obj_text_exists ( object, table_row, table_column, text_to_find [, text_before, text_after] );
a. object The logical name of the object to search.
b. table_row If the object is a table, it specifies the location of the row within a table. The string is preceded by the character #.
c. table_column If the object is a table, it specifies the location of the column within a table. The string is preceded by the
character #.
d. text_to_find The string that is searched for.
e. text_before Defines the start of the search area for a particular text string.
f. text_after Defines the end of the search area for a particular text string.
100. Which TSL functions you will use for
22
a) Searching text on the window
i. find_text ( string, out_coord_array, search_area [, string_def ] );
string The string that is searched for. The string must be complete, contain no spaces, and it must be preceded and followed
by a space outside the quotation marks. To specify a literal, case-sensitive string, enclose the string in quotation marks.
Alternatively, you can specify the name of a string variable. In this case, the string variable can include a regular expression.
out_coord_array The name of the array that stores the screen coordinates of the text (see explanation below).
search_area The area to search, specified as coordinates x1,y1,x2,y2. These define any two diagonal corners of a rectangle.
The interpreter searches for the text in the area defined by the rectangle.
string_def Defines the type of search to perform. If no value is specified, (0 or FALSE, the default), the search is for a single
complete word only. When 1, or TRUE, is specified, the search is not restricted to a single, complete word.
b) getting the location of the text string
i. win_find_text ( window, string, result_array [, search_area [, string_def ] ] );
window The logical name of the window to search.
string The text to locate. To specify a literal, case sensitive string, enclose the string in quotation marks. Alternatively, you can
specify the name of a string variable. The value of the string variable can include a regular expression. The regular expression
should not include an exclamation mark (!), however, which is treated as a literal character. For more information regarding
Regular Expressions, refer to the "Using Regular Expressions" chapter in your User's Guide.
result_array The name of the output variable that stores the location of the string as a four-element array.
search_area The region of the object to search, relative to the window. This area is defined as a pair of coordinates, with
x1,y1,x2,y2 specifying any two diagonally opposite corners of the rectangular search region. If this parameter is not defined,
then the entire window is considered the search area.
string_def Defines how the text search is performed. If no string_def is specified, (0 or FALSE, the default parameter), the
interpreter searches for a complete word only. If 1, or TRUE, is specified, the search is not restricted to a single, complete
word.
c) Moving the pointer to that text string
i. win_move_locator_text (window, string [ ,search_area [ ,string_def ] ] );
window The logical name of the window.
string The text to locate. To specify a literal, case sensitive string, enclose the string in quotation marks. Alternatively, you can
specify the name of a string variable. The value of the string variable can include a regular expression (the regular expression
need not begin with an exclamation mark).
search_area The region of the object to search, relative to the window. This area is defined as a pair of coordinates, with x1,
y1, x2, y2 specifying any two diagonally opposite corners of the rectangular search region. If this parameter is not defined,
then the entire window specified is considered the search area.
string_def Defines how the text search is performed. If no string_def is specified, (0 or FALSE, the default parameter), the
interpreter searches for a complete word only. If 1, or TRUE, is specified, the search is not restricted to a single, complete
word.
d) Comparing the text
i. compare_text (str1, str2 [, chars1, chars2]);
str1, str2 The two strings to be compared.
chars1 One or more characters in the first string.
chars2 One or more characters in the second string. These characters are substituted for those in chars1.
Win Runner Q & A Part 11
101. What are the steps of creating a data driven test?
a) The steps involved in data driven testing are:
i. Creating a test
ii. Converting to a data-driven test and preparing a database
iii. Running the test
iv. Analyzing the test results.
102. Record a data driven test script using data driver wizard?
a) You can use the DataDriver Wizard to convert your entire script or a part of your script into a data-driven test. For example,
your test script may include recorded operations, checkpoints, and other statements that do not need to be repeated for
multiple sets of data. You need to parameterize only the portion of your test script that you want to run in a loop with multiple
sets of data.
To create a data-driven test:
i. If you want to turn only part of your test script into a data-driven test, first select those lines in the test script.
ii. Choose Tools > DataDriver Wizard.
iii. If you want to turn only part of the test into a data-driven test, click Cancel. Select those lines in the test script and reopen
the DataDriver Wizard. If you want to turn the entire test into a data-driven test, click Next.
iv. The Use a new or existing Excel table box displays the name of the Excel file that WinRunner creates, which stores the
data for the data-driven test. Accept the default data table for this test, enter a different name for the data table, or use
v. The browse button to locate the path of an existing data table. By default, the data table is stored in the test folder.
vi. In the Assign a name to the variable box, enter a variable name with which to refer to the data table, or accept the default
name, “table.”
vii. At the beginning of a data-driven test, the Excel data table you selected is assigned as the value of the table variable.
Throughout the script, only the table variable name is used. This makes it easy for you to assign a different data table
viii. To the script at a later time without making changes throughout the script.
ix. Choose from among the following options:
1. Add statements to create a data-driven test: Automatically adds statements to run your test in a loop: sets a variable name
by which to refer to the data table; adds braces ({and}), a for statement, and a ddt_get_row_count statement to your test script
selection to run it in a loop while it reads from the data table; adds ddt_open and ddt_close statements
2. To your test script to open and close the data table, which are necessary in order to iterate rows in the table. Note that you
23
can also add these statements to your test script manually.
3. If you do not choose this option, you will receive a warning that your data-driven test must contain a loop and statements to
open and close your datatable.
4. Import data from a database: Imports data from a database. This option adds ddt_update_from_db, and ddt_save
statements to your test script after the ddt_open statement.
5. Note that in order to import data from a database, either Microsoft Query or Data Junction must be installed on your
machine. You can install Microsoft Query from the custom installation of Microsoft Office. Note that Data Junction is not
automatically included in your WinRunner package. To purchase Data Junction, contact your Mercury Interactive
representative. For detailed information on working with Data Junction, refer to the documentation in the Data Junction
package.
6. Parameterize the test: Replaces fixed values in selected checkpoints and in recorded statements with parameters, using the
ddt_val function, and in the data table, adds columns with variable values for the parameters. Line by line: Opens a wizard
screen for each line of the selected test script, which enables you to decide whether to parameterize a particular line, and if so,
whether to add a new column to the data table or use an existing column when parameterizing data.
7. Automatically: Replaces all data with ddt_val statements and adds new columns to the data table. The first argument of the
function is the name of the column in the data table. The replaced data is inserted into the table.
x. The Test script line to parameterize box displays the line of the test script to parameterize. The highlighted value can be
replaced by a parameter. The Argument to be replaced box displays the argument (value) that you can replace with a
parameter. You can use the arrows to select a different argument to replace.
Choose whether and how to replace the selected data:
1. Do not replace this data: Does not parameterize this data.
2. An existing column: If parameters already exist in the data table for this test, select an existing parameter from the list.
3. A new column: Creates a new column for this parameter in the data table for this test. Adds the selected data to this column
of the data table. The default name for the new parameter is the logical name of the object in the selected. TSL statement
above. Accept this name or assign a new name.
xi. The final screen of the wizard opens.
1. If you want the data table to open after you close the wizard, select Show data table now.
2. To perform the tasks specified in previous screens and close the wizard, click Finish.
3. To close the wizard without making any changes to the test script, click Cancel.
25
data_table_name The name of the data table. The name may be the table variable name, the Microsoft Excel file or a tabbed
text file name, or the full path and file name of the table. The first row in the file contains the names of the parameters. This
row is labeled row 0.
q) ddt_update_from_db
imports data from a database into a data table. It is inserted into your test script when you select the Import data from a
database option in the DataDriver Wizard. When you run your test, this function updates the data table with data from the
database.
105. How do you handle unexpected events and errors?
a) WinRunner uses exception handling to detect an unexpected event when it occurs and act to recover the test run.
Define Exception Handling
Define Exception
Define Handler Function
WinRunner enables you to handle the following types of exceptions:
Pop-up exceptions: Instruct WinRunner to detect and handle the appearance of a specific window.
TSL exceptions: Instruct WinRunner to detect and handle TSL functions that return a specific error code.
Object exceptions: Instruct WinRunner to detect and handle a change in a property for a specific GUI object.
Web exceptions: When the WebTest add-in is loaded, you can instruct WinRunner to handle unexpected events and errors
that occur in your Web site during a test run.
106. How do you handle pop-up exceptions?
a) A pop-up exception Handler handles the pop-up messages that come up during the execution of the script in the AUT. TO
handle this type of exception we make WinRunner learn the window and also specify a handler to the exception. It could be
i. Default actions: WinRunner clicks the OK or Cancel button in the pop-up window, or presses Enter on the keyboard. To
select a default handler, click the appropriate button in the dialog box.
ii. User-defined handler: If you prefer, specify the name of your own handler. Click User Defined Function Name and type in a
name in the User Defined Function Name box.
107. How do you handle TSL exceptions?
a) A TSL exception enables you to detect and respond to a specific error code returned during test execution.
b) Suppose you are running a batch test on an unstable version of your application. If your application crashes, you want
WinRunner to recover test execution. A TSL exception can instruct WinRunner to recover test execution by exiting the current
test, restarting the application, and continuing with the next test in the batch.
c) The handler function is responsible for recovering test execution. When WinRunner detects a specific error code, it calls the
handler function. You implement this function to respond to the unexpected error in the way that meets your specific testing
needs.
d) Once you have defined the exception, WinRunner activates handling and adds the exception to the list of default TSL
exceptions in the Exceptions dialog box. Default TSL exceptions are defined by the XR_EXCP_TSL configuration parameter in
the wrun.ini configuration file.
108. How do you handle object exceptions?
a) During testing, unexpected changes can occur to GUI objects in the application you are testing. These changes are often
subtle but they can disrupt the test run and distort results.
b) You could use exception handling to detect a change in property of the GUI object during the test run, and to recover test
execution by calling a handler function and continue with the test execution
109. How do you comment your script?
a) We comment a script or line of script by inserting a ‘#’ at the beginning of the line.
110. What is a compile module?
a) A compiled module is a script containing a library of user-defined functions that you want to call frequently from other tests.
When you load a compiled module, its functions are automatically compiled and remain in memory. You can call them directly
from within any test.
b) Compiled modules can improve the organization and performance of your tests. Since you debug compiled modules before
using them, your tests will require less error-checking. In addition, calling a function that is already compiled is significantly
faster than interpreting a function in a test script.
Win Runner Q & A Part 12
111. What is the difference between script and compile module?
a) Test script contains the executable file in WinRunner while Compiled Module is used to store reusable functions. Complied
modules are not executable.
b) WinRunner performs a pre-compilation automatically when it saves a module assigned a property value of “Compiled
Module”.
c) By default, modules containing TSL code have a property value of "main". Main modules are called for execution from within
other modules. Main modules are dynamically compiled into machine code only when WinRunner recognizes a "call"
statement. Example of a call for the "app_init" script:
call cso_init();
call( "C:\\MyAppFolder\\" & "app_init" );
d) Compiled modules are loaded into memory to be referenced from TSL code in any module. Example of a load statement:
reload (“C:\\MyAppFolder\\" & "flt_lib");
or
load ("C:\\MyAppFolder\\" & "flt_lib");
112. Write and explain various loop command?
a) A for loop instructs WinRunner to execute one or more statements a specified number of times.
It has the following syntax:
for ( [ expression1 ]; [ expression2 ]; [ expression3 ] )statement
i. First, expression1 is executed. Next, expression2 is evaluated. If expression2 is true, statement is executed and expression3
is executed. The cycle is repeated as long as expression2 remains true. If expression2 is false, the for statement terminates
26
and execution passes to the first statement immediately following.
ii. For example, the for loop below selects the file UI_TEST from the File Name list
iii. in the Open window. It selects this file five times and then stops.
set_window ("Open")
for (i=0; i<5; i++)
list_select_item("File_Name:_1","UI_TEST"); #Item Number2
b) A while loop executes a block of statements for as long as a specified condition is true.
It has the following syntax:
while ( expression )
statement ;
i. While expression is true, the statement is executed. The loop ends when the expression is false. For example, the while
statement below performs the same function as the for loop above.
set_window ("Open");
i=0;
while (i<5){
i++;
list_select_item ("File Name:_1", "UI_TEST"); # Item Number 2
}
c) A do/while loop executes a block of statements for as long as a specified condition is true. Unlike the for loop and while
loop, a do/while loop tests the conditions at the end of the loop, not at the beginning.
A do/while loop has the following syntax:
do
statement
while (expression);
i. The statement is executed and then the expression is evaluated. If the expression is true, then the cycle is repeated. If the
expression is false, the cycle is not repeated.
ii. For example, the do/while statement below opens and closes the Order dialog box of Flight Reservation five times.
set_window ("Flight Reservation");
i=0;
do
{
menu_select_item ("File;Open Order...");
set_window ("Open Order");
button_press ("Cancel");
i++;
}
while (i<5);
113. Write and explain decision making command?
a) You can incorporate decision-making into your test scripts using if/else or switch statements.
i. An if/else statement executes a statement if a condition is true; otherwise, it executes another statement.
It has the following syntax:
if ( expression )
statement1;
[ else
statement2; ]
expression is evaluated. If expression is true, statement1 is executed. If expression1 is false, statement2 is executed.
b) A switch statement enables WinRunner to make a decision based on an expression that can have more than two values.
It has the following syntax:
switch (expression )
{
case case_1: statements
case case_2: statements
case case_n: statements
default: statement(s)
}
The switch statement consecutively evaluates each case expression until one is found that equals the initial expression. If no
case is equal to the expression, then the default statements are executed. The default statements are optional.
114. Write and explain switch command?
a) A switch statement enables WinRunner to make a decision based on an expression that can have more than two values.
It has the following syntax:
switch (expression )
{
case case_1: statements
case case_2: statements
case case_n: statements
default: statement(s)
}
b) The switch statement consecutively evaluates each case expression until one is found that equals the initial expression. If
no case is equal to the expression, then the default statements are executed. The default statements are optional.
115. How do you write messages to the report?
27
a) To write message to a report we use the report_msg statement
Syntax: report_msg (message);
116. What is a command to invoke application?
a) Invoke_application is the function used to invoke an application.
Syntax: invoke_application(file, command_option, working_dir, SHOW);
117. What is the purpose of tl_step command?
a) Used to determine whether sections of a test pass or fail.
Syntax: tl_step(step_name, status, description);
118. Which TSL function you will use to compare two files?
a) We can compare 2 files in WinRunner using the file_compare function.
Syntax: file_compare (file1, file2 [, save file]);
119. What is the use of function generator?
a) The Function Generator provides a quick, error-free way to program scripts. You can:
i. Add Context Sensitive functions that perform operations on a GUI object or get information from the application being tested.
ii. Add Standard and Analog functions that perform non-Context Sensitive tasks such as synchronizing test execution or
sending user-defined messages to a report.
iii. Add Customization functions that enable you to modify WinRunner to suit your testing environment.
120. What is the use of putting call and call_close statements in the test script?
a) You can use two types of call statements to invoke one test from another:
i. A call statement invokes a test from within another test.
ii. A call_close statement invokes a test from within a script and closes the test when the test is completed.
iii. The call statement has the following syntax:
1. call test_name ( [ parameter1, parameter2, ...parametern ] );
iv. The call_close statement has the following syntax:
1. call_close test_name ( [ parameter1, parameter2, ... parametern ] );
v. The test_name is the name of the test to invoke. The parameters are the parameters defined for the called test.
vi. The parameters are optional. However, when one test calls another, the call statement should designate a value for each
parameter defined for the called test. If no parameters are defined for the called test, the call statement must contain an empty
set of parentheses.
Win Runner Q & A Part 13
121. What is the use of treturn and texit statements in the test script?
a) The treturn and texit statements are used to stop execution of called tests.
i. The treturn statement stops the current test and returns control to the calling test.
ii. The texit statement stops test execution entirely, unless tests are being called from a batch test. In this case, control is
returned to the main batch test.
b) Both functions provide a return value for the called test. If treturn or texit is not used, or if no value is specified, then the
return value of the call statement is 0.
treturn
c) The treturn statement terminates execution of the called test and returns control to the calling test.
The syntax is:
treturn [( expression )];
d) The optional expression is the value returned to the call statement used to invoke the test.
texit
e) When tests are run interactively, the texit statement discontinues test execution. However, when tests are called from a
batch test, texit ends execution of the current test only; control is then returned to the calling batch test.
The syntax is:
texit [( expression )];
122. Where do you set up the search path for a called test.
a) The search path determines the directories that WinRunner will search for a called test.
b) To set the search path, choose Settings > General Options. The General Options dialog box opens. Click the Folders tab
and choose a search path in the Search Path for Called Tests box. WinRunner searches the directories in the order in which
they are listed in the box. Note that the search paths you define remain active in future testing sessions.
123. How you create user-defined functions and explain the syntax?
a) A user-defined function has the following structure:
[class] function name ([mode] parameter...)
{
declarations;
statements;
}
b) The class of a function can be either static or public. A static function is available only to the test or module within which the
function was defined.
c) Parameters need not be explicitly declared. They can be of mode in, out, or inout. For all non-array parameters, the default
mode is in. For array parameters, the default is inout. The significance of each of these parameter types is as follows:
in: A parameter that is assigned a value from outside the function.
out: A parameter that is assigned a value from inside the function.
inout: A parameter that can be assigned a value from outside or inside the function.
124. What does static and public class of a function means?
a) The class of a function can be either static or public.
b) A static function is available only to the test or module within which the function was defined.
c) Once you execute a public function, it is available to all tests, for as long as the test containing the function remains open.
This is convenient when you want the function to be accessible from called tests. However, if you want to create a function that
28
will be available to many tests, you should place it in a compiled module. The functions in a compiled module are available for
the duration of the testing session.
d) If no class is explicitly declared, the function is assigned the default class, public.
125. What does in, out and input parameters means?
a) in: A parameter that is assigned a value from outside the function.
b) out: A parameter that is assigned a value from inside the function.
c) inout: A parameter that can be assigned a value from outside or inside the function.
126. What is the purpose of return statement?
a) This statement passes control back to the calling function or test. It also returns the value of the evaluated expression to the
calling function or test. If no expression is assigned to the return statement, an empty string is returned.
Syntax: return [( expression )];
127. What does auto, static, public and extern variables means?
a) auto: An auto variable can be declared only within a function and is local to that function. It exists only for as long as the
function is running. A new copy of the variable is created each time the function is called.
b) static: A static variable is local to the function, test, or compiled module in which it is declared. The variable retains its value
until the test is terminated by an Abort command. This variable is initialized each time the definition of the function is executed.
c) public: A public variable can be declared only within a test or module, and is available for all functions, tests, and compiled
modules.
d) extern: An extern declaration indicates a reference to a public variable declared outside of the current test or module.
128. How do you declare constants?
a) The const specifier indicates that the declared value cannot be modified. The class of a constant may be either public or
static. If no class is explicitly declared, the constant is assigned the default class public. Once a constant is defined, it remains
in existence until you exit WinRunner.
b) The syntax of this declaration is:
[class] const name [= expression];
129. How do you declare arrays?
a) The following syntax is used to define the class and the initial expression of an array. Array size need not be defined in TSL.
b) class array_name [ ] [=init_expression]
c) The array class may be any of the classes used for variable declarations (auto, static, public, extern).
130. How do you load and unload a compile module?
a) In order to access the functions in a compiled module you need to load the module. You can load it from within any test
script using the load command; all tests will then be able to access the function until you quit WinRunner or unload the
compiled module.
b) You can load a module either as a system module or as a user module. A system module is generally a closed module that
is “invisible” to the tester. It is not displayed when it is loaded, cannot be stepped into, and is not stopped by a pause
command. A system module is not unloaded when you execute an unload statement with no parameters (global unload).
load (module_name [,1|0] [,1|0] );
The module_name is the name of an existing compiled module.
Two additional, optional parameters indicate the type of module. The first parameter indicates whether the function module is a
system module or a user module: 1 indicates a system module; 0 indicates a user module.
(Default = 0)
The second optional parameter indicates whether a user module will remain open in the WinRunner window or will close
automatically after it is loaded: 1 indicates that the module will close automatically; 0 indicates that the module will remain
open.
(Default = 0)
c) The unload function removes a loaded module or selected functions from memory.
d) It has the following syntax:
unload ( [ module_name | test_name [ , "function_name" ] ] );
29
134. How do you call a function from external libraries (dll).
135. What is the purpose of load_dll?
136. How do you load and unload external libraries?
137. How do you declare external functions in TSL?
138. How do you call windows APIs, explain with an example?
139. Write TSL functions for the following interactive modes:
i. Creating a dialog box with any message you specify, and an edit field.
ii. Create dialog box with list of items and message.
iii. Create dialog box with edit field, check box, and execute button, and a cancel button.
iv. Creating a browse dialog box from which user selects a file.
v. Create a dialog box with two edit fields, one for login and another for password input.
140. What is the purpose of step, step into, step out, step to cursor commands for debugging your script?
Win Runner Q & A Part 15
141. How do you update your expected results?
142. How do you run your script with multiple sets of expected results?
143. How do you view and evaluate test results for various check points?
144. How do you view the results of file comparison?
145. What is the purpose of Wdiff utility?
146. What are batch tests and how do you create and run batch tests ?
147. How do you store and view batch test results?
148. How do you execute your tests from windows run command?
149. Explain different command line options?
150. What TSL function you will use to pause your script?
Win Runner Q & A Part 16
151. What is the purpose of setting a break point?
152. What is a watch list?
153. During debugging how do you monitor the value of the variables?
154.What are the reasons that WinRunner fails to identify an object on the GUI?
a) WinRunner fails to identify an object in a GUI due to various reasons.
i. The object is not a standard windows object.
ii. If the browser used is not compatible with the WinRunner version, GUI Map Editor will not be able to learn any of the objects
displayed in the browser window.
155.What do you mean by the logical name of the object.
a) An object’s logical name is determined by its class. In most cases, the logical name is the label that appears on an object.
156.If the object does not have a name then what will be the logical name?
If the object does not have a name then the logical name could be the attached text.
157.What is the different between GUI map and GUI map files?
a) The GUI map is actually the sum of one or more GUI map files. There are two modes for organizing GUI map files.
i. Global GUI Map file: a single GUI Map file for the entire application
ii. GUI Map File per Test: WinRunner automatically creates a GUI Map file for each test created.
b) GUI Map file is a file which contains the windows and the objects learned by the WinRunner with its logical name and their
physical description.
158.How do you view the contents of the GUI map?
a) GUI Map editor displays the content of a GUI Map. We can invoke GUI Map Editor from the Tools Menu in WinRunner. The
GUI Map Editor displays the various GUI Map files created and the windows and objects learned in to them with their logical
name and physical description.
160.What is startup script in WinRunner?
It is writing a script and when WinRunner starts it automatically runs the script. If you write script like invoking some application
as soon as the script is run the application will be invoked for the purpose of testing
161.What is the purpose of loading WinRunner add-ins?
Add-ins are used in WinRunner to load functions specific to the particular add-in to the memory. While creating a script only
those functions in the add-in selected will be listed in the function generator,and while executing the script only those functions
in the loaded add-in will be executed,else WinRunner will give an error message saying it does not recognize the function
162.What is the purpose of GUI spy?
Using the GUI spy you can view the properties of any GUI object and your desktop. You use the spy pointer to point to an
object,and the GUI spy displays the properties and their values in the GUI spy dialog box. You can choose to view all
properties of an object, or only the selected set of properties that WinRunner learns.
163.When you create GUI map do you record all the objects of specific objects?
a) If we are learning a window then WinRunner automatically learns all the objects in the window else we will we identifying
those object, which are to be learned in a window, since we will be working with only those objects while creating scripts.
164.What is the purpose of set_window command?
b) Set_Window command sets the focus to the specified window. We use this command to set the focus to the required
window before executing tests on a particular window.
34