Tuesday, October 13, 2015

QA interview questions and answers - quality assurance

QA interview questions and answers - contributed by Rohit Srivastava

Q1. What is difference between QA, QC and Software Testing?

Quality Assurance (QA): QA refers to the planned and systematic way of monitoring the quality of process which is followed to produce a quality product. QA tracks the outcomes and adjusts the process to meet the expectation.

Quality Control (QC): Concern with the quality of the product. QC finds the defects and suggests improvements. The process set by QA is implemented by QC. The QC is the responsibility of the tester.

Software Testing: is the process of ensuring that product which is developed by the developer meets the user requirement. The motive to perform testing is to find the bugs and make sure that they get fixed.

Q2. When to start QA in a project?

A good time to start the QA is from the beginning of the project startup. This will lead to plan the process which will make sure that product coming out meets the customer quality expectation. QA also plays a major role in the communication between teams. It gives time to step up the testing environment. The testing phase starts after the test plans are written, reviewed and approved.

Q3. What are verification and validation and difference between these two?

Verification: process of evaluating steps which is followed up to development phase to determine whether they meet the specified requirements for that stage.

Validation: process of evaluating product during or at the end of the development process to determine whether product meets specified requirements.
Difference between Verification and Validation:
  • Verification is Static Testing where as Validations is Dynamic Testing.
  • Verification takes place before validation.
  • Verification evaluates plans, documents, requirements and specifications, where as Validation evaluates product.
  • Verification inputs are checklist, issues list, walkthroughs and inspection, where as in Validation testing of actual product.
  • Verification output is set of documents, plans, specifications and requirement documents where as in Validation actual product is output.

Q4. What is difference between Smoke testing and Sanity Testing?

The difference between smoke and sanity testing is described below:
  • Sanity testing is performed when new build is released after fixing bugs where as smoke testing is performed to check the major functionalities of the application.
  • Sanity is performed by the tester or the developer but smoke testing can be performed by the tester or developer.
  • Smoke testing is performed earlier where as sanity is performed after the smoke testing.
  • Sanity testing is narrow and deep approach of testing and smoke testing is focused testing based on major functionalities.

Q5. What is destructive testing, and what are its benefits?

Destructive testing includes methods where material is broken down to evaluate the mechanical properties, such as strength, toughness and hardness.
For example, finding the quality of a weld is good enough to withstand extreme pressure and also to verify the properties of a material.
Benefits of Destructive Testing (DT)
  • Verifies properties of a material
  • Determines quality of welds
  • Helps you to reduce failures, accidents and costs
  • Ensures compliance with regulations

Q6. What is Testware?

The testware is:
  • The subset of software which helps in performing the testing of application.
  • Testware are required to plan, design, and execute tests. It contains documents, scripts, inputs, expected results, set-up and additional software or utilities used in testing.
  • Testware is term given to combination of all utilities and application software that required for testing a software package.
Testware is special because it has:
1. Different purpose
2. Different metrics for quality and
3. Different users

Q7. What is difference between Retesting and Regression testing?

The difference between Retesting and Regression testing are below:
  • Retesting is done to verify defects fixes where as regression is perform to check if the defect fix have not impacted other functionality that was working fine before doing changes in the code.
  • Retesting is planned testing based on the defect fixes listed where as regression is not be always specific to any defect fix. Also regression can be executed for some modules or all modules.
  • Retesting concern with executing those test cases that are failed earlier whereas regression concern with executing test cases that was passed in earlier builds.
  • Retesting has higher priority over regression, but in some case retesting and regression testing are carried out in parallel.

Q8. Explain bug life cycle.

Bug Life Cycle:
  • When a tester finds a bug .The bug is assigned with NEW or OPEN status.
  • The bug is assigned to development project manager who will analyze the bug .He will check whether it is a valid defect. If it is not valid bug is rejected, now status is REJECTED.
  • If not, next the defect is checked whether it is in scope. When bug is not part of the current release .Such defects are POSTPONED
  • Now, Tester checks whether similar defect was raised earlier. If yes defect is assigned a status DUPLICATE
  • When bug is assigned to developer. During this stage bug is assigned a status IN-PROGRESS
  • Once code is fixed. Defect is assigned with FIXED status.
  • Next the tester will re-test the code. In case the test case passes the defect is CLOSED
  • If the test case fails again the bug is RE-OPENED and assigned to the developer. That’s all to Bug Life Cycle.

