Showing posts with label Certified Tester Foundation Level. Show all posts
Showing posts with label Certified Tester Foundation Level. Show all posts

Sunday, 16 December 2018

Chapter 2 : Testing Throughout the software Life cycle

Testing Throughout the software Life cycle

Chapter 2: Testing Throughout the software Life cycle

We will cover the following topics in this chapter.

  • 2.1 Software Development Models (U)
  • 2.2 Test Levels (U)
  • 2.3 Test Types (U)
  • 2.4 Maintenance Testing(U)

2.1 Software Development Models

Testing does not exist in isolation;test activities are related to software development activities.Different development life cycle models need different approaches to testing.

2.1.1 V-model (Sequential Development Model

Generally V-model uses four test levels,corresponding to the four development levels. The four levels are:

  • Component (unit) testing
  • Integration testing
  • System testing
  • Acceptance testing

In real-time, a V-model may have more,fewer or different levels of development and testing,depending on the project and the software product.For example,there may be component integration testing after component testing,and system integration testing after system testing.

Software work products such as business scenarios or use cases,requirements specifications,design documents and code produced during development are often the basis of testing in one or more test levels.

2.1.2 Iterative-incremental Development Models

Iterative-incremental development is the process of establishing requirements, designing, building,and testing a system in a series of short development cycles. Examples for Iterative and incremental models are: prototyping,Rapid Application Development (RAD), Rational Unified Process (RUP) and agile development models.

A system that is produced using these models may be tested at several test levels during each iteration.An increment,added to others developed previously, forms a growing partial system,which should also be tested. Regression testing is increasingly important on all iterations after the first one. Verification and Validation can be carried out one each increment.

2.1.3 Testing Within a Life Cycle Model

In any life cycle model,there are several characteristics of good testing:

  • For every development activity there is a corresponding testing activity
  • Each test level has test objectives specific to that level
  • The analysis and design of tests for a given test level should begin during the corresponding development activity
  • Testers should be involved in reviewing documents as soon as drafts are available in the development life cycle

Test levels can be combined or reorganized depending on the nature of the project or the system architecture.

2.2 Test Levels

Based on the test objective( main purpose of testing) and test object(what is being tested) test levels can be classified as below.

  • 2.2.1 Component Testing (U)
  • 2.2.2 Integration Testing (U)
  • 2.2.3 System Testing (U)
  • 2.2.4 Acceptance Testing (U)

In this section, we will discussion on the each of the above test levels.

2.2.1 Component Testing

Component testing (also known as unit, module or program testing) searches for defects in, and verifies the functioning of, software modules, programs, objects, classes, etc; that are separately testable. It may be done in isolation from the rest of the system, depending on the context of the development life cycle and the system. Stubs, drivers and simulators may be used.

Component testing may include testing of functionality and specific non-functional characteristics, such as resource-behavior (ex: searching for memory leaks) or robustness testing, as well as structural testing (ex:, decision coverage). Test cases are derived from work products such as a specification of the component, the software design or the data model.

Typically, component testing occurs with access to the code being tested and with the support of a development environment, such as a unit test framework or debugging tool. In practice, component testing usually involves the programmer who wrote the code. Defects are typically fixed as soon as they are found, without formally managing these defects.

One approach to component testing is to prepare and automate test cases before coding. This is called a test-first approach or test –driven development. This approach is highly iterative and is based on cycles of developing test cases, then building and integrating small pieces of code, and executing the component tests correcting any issues and iterating until they pass.

Test basis(reference) for component testing are: Component requirements, design, code.

Typical test objects tested during component testing are: Components, Programs, Database modules.

2.2.2 Integration Testing

Integration testing tests interfaces between components, interactions with different parts of a system, such as the operating system, file system and hardware, and interfaces between systems.

There may be more than one level of integration testing and it may be carried out on test objects of varying size as follows:

  • Component integration testing tests the interactions between software components and is done after component testing.
  • System integration testing tests the interactions between different systems or between hardware and software and may be done after system testing.

The greater the scope of integration, the more difficult it becomes to isolate defects to a specific component or system, which may lead to increased risk and additional time for troubleshooting.

Systematic integration strategies may be based on the system architecture (such as top-down and bottom-up), functional tasks, transaction processing sequences, or some other aspect of the system or components. In order to ease fault isolation and detect defects early, integration should normally be incremental rather than “big bang”.

Testing of specific non-functional characteristics such as performance may be included in integration testing as well as function testing.

At each stage of integration, testers concentrate solely on the integration itself. For example, if they are integrating module A with module B they are interested in testing the communication between the modules, not the functionality of the individual module as that was done during component testing. Both function and structural approaches may be used.

Ideally, testers should understand the architecture and influence integration planning. If integration tests are planned before components or systems are built, those components can be built in the order required for most efficient testing.

Test basis(reference) for integration testing are: Software and system design, Architecture, Use cases, Workflows

Typical test objects tested during integration testing are: Subsystems, Infrastructure, Database implementation, Interfaces, System configuration, Configuration data

2.2.3 System Testing

System testing is concerned with the behavior of a whole system or product.

In system testing, the test environment should correspond to the final target or production environment as much as possible in order to minimize the risk of environment-specific failures not being found in testing.

System testing may include tests based on risks and/or on requirements specifications, business processes, use cases, or other high level test descriptions or modules of system behavior, interactions with the operating system, and system resources.

System testing should investigate functional and non functional requirements of the system, and data quality characteristics. Testers also need to deal with incomplete or undocumented requirements. System testing of functional requirements starts by using the most appropriate specification-based (black-box) techniques for the aspect of the system to be tested. For example, a decision table may be created for combinations of effects described in business rules. Structure-based techniques (white-box) may then be used to assess the thoroughness of the testing with respect to a structural element, such as menu structure or web page navigation. An independent test team often carries out system testing.

Test basis(reference) for System testing are: System and software requirement specification, Use cases, Functional specification, Risk analysis reports

Typical test objects tested during integration testing are: System, user and operation manuals, System configuration and configuration data

2.2.4 Acceptance Testing

Acceptance testing is often the responsibility of the customers or users of a system; other stakeholders may be involved as well.

The goal in acceptance testing is to establish confidence in the system, parts of the system or specific non-functional characteristics of the system. Finding defects is not the main focus in acceptance testing. Acceptance testing may assess the system’s readiness for deployment and use, although it is not necessarily the final level of testing.

Typical forms of acceptance testing include the following:

User acceptance testing

Typically verifies the fitness for use of the system by business users.

Operational (acceptance) testing

The acceptance of the system by the system administrators, including:

  • Maintenance tasks
  • Data load and migration tasks
  • Testing of backup/restore
  • Disaster recovery
  • User management
  • Periodic checks of security vulnerabilities

Contract and regulation acceptance testing

Contract acceptance testing is performed against a contract’s acceptance criteria for producing custom-developed software. Acceptance criteria should be defined when the parties agree to the contract. Regulation acceptance testing is performed against any regulations that must be adhered to, such as government, legal or safety regulations.

Alpha and beta (field) testing

Developers of market, or COTS, software often went to get feedback from potential or existing customers in their market before the software product is put up for sale commercially. Alpha testing is performed at the developing organization’s site but not by the developing team. Beta testing, or field-testing, is performed by customers or potential customers at their own locations.

Organization may use other terms as well, such as factory acceptance testing and site acceptance testing for systems that are tested before and after being moved to a customer’s site.

Test basis(reference) for Acceptance testing are: Use cases, User requirements, System requirements, Business processes, Risk analysis reports

Typical test objects tested during Acceptance testing are: Forms, Reports, User procedures, Business processes, Operational and maintenance processes

2.3 Test Types

A group of test activities can be aimed at verifying the software system (or part of a system) based on a specific reason or target for testing.

A test type is focused on a particular test objective, which could be any of the following:

  • A function to be performed by the software
  • A non-functional quality characteristic, such as reliability and usability
  • The structure or architecture of the software or system
  • Change related, i.e., confirming that defects have been fixed (confirmation testing) and looking for unintended changes (regression testing)

A model of the software may be developed and/or used in structural testing (e.g., a control flow model or menu structure model), non-function testing, (e.g., performance model, usability model security threat modeling), and function testing (e.g., a process flow model, a state transition model or a plain language specification).

2.3.1 Testing of Function (Functional Testing)

The functions that a system, subsystem or component are to perform may be described in work products such as a requirements specification, use cases, or a function specification, or they may be undocumented. The functions are “what the system does.

Functional tests are based on functions and features (described in documents or understood by the testers) and their interoperability with specific systems, and may be performed at all test levels (e.g., tests for components may be based on a component specification).

Specification-based techniques may be used to derive test conditions and test cases from the functionality of the software or system (see Chapter4). Function testing considers the external behavior of the software (black box testing).

A type of functional testing, security testing, investigates the functions (e.g., a firewall ) relating to detection of threats, such as viruses, from malicious outsiders. Another type of function testing , interoperability testing, evaluates the capability of the software product to interact with one or more specified components or systems.

2.3.2 Testing of Non-Functional Software Characteristics (Non-functional Testing)

Non-functional testing includes, but is not limited to, performance testing, load testing, stress testing, usability testing, maintainability testing, reliability testing, and portability testing, it is the testing of “how” the system works.

Non-function testing may be performed at all test levels. The term non-function testing describes the tests required to measure characteristics of systems and software that can be quantified on a varying scale, such as response times for performance testing. These tests can be referenced to a quality model such as the one defined in ‘Software Engineering-Software Product Quality’ (ISO 1926). Non-function testing considers the external behavior of the software and in most cases uses black-box test design techniques to accomplish that.

2.3.3 Testing of Software Structure/Architecture (Structural Testing)

Structural (white-box) testing may be performed at all test levels. Structural techniques are best used after specification-based techniques, in order to help measure the thoroughness of testing through assessment of coverage of a type of structure.

Coverage is the extent that a structure has been exercised by a test suite, expressed as a percentage of the items being covered. If coverage is not 100%, then more tests may be designed to test those items that were missed to increase coverage. Coverage techniques are covered in Chapter4.

At all test levels, but especially in component testing and component integration testing. Tools can be used to measure the code coverage of elements, such as statements or decisions. Structural testing may be based on the architecture of the system, such as a calling hierarchy.

Structural testing approaches can also be applied at a system, system integration or acceptance testing levels (e.g., to business models or menu structures).

2.3.4 Testing Related to Changes: Re-testing and Regression Testing

After a defect is detected and fixed, the software should be re-tested to confirm that the original defect has been successfully removed. This is called confirmation. Dubbing (locating and fixing a defect) is a development activity, not a testing activity.

Regression testing is the repeated testing of an already tested program. after modification, to discover any defects introduced or uncovered as a result of the change(s). These defects may be either in the software being tested, or in another related or unrelated software component. It is performed when the software, or its environment, is changed. The extent of regression testing is based on the risk of not finding defects in software that was working previously.

Tests should be repeatable if they are to be used for conformation testing and to assist regression testing.

Regression testing may be performed at all test levels, and includes functional, non-functional and structural testing. Regression test suites are run many times and generally evolve slowly, so regression testing is a strong candidate for automation

2.4 Maintenance Testing

Maintenance testing is a testing of the existing operational systems.

Once deployed, a software system is often in service for years or decades. During this time the system, its configuration data, or its environment are often corrected, changed or extended. The planning of releases in advance is crucial for successful maintenance testing. A distinction has to be made between planned releases and hot fixes. Maintenance testing is done on an existing operational system, and is triggered by modifications, migration, or retirement, of the software or system.

Modifications include planned enhancement changes, corrective and emergency changes, and changes of environment, such as planned operating system or database upgrades, planned upgrade of Commercial-Off-The-Shelf software, or patches to correct newly exposed or discovered vulnerabilities of the operating system.

Maintenance testing for migration (ex: form one platform to another) should include operational tests of the new environment as well as of the changed software. Migration testing (conversion testing) is also needed when data from another application will be migrated into the system being maintained.

Maintenance testing for the retirement of a system may include the testing of data migration or archiving if long data-retention periods are required.

In addition to testing what has been changed, maintenance testing includes regression testing to parts of the system that have not been changed. The scope of maintenance testing is related to the risk of the change, the size of the existing system and to the size of the change. Depending on the changes, maintenance testing may be done at any or all test levels and for any or all test types. Determining how the existing system may be affected by changes is called impact analysis, and is used to help decide how much regression testing to do. The impact analysis, may be used to determine the regression test suite.

Maintenance testing can be difficult if specifications are out of data or missing, or testers with domain knowledge are not available.


Practice Test on Chapter 2 : Testing Throughout the software Life cycle


Sunday, 25 March 2018

Chapter 1 : Fundamentals of Testing

Fundamentals of testing

Chapter 1 : Introduction and Fundamentals of Testing



Introduction

In this course from Chapter 1 to Chapter 8, we will cover the basics testing concepts. We will also cover the few questions and answers in the end of each chapter. These questions should help you clear various certification exams. Also in the chapter 8, we will cover the software testing interview questions and answers.

After learning this course it should help you to start career in testing and take your software testing knowledge to next level.

Start learning now. We wish you all the best.

Note: Following notations will indicate the learning objectives:

  • (R) : Remember
  • (U) : Understand
  • (Y) : Apply
  • (Z) : Analyze

In this Chapter we will discuss the following:

1.1 What is testing?

  • 1.1a. Objectives of Testing (R)
  • 1.1b. Testing Objectives at different stages of Software Development Life Cycle (U)
  • 1.1c. Debugging Vs Testing (U)

1.2 Why is testing necessary?

  • 1.2a. Software System Context (R)
  • 1.2b. Causes of Defects (U)
  • 1.2c. Role of Testing in Software Development maintenance and Operations (U)
  • 1.2d. Testing and Quality (U)
  • 1.2e. How much testing is enough? (U)

1.3 Principles of testing (U)

1.4 Fundamental Test Process

1.5 Psychology of Testing

1.6 Practice Questions and Answers

--------------------------------------------------------------------------------------------------------------------

1.1 What is Testing ? (U)

Testing is a process of identifying defects in software. Defect is also called as bug. It can also be defined as process of validating and verifying software program/product/application works as expected.

1.1a Objectives of Testing (R):

  • Preventing a defect
  • Finding a defect
  • Gaining a confidence about the level of quality
  • Providing information for decision making

Designing test early in the life cycle can help to prevent the defects being introduced into the code.

1.1b Testing Objectives at different stages of Software Development Life Cycle (U)

Different viewpoints in testing take different objectives into account.

  • Acceptance testing – to confirm system works as expected and to gain the confidence in the quality of the software.
  • Maintenance testing – testing that no new defects have been introduced during the development of changes.
  • Operations testing – to test the system characteristics such as reliability and availability.

1.1c Debugging Vs Testing (U)

Debugging:

Debugging is a process of identifying, analyzing and removing the cause of the failure. Debugging is a development activity. It is done by the developers.

Testing:

Testing is performed by the testers. Testing is activity of finding and reporting the defects in software. Re-testing is done after the defect is fixed to ensure that fix resolve the failure.

1.2 Why is testing necessary?

Testing is necessary to ensure that system is working as expected or working as per the requirement.

1.2a Software System Context (R)

Software systems are an integral part of life, from business applications (e.g., Insurance, Banking) to consumer products (e.g., motors, cars). People may have had an experience with software that did not work as expected. Software that does not work correctly can lead to many problems, including loss of money, time, business reputation, and could even cause injury or death.

1.2b Causes of Defects (U)

A human being can make an error (mistake), which produces a defect (fault, bug) in the program code, or in a document. If a defect in code is executed, the system may fail to do what it should do (or do something it shouldn’t), causing a failure. Defects in a software, systems or documents may result in failures, but not all defects do so.

Defects occur because human beings are fallible and because there is time pressure, complex code, complexity of infrastructure, changing technologies, and/or many system interactions.

Failures can be caused by environmental conditions as well. For example, radiation, magnetism, electronic fields, and pollution can cause faults in firmware or influence the execution of software by changing the hardware conditions.

1.2c Role of Testing in Software Development maintenance and Operations (U)

Rigorous testing of systems and documentation can help to reduce the risk of problems occurring during operation and contribute to the quality of the software system, if the defects found are corrected before the system is released for operational use.

Software testing may also be required to meet contractual or legal requirements, or industry –specific standards.

1.2d Testing and Quality (U)

With the help of testing, it is possible to measure the quality of software in terms of defects found, for both functional and non-functional software requirements and characteristics (e.g.,reliability,usability,efficiency,maintainability and portability).

Testing can give confidence in the quality of the software if it finds few or no defects. A properly designed test that passes reduces the overall level of risk in a system when testing does find defects, the quality of the software system increases when those defects are fixed.

Lessons should be learned from previous projects.By under standing the root causes of defects found in other projects,processes can be improved,which in turn should prevent those defects from reoccurring and,as a consequence,improve the quality of future systems.This is an aspect of quality assurance.

Testing should be integrated as one of the quality assurance activities (i.e., alongside development standards, training and defect analysis).

1.2e How much testing is enough? (U)

Deciding how much testing is enough should take account of the level of risk, including technical, safety, business risks, and project constraints such as time and budget.

Testing should provide sufficient information to stakeholders to make informed decisions about the release of the software or system being tested, for the next development step or handover to customers.

1.3 Principles of Testing(U)

There are 7 suggested testing principles. These are general guidelines evolved over the years.

Principle 1 –Testing shows presence of defects

Testing can show that defects are present, but cannot prove that there are no defects. Testing reduces the probability of undiscovered defects remaining in the software but, even if no defects are found, it is not a proof of correctness.

Principle 2 –Exhaustive testing is impossible

Testing everything (all combinations of inputs and preconditions) is not feasible except for trivial cases. Instead of exhaustive testing, risk analysis and priorities should be used to focus testing efforts.

Principle 3- Early testing

To find defects early, testing activities shall be started as early as possible in the software or system development life cycle, and shall be focused on defined objectives.

Principle 4- Defect clustering

Testing effort shall be focused proportionally to the expected and later observed defect density of modules. A small number of modules usually contains most of the defects discovered during pre-release testing, or is responsible for most of the operational failures.

Principle 5- Pesticide paradox

If the same tests are repeated over and over again, eventually the same set of test cases will no longer find any new defects. To overcome this “pesticide paradox”, test cases need to be regularly reviewed and revised, and new and different tests need to be written to exercise different parts of the software or system to find potentially more defects.

Principle 6- Testing is context dependent

Testing is done differently in different contexts. For example, safety-critical software is tested differently from an e-commerce site.

Principle 7- Absence –of-errors fallacy

Finding and fixing defects does not help if the system built is unusable and does not fulfill the user’s needs and expectations.

1.4 Fundamental Test Process (R)

The fundamental test process consists of the following main activities:

  • Test planning and control
  • Test analysis and design
  • Test implementation and execution
  • Evaluating exit criteria and reporting
  • Test closure activities

These activities are logically sequential, however the activities in the process may overlap or take place concurrently depending the project and context of the system. We will discusses these activities one by one

1.4.1 Test Planning and control

Test planning is the activity of defining the objectives of testing and the specification of test activities in order to meet the defined objectives .

Test control is the ongoing activity of comparing actual progress against the plan,and reporting the status, including deviations from the plan.It involves taking actions necessary to meet the objectives of the project.In order to control testing,the testing activities should be monitored throughout the project.

1.4.2 Test Analysis and Design

Test analysis and design is the activity during which general testing objectives are transformed into tangible test conditions and test cases.

The test analysis and design activity has the following major tasks:

  • Reviewing the test basis (such as requirements,software integrity level (risk level),risk analysis reports,architecture,design,interface specifications)
  • Evaluating test ability of the test basis and test objects
  • Identifying and prioritizing test conditions based on analysis of test items,the specification,behavior and structure of the software
  • Designing and prioritizing high level test cases
  • Identifying necessary test data to support the test conditions and test cases
  • Designing the test environment setup and identifying any required infrastructure and tools
  • Creating bi-directional traceability between test basis and test cases

1.4.3 Test Implementation and Execution

Test implementation and Execution is the activity where test procedures or scripts are specified by combining the test cases in a particular order and including any other information needed for test execution,the environment is set up and the tests are run.

Test implementation and execution has the following major tasks:

  • Finalizing,implementing and prioritizing test cases including the identification of test data & test conditions.
  • Developing and prioritizing test procedures,creating test data and preparing test harnesses and writing automated test scripts.
  • Creating test suites from the test procedures for efficient test execution
  • Verifying that the test environment has been set up correctly
  • Verifying and updating bi-directional traceability between the test basis and test cases
  • Executing test procedures either manually or by using test execution tools,according to the planned sequence
  • Logging the outcome of test execution and recording the identities and versions of the software under test,test tools and testware.
  • Comparing actual results with expected results
  • Reporting discrepancies as incidents and analyzing them in order to establish their cause.
  • Repeating test activities as a result of action taken for each discrepancy,for example,re-execution of a test that previously failed in order to confirm a fix (confirmation testing), execution of a corrected test and/or execution of tests in order to ensure that defects have not been introduced in unchanged areas of the software or that defect fixing did not uncover other defects (regression testing)

1.4.4 Evaluating Exit Criteria and Reporting

Evaluating exit criteria is the activity where test execution is assessed against the defined objectives. This should be done for each test level.

Evaluating exit criteria has the following major tasks:

  • Checking test logs against the exit criteria specified in test planning
  • Assessing if more tests are needed or if the exit criteria specified should be changed
  • Writing a test summary report for stakeholders

1.4.5 Test Closure Activities

Test closure activities collect data from completed test activities to consolidate experience,testware,facts and numbers.Test closure activities occur at project milestones such as when a software system is released,a test project is completed (or cancelled),a milestone has been achieved,or a maintenance release has been completed.

Test closure activities include the following major tasks:

  • Checking which planned deliverables have been delivered
  • Closing incident reports or raising change records for any that remain open.
  • Documenting the acceptance of the system
  • Finalizing and archiving testware,the test environment and the test infrastructure for later reuse
  • Handing over the testware to the maintenance organization
  • Analyzing lessons learned to determine changes needed for future releases and projects
  • Using the information gathered to improve test maturity

1.5 The Psychology of Testing (U)

Background

The mindset to be used while testing and reviewing is different from that used while developing software. With the right mindset developers are able to test their own code, but separation of this responsibility to a tester is typically done to help focus effort and provide additional benefits,such as an independence view by trained and professional testing resources.Independent testing may be carried out at any level of testing.

A certain degree of independence (avoiding the author bias) often makes the tester more effective at finding defects and failures. Independence is not a replacement for familiarity and developers can efficiently find many defects in their own code. Several levels of independence can be defined as shown here from low to high:

  • Tests designed by the person(s)who wrote the software under test (low level of independence)
  • Tests designed by another person(s) (e.g.,from the development team)
  • Tests designed by a person(s) from a different organizational group (e.g.,an independence test team) or test specialists (e.g.,usability or performance test specialists)
  • Tests designed by a person(s) from a different organization or company (i.e.,outsourcing or certification by an external body)

People and projects are driven by objectives.people tend to align their plans with the objectives set by management and other stakeholders,for example,to find defects or to confirm that software meets its objectives.Therefore,it is important to clearly state the objectives of testing.

Identifying failures during testing may be perceived as criticism against the product and against the author.As a result,testing is often seen as a destructive activity,even though it is very constructive in the management of product risks.Looking for failures in a system requires curiosity,professional pessimism,a critical eye,attention to detail,good communication with development peers,and experience on which to base error guessing.

If errors,defects or failures are communicated in a constructive way,bad feelings between the testers and the analysts,designers and developers can be avoided.This applies to defects found during reviews as well as in testing.

The tester and test leader need good interpersonal skills to communicate factual information about defects,progress and risks in a constructive way. For the author of the software or document,defect information can help them improve their skills.Defects found and fixed during testing will save time and money later,and reduce risks.

Communication problems may occur,particularly if testers are seen only as messengers of unwanted news about defects.However,there are several ways to improve communication and relationships between testers and others:

  • Start with collaboration rather then battles-remind everyone of the common goal of better quality systems
  • Communicate findings on the product in a neutral,fact-focused way without criticizing the person who created it,for example,write objective and factual incident reports and review findings
  • Try to understand how the other person feels and why they react as they do
  • Confirm that the other person has understood what you have said and vice versa


Practice Test on Chapter 1: Fundamentals of Testing