Question-31. What is the best way to set priority for test cases in TestNG?

Prioritizing the order of your test methods can be accomplished by defining a priority order. Consequently, the test will execute in accordance with the priority set.

Syntax: @Test(priority=2)

Example: The following code demonstrates how to set the priority of a test case in TestNG.

package TestNG;
import org.testng.annotations.*;
public class SettingPriority {
@Test(priority=0)
public void scalermethod1() {
}
@Test(priority=1)
public void scalermethod2() {
}
@Test(priority=2)
public void scalermethod3() {
}
}

Test Execution Sequence:

ScalerMethod1
ScalerMethod2
ScalerMethod3

Question-32. What is Object Repository?

Answer- Object Repository is a collection of web elements and their locators that belong to the Application Under Test (AUT). The QAs maintain all element locators in a separate file known as the property file (. properties) in Selenium. During execution, it serves as a means of identifying objects between the test script and the application.

Question-33. What are the valuable steps to resolve issues while testing?

Answer- The following steps can assist in resolving issues during 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.

Question-34. What qualities a software tester should have?

Answer- Any software tester’s goal is to find out as many bugs and problems in the system so that the customers don’t have to. Hence, a good software tester should have a keen eye for detail. They should know the ins and outs of the software they are testing and push every aspect of the software to its limits, to identify bugs that are hard to find with the software’s regular use.

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.

Question-35. Explain boundary value analysis in software testing.

Answer- BVA (Boundary Value Analysis) is a black box software testing technique that uses boundary values to create test cases. Input values near the boundary have a higher probability of error, so BVA is used to test boundary values. BVA includes values at the boundaries in the test cases. If the input falls within the boundary range, then the test is positive; if it falls outside, then it is negative. There are several types of values, including maximum or minimum, inside or outside edge, and typical or error values.

Question-36. Explain the role of testing in software development?

Answer- Software testing comes into play at different times in different software development methodologies. There are two main methodologies in software development, namely Waterfall and Agile.

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.

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.

Question-37. How much testing is sufficient? Or, is it possible to do exhaustive testing of the software?

Answer- It is impossible to exhaustively test software or prove the absence of errors, no matter how specific your test strategy is.

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.

Question-38. Why developers shouldn’t test the software they wrote?

Answer- Developers make poor testers. Here are some reasons why:

  • They try to test the code to make sure that it works, rather than testing all the ways in which it doesn’t work.
  • 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.
  • 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.

Question-39. What is SDLC in software testing?

Answer- In short, SDLC (Software Development Life Cycle) enables the development of high-quality, low-cost software with the shortest possible development time. A major objective of the SDLC is to produce high-quality software that meets and exceeds the expectations of customers. SDLC provides a detailed plan with a series of stages, or phases, that encompass their own processes and deliverables. By adhering to the SDLC, developers can enhance the speed of their projects and minimize risks and costs.

Question-40. What is the software testing life cycle?

Answer- Similar to software development, testing has its life cycle. During the testing, a tester goes through the following activities.

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.