Testing Flashcards
What is the difference between black box and white box testing?
Internal system design is not considered in black box testing. Tests are based on requirements and functionality. White box testing (aka glass box) is based on knowledge of the internal logic of an application’s code. Internal software and code working should be known for this type of testing. Tests are based on coverage of code statements, branches, paths, conditions.
What is unit testing?
Testing of individual software components, modules, and methods. Typically done by the programmer and not by testers, as it requires detailed knowledge of the internal program design and code. May require developing test driver modules, stubs, or test harnesses.
What is integration testing?
Testing of integrated modules to verify combined functionality after integration. Modules are typically 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.
What is functional testing?
This type of testing ignores the internal parts and focus on the output is as per requirement or not. Black-box type testing geared to functional requirements of an application.
What is system testing?
Entire system is tested as per the requirements. Black-box type testing that is based on overall requirements specifications, covers all combined parts of a system.
What is regression testing?
Testing the application as a whole after the modification in any module or functionality to ensure new modules do not break old modules. Difficult to cover all the system in regression testing so typically automation tools are used for these testing types.
What is the difference between performance, load, and stress testing?
Performance testing is used to check whether system meets performance requirements under normal conditions. Load testing is used to check system behavior under heavy loads, such as testing of a web site under a range of loads and incrementally ramping up requests to determine at what point the system’s response time degrades or fails. In stress testing, the system is stressed beyond its specifications typically in spikes to check how and when it fails.
What is acceptance testing?
Normally this type of testing is done to verify if system meets the customer specified requirements. User or customer do this testing to determine whether to accept application.
What is the difference between alpha testing and beta testing?
“Alpha testing is a type of acceptance testing; performed to identify all possible issues/bugs before releasing the product to everyday users or public. The focus of this testing is to simulate real users by using blackbox and whitebox techniques. The aim is to carry out the tasks that a typical user might perform. Alpha testing is carried out in a lab environment and usually the testers are internal employees of the organization. Beta Testing of a product is performed by ““real users”” of the software application in a ““real environment”” and can be considered as a form of external user acceptance testing. Beta version of the software is released to a limited number of end-users of the product to obtain feedback on the product quality. Beta testing reduces product failure risks and provides increased quality of the product through customer validation. It is the final test before shipping a product to the customers.”
What is usability testing?
User-friendliness check. Application flow is tested, Can new user understand the application easily, Proper help documented whenever user stuck at any point. Basically system navigation is checked in this testing.
List the annotations in JUnit 4.
BeforeClass, Before, Test, After, AfterClass, Ignore, Suite, RunWith
In what order are annotated methods executed?
BeforeClass –> Before –> Test –> After –> AfterClass
How many times are the Before and After methods executed?
Once for each method annotated as Test. Used for setup and teardown for each test case scenario.
Name some of the methods available in the Assert class.
assertArrayEquals, assertEquals, assertNotEquals, assertTrue, assertFalse, assertSame, assertNotSame, assertNull, assertNotNull, assertThat, fail
What is test-driven development (TDD)?
Test-driven development (TDD) is an evolutionary approach to development which combines test-first development. In TDD, you write a failing unit test before you write just enough production code to fulfill that test and then refactor.
What is behavior-driven development (BDD)?
Similar to TDD, behavior-driven development uses a test-first develop later approach. The approach starts by writing a failing acceptance test, typically in a plain text / business and domain readable file. Then, developers write a failing unit test in a programming language, known as a step implementation. Then, as in TDD, you write just enough production code to fulfill that test and then refactor.
What is Cucumber?
Cucumber is a BDD framework that uses Gherkin as its domain-readable language and supports step implementations in a variety of languages, including Java and Ruby.
What is Gherkin?
Gherkin is a Business Readable, Domain Specific Language created especially for behavior descriptions. Gherkin serves two purposes: serving as your project’s documentation and automated tests. The Gherkin file describes the feature, scenarios, and scenario steps for the test. It can also contain test data examples and background data for preconditions. Gherkin supports over 60 spoken languages.
What is feature file in Cucumber? What does feature file consist of?
Feature file in Cucumber is written in Gherkin and consists of parameters or conditions required for executing code. They are: Feature, Scenario, Scenario Outline, Given, When, Then, etc.
What is step definition in Cucumber?
A step definition is a method definition in a programming language that is tagged with a regular expression that matches a step in the Gherkin feature file. When Cucumber executes the plain text, it will (for each step) look for a registered Step Definition with a matching Regexp. If it finds one, Cucumber will execute the method, passing all groups from the Regexp match as arguments to the method.
Explain Given, When, Then.
Gherkin follows a standard series of steps: Given > When > Then. GIVEN is a set of preconditions, WHEN is the action(s) taken by the user, and THEN is the expected outcome.
What is the difference between Scenario and Scenario Outline?
Scenario is one of the core Gherkin structures. Every scenario starts with the Scenario: keyword (or localized one), followed by an optional scenario title. Each feature can have one or more scenarios, and every scenario consists of one or more steps (given, when, then). Scenario Outlines allow us to more concisely express these examples through the use of a template with placeholders instead of copying and pasting scenarios to use different values which can quickly become tedious and repetitive. Scenario Outline must be followed by Examples.
What is the difference between Examples and data tables?
Tables are arguments to steps, and they are handy for specifying a larger data set - usually as input to a Given or as expected output from a Then. While syntactically they are identical to tables in Examples, they have a different purpose. With Examples, the value substituted for the placeholder changes with each subsequent run of the Scenario Outline, until the end of the Examples table is reached.
What is Background?
Backgrounds allows you to add some context to all scenarios in a single feature. A Background is like an untitled Scenario, containing a number of steps. The difference is when it is run: the Background is run before each of your Scenarios.