Categories
Top 50 Software Testing Interview Questions for Freshers
This article provides the frequently asked interview questions by the interviewer for a Software Tester or (QA) position. It’s divided into three sections based on the skill set of the applicant. The fresher’s section includes software testing questions you might get asked for a junior-level position if you are recently graduated from college.
1.What is Software testing?
2. What are the principles of software testing?
Absence of errors fallacy:
Even if the software is 99% bug-free, it is unusable if it does not conform to the user's requirements. Software needs to be bug-free 99% of the time, and it must also meet all customer requirements.Testing shows the presence of errors:
Testing can verify the presence of defects in software, but it cannot guarantee that the software is defect-free. Testing can minimize the number of defects, but it can't remove them all.Exhaustive testing is not possible:
The software cannot be tested exhaustively, which means all possible test cases cannot be covered. Testing can only be done with a select few test cases, and it's assumed that the software will produce the right output in all cases. Taking the software through every test case will cost more, take more effort, etc., which makes it impractical.Defect clustering:
The majority of defects are typically found in a small number of modules in a project. According to the Pareto Principle, 80% of software defects arise from 20% of modules.Pesticide Paradox:
It is impossible to find new bugs by re-running the same test cases over and over again. Thus, updating or adding new test cases is necessary in order to find new bugs.Early testing:
Early testing is crucial to finding the defect in the software. In the early stages of SDLC, defects will be detected more easily and at a lower cost. Software testing should start at the initial phase of software development, which is the requirement analysis phase.Testing is context-dependent:
The testing approach varies depending on the software development context. Software needs to be tested differently depending on its type. For instance, an ed-tech site is tested differently than an Android app.3. What is exploratory testing?
1) Follow a map, itinerary, or a list of places they should visit
2) Explore randomly, following the streets as they lead them to new places
With the first approach, the tourist follows a predetermined plan and executes it. Though they may visit famous spots, they might miss out on hidden, more exciting places in the city. With the second approach, the tourist wanders around the city and might encounter strange and exotic places that the itinerary would have missed.
Both approaches have their pros and cons.
A tester is similar to a tourist when they are testing software. They can follow a strict set of test cases and test the software according to them, with the provided inputs and outputs, or they can explore the software.
When a tester doesn't use the test scripts or a predefined test plan and randomly tests the software, it is called exploratory testing. As the name suggests, the tester is exploring the software as an end-user would. It's a form of black-box testing.
In exploratory testing, the tester interacts with the software in whatever manner they want and follows the software's instructions to navigate various paths and functionality. They don't have a strict plan at hand.
Exploratory testing primarily focuses on behavioural testing. It is effective for getting familiar with new software features. It also provides a high-level overview of the system that helps evaluate and quickly learn the software.
Though it seems random, exploratory testing can be powerful in an experienced and skilled tester's hands. As it's performed without any preconceived notions of what software should and shouldn't do, it allows greater flexibility for the tester to discover hidden paths and problems along those paths.
4. What is regression testing in software testing?
Regression problems are pervasive in the software industry, as new features are getting added all the time. Developers don't build these features in isolation, separate from the existing code. Instead, the new code interacts with the legacy code and modifies it in various ways, introducing side effects, whether intended or not.
As a result, there is always a chance that introducing new changes may negatively impact a working feature. It's important to keep in mind that even a small change has the potential to cause regression.
Regression testing helps ensure that the new code or modifications to the existing code don't break the present behaviour. It allows the tester to verify that the new code plays well with the legacy code.
5. What are the different types of testing?
Type | Description |
Unit Testing | A programmatic test that tests the internal working of a unit of code, such as a method or a function. |
Integration Testing | Ensures that multiple components of systems work as expected when they are combined to produce a result. |
Regression Testing | Ensures that existing features/functionality that used to work are not broken due to new code changes. |
System Testing | Complete end-to-end testing is done on the complete software to make sure the whole system works as expected. |
Smoke Testing | A quick test performed to ensure that the software works at the most basic level and doesn’t crash when it’s started. Its name originates from the hardware testing where you just plug the device and see if smoke comes out. |
Performance Testing | Ensures that the software performs according to the user’s expectations by checking the response time and throughput under specific load and environment. |
User-Acceptance Testing | Ensures the software meets the requirements of the clients or users. This is typically the last step before the software is live, i.e. it goes to production. |
Stress Testing | Ensures that the performance of the software doesn’t degrade when the load increases. In stress testing, the tester subjects the software under heavy loads, such as a high number of requests or stringent memory conditions to verify if it works well. |
Usability Testing | Measures how usable the software is. This is typically performed with a sample set of end-users, who use the software and provide feedback on how easy or complicated it is to use the software. |
Security Testing | Now more important than ever. Security testing tries to break a software’s security checks, to gain access to confidential data. Security testing is crucial for web-based applications or any applications that involve money. |
6. Explain how does a test coverage tool work?
7. What is a test environment?
Whenever a new build of the software is released, the tester updates the test environment with the latest build and runs the regression tests suite. Once it passes, the tester moves on to testing new functionality.
8. What is an API?
When building software, developers rarely write software from scratch and make use of other third-party libraries. An API allows two software components to talk to each other by providing an interface that they can understand.
Another use of an API is to provide data required by an application. Let's say you are building a weather application that displays the temperature. Instead of building the technology to collect the temperature yourself, you'd access the API provided by the meteorological institute.
9. What is unit testing?
A unit test invokes the code and verifies the result with the expected result. If the expected and actual outcomes match, then the unit test passes. Otherwise, it fails.
A good unit test has the following characteristics:
1) It should test a single piece of functionality.
2) It is fully automated and repeatable.
3) It should run quickly and provide immediate feedback.
4) It should be isolated and shouldn’t interact with external dependencies such as network, database, or file system unless needed. You can use the mocking technique to simulate the external dependencies and isolate the code under test.
10. What is end-to-end testing?
There is an important difference between end-to-end testing vs. other forms of testing that are more isolated, such as unit testing. In end-to-end testing, the software is tested along with all its dependencies and integrations, such as databases, networks, file systems, and other external services.
11. What is a bug in software testing?
There are many causes for the bugs—for example, poor design, sloppy programming, lack of version control, or miscommunication. Throughout development, developers introduce hundreds or thousands of bugs in the system. The goal of the tester is to uncover those bugs.
You can find a bug in many different ways, regardless of your role. When building the software, the software developer might notice the bug in another module, written by another developer or by themselves. The tester actively tries to find the bugs as part of a routine testing process. Finally, the users could see the bugs when the software is in production.
All bugs, no matter how they are found, are recorded into a bug-tracking system. A triage team triages the bugs and assigns a priority to the bug, and assigns the bug to a software developer to fix it. Once the developer resolves the problem, they check in the code and mark that bug as ready for testing. Once a bug is ready for testing, it goes to the tester, who tests the software to verify if it’s indeed fixed. If it is, then it’s closed. If not, they assign it to the same developer with a description of the exact steps to reproduce the bug. Some examples of popular bug-tracking systems include BugZilla, FogBugz, etc.
12. Explain test scenarios, test scripts, and test cases in software testing.
Test Case:
Test Cases are a series of actions executed during software development to verify a particular feature or function. A test case consists of test steps, test data, preconditions, and postconditions designed to verify a specific requirement.Test Scenario:
Usually, a test scenario consists of a set of test cases covering the end-to-end functionality of a software application. A test scenario provides a high-level overview of what needs to be tested.Test Scripts:
When it comes to software testing, a test script refers to the set of instructions that will be followed in order to verify that the system under test performs as expected. The document outlines each step to be taken and the expected results.13. Is Automation testing in agile methodology useful?
14. Explain black-box testing, white-box testing, and grey-box testing.
Black-box testing in software testing:
In black-box testing, the system is tested only in terms of its external behaviour; it does not consider how the software functions on the inside. This is the only limitation of the black-box test. It is used in Acceptance Testing and System Testing.White-box testing in software testing:
A white-box test is a method of testing a program that takes into account its internal workings as part of its review. It is used in integration testing and unit testing.Grey-box testing in software testing:
A Gray Box Testing technique can be characterized as a combination of a black box as well as a white box testing technique used in the software testing process. Using this technique, you can test a software product or application with a partial understanding of its internal structure.15. Can you describe the different types of test coverage techniques?
Statement/Block Coverage:
Measures how many statements in the source code have been successfully executed and tested.Decision/Branch Coverage:
his metric measures how many decision control structures were successfully executed and tested.Path Coverage:
This ensures that the tests are conducted on every possible route through a section of the code.Function coverage:
It measures how many functions in the source code have been executed and tested at least once.16. What are different categories of debugging?
1) Brute force debugging
2) Backtracking
3) Cause elimination
4) Program slicing
5) Fault tree analysis
17. What do you mean by Test Deliverables?
Before Testing Phase
1) Test plans document.
2) Test cases documents
3) Test Design specifications.
During Testing Phase
1) Test Scripts
2) Simulators
3) Test Data
4) Test Traceability Matrix
5) Error logs and execution logs
After testing Phase
1) Brute force debugging
2) Backtracking
3) Cause elimination
4) Program slicing
5) Fault tree analysis
18. What is a Test Report? What does it include?
1) Test Objective
2) Project Information
3) Defect
4) Test Summary
19. What is a Test Plan? What does it include?
A test plan must include the following details:
1) Test Strategy
2) Test Objective
3) Test Scope
4) Reason for Testing
5) Exit/Suspension Criteria
6) Resource Planning
7) Test Deliverables.
20. What is defects in software testing?
Wrong:
It implies incorrect implementation of requirements. There is a variance between the specifications and what was expected, resulting in this defect.Missing:
This indicates that a specification has not been implemented, or a requirement of the customer has not been properly noted.Extra
In this case, the defect is caused by a requirement incorporated into the product that was not provided by the end-user.21. What is A/B testing?
You can choose a part of your users to use feature A. The other group uses feature B. Then user feedback and response are evaluated using statistical testing to decide the final version of the feature.
Typically, A/B testing is used to test the user experience of different interfaces. This allows the team to quickly gather feedback and test their initial hypothesis.
22. List some of the popular software testing tools/frameworks, providing a brief description of each.
Selenium:
a web browser automation tool that automates the test suites you need to run on a web browser.Protractor
An end-to-end test framework for Angular and AngularJS applications. Protractor runs tests against your application running in a real browser, interacting with it as a user would.Cypress
A modern front-end testing tool built for the modern web. Though it’s similar to Selenium and Protractor, it’s architecturally different from them.Jasmine
This is an open-source JavaScript testing framework that allows you to write behaviour-driven tests.23. What is a user story?
A user story aims to focus on the value provided to the end-user instead of the exact inputs they might enter and the expected output.
In a user story, the tester creates user personas with real names and characteristics and tries to simulate a real-life interaction with the software. A user story often helps fish out hidden problems that are often not revealed by more formal testing processes.
24. Write some common mistakes that lead to major issues.
1) Poor Scheduling
2) Underestimating
3) Ignoring small issues
4) Not following the exact process
5) Improper resource allocation
25. Is it possible to skip a method or a code block in Testing?
@Test(enabled = false).
26. What is the purpose of Testing?
27. Can you explain sanity testing in software testing?
features
1) It focuses on a smaller section of the application and is a subset of regression testing.2) The process is undocumented.
3) Sanity testing is often unscripted.
4) In this approach, limited functionalities are deeply tested.
5) A tester is usually responsible for performing this task.
28. What do you mean by latent defect and masked defect?
Latent Defect:
Latent defects are defects that exist but have not yet been invoked because the conditions required to invoke them have not been met. As a systematic flaw, it encompasses the entire production process of the software, including all pre-production testing and extended testing. When users perform a particular task in an unusual or rare situation or without the presence of usual scenarios, latent defects are revealed.
Masked Defect:
These are the defects that have not yet resulted in a failure since another defect hides that portion of the code from being executed. It can only be discovered when the defect hiding it is exposed by the user through a specific operation. There are defects that are hidden or marked by another defect and remain hidden until the other defect is detected.
29. What is spice in software testing?
30. What qualities a software tester should have?
Having the domain knowledge of the application is essential. If a tester doesn't understand the specific problems the software is trying to solve, they won't be able to test it thoroughly.
A good tester should keep the end-user in mind when they are testing. Having empathy with the end-user helps the tester ensure that the software is accessible and usable. Simultaneously, the tester should possess basic programming skills to think from a developer's perspective, which allows them to notice common programming errors such as null-references, out-of-memory errors, etc.
Communication, both written and verbal, is an essential skill for a tester. A tester will frequently have to interact with both the developers and the management. They should be able to explain the bugs and problems found during testing to the developers. For each bug found, a good tester should provide a detailed bug report consisting of all the information a developer would need to fix that problem. They should be able to make a good case to the management if they are uncomfortable releasing the software if it contains unresolved issues.
31. What are the valuable steps to resolve issues while testing?
Record
Keep track of any problems that arise and resolve them.Report
Inform higher-level managers of the issues.Control
Establish a process for managing issues.32.What is Object Repository?
33. What is the best way to set priority for test cases in Testing?
Syntax
@Test(priority=2)Example
The following code demonstrates how to set the priority of a test case in Testing.34. State the difference between bugs and errors
Bugs | Errors |
Software bugs are defects, which occur when the software or an application does not work as intended. A bug occurs when there is a coding error, which causes the program to malfunction. | Errors in code are caused by problems with the code, which means that the developer could have misunderstood the requirement or the requirement was not defined correctly, leading to a mistake. |
The bug is submitted by the testers. | Errors are raised by test engineers and developers. |
Logic bugs, resource bugs, and algorithmic bugs are types of bugs. | Syntactic error, error handling error, error handling error, user interface error, flow control error, calculation error, and testing error are types of errors. |
The software is detected before it is deployed in production. | The error occurs when the code is unable to be compiled. |
Software Testing Interview Questions for Experienced
35. What is the software testing life cycle?
Understand the requirements:
Before testing software or a feature, the tester must first understand what it is supposed to do. If they don’t know how the software is supposed to work, they can’t test it effectively.Test Planning and Case Development:
Once the tester has a clear understanding of the requirements, they can create a test plan. It includes the scope of testing, i.e., part of software under test and objectives for testing. Various activities are involved in planning the test, such as creating documentation, estimating the time and efforts involved, deciding the tools and platforms, and the individuals who will be conducting the tests.Prepare a test environment:
The development happens in a development environment, i.e., on a developer’s computer that might not represent the actual environment that the software will run in production. A tester prepares an environment with the test data that mimics the end user’s environment. It assists with realistic testing of the software.Generate the test data:
Though it is impossible to do exhaustive testing of the software, the tester tries to use realistic test data to give them the confidence that the software will survive the real world if it passes the tests.Test Execution:
Once the tester has a complete understanding of the software and has a test environment set up with the test data, they execute the test. Here, execution means that the tester runs the software or the feature under test and verifies the output with the expected outcome.Test Closure:
At the end of the test execution, there can be two possible outcomes. First, the tester finds a bug in the part of the software under test. In this case, they create a test record/bug report. Second, the software works as expected. Both these events indicate the end of the test cycle.36. What is SDLC in software testing?
37. Why developers shouldn’t test the software they wrote?
1) They try to test the code to make sure that it works, rather than testing all the ways in which it doesn't work.
2) Since they wrote it themselves, developers tend to be very optimistic about the software and don't have the correct attitude needed for testing: to break software.
3) Developers skip the more sophisticated tests that an experienced tester would perform to break the software. They follow the happy path to execute the code from start to finish with proper inputs, often not enough to get the confidence to ship software in production.
However, it doesn't mean that developers shouldn't test the software before sending it to the tester. Developer testing helps find many bugs that are caused by programming errors. These are hard to find for a tester because they don't always have access to the source code.
38. How much testing is sufficient? Or, is it possible to do exhaustive testing of the software?
An extensive test that finds hundreds of errors doesn’t imply that it has discovered them all. There could be many more errors that the test might have missed. The absence of errors doesn’t mean there are no errors, and the software is perfect. It could easily mean ineffective or incomplete tests. To prove that a program works, you’d have to test all possible inputs and their combinations.
Consider a simple program that takes a string as an input that is ten characters long. To test it with each possible input, you’d have to enter 2610 names, which is impossible. Since exhaustive testing is not practical, your best strategy as a tester is to pick the test cases that are most likely to find errors. Testing is sufficient when you have enough confidence to release the software and assume it will work as expected.
39. Explain the role of testing in software development?
In a traditional waterfall software development model, requirements are gathered first. Then a specification document is created based on the document, which drives the design and development of the software. Finally, the testers conduct the testing at the end of the software development life cycle once the complete software system is built.
Waterfall Software Development Model
An agile software development model works in small iterations. You test the software in parallel as it is getting built. The developers build a small functionality according to the requirements. The testers test it and get customer feedback, which drives future development.
40. Explain boundary value analysis in software testing.
41. What is Test-Driven-Development?
In TDD, a developer working on a feature first writes a failing test, then writes just enough code to make that test pass. Once they have a passing test, they add another failing test and then write just enough code to pass the failing test. This cycle repeats until the developer has the fully working feature. If the code under the test has external dependencies such as database, files, or network, you can mock them to isolate the code.
Benefits of TDD:
1) Writing tests first forces you to think about the feature you are trying to build, helping you produce better code.2) As you always have a working set of tests at hand, a failing test indicates that the problem is with the code you just added, reducing the time spent in debugging.
3) Writing tests help the developer to clarify the requirements and specification. It’s challenging to write good tests for a poor set of requirements.
4) It’s tough to produce high-quality software unless you can test the software after each new change. You can never be sure that your new code didn’t break the working software. TDD gives you the confidence to add new code, as you already have a test in place.
42. What are some important testing metrics?
Here are some of the metrics derived from a record of the tests and failures:
1) Total number of defects found, ordered by their severity
2) Total number of bugs fixed
3) Total number of problems caused by an error in the source code vs. configuration or external environmental factors
4) Bug find and fix rate over time
5) Bugs by produce/feature area
6) The average time is taken by a bug since it’s found and fixed.
7) Total time spent on new feature development vs. time spent on resolving bugs and failures
8) Number of outstanding bugs before a release
9) Bugs/failures reported by the customers vs. those found by the testers
43. What is non-functional testing?
Non-functional testing comes after functional testing. It tests the general characteristics unrelated to the functional requirements of the software. Non-functional testing ensures that the software is secure, scalable, high-performance, and won't crash under heavy load.
44. What is functional testing?
It validates the software against the functional requirements or the specification, ignoring the non-functional attributes such as performance, usability, and reliability.
Functional testing aims to answer the following questions, in particular:
1) Does the software fulfill its functional requirements?
2) Does it solve its intended users' problems?
45. What is a bug report?
A detailed bug report is an important artifact produced during testing. It helps the team members with:
1) Understand the problem,
2) Steps to reproduce the problem,
3) The environment and the specific conditions under which it happens, and
4) The resolution if/when the developers fix the problem.
46. Which test cases are written first: white boxes or black boxes?
47. What is alpha testing?
48. What is beta testing?
49. What is meant by browser automation?
The only difference is that the browser automation can test this very quickly and often, whereas the same test would take a human tester a long time. It’s part of automated testing. Some essential tools for browser testing include Selenium, protractor.js, and cypress.