Q9. What is severity and priority of bug? Give some example.

Priority: concern with application from the business point of view.
It answers: How quickly we need to fix the bug? Or How soon the bug should get fixed?
Severity: concern with functionality of application. It deals with the impact of the bug on the application.

How much the bug is affecting the functionality of the application?

Ex.
  • High Priority and Low Severity:
    Company logo is not properly displayed on their website.
  • High Priority and High Severity:
    Suppose you are doing online shopping and filled payment information, but after submitting the form, you get a message like "Order has been cancelled."
  • Low Priority and High Severity:
    If we have a typical scenario in which the application get crashed, but that scenario exists rarely.
  • Low Priority and Low Severity:
    There is a mistake like "You have registered success" instead of successfully, success is written.

Q10. What are the common problems with software automation?

Software problem are listed below:
1. Purchasing the license of tool (QTP, selenium, QC, LR)
2. Lack of skilled Tester to run the tool
3. Expectation that automated tests will find a lot of new defects
4. Maintenance of automated tests
5. Technical problems of tools

Q11. What is the role of QA in a project development?

QA stands for QUALITY ASSURANCE. QA team assures the quality by monitor the whole development process. QA tracks the outcomes and adjusting process to meet the expectation.
The role of Quality Assurance is discussed below:
  • QA team is responsible for monitoring the process to be carried out for development.
  • Responsibilities of QA team are planning testing execution process.
  • QA Lead creates the time tables and agrees on a Quality Assurance plan for the product.
  • QA team communicated QA process to the team members.
  • QA team ensures traceability of test cases to requirements.

Q13. What is the difference between build and release?

BUILD: is a number given to installable software that is given to testing team for testing by the development team. Build number assigned are incremental and sequential.
RELEASE: is a number given to installable software that is handed over to customer by the developer or tester.
The information of build, release and version are displayed in software help page. Using this build and release customer can let the customer team know which release version build thet are using.
eg "9.4.123.2" (Release Number.Version Number.Build Number.Patch Number)

Q14. What are the key challenges of software testing?

Following are some challenges of software testing
1. Application should be stable enough to be tested.
2. Testing always under time constraint
3. Understanding requirements, Domain knowledge and business user perspective understanding
4. Which tests to execute first?
5. Testing the Complete Application
6. Regression testing
7. Lack of skilled testers.
8. Changing requirements
9. Lack of resources, tools and training

Q15.Why you choose automated testing over manual testing?

The reasons for choosing automation testing over manual testing are following:
1. Frequency of use of test case
2. Time Comparison (automated script run much faster than manual execution.)
3. Reusability of Automation Script
4. Adaptability of test case for automation.
5. Exploitation of automation tool.

Q16. What is the basis for choosing the SDLC model for development of software?

The choice of SDLC depends on the various factors, how stable are the requirements:
  • When the requirements are very clearly know, documented and not subject to change then we can follow the waterfall model.
  • Most of the companies follow the V mode for the development because this model includes both verification and validation activities and testing is involved in earlier phase.
  • Iterative model can be used to build application where requirement changes after a period of times or application features or added on with smaller release. When the client is ready for the delivery of the product in parts or phases.

Q17. Explain bug leakage and bug release.

Bug Leakage: When customer or end user discovered a bug which can be detected by the testing team. Or when a bug is detected which can be detected in pervious build then this is called as Bug Leakage.
Bug release: is when a build is handed to testing team with knowing that defect is present in the release. The priority and severity of bug is low. It is done when customer want the application on the time. Customer can tolerate the bug in the released then the delay in getting the application and the cost involved in removing that bug. These bugs are mentioned in the Release Notes handed to client for the future improvement chances.

Q18. What is regression testing?

Regression Testing: When changes in the code of the software are made to fix the previous bug. Then testing needs to be perform to ensure that it will not generate a new bug in the application and it works as specified and that it has not negatively impacted any functionality that it offered previously. Regression Testing is important because of following reason:
  • That the application works even after the alteration in the code were made.
  • The original functionality continues to work as specified even after doing changes in the software application.
  • The alteration to the software application has not introduced any new bugs.

