Fundamentals of Testing
Fundamentals of Testing
Hela Lajmi
Assistant Professor
IEEE Membership Developement chair at Tunisia Section
IEEE Intelligent Transportation Systems Chair
[email protected]
References
[1] https://www.cftl.fr/wp-content/uploads/2018/10/CTFL-Syllabus-
2018-FR.pdf
[2] https://www.istqb.org/
[3] http://istqbfoundation.wikidot.com/1#toc0
2
3
Outline and Learning Objectives
Part 6: Quizz
4
Overview
Chapter 1: Fundamentals of Testing The tester learns the basic principles related to
testing, the reasons why testing is required, what test objectives are, and the
principles of successful testing. The tester understands the test process, the major
test objectives are, and the principles of successful testing. The tester
understands the test process, the major activities, and work products.
5
6
Outline and Learning Objectives
Learning Objectives:
LO-1.1.1 Identify typical objectives of testing (K1)
LO-1.1.2 Differentiate testing from debugging (K2)
7
Typical Objectives of Testing
Testing Debugging
Tester Developer
Learning Objectives:
- Achievement of appropriate levels of quality - Provide confidence that the appropriate levels of quality will be
achieved.
- Test activities are part of the overall software - Quality Audits
development or maintenance
process.
- Testing contributes to the - The use of root cause analysis to detect and remove the causes of
achievement of quality in a variety of ways defects, along with the proper application of the findings of retrospective
meetings to improve processes, are important for effective
quality assurance.
18
Error - Fault - Failure
A person makes
an error or mistake ...
… that creates a
fault, defect or bug in the
software ...
Learning Objective:
LO-1.3.1 Explain the seven principles of testing (K2)
23
Testing principles : Principle 1 – Testing shows presence of defects, not their absence
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.
24
Testing principles : Principle 2 – Exhaustive testing is impossible (1/5)
Prioritise tests
so that,
whenever you stop testing,
you have done the best testing
in the time available.
29
Testing principles : Principle 3 – Early testing
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”, the 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 potentially find more defects.
the higher the possibility of losses, the more we need to invest in testing
33
Testing principles : Principle 7 – Absence-of-errors is a fallacy
Finding and fixing defects does not help if the system built
is unusable and does not fulfil the users’ needs and
expectations.
Learning Objectives:
LO-1.4.1 Explain the impact of context on the test process (K2)
LO-1.4.2 Describe the test activities and respective tasks within the test process (K2)
LO-1.4.3 Differentiate the work products that support the test process (K2)
LO-1.4.4 Explain the value of maintaining traceability between the test basis and the test work products (K2)
Test Process in Context 35
Contextual factors that could influence the test process for an organization:
Business domain
Test Process in Context 36
Timescales
Complexity
…
3734
Fundamental Test Process
38
Fundamental Test Process
39
Test planning and control
Test planning is the activity of verifying the mission of testing, defining the
objectives of testing and the specification of test activities in order to meet
the objectives and mission.
Test analysis and design is the activity where general testing objectives are transformed
Identifying and prioritizing test conditions based on analysis of test items, the
Identifying necessary test data to support the test conditions and test cases.
Developing and prioritizing test procedures, creating test data and, optionally, preparing
test harnesses and writing automated test scripts.
Creating test suites from the test procedures for efficient test execution.
Executing test procedures either manually or by using test execution tools, according to the
planned sequence.
43
Test implementation and execution (2/2)
Reporting discrepancies as incidents and analyzing them in order to establish their cause
(e.g. a defect in the code, in specified test data, in the test document, or a mistake in the
way the test was executed).
44
Test implementation and execution (2/2)
Repeating test activities as a result of action taken for each discrepancy. For example,
reexecution 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).
45
Evaluating exit criteria and reporting
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.
Checking which planned deliverables have been delivered, the closure of incident
reports or raising of change records for any that remain open, and the documentation
of the acceptance of the system.
Finalizing and archiving testware, the test environment and the test infrastructure for
later reuse.
Test conditions should be able to be linked back to their sources in the test basis,
this is known as traceability.
Traceability can be horizontal through all the test documentation for a given test
level (e.g. system testing, from test conditions through test cases to test scripts)
or it can be vertical through the layers of development documentation (e.g.
from requirements to components).
50
What does good traceability support ?
Relating the technical aspects of testing to stakeholders in terms that they can
understand
Providing information to assess product quality, process capability, and project
progress against business goals
52
Outline and Learning Objectives
Learning Objectives:
LO-1.5.1 Identify the psychological factors that influence the success of testing (K1)
LO-1.5.2 Explain the difference between the mindset required for test activities and the mindset required
for development activities (K2)
The Psychology of Testing 53
Testers and test managers need to have good interpersonal skills to be able to communicate effectively about
defects, failures, test results, test progress, and risks, and to build positive relationships with colleagues.
Ways to communicate :
Start with collaboration rather than battles. Remind everyone of the common goal of better-quality systems.
Emphasize the benefits of testing. For example, for the authors, defect information can help them
improve their work products and their skills. For the organization, defects found and fixed during testing will
save time and money and reduce overall risk to product quality.
Communicate test results and other findings in a neutral, fact-focused way without criticizing the
person who created the defective item. Write objective and factual defect reports and review findings.
Try to understand how the other person feels and the reasons they may react negatively to the information.
Confirm that the other person has understood what has been said and vice versa.
54
Outline and Learning Objectives
Quizz
55
Q1 : Keywords Chapter 1
Which one of the statements below describes a failure discovered during testing or in
production?
a) The product crashed when the user selected an option in a dialog box.
b) The wrong version of one source code file was included in the build.
c) The computation algorithm used the wrong input variables.
d) The developer misinterpreted the requirement for the algorithm.
Which of the following statements CORRECTLY describes one of the seven key
principles of software testing?
Which of the below tasks is performed during the test analysis activity of the test
process?
Differentiate the following test work products,1-4, by mapping them to the right
description, AD.
Test suite : Syllabus 1.4.3 for Test implementation: Test implementation work products
also include test suites, which are groups of test scripts, as well as a test execution
schedule. (1A).
Test case : A set of input values, execution preconditions, expected results and execution
postconditions…. (2C).
Test script : Glossary test script, A set of instructions for the automated execution of test
procedures (3B).
Test procedure : Document specifying a sequence of actions for the execution of a test.
Also known as test script or manual test script
Test policy : high level document that describes the principles / approch and major
objectives.
Test plan : A document describing the scope / approach / ressources and schedule of test
activities. It identifies the test items / the features to be tested / test tasks and
responsabilities / tester independence level / test environnement / test design
techniques / entry and exit criteria
Test Harness : Test harness execute tests, by using a test library and generates a report. It
requires that your test scripts are designed to handle different test scenarios and test
data. It provides stubs and drivers which are small programs that interact with the
software under test.