Q19.What is data driven testing?

Data Driven is an automation testing part in which test input or output values, these values are read from data files. It is performed when the values are changing by the time. The different data files may include data pools, csv files, Excel files. The data is then loaded into variables in recorded or manually coded scripts. For data driven testing we use Parameterzing and Regular expression Technique.
Ex: To evaluate login functionality, we use different user name and password combinations, variables are used to access different username and password. The list of username and password are stored in a data table or excel sheet.

Q20. What is alpha and beta testing?

Alpha testing: is performed by the IN-House developers. After alpha testing the software is handed over to software QA team, for additional testing in an environment that is similar to the client environment.
Beta testing: It is performed by end user. So that they can make sure that the product is bug free or working as per the requirement. IN-house developers and software QA team perform alpha testing. The public, a few select prospective customers or the general public performs beta testing.

Top 20 SQL Interview Questions with Answers For QA

SQL is a language for accessing and manipulating database standardized by ANSI. To be successful with database-centric applications (which includes most of the applications Data Warehousing domain), one must be strong enough in SQL. In this article, we will learn more about SQL by breaking the subject in the form of several question-answer sessions commonly asked in Interviews.

What is the difference between inner and outer join? Explain with example.

Inner Join

Inner join is the most common type of Join which is used to combine the rows from two tables and create a result set containing only such records that are present in both the tables based on the joining condition (predicate).
Inner join returns rows when there is at least one match in both tables
If none of the record matches between two tables, then INNER JOIN will return a NULL set. Below is an example of INNER JOIN and the resulting set.
SELECT dept.name DEPARTMENT, emp.name EMPLOYEE 
FROM DEPT dept, EMPLOYEE emp
WHERE emp.dept_id = dept.id
DepartmentEmployee
HRInno
HRPrivy
EngineeringRobo
EngineeringHash
EngineeringAnno
EngineeringDarl
MarketingPete
MarketingMeme
SalesTomiti
SalesBhuti

Outer Join

Outer Join, on the other hand, will return matching rows from both tables as well as any unmatched rows from one or both the tables (based on whether it is single outer or full outer join respectively).
Outer Join can be full outer or single outer
Notice in our record set that there is no employee in the department 5 (Logistics). Because of this if we perform inner join, then Department 5 does not appear in the above result. However in the below query we perform an outer join (dept left outer join emp), and we can see this department.
SELECT dept.name DEPARTMENT, emp.name EMPLOYEE 
FROM DEPT dept, EMPLOYEE emp
WHERE dept.id = emp.dept_id (+)
DepartmentEmployee
HRInno
HRPrivy
EngineeringRobo
EngineeringHash
EngineeringAnno
EngineeringDarl
MarketingPete
MarketingMeme
SalesTomiti
SalesBhuti
Logistics
The (+) sign on the emp side of the predicate indicates that emp is the outer table here. The above SQL can be alternatively written as below (will yield the same result as above):
SELECT dept.name DEPARTMENT, emp.name EMPLOYEE 
FROM DEPT dept LEFT OUTER JOIN EMPLOYEE emp
ON dept.id = emp.dept_id  

What is the difference between JOIN and UNION?

SQL JOIN allows us to “lookup” records on other table based on the given conditions between two tables. For example, if we have the department ID of each employee, then we can use this department ID of the employee table to join with the department ID of department table to lookup department names.
UNION operation allows us to add 2 similar data sets to create resulting data set that contains all the data from the source data sets. Union does not require any condition for joining. For example, if you have 2 employee tables with same structure, you can UNION them to create one result set that will contain all the employees from both of the tables.
SELECT * FROM EMP1
UNION
SELECT * FROM EMP2;

What is the difference between UNION and UNION ALL?

UNION and UNION ALL both unify for add two structurally similar data sets, but UNION operation returns only the unique records from the resulting data set whereas UNION ALL will return all the rows, even if one or more rows are duplicated to each other.
In the following example, I am choosing exactly the same employee from the emp table and performing UNION and UNION ALL. Check the difference in the result.
SELECT * FROM EMPLOYEE WHERE ID = 5
UNION ALL
SELECT * FROM EMPLOYEE WHERE ID = 5
IDMGR_IDDEPT_IDNAMESALDOJ
5.02.02.0Anno80.001-Feb-2012
5.02.02.0Anno80.001-Feb-2012
SELECT * FROM EMPLOYEE WHERE ID = 5
UNION 
SELECT * FROM EMPLOYEE WHERE ID = 5
IDMGR_IDDEPT_IDNAMESALDOJ
5.02.02.0Anno80.001-Feb-2012

What is the difference between WHERE clause and HAVING clause?

WHERE and HAVING both filters out records based on one or more conditions. The difference is, WHERE clause can only be applied on a static non-aggregated column whereas we will need to use HAVING for aggregated columns.
To understand this, consider this example. 
Suppose we want to see only those departments where department ID is greater than 3. There is no aggregation operation and the condition needs to be applied on a static field. We will use WHERE clause here:
SELECT * FROM DEPT WHERE ID > 3
IDNAME
4Sales
5Logistics
Next, suppose we want to see only those Departments where Average salary is greater than 80. Here the condition is associated with a non-static aggregated information which is “average of salary”. We will need to use HAVING clause here:
SELECT dept.name DEPARTMENT, avg(emp.sal) AVG_SAL
FROM DEPT dept, EMPLOYEE emp
WHERE dept.id = emp.dept_id (+)
GROUP BY dept.name
HAVING AVG(emp.sal) > 80
DEPARTMENTAVG_SAL
Engineering90
As you see above, there is only one department (Engineering) where average salary of employees is greater than 80.

What is the difference among UNION, MINUS and INTERSECT?

UNION combines the results from 2 tables and eliminates duplicate records from the result set.
MINUS operator when used between 2 tables, gives us all the rows from the first table except the rows which are present in the second table.
INTERSECT operator returns us only the matching or common rows between 2 result sets.
To understand these operators, let’s see some examples. We will use two different queries to extract data from our emp table and then we will perform UNION, MINUS and INTERSECT operations on these two sets of data.

UNION

SELECT * FROM EMPLOYEE WHERE ID = 5
UNION 
SELECT * FROM EMPLOYEE WHERE ID = 6
IDMGR_IDDEPT_IDNAMESALDOJ
522.0Anno80.001-Feb-2012
622.0Darl80.011-Feb-2012

MINUS

SELECT * FROM EMPLOYEE
MINUS
SELECT * FROM EMPLOYEE WHERE ID > 2
IDMGR_IDDEPT_IDNAMESALDOJ
12Hash100.001-Jan-2012
212Robo100.001-Jan-2012

INTERSECT

SELECT * FROM EMPLOYEE WHERE ID IN (2, 3, 5)
INTERSECT
SELECT * FROM EMPLOYEE WHERE ID IN (1, 2, 4, 5)
IDMGR_IDDEPT_IDNAMESALDOJ
522Anno80.001-Feb-2012
212Robo100.001-Jan-2012

What is Self Join and why is it required?

Self Join is the act of joining one table with itself.
Self Join is often very useful to convert a hierarchical structure into a flat structure
In our employee table example above, we have kept the manager ID of each employee in the same row as that of the employee. This is an example of how a hierarchy (in this case employee-manager hierarchy) is stored in the RDBMS table. Now, suppose if we need to print out the names of the manager of each employee right beside the employee, we can use self join. See the example below:
SELECT e.name EMPLOYEE, m.name MANAGER
FROM EMPLOYEE e, EMPLOYEE m
WHERE e.mgr_id = m.id (+)
EMPLOYEEMANAGER
PeteHash
DarlHash
InnoHash
RoboHash
TomitiRobo
AnnoRobo
PrivyRobo
MemePete
BhutiTomiti
Hash
The only reason we have performed a left outer join here (instead of INNER JOIN) is we have one employee in this table without a manager (employee ID = 1). If we perform inner join, this employee will not show-up.

How can we transpose a table using SQL (changing rows to column or vice-versa) ?

The usual way to do it in SQL is to use CASE statement or DECODE statement.

How to generate row number in SQL Without ROWNUM

Generating a row number – that is a running sequence of numbers for each row is not easy using plain SQL. In fact, the method I am going to show below is not very generic either. This method only works if there is at least one unique column in the table. This method will also work if there is no single unique column, but collection of columns that is unique. Anyway, here is the query:
SELECT name, sal, (SELECT COUNT(*)  FROM EMPLOYEE i WHERE o.name >= i.name) row_num
FROM EMPLOYEE o
order by row_num
NAMESALROW_NUM
Anno801
Bhuti602
Darl803
Hash1004
Inno505
Meme606
Pete707
Privy508
Robo1009
Tomiti7010
The column that is used in the row number generation logic is called “sort key”. Here sort key is “name” column. For this technique to work, the sort key needs to be unique. We have chosen the column “name” because this column happened to be unique in our Employee table. If it was not unique but some other collection of columns was, then we could have used those columns as our sort key (by concatenating those columns to form a single sort key).
Also notice how the rows are sorted in the result set. We have done an explicit sorting on the row_num column, which gives us all the row numbers in the sorted order. But notice that name column is also sorted (which is probably the reason why this column is referred as sort-key). If you want to change the order of the sorting from ascending to descending, you will need to change “>=” sign to “<=” in the query.
As I said before, this method is not very generic. This is why many databases already implement other methods to achieve this. For example, in Oracle database, every SQL result set contains a hidden column called ROWNUM. We can just explicitly select ROWNUM to get sequence numbers.

How to select first 5 records from a table?

This question, often asked in many interviews, does not make any sense to me. The problem here is how do you define which record is first and which is second. Which record is retrieved first from the database is not deterministic. It depends on many uncontrollable factors such as how database works at that moment of execution etc. So the question should really be – “how to select any 5 records from the table?” But whatever it is, here is the solution:
In Oracle,
SELECT * 
FROM EMP
WHERE ROWNUM <= 5;
In SQL Server,
SELECT TOP 5 * FROM EMP;
Generic solution,
I believe a generic solution can be devised for this problem if and only if there exists at least one distinct column in the table. For example, in our EMP table ID is distinct. We can use that distinct column in the below way to come up with a generic solution of this question that does not require database specific functions such as ROWNUM, TOP etc.
SELECT  name 
FROM EMPLOYEE o
WHERE (SELECT count(*) FROM EMPLOYEE i WHERE i.name < o.name) < 5
name
Inno
Anno
Darl
Meme
Bhuti
I have taken “name” column in the above example since “name” is happened to be unique in this table. I could very well take ID column as well.
In this example, if the chosen column was not distinct, we would have got more than 5 records returned in our output.
Do you have a better solution to this problem? If yes, post your solution in the comment.

What is the difference between ROWNUM pseudo column and ROW_NUMBER() function?

ROWNUM is a pseudo column present in Oracle database returned result set prior to ORDER BY being evaluated. So ORDER BY ROWNUM does not work.
ROW_NUMBER() is an analytical function which is used in conjunction to OVER() clause wherein we can specify ORDER BY and also PARTITION BY columns.
Suppose if you want to generate the row numbers in the order of ascending employee salaries for example, ROWNUM will not work. But you may use ROW_NUMBER() OVER() like shown below:
SELECT name, sal, row_number() over(order by sal desc) rownum_by_sal
FROM EMPLOYEE o
nameSalROWNUM_BY_SAL
Hash1001
Robo1002
Anno803
Darl804
Tomiti705
Pete706
Bhuti607
Meme608
Inno509
Privy5010

What are the differences among ROWNUM, RANK and DENSE_RANK?

ROW_NUMBER assigns contiguous, unique numbers from 1.. N to a result set.
RANK does not assign unique numbers—nor does it assign contiguous numbers. If two records tie for second place, no record will be assigned the 3rd rank as no one came in third, according to RANK. See below:
SELECT name, sal, rank() over(order by sal desc) rank_by_sal
FROM EMPLOYEE o
nameSalRANK_BY_SAL
Hash1001
Robo1001
Anno803
Darl803
Tomiti705
Pete705
Bhuti607
Meme607
Inno509
Privy509
DENSE_RANK, like RANK, does not assign unique numbers, but it does assign contiguous numbers. Even though two records tied for second place, there is a third-place record. See below:
SELECT name, sal, dense_rank() over(order by sal desc) dense_rank_by_sal
FROM EMPLOYEE o
nameSalDENSE_RANK_BY_SAL
Hash1001
Robo1001
Anno802
Darl802
Tomiti703
Pete703
Bhuti604
Meme604
Inno505
Privy505
This article is to be extended with more questions