Ilovepdf - Merged (1) - 1-504
Ilovepdf - Merged (1) - 1-504
Software Testing
Software Testing Introduction
20 th Century: 50 th -60 th
Mathematical Exhaustive
Debugging
Approach Testing
This is not the “Testing”, this is just some sort of activity during
the Development
2
20 th Century: 70 th
Both first attempts failed, but the basis for modern approaches
has been built
3
20 th Century: 80 th
4
20 th Century: 90 th
For the first time Software Testing looks a lot like today
5
21 st Century Beginning
6
Modern Situation
7
More About Our Days
8
The History of
Software Testing
Software Testing Introduction
Why Software
Testing is Important
and What to Test
Software Testing Introduction
For Individual Users (and B2C Businesses)
2
For Enterprise (and B2B Businesses)
3
For Everyone
4
What to Test: Main Testing Areas
We can test…
Literally EVERYTHING
5
What to Test: Main Testing Areas
We can test…
6
Why Software
Testing is Important
and What to Test
Software Testing Introduction
Soft Skills and Hard Skills
of Software Tester
Enhanced responsibility
Good communication skills
Presentation skills
Performance and goal oriented approach
Observation and attentiveness to details
Flexible thinking and ability to learn fast
Good abstract and analytical thinking
Tendency to experimenting
2
Hard Skills
Good English
General IT knowledge
4
Soft Skills and Hard Skills
of Software Tester
Quality
Quality
Management Testing
Quality Quality
Assurance Control
2
Testing and Quality by Example
Quality
Healthy Patient
Quality
Management
Treatment
Quality Quality
Assurance Control
Medication and Ongoing
Procedures Diagnostics
3
Testing and Quality Read and remember!
4
Testing and Quality Read and remember!
5
Defect, Expected Result, Actual Result
Expected result
Defect
Actual result
6
Defect, Expected Result, Actual Result Read and remember!
7
Defect Report: Sample
8
Checklist, Test Case, Test Suite
Checklist
Test Cases
Test Suites
9
Checklist, Test Case, Test Suite Read and remember!
10
Checklist: Sample
11
Test Case: Sample
12
Test Suite: Sample
13
Please, visit this URL
https://glossary.istqb.org
14
Basic Software
Testing Terminology
Software Testing Introduction
Software
Development Models
and Testing
Software Testing Introduction
Disclaimer
2
Waterfall
General Planning
User Requirements
System Requirements
Technical Architecture
Detailed Design
Final Reporting
3
V-Model
4
Iterative Incremental Model
5
Agile Model
Sprint
(2-4 weeks)
Deliverable
6
And what about…
Spiral Model
With iterative models Testing not
only has dedicated stages, but fills
Prototype Model any other activities like air or
water.
7
Software
Development Models
and Testing
Software Testing Introduction
Software Testing
Lifecycle
Software Testing Introduction
General Overview General planning
and requirements
analysis
1 Acceptance criteria
establishment
Test results
reporting 2
Test results 8
analysis
Test strategy
3
establishment
7
6
4
Defect reporting
5 Test cases creation
Test cases
execution
2
General planning and requirements analysis
General planning
and requirements
analysis
Here we have to find out: what to test; how much work is ahead;
what difficulties we may face; do we have all necessary resources; are
requirements good enough.
3
Acceptance criteria establishment
Acceptance criteria
establishment
Test strategy
establishment
6
Test cases execution and defect reporting
Defect reporting
Testing
Functional Non-Functional
Requirements Requirements
Classification by…
Static testing Manual
Code execution Automation level
Dynamic testing Automated
Unit testing
4
General Classification Approach: There Is Much More!
Please, visit:
http://svyatoslav.biz/urls/stc_en/
5
Classification by code execution
Classification by…
Static testing Manual
Code execution Automation level
Dynamic testing Automated
Unit testing
6
Classification by code execution Read and remember!
Static testing
Code execution
Dynamic testing
7
… by access to application code … Read and remember!
White-box testing
Access to application
code and architecture
Black-box testing
Gray-box testing
Unit testing
10
… by functions under test importance Read and remember!
Extended testing
By functions under test
importance
Critical path testing
Smoke testing
Smoke test – a subset of all defined test cases that cover the main
functionality of a component or system, the most crucial functions.
Critical path test – test cases that cover the functionality used most of
the time by the majority of users.
Extended test – test cases that cover the “nice-to-have” functionality
(not used most of the time by the majority of users).
11
… by ways of dealing with application Read and remember!
Positive testing
By ways of dealing with
application
Negative testing
12
Let’s look at the big picture one more time…
Classification by…
Static testing Manual
Code execution Automation level
Dynamic testing Automated
Unit testing
13
Software Testing
Classification
Software Testing Introduction
Test Planning and
Its Tasks and Goals
Software Testing Introduction
Main Definitions Read and remember!
2
Planning Tasks and Goals (part 1)
Designation of
Estimation of work Definition of schedule
resources and ways to
scope and complexity and milestones
acquire them
3
Why is Test Plan so important? General planning
and requirements
analysis
Acceptance
1
Test Plan is the criteria
establishment
basis for all further Test results
reporting 2
activities, it is a
8
map to the Test results
analysis
defined 3 Test strategy
establishment
7
destination, a
starting point to 6
4
the reporting and Defect reporting
so on and so 5 Test cases creation
4
Planning Tasks and Goals (part 2)
Get better results with Optimize resources See the progress at any
less effort usage, avoid waste given moment
Get better
Understand what to do
understanding between Cooperate better
in any situation
people
5
Test Planning and
Its Tasks and Goals
Software Testing Introduction
Test Plan
Sections
Software Testing Introduction
Main Definition Read and remember!
2
General Test Plan Sections Overview
Criteria Metrics
Resources …
3
Project scope and main goals Read and remember!
4
Requirements to be tested Read and remember!
6
Test strategy and approach Read and remember!
7
Criteria Read and remember!
8
Resources Read and remember!
E.g.: • Software: four virtual machines (two with Windows 10 Ent x64, two with
Linux Ubuntu 18 LTS x64), two PHP Storm licenses (latest version
available).
• Hardware: two standard workstations (8GB RAM, i7 3GHz).
9
Schedule Read and remember!
10
Roles and responsibilities Read and remember!
11
Risk evaluation Read and remember!
Risk evaluation – the list of risks that are likely to arise during
the project. For each risk there is a probability evaluation and
some options for resolving the situation.
There are a lot of typical risks (actual for every project) so no need to list such
risks here. This section is for risks specific (or even unique) to the project.
E.g.: • Personnel (low probability): if any team member is inaccessible, we can
contact the representatives of the “Cataloger” project to get a temporary
replacement (the commitment from the “Cataloger” PM John Smith was
received).
12
Documentation Read and remember!
13
Metrics Read and remember!
14
Test Plan
Sections
Software Testing Introduction
«File Converter» Project
Test Plan
SAMPLE
Project Documentation
EPAM Training Center: Software Testing Introduction Most Recent Update: 14.06.2019 10:12:23
«File Converter» Project
Contents
EPAM Training Center: Software Testing Introduction Most Recent Update: 14.06.2019 10:12:23
«File Converter» Project
2. Requirements to be tested
See referenced sections in “File Converter Requirements.docx”:
UR-1.*: smoke test.
UR-2.*: smoke test, critical path test.
UR-3.*: critical path test.
BR-1.*: smoke test, critical path test.
QA-2.*: smoke test, critical path test.
L-4: smoke test.
L-5: smoke test.
DS-*: smoke test, critical path test.
EPAM Training Center: Software Testing Introduction Most Recent Update: 14.06.2019 10:12:23
«File Converter» Project
5. Criteria
Acceptance criteria: 100% success of test cases on smoke test level and 90%
success of test cases on critical path test level (see “Test cases success
percentage” metric) if 100% of critical and major bugs are fixed (see “Overall defects
fixed percentage” metric). Final requirements coverage by tests (see “Requirements
coverage by tests” metric) should be at least 80%.
Testing start criteria: new build.
Testing pause criteria: critical path test must begin only after 100% success of test-
cases on the smoke test (see “Test cases success percentage”); test process may
be paused is with at least 25% test-cases executed there is at least 50% failure rate
(see “Stop-factor” metric).
Testing resumption criteria: more than 50% of bugs found during the previous
iteration are fixed (see “Ongoing defects fixed percentage” metric).
Testing finish criteria: more than 80% planned for the current iteration test cases are
executed (see “Test-cases execution percentage”).
6. Resources
Software: four virtual machines (two with Windows 10 Ent x64, two with Linux
Ubuntu 18 LTS x64), two PHP Storm licenses (latest version available).
Hardware: two standard workstations (8GB RAM, i7 3GHz).
Personnel:
o One senior developer with testing experience (100% workload during all
project time). Roles: team lead, senior developer.
o One tester with PHP knowledge (100% workload during all project time).
Role: tester.
Time: one workweek (40 work hours).
Finances: according to the approved budget.
7. Schedule
25.05 – requirements testing and finalizing.
26.05 – test-cases and scripts for automated testing creation.
27.05-28.05 – main testing stage (test-cases execution, defect reports creation).
29.05 – testing finalization, reporting.
9. Risk evaluation
Personnel (low probability): if any team member is inaccessible, we can contact the
representatives of the “Cataloger” project to get a temporary replacement (the
commitment from the “Cataloger” PM John Smith was received).
EPAM Training Center: Software Testing Introduction Most Recent Update: 14.06.2019 10:12:23
«File Converter» Project
Time (high probability): the customer has indicated a deadline of 01.06, therefore
time is a critical resource. It is recommended to do our best to complete the project
by 28.05 so that one day (29.05) remains available for any unexpected issues.
Other risks: no other specific risks have been identified.
10. Documentation
Requirements. Responsible person – tester, deadline – 25.05.
Test cases and defect reports. Responsible – tester, creation period – 26.05-28.05.
Test result report. Responsible person – tester, deadline – 29.05.
11. Metrics
Test cases success percentage:
𝑇 𝑆𝑢𝑐𝑐𝑒𝑠𝑠
𝑇 𝑆𝑃 = 𝑇 𝑇𝑜𝑡𝑎𝑙
∙ 100%, where
𝐹𝑇𝑃
𝐷𝐿𝑒𝑣𝑒𝑙 – overall defects fixation percentage by 𝐿𝑒𝑣𝑒𝑙 during all project lifetime,
𝐶𝑙𝑜𝑠𝑒𝑑
𝐷𝐿𝑒𝑣𝑒𝑙 – quantity of defects of 𝐿𝑒𝑣𝑒𝑙 fixed during all project lifetime,
𝐹𝑜𝑢𝑛𝑑
𝐷𝐿𝑒𝑣𝑒𝑙 – quantity of defects of 𝐿𝑒𝑣𝑒𝑙 found during all project lifetime.
𝐹𝐶𝑃
𝐷𝐿𝑒𝑣𝑒𝑙 – defects fixation percentage by 𝐿𝑒𝑣𝑒𝑙 (defects found in the previous build and fixed in the current build),
𝐶𝑙𝑜𝑠𝑒𝑑
𝐷𝐿𝑒𝑣𝑒𝑙 – quantity of defects of 𝐿𝑒𝑣𝑒𝑙 fixed in the current build,
𝐹𝑜𝑢𝑛𝑑
𝐷𝐿𝑒𝑣𝑒𝑙 – quantity of defects of 𝐿𝑒𝑣𝑒𝑙 found in the previous build.
EPAM Training Center: Software Testing Introduction Most Recent Update: 14.06.2019 10:12:23
«File Converter» Project
Stop-factor:
𝑌𝑒𝑠, 𝑇 𝐸 ≥ 25% && 𝑇 𝑆𝑃 < 50%
𝑆={ , where
𝑁𝑜, 𝑇 𝐸 < 25% || 𝑇 𝑆𝑃 ≥ 50%
𝑆 – decision to pause the testing process,
𝑇 𝐸 – current 𝑇 𝐸 value,
𝑇 𝑆𝑃 – current 𝑇 𝑆𝑃 value.
EPAM Training Center: Software Testing Introduction Most Recent Update: 14.06.2019 10:12:23
What is Requirement and
Why Requirements are
Important
Software Testing Introduction
Main Definitions Read and remember!
2
General Documentation Overview
3
Why Documentation Is Important
One of the
greatest
reasons for
the Failure is
here
4
Why Documentation Is Important
5
Why Documentation Is Important
Other
15%
Code
¾ of defects are 10%
Requirements
originated from 50%
documentation
Architecture
and Design
25%
6
What is Requirement and
Why Requirements are
Important
Software Testing Introduction
Ways of Requirements
Gathering – Part 1
Software Testing Introduction
General Overview
Meetings and
Interview Questioning
Brainstorming
2
Interview Read and remember!
Interview – the most common way of identifying requirements. Usually,
two main roles involved: interviewer (project specialist, BA) and
interviewee (customer representative or expert, user, etc.)
3
Meetings and Brainstorming Read and remember!
Meetings and Brainstorming – unlike with Interview, several people are
playing active role here to share information, discuss issues and be on
the same page immediately.
4
Questioning Read and remember!
Questioning (and questionnaires) – is a fast and easy way of gathering
and aggregation of information from thousands of respondents. When
organized properly, questioning brings a lot of useful results.
5
Observation Read and remember!
Observation – is a method that shows things you never hear about.
People are apt to lie (not only to others but to themselves), they forget
things, do not know things… But observation shows the truth.
6
Ways of Requirements
Gathering – Part 1
Software Testing Introduction
Ways of Requirements
Gathering – Part 2
Software Testing Introduction
General Overview
Meetings and
Interview Questioning
Brainstorming
2
Prototyping Read and remember!
Prototyping allows to use “something real” (not imaginary) both as (and
always these two ways): a) the source of the new information; b) real
material thing to discuss.
3
Modeling Read and remember!
Modeling is somehow similar to prototyping, but it (usually) does not
require “physical” development. A model may be mathematical one,
computational one and so on.
4
Documentation Analysis Read and remember!
Documentation analysis allows us to find issues with existing
project/product documentation and to get extra information (when
reading standards, manuals, books, etc.)
This method requires no special actions, tools, and so on: you may just
sit and read a document. Anytime you like. Anywhere you like.
Reading documentation makes you a better professional.
Sometimes with new data new questions rise (you have to write them
down for further discussion). Working alone increases the probability to
miss a defect or to create one.
5
Work with Focus Groups Read and remember!
Work with focus groups looks a lot like questioning except it involves in-
person communication, discussions, end-user involvement in beta-
testing, deep end-user participation in product development.
6
Self-(re)writing Read and remember!
Self-(re)writing is mostly a way not for gathering requirements, but for
formalizing them (because it’s extremely difficult to think for the
customer and somehow telepathically know his ideas ☺).
Sometimes it’s difficult to avoid adding your own ideas into the
Requirements. You can propose ideas but absolutely have to get the
approval from the Customer side.
7
Ways of Requirements
Gathering – Part 2
Software Testing Introduction
Requirements Levels
and Types
Software Testing Introduction
General Overview
2
Where to read MORE
3
Simplified Model
Business Requirements
Project Vision
User Requirements
Use-cases / user
stories
Non-Functional
Functional Requirements
Requirements
4
Business Requirements Read and remember!
E.g.: • We need a tool to display the most profitable currency exchange rate in real
time.
• It is necessary to increase by 2-3 times the number of tickets processed by one
operator per shift.
• It is necessary to automate the process of issuing invoices based on contracts.
5
User Requirements Read and remember!
E.g.: • The license agreement should be displayed on the user first login.
• The administrator should be able to view a list of all users currently
working in the system.
• When you first save a new article, the system should produce a request
to either save it as a draft or to publish it immediately.
6
Requirements Types Read and remember!
7
Functional Requirements Read and remember!
E.g.: • The application should check the remaining free space on the target
media during installation.
• The system should automatically backup data daily at the specified time.
• The user's email address must be verified against RFC822.
8
Non-Functional Requirements Read and remember!
E.g.: • The minimum “time to failure” must be >= 100 hours with simultaneous
continuous work of 1000 users.
• Under no circumstances the total memory used by the application should
exceed 2 GB.
• The font size for any label on the screen must support a range of 5-15 points.
9
Requirements Levels
and Types
Software Testing Introduction
Good Requirements
Properties – Part 1
Software Testing Introduction
General Overview
Obligation Up-to-date
Consistency Atomicity
Correctness and
Unambiguousness Completeness
verifiability
Traceability Feasibility
Ranked for…
Modifiability
2
Atomicity Read and remember!
Typical problems
• One requirement actually contains several independent requirements.
• The requirement allows discrepancies due to the grammatical features of
the language.
• Description of several independent situations combined into one
requirement.
3
Atomicity Read and remember!
4
Completeness Read and remember!
Typical problems
• There is no non-functional part of the requirement or link to the corresponding non-
functional requirement (e.g.: “passwords must be stored in encrypted form” - what is the
encryption algorithm?).
• Only a part of some enumeration is mentioned (e.g.: “export is carried out in PDF, PNG, etc.”
formats - what should we understand by “etc.”?).
• The references cited are ambiguous (e.g.: “see above” instead of “see section 123.45.b”).
5
Completeness Read and remember!
6
Consistency Read and remember!
Typical problems
• Contradictions within one requirement.
• Contradictions between two or more requirements, between a table and text, a
picture and text, a requirement and a prototype, etc.
• Incorrect terminology or different terms to refer to the same phenomenon.
7
Consistency Read and remember!
8
Unambiguousness Read and remember!
Typical problems
• Use of terms or phrases that allow subjective interpretation.
• Use of non-obvious or ambiguous abbreviations without decoding.
• Writing the requirement assuming that some parts are obvious to everybody by
default and therefore needs no explanation.
9
Unambiguousness Read and remember!
10
Unambiguousness Read and remember!
11
Good Requirements
Properties – Part 1
Software Testing Introduction
Good Requirements
Properties – Part 2
Software Testing Introduction
General Overview
Obligation Up-to-date
Consistency Atomicity
Correctness and
Unambiguousness Completeness
verifiability
Traceability Feasibility
Ranked for…
Modifiability
2
Obligation and up-to-date state Read and remember!
Typical problems
• The requirement was added for “why not” reason although there is no real need
for it.
• The requirement has wrong values for priority/importance properties.
• The requirement is outdated, but it has not been removed.
3
Obligation and up-to-date state Read and remember!
4
Feasibility Read and remember!
Typical problems
• So called “Gold plating” – requirements that are extremely expensive to
implement and at the same time almost useless for end users.
• Requirements that are technically unrealistic at the present level of technology.
• Unrealizable requirements (usually – requirements not to the product, but to the
user, environment, laws of physics and so on).
5
Feasibility Read and remember!
6
Traceability Read and remember!
Typical problems
• Requirements have no ids, not structured, don’t have a table of contents, don’t
have cross-references.
• No tools and/or techniques of requirements management were used during the
development of requirements.
• The set of requirements is incomplete, it is fragmented and has obvious “blind
spots".
7
Traceability Read and remember!
8
Modifiability Read and remember!
Typical problems
• Requirements are non-atomic and/or untraceable, therefore changes lead to
inconsistency.
• Requirements are initially contradictory, so changes (not related to eliminating
inconsistencies) only worsen the situation.
• Requirements are in an inconvenient form (e.g., requirements management tools
are not used, so the team has to work with dozens of huge text documents).
9
Modifiability Read and remember!
10
Good Requirements
Properties – Part 2
Software Testing Introduction
Good Requirements
Properties – Part 3
Software Testing Introduction
General Overview
Obligation Up-to-date
Consistency Atomicity
Correctness and
Unambiguousness Completeness
verifiability
Traceability Feasibility
Ranked for…
Modifiability
2
Rank for importance, stability, priority Read and remember!
Typical problems
No rank (or incorrect rank, or outdated rank) for importance, stability, priority
3
Rank for importance, stability, priority Read and remember!
4
Correctness and verifiability Read and remember!
Typical problems
As these properties follow from compliance with all of the above mentioned ones,
if any other “good property” is violated the requirement most likely becomes
incorrect and unverifiable.
5
Correctness and verifiability Read and remember!
6
General Overview
Obligation Up-to-date
Modifiability Atomicity
Correctness and
Traceability Completeness
verifiability
Unambiguousness Feasibility
Ranked for…
Consistency
7
The main idea!
8
Good Requirements
Properties – Part 3
Software Testing Introduction
Requirements
Testing Techniques
Software Testing Introduction
General Overview
Peer review
Asking questions
Writing check-lists
Visualization
2
Peer review Read and remember!
3
Peer review types
Walkthrough
Technical review
Formal inspection
Formal and systematical approach with a lot of specialists following special procedures
4
Asking questions
5
Asking questions
6
Writing check-lists
Ask yourself: “How shall I test this requirement? Are there tests
that show objectively that this requirement is implemented
correctly?”
If you have a lot of ideas in mind – that’s good, but not enough:
this requirement may be outdated, inconsistent and so on.
7
Visualization
8
Modeling and prototyping
Point «abstract» Ellypsoid
Shape
Triangle - x
- radiusA: var
- y Sphere
«abstract»
Shape2D Parallelepiped
Rectangle
«abstract»
+ getId() : var - sideA: var
- sideA: var Shape3D
+ getSquare() : var - sideB: var
ambiguous or completely
- sideB: var + rotate2Dimensional(var) : void - sideC: var
+ getId() : var
+ setId(var) : void
+ getId() : var + getSquare() : var
+ getId() : var
+ getSquare() : var + getVolume() : var
+ getSquare() : var
+ rotate2Dimensional(var) : void + rotate2Dimensional(var) : void
+ getVolume() : var
+ setId(var) : void + rotate3Dimensional(var, var, var) : void
+ rotate2Dimensional(var) : void
+ setId(var) : void
+ rotate3Dimensional(var, var, var) : void
Square
«interface»
- sideLength: var Rotation2D
Cube
+ rotate2Dimensional(var) : void
+ getId() : var - sideLength: var
Requirements
SAMPLE
Project Documentation
EPAM Training Center: Software Testing Introduction Most Recent Update: 15.03.2022 12:05:26
«File Converter» Project
Contents
EPAM Training Center: Software Testing Introduction Most Recent Update: 15.03.2022 12:05:26
«File Converter» Project
1. Project scope
Development of a tool to eliminate encoding multiplicity in text documents stored
locally.
2. Main goals
• Eliminate the necessity for manual detection and conversion of encoding in text
documents.
• Decrease document-processing time by the amount needed for manual encoding
detection and conversion.
4. Risks
• High complexity of accurate detection of text document initial encoding.
5. System characteristics
• SC-1: The application should be a console one.
• SC-2: The application should be developed using PHP (see L-1 for the explanation;
PHP-related details are described in DS-1).
• SC-3: The application should be a multi-platform one (taking into account L-4).
6. User requirements
• See also the use cases diagram below for details.
• UR-1: Start and stop of the application.
o UR-1.1: The application start should be performed by the following console
command: “php converter.phar SOURCE_DIR DESTINATION_DIR
[LOG_FILE_NAME]” (see DS-2.1 for parameters description, see DS-2.2, DS-
2.3, and DS-2.4 for error messages on any misconfiguration situation).
o UR-1.2: The application stop (shutdown) should be performed by applying
Ctrl+C to the console window, which holds the running application.
• UR-2: Configuration of the application.
o UR-2.1: The only configuration available is through command line parameters
(see DS-2).
o UR-2.2: Target encoding for text file conversion is UTF8 (see also L-5).
• UR-3: Application log.
o UR-3.1: The application should output its log both to the console and to a log-
file (see DS-4). Log file name should comply with the rules described in DS-
2.1.
EPAM Training Center: Software Testing Introduction Most Recent Update: 15.03.2022 12:05:26
«File Converter» Project
o UR-3.2: Log contents and format are described in DS-4.1, the application
reaction to log file presence/absence is described in DS-4.2 and DS-4.3
accordingly.
Application
Other functions are provided by
external tools and are NOT part of
the application
Configure the
application
Administrator
7. Business rules
• BR-1: The source directory and the destination directory
o BR-1.1: The source directory and the destination directory may NOT be the
same directory (see also DS-2.1 and DS-3.2).
o BR-1.2: The destination directory may NOT be inside the source directory or
any of its subdirectories (see also DS-2.1 and DS-3.2).
8. Quality attributes
• QA-1: Performance
o QA-1.1: The application should provide the processing speed of at least 5
MB/sec with the following (or equivalent) hardware: CPU i7, RAM 4 GB,
average disc read/write speed 30 MB/sec. See also L-6.
• QA-2: Resilience to input data
o QA-2.1: See DS-5.1 for the requirements to input file formats.
o QA-2.2: See DS-5.2 for the requirements to input file size.
o QA-2.3: See DS-5.3 for the details on application reaction on incorrect input
EPAM Training Center: Software Testing Introduction Most Recent Update: 15.03.2022 12:05:26
«File Converter» Project
file format.
9. Limitations
• L-1: The application should be developed using PHP as the Customer is going to
support the application with their own IT-department.
• L-2: See DS-1 for PHP version and configuration details.
• L-3: PHP setup and configuration process are out of this project scope and therefore
are NOT described in any product/project documentation.
• L-4: Multi-platform capabilities of the application are the next: it should work with
Windows and Linux assuming that proper PHP version (see DS-1.1) works there.
• L-5: The target encoding (UTF8) is fixed. There is no option to change it.
• L-6: The QA-1.1 may be violated in case of objective reasons (e.g., system overload,
low-performing hardware and so on).
EPAM Training Center: Software Testing Introduction Most Recent Update: 15.03.2022 12:05:26
«File Converter» Project
DS-4.1: The log format is the same for the console and the log file: YYYY-MM-DD
HH:II:SS operation_name operation_parameters operation_result.
DS-4.2: If the log-file is missing, a new empty one should be created
DS-4.3: If the log file exists, the application should append new records to its tail.
DS-5: File format and size
DS-5.1: The application should process input files in Russian and English languages
with the following encodings: WIN1251, CP866, and KOI8R.
Supported file formats (defined by extension) are:
• Plain Text (TXT).
• Hyper Text Markup Language Document (HTML).
• Mark Down Document (MD).
DS-5.2: The application should process files up to 50 MB (inclusive), the application
should ignore any file with the size larger than 50 MB.
DS-5.3: If a file with supported format (see DS-5.1) contains format-incompatible data,
such data may be damaged during file processing, and this situation should be treated as
correct application work.
EPAM Training Center: Software Testing Introduction Most Recent Update: 15.03.2022 12:05:26
Checklists
2
Example (famous “Triangle Task” by Glenford J. Myers)
Take a pause and write down your own ideas on how to test
such program.
3
Checklist example
4
General ideas
5
Checklists writing approaches
By requirements
By interface
6
Checklists
For more
details see
this
outstanding
book:
2
Basic definitions Read and remember!
3
Equivalence classes and boundary values: example
Take a pause and write down your own ideas on how to test
such function.
4
Equivalence classes and boundary values: example
Username requirements:
• Length: 3-20 symbols.
• Allowed symbols: numbers, underscores, English letters (in
upper and lower case).
5
Equivalence classes and boundary values: example
0 2 21
6
Equivalence classes and boundary values: example
Invalid
doesn’t work this way. decision.
Letters A-Z
Numbers Letters A-Z _ Letters a-z Letters a-z
48 57 65 90 95 97 122 Other symbols
Numbers
Underscore _
0 47 58 64 91 94 96 123 255
7
Equivalence classes and boundary values: example
9
Functional approach Read and remember!
10
Functional approach
12
Please read these books!
A lot (and lot, and lot!) of nice ideas on testing techniques you
can find in these books:
13
Basic Testing
Techniques
Software Testing Introduction
Test cases
2
Key test case fields
3
Key test case fields: general overview
UG_U1.12 A R97 Gallery Uploader File upload, name with 1. Upload window appears.
special symbols 2. Standard file selection
Preparations: create a dialog window appears.
non-empty file named 3. Chosen file name
#$%^&.jpg. appears in “File” field.
1. Click “Upload photo”. 4. File selection dialog
2. Click “Choose”. window closes, “File” field
3. Select the prepared contains full path to the
file from the list. selected file.
4. Click “OK”. 5. Uploaded file appears in
5. Click “Add to the the gallery contents list.
gallery”.
4
Key test case fields: general overview
5
Key test case fields: ID
UG_U1.12 A R97 Gallery Uploader File upload, name with 1. Upload window appears.
special symbols 2. Standard file selection
• Unique. Preparations: create a
non-empty file named
dialog window appears.
3. Chosen file name
ID
• Meaningful (if test #$%^&.jpg.
management toolappears allows).in “File” field.
1. Click “Upload photo”. 4. File selection dialog
2. Click “Choose”. window closes, “File” field
3. Select the prepared contains full path to the
file from the list. selected file.
4. Click “OK”. 5. Uploaded file appears in
5. Click “Add to the the gallery contents list.
gallery”.
6
Key test case fields: priority
Priority
• Shows how important this test case is.
UG_U1.12 A • Represented
R97 Gallery UploaderbyFile
letters
upload, (A,
nameB, C, D,1.E),
with numbers
Upload window appears.
special symbols 2. Standard file selection
(1, 2, 3, 4, 5), words («extremely
Preparations: create a high»,
dialog «high»,
window appears.
«medium», «low», «extremely
non-empty file named low») orfile
3. Chosen anyname
#$%^&.jpg. appears in “File” field.
other convenient way.
1. Click “Upload photo”. 4. File selection dialog
• Correlated with:2.3. Click “Choose”.
Select the prepared
window closes, “File” field
contains full path to the
• the requirementfile fromimportance;
the list. selected file.
• potential severity
4. Click “OK”.
of a defect
5. Click “Add to the
5. Uploaded file appears in
that this test
the gallery contents list.
case may detect.
gallery”.
7
Key test case fields: related requirement
Related requirement
8
Key test case fields: module and submodule
10
Key test case fields: preparations
12
Key test case fields: general overview
13
Useful ideas
14
Useful ideas
15
Useful ideas
17
Test cases
Obligation Up-to-date
Modifiability Atomicity
Correctness and
Traceability Completeness
verifiability
Unambiguousness Feasibility
Ranked for…
Consistency
2
A little step aside: let’s consider good requirements properties
Obligation Up-to-date
Modifiability Atomicity
Correctness and
Traceability Completeness
verifiability
Unambiguousness Feasibility
Ranked for…
Consistency
3
And there are more specific properties
… too specific
Somewhere between…
… too general
… too simple
Somewhere between…
… too complex
… independent …
Either… or…
… reasonably linked …
4
Somewhere between being too specific or too general
1. Enter 10 to the 3. The “C” field 1. Check that the 1. The app adds
“A” field. contains 25. app adds two two numbers
2. Enter 15 to the numbers properly. properly.
“B” filed.
3. Click the “Add”
button.
5
Somewhere between being too specific or too general
1. Enter 10 to the 3. The “C” field 1. Check that the 4. The app adds
“A” field. contains 25. app adds two two numbers
2. Enter 15 to the numbers properly. properly.
“B” filed.
3. Click the “Add”
button.
6
Somewhere between being too specific or too general
Balanced:
• we are not tied to specific values (so each time we use different ones);
• we know exactly how to check the result (no guessing needed);
• we reduce the time to write and support the test case by referring its own steps;
• we have the list of values we particularly interested in.
7
Between being too simple or too complex Read and remember!
A simple test case operates with single object (or the main
object is obvious), it contains a small number of trivial actions.
8
Somewhere between being too simple or too complex
9
Somewhere between being too simple or too complex
Easy to understand
Too simple test cases are nothing
Easy to execute more than a step (or several steps) of
more complex test cases. That’s why
Easy to see the defects such extremely simple test cases are
useless.
Found defects are obvious
10
Somewhere between being too simple or too complex
More chances to break something Too complex test cases take a lot of
time to write and maintain. And they
More similar to real user actions
often need huge maintenance with
Developers rarely test such things each application change.
… too specific
Somewhere between…
… too general
… too simple
Somewhere between…
… too complex
… independent …
Either… or…
… reasonably linked …
2
Either independent or reasonably linked Read and remember!
3
Either independent or reasonably linked
Work if some other test cases fail May produce some redundancy
4
Either independent or reasonably linked
Start work from the point where If previous test case fails, all next-in-
previous test case ends chain test cases fail too
5
Some more useful ideas about good test cases…
6
Some more useful ideas about good test cases…
File saving
1. Open “File -> Print”.
2. …
7
Some more useful ideas about good test cases…
What for?!
…
3. Open “File -> Print” dialog.
4. Click several times in random places of the
windows.
…
8
Some more useful ideas about good test cases…
10
Some more useful ideas about good test cases…
…
3. Upload the file with the following name
“%^##76 / // \ ^^ [ ] : .jpg” as user avatar.
…
11
Good Test Cases
Properties – Part 2
Software Testing Introduction
Test Suites
Usually test suites are sets of test cases selected with some
common goal or on some common basis.
2
Test Suites creation logic
3
Test Suites: free sets and linked sets Read and remember!
Free Linked
4
Test Suites: free sets and linked sets
Free Linked
5
Test Suites
EPAM Training Center: Software Testing Introduction Most Recent Update: 14.06.2019 10:48:27
«File Converter» Project
Contents
1. Stage 1: read and improve the requirements ................................................................. 3
2. Stage 2: checklist creation logic and checklist sample................................................... 3
2.1. Basic functions ........................................................................................................ 3
2.2. Functions used by most users in their daily work .................................................... 3
2.3. Remaining functions ................................................................................................ 5
3. Stage 3: test cases sample ............................................................................................ 6
4. Stage 4: test suites sample ............................................................................................ 9
EPAM Training Center: Software Testing Introduction Most Recent Update: 14.06.2019 10:48:27
«File Converter» Project
Requirements
Sample.docx
Let’s use the logic of splitting application functions according to their degree of
importance:
Basic functions (i.e., the most important ones; failure with these functions make the
application unusable).
Functions used by most users in their daily work.
Remaining functions (a variety of "little things"; failure with these function do not really
affect the value of the application for the end user).
A very common question here is: can we copy here some ideas from the previous
level? The answer is “yes and no at the same time”. “No” because it doesn’t make sense to
repeat the same checks. “Yes” because any idea can be expanded and provided with
additional details.
EPAM Training Center: Software Testing Introduction Most Recent Update: 14.06.2019 10:48:27
«File Converter» Project
EPAM Training Center: Software Testing Introduction Most Recent Update: 14.06.2019 10:48:27
«File Converter» Project
The time has come to pay attention to various potential problems that may hardly
trouble the user, but formally such problems are still application defects.
Configuration and start:
o Values for SOURCE_DIR, DESTINATION_DIR, LOG_FILE_NAME:
In different styles (Windows-like + *nix-like): one value in one style and
the other value in another style at the same time.
UNC-names.
LOG_FILE_NAME inside SOURCE_DIR.
LOG_FILE_NAME inside DESTINATION_DIR.
o Log file size at the application start:
2–4 GB.
4+ GB.
o Start of two (and more) copies of the application:
With the same SOURCE_DIR, DESTINATION_DIR,
LOG_FILE_NAME.
With the same SOURCE_DIR and LOG_FILE_NAME, but different
DESTINATION_DIR.
With the same DESTINATION_DIR and LOG_FILE_NAME, but
different SOURCE_DIR.
File processing:
o File of valid supported format containing text in two or more encodings.
o Input file size:
2–4 GB.
4+ GB.
EPAM Training Center: Software Testing Introduction Most Recent Update: 14.06.2019 10:48:27
3. Stage 3: test cases sample
Here we have only some test-cases samples (in real life there will be hundreds of test cases).
EPAM Training Center: Software Testing Introduction Most Recent Update: 14.06.2019 10:48:27
«File Converter» Project
EPAM Training Center: Software Testing Introduction Most Recent Update: 14.06.2019 10:48:27
«File Converter» Project
EPAM Training Center: Software Testing Introduction Most Recent Update: 14.06.2019 10:48:27
4. Stage 4: test suites sample
Imagine we have the set of the following tests:
EPAM Training Center: Software Testing Introduction Most Recent Update: 14.06.2019 10:48:27
Focusing on
Important Things
Software Testing Introduction
Closer look to some familiar things…
2
Closer look to some familiar things…
3
So, the Quality is…
4
How to deliver the value
5
What to do and what not to do? Applying common sense.
6
What to do and what not to do? Applying common sense.
7
What to do and what not to do? Applying common sense.
8
What to do and what not to do? Applying common sense.
9
What to do and what not to do? Applying common sense.
8. File system:
• FAT16, FAT32, NTFS4, NTFS5, ext3fs, ext4fs;
• raiserfs (?), FS for MacOS (???);
• Check each of the FSs under different OSs.
9. Location:
• On a local drive.
• On a network:
+ Network folder.
+ Mounted network drive.
10
What to do and what not to do? Applying common sense.
O! M! G!
According to the most pessimistic estimations this testing process may take
several months. But we only have 30 minutes!
11
What to do and what not to do? Applying common sense.
12
What to do and what not to do? Applying common sense.
3. Output (in txt-file and HTML-file): For such a “huge” project it is enough to
• Output data correctness: just look at the output results.
+ Encodings.
+ The names of different files in different encodings.
• Output data validity:
+ HTML compliance to the standards.
13
What to do and what not to do? Applying common sense.
14
What to do and what not to do? Applying common sense.
15
What to do and what not to do? Applying common sense.
8. File system:
• FAT16, FAT32, NTFS4, NTFS5, ext3fs, ext4fs;
• raiserfs (?), FS for MacOS (???);
• Check each of the FSs under different OSs.
9. Location:
• On a local drive.
• On a network:
+ Network folder. Run the application from a virtual
+ Mounted network drive. machine or from another PC in the LAN.
16
What to do and what not to do? Applying common sense.
17
So, the Quality is…
1. Enter «abc».
2. Enter «%^#^#^%$&^#^^#&^^%$%#^#&^».
3. Enter «; delete from `users`; -- »
4. Leave the field empty.
3
BAD! Don’t do such things!
WHAT?! IS?!
THIS?!
Positive tests?
1. Enter «abc».
No…
2. Enter «%^#^#^%$&^#^^#&^^%$%#^#&^».
3. Enter «; delete from `users`; -- »
4. Leave the field empty. Button click?
What is the purpose No…
of this form?!
4
BAD! Don’t do such things!
Test 1
open http://site.com/subscribe/
Test 2
verifyElementNotPresent //form
Test 3
type //input $%@%^#$%$%^^
5
BAD! Don’t do such things!
This is
Test 1
insanity…
open http://site.com/subscribe/
Test 2
verifyElementNotPresent //form
Test 3
type //input $%@%^#$%$%^^
6
Three mortal sins in testing
7
Good! Still may be improved, but really good!
What is this?
9
What to do and what not to do? Applying common sense.
10
Good Test Cases with
Four Questions
Software Testing Introduction
Defects and
Defect Reports
Software Testing Introduction
Definitions
Expected result
Defect
Actual result
2
Definitions Read and remember!
3
More scientific technical approach Read and remember!
4
Defect Report Read and remember!
5
It’s important!
6
It’s important!
7
It’s important!
8
Some simple logic
Before you write down a defect report, make sure you have
answers to the following questions
9
Defect Report Lifecycle
Deferred Declined
10
Defect Report Lifecycle
Reopened Closed
To be
declined
Deferred Declined
11
Defects and
Defect Reports
Software Testing Introduction
Defect Report
Fields – Part 1
Software Testing Introduction
Key defect report fields
Disclaimer: each and every bug tracking system has much more
fields to fill. There are different approaches in details, but now
we are going to review only KEY FIELDS that remains more or
less the same for past 3-4 decades.
2
Key defect report fields: general overview
Infinite loop on input file If an input file has the “read-only” attribute, the app can not 1. Place a valid file (size, type) into
19 move the processed file into the destination directory: so the the input directory.
with read-only attribute app processes the file again and again and thus falls into the 2. Set the “read-only” attribute on
infinite loop. this file.
3. Start the app.
Exp: the processed file is moved from the input directory to
the destination directory. Bug: the processing result
appears inside the destination dir
Act: the processed data (new file) appears inside the
(and the file is repeatedly updated
destination directory, but the original file is not deleted from
according to the last write time),
the input directory.
but the original file stays inside the
Req: DS-2.1. input directory.
Reproducibility
Severity Priority Symptom Workaround Comments Attachments
If the customer has no special plans for
Always Medium Normal Incorrect No using “read-only” attribute on files in the -
operation input directory, the Easiest solution is to
remove the attribute once it is detected.
3
Key defect report fields: ID
ID
Infinite loop on input file If an input file has the “read-only” attribute, the app can not 1. Place a valid file (size, type) into
19 move the processed file into the destination directory: so the the input directory.
with read-only attribute app processes the file again and again and thus falls into the 2. Set the “read-only” attribute on
infinite loop. this file.
• Unique. Exp: the processed file is moved from the input directory to
3. Start the app.
the destination directory. Bug: the processing result
• Meaningful (if bugAct:tracking
the processed datasystem allows).
(new file) appears inside the
appears inside the destination dir
(and the file is repeatedly updated
destination directory, but the original file is not deleted from
according to the last write time),
the input directory.
but the original file stays inside the
Req: DS-2.1. input directory.
4
Key defect report fields: summary
Summary
Infinite loop on input file If an input file has the “read-only” attribute, the app can not 1. Place a valid file (size, type) into
19 move the processed file into the destination directory: so the the input directory.
with read-only attribute app processes the file again and again and thus falls into the 2. Set the “read-only” attribute on
infinite loop. this file.
3. Start the app.
Exp: the processed file is moved from the input directory to
the destination directory. Bug: the processing result
• Answers questions:
Act: thewhat did
processed data (newhappen,
file) appears insidewhere
the did it happen,appears inside the destination dir
(and the file is repeatedly updated
destination directory, but the original file is not deleted from
and in what conditions did it happen.
the input directory.
according to the last write time),
but the original file stays inside the
Req: DS-2.1. input directory.
• Should at the same time:
• Provide as much information as possible.
• Be as short as possible.
Always Medium Normal Incorrect No Ifusing the customer has no special plans for
-
• Be easily distinguishable
“read-only” attribute on files in the
operation from other summaries. input directory, the Easiest solution is to
remove the attribute once it is detected.
5
Key defect report fields: description
Description
Infinite loop on input file If an input file has the “read-only” attribute, the app can not 1. Place a valid file (size, type) into
19 move the processed file into the destination directory: so the the input directory.
with read-only attribute app processes the file again and again and thus falls into the 2. Set the “read-only” attribute on
infinite loop. this file.
3. Start the app.
Exp: the processed file is moved from the input directory to
the destination directory. Bug: the processing result
appears inside the destination dir
Act: the processed data (new file) appears inside the
(and the file is repeatedly updated
destination directory, but the original file is not deleted from
according to the last write time),
the input directory.
but the original file stays inside the
Req: DS-2.1. input directory.
corresponding requirement. 6
Key defect report fields: steps to reproduce
Steps to reproduce
Infinite loop on input file If an input file has the “read-only” attribute, the app can not 1. Place a valid file (size, type) into
19 move the processed file into the destination directory: so the the input directory.
with read-only attribute app processes the file again and again and thus falls into the 2. Set the “read-only” attribute on
infinite loop. this file.
3. Start the app.
Exp: the processed file is moved from the input directory to
the destination directory. Bug: the processing result
appears inside the destination dir
Act: the processed data (new file) appears inside the
(and the file is repeatedly updated
destination directory, but the original file is not deleted from
according to the last write time),
the input directory.
but the original file stays inside the
Req: DS-2.1. input directory.
7
Key defect report fields: general overview
Infinite loop on input file If an input file has the “read-only” attribute, the app can not 1. Place a valid file (size, type) into
19 move the processed file into the destination directory: so the the input directory.
with read-only attribute app processes the file again and again and thus falls into the 2. Set the “read-only” attribute on
infinite loop. this file.
3. Start the app.
Exp: the processed file is moved from the input directory to
the destination directory. Bug: the processing result
appears inside the destination dir
Act: the processed data (new file) appears inside the
(and the file is repeatedly updated
destination directory, but the original file is not deleted from
according to the last write time),
the input directory.
but the original file stays inside the
Req: DS-2.1. input directory.
Reproducibility
Severity Priority Symptom Workaround Comments Attachments
If the customer has no special plans for
Always Medium Normal Incorrect No using “read-only” attribute on files in the -
operation input directory, the Easiest solution is to
remove the attribute once it is detected.
8
Defect Report
Fields – Part 1
Software Testing Introduction
Defect Report
Fields – Part 2
Software Testing Introduction
Key defect report fields: general overview
Infinite loop on input file If an input file has the “read-only” attribute, the app can not 1. Place a valid file (size, type) into
19 move the processed file into the destination directory: so the the input directory.
with read-only attribute app processes the file again and again and thus falls into the 2. Set the “read-only” attribute on
infinite loop. this file.
3. Start the app.
Exp: the processed file is moved from the input directory to
the destination directory. Bug: the processing result
appears inside the destination dir
Act: the processed data (new file) appears inside the
(and the file is repeatedly updated
destination directory, but the original file is not deleted from
according to the last write time),
the input directory.
but the original file stays inside the
Req: DS-2.1. input directory.
Reproducibility
Severity Priority Symptom Workaround Comments Attachments
If the customer has no special plans for
Always Medium Normal Incorrect No using “read-only” attribute on files in the -
operation input directory, the Easiest solution is to
remove the attribute once it is detected.
2
Key defect report fields: reproducibility
Reproducibility
3
Key defect report fields: severity
• Shows If an input
the
file has
damage
the “read-only”
thethedefect
attribute, app can not
causes.
1. Place a valid file (size, type) into
19 Infinite loop on input file
• Typical
with read-only attribute values are:
move the processed file into the destination directory: so the
app processes the file again and again and thus falls into the
the input directory.
2. Set the “read-only” attribute on
• Critical
infinite loop.
Exp: the processed file is moved from the input directory to
this file.
3. Start the app.
• Major
the destination directory.
Act: the processed data (new file) appears inside the
Bug: the processing result
appears inside the destination dir
(and the file is repeatedly updated
• Medium
destination directory, but the original file is not deleted from
the input directory.
according to the last write time),
but the original file stays inside the
• Minor
Req: DS-2.1. input directory.
Severity
If the customer has no special plans for
Always Medium Normal Incorrect No using “read-only” attribute on files in the -
operation input directory, the Easiest solution is to
remove the attribute once it is detected.
4
Key defect report fields: priority
• Normal
(and the file is repeatedly updated
destination directory, but the original file is not deleted from
according to the last write time),
the input directory.
but the original file stays inside the
• Low Req: DS-2.1. input directory.
Priority
If the customer has no special plans for
Always Medium Normal Incorrect No using “read-only” attribute on files in the -
operation input directory, the Easiest solution is to
remove the attribute once it is detected.
5
Key defect report fields: severity vs priority
Severity Priority
Shows, how dangerous the Shows, how quickly the
defect is defect should be fixed
6
Key defect report fields: symptom
Symptom
If the customer has no special plans for
Always Medium Normal Incorrect No using “read-only” attribute on files in the -
operation input directory, the Easiest solution is to
remove the attribute once it is detected.
7
Key defect report fields: workaround
Infinite loop on input file If an input file has the “read-only” attribute, the app can not 1. Place a valid file (size, type) into
19 move the processed file into the destination directory: so the the input directory.
with read-only attribute app processes the file again and again and thus falls into the 2. Set the “read-only” attribute on
infinite loop. this file.
3. Start the app.
• Shows, Exp:
if destination
the there is a way to achieve the
the processed file is moved from the input directory to
directory. desired
Bug: the processing result
appears inside the destination dir
result without being interrupted
file is not deleted fromby the defect.
Act: the processed data (new file) appears inside the
destination directory, but the original
(and the file is repeatedly updated
according to the last write time),
the input directory.
• Typical values
Req: DS-2.1. are: “yes”, “no”.
but the original file stays inside the
input directory.
Workaround
If the customer has no special plans for
Always Medium Normal Incorrect No using “read-only” attribute on files in the -
operation input directory, the Easiest solution is to
remove the attribute once it is detected.
8
Key defect report fields: comments
Infinite loop on input file If an input file has the “read-only” attribute, the app can not 1. Place a valid file (size, type) into
19 move the processed file into the destination directory: so the the input directory.
with read-only attribute app processes the file again and again and thus falls into the 2. Set the “read-only” attribute on
infinite loop. this file.
3. Start the app.
Exp: the processed file is moved from the input directory to
• Optional field.
the destination directory.
Act: the processed data (new file) appears inside the
Bug: the processing result
appears inside the destination dir
(and the file is repeatedly updated
• May contain any data useful to the process
destination directory, but the original file is not deleted from
the input directory. ofwrite time),
according to the last
but the original file stays inside the
bug fixing.
Req: DS-2.1. input directory.
Comments
If the customer has no special plans for
Always Medium Normal Incorrect No using “read-only” attribute on files in the -
operation input directory, the Easiest solution is to
remove the attribute once it is detected.
9
Key defect report fields: attachments
Infinite loop on input file If an input file has the “read-only” attribute, the app can not 1. Place a valid file (size, type) into
19 move the processed file into the destination directory: so the the input directory.
with read-only attribute app processes the file again and again and thus falls into the 2. Set the “read-only” attribute on
infinite loop. this file.
3. Start the app.
Exp: the processed file is moved from the input directory to
• Optional field.the destination directory.
Act: the processed data (new file) appears inside the
Bug: the processing result
appears inside the destination dir
Attachments
If the customer has no special plans for
Always Medium Normal Incorrect No using “read-only” attribute on files in the -
operation input directory, the Easiest solution is to
remove the attribute once it is detected.
10
Useful ideas
11
Key defect report fields: general overview
Infinite loop on input file If an input file has the “read-only” attribute, the app can not 1. Place a valid file (size, type) into
19 move the processed file into the destination directory: so the the input directory.
with read-only attribute app processes the file again and again and thus falls into the 2. Set the “read-only” attribute on
infinite loop. this file.
3. Start the app.
Exp: the processed file is moved from the input directory to
the destination directory. Bug: the processing result
appears inside the destination dir
Act: the processed data (new file) appears inside the
(and the file is repeatedly updated
destination directory, but the original file is not deleted from
according to the last write time),
the input directory.
but the original file stays inside the
Req: DS-2.1. input directory.
Reproducibility
Severity Priority Symptom Workaround Comments Attachments
If the customer has no special plans for
Always Medium Normal Incorrect No using “read-only” attribute on files in the -
operation input directory, the Easiest solution is to
remove the attribute once it is detected.
12
Defect Report
Fields – Part 2
Software Testing Introduction
Typical Defect
Reporting Mistakes
Software Testing Introduction
The defect report is a bad one if…
Really!? Such a
shame…
2
The defect report is a bad one if…
3
The defect report is a bad one if…
4
The defect report is a bad one if…
Description
Some s[censored] has happened again to this f[censored]
back-redirectors!
5
The defect report is a bad one if…
Description
….
P.S. What a stupid fool may fail with such simple feature
implementation?!
6
The defect report is a bad one if…
W7, Chr, EN
W10, FF, RU
7
The defect report is a bad one if…
Bad joke
8
The defect report is a bad one if…
9
The defect report is a bad one if…
10
The defect report is a bad one if…
Is it trifle?
11
Conclusion
The more “tricky” defect you found, the more time it may take
to deal with. But it saves much more time in the future.
12
Typical Defect
Reporting Mistakes
Software Testing Introduction
Defect Reporting
Recommendations
Software Testing Introduction
General idea…
All the next points are just variations of one synonymous series
Attentiveness Particularity
Thoroughness Nicety
Accuracy Scrupulousness
Exactness …
2
Follow this advice!
Bug: there is a redirection to the DBMS main administration page without additional
authentication.
3
Follow this advice!
Description
Wrong calculation of the total price of the order in the basket. It seems like
the last item in the list is processed twice.
Act: the “Total” field contains the prices sum + the price of the last item.
Exp: the “Total” field contains the exact sum of all prices of all items in the list.
Req: R892.34b/73.
4
Follow this advice!
STR
1. Clear cookies or create a fresh new user profile.
2. Open http://pathtoapplication/admin_login/
3. Change the current language to any different from default.
4. Authenticate with your domain credentials.
5. Perform a search for any dismissed employee (search has to return 2+ results).
5
Follow this advice!
6
Follow this advice!
Description
After re-authentication caused by logout after 10 minutes timeout, the each-minute
auto saving of current document stops working.
Act: the app either doesn’t auto save the document, or the auto saving process fails
with no error messages.
Exp: the app automatically saves the current document each minute, corresponding
hint appears for two seconds at the right top corner of the main app window.
Req: R1752.2a/4.
7
Follow this advice!
Summary
[XP, IE6, ru] JQuery fails to initialize.
8
Follow this advice!
Summary
The license agreement main page contains 72 typos.
9
Follow this advice!
But! If you are absolutely sure you found one defect with
several indications, you can write one defect report and
provide the list of indications in the Description field.
10
Follow this advice!
Make the root cause analysis. Try to find the real cause of the
defect. Don’t stop with only system behavior description.
Comments
According to the symptoms, the performance falls to almost zero once the DB
size reaches 70-80% of the RAM. It seems that the app tries to load all the DB
into the RAM, while it really needs only 3-5% of records.
11
Follow this advice!
Even better: we can try to adjust our DAO-layer not to buffer “ahead data”. See the
description of the similar problem here: http://habr.com/articles/art97234/
12
Follow this advice!
The less time has passed, the more details you remember.
13
Follow this advice!
14
Follow this advice!
It’s likely that you yourself will verify that the defect is fixed. So
writing a good defect report now saves the future you a lot of
time and effort.
15
Follow this advice!
Use spellchecking…
Attentiveness Particularity
Thoroughness Nicety
Accuracy Scrupulousness
Exactness …
16
Defect Reporting
Recommendations
Software Testing Introduction
«File Converter» Project
EPAM Training Center: Software Testing Introduction Most Recent Update: 14.06.2019 10:50:48
Defect report sample 1:
EPAM Training Center: Software Testing Introduction Most Recent Update: 14.06.2019 10:50:48
«File Converter» Project
EPAM Training Center: Software Testing Introduction Most Recent Update: 14.06.2019 10:50:48
«File Converter» Project
EPAM Training Center: Software Testing Introduction Most Recent Update: 14.06.2019 10:50:48
«File Converter» Project
EPAM Training Center: Software Testing Introduction Most Recent Update: 14.06.2019 10:50:48
Test Result
Reports
Software Testing Introduction
Definitions Read and remember!
2
Why is Test Result Report so important? General planning
and requirements
analysis
Acceptance
1
TRR is the basis for criteria
establishment
the planning of the Test results
reporting 2
next iteration. We
8
have to know Test results
analysis
“where are we” in 3 Test strategy
establishment
7
order to decide
“where to go” and 6
4
“how to get Defect reporting
there”. 5 Test cases creation
Test cases
execution
3
Test Result Report Purpose
Reliable source of
Basis for the planning of
information for
the next iteration
stakeholders
4
Principles of Test Result Reporting
5
Who uses the Test Result Report
6
Test Result
Reports
Software Testing Introduction
Test Result Report
Sections
Software Testing Introduction
General Test Result Report Sections Overview
Timetable
2
Summary Read and remember!
3
Test team Read and remember!
E.g.:
Name Role Responsibility
Joe Black Tester Documentation creation, test-
cases execution, participation in
code-review
Jim White Senior Participation in requirements
developer testing and code review
4
Testing process description Read and remember!
6
New defects statistics Read and remember!
7
New defects list Read and remember!
8
Overall defects statistics Read and remember!
9
Recommendations Read and remember!
10
Attachments / appendixes Read and remember!
E.g.:
11
Test Result Report
Sections
Software Testing Introduction
«File Converter» Project
EPAM Training Center: Software Testing Introduction Most Recent Update: 14.06.2019 10:51:43
«File Converter» Project
Contents
1. Summary ...................................................................................................... 3
2. Test team ..................................................................................................... 3
3. Testing process description ......................................................................... 3
4. Timetable ...................................................................................................... 3
5. New defects statistics ................................................................................... 4
6. New defects list ............................................................................................ 4
7. Overall defects statistics .............................................................................. 4
8. Recommendations ....................................................................................... 5
9. Attachments ................................................................................................. 5
EPAM Training Center: Software Testing Introduction Most Recent Update: 14.06.2019 10:51:43
«File Converter» Project
1. Summary
During May 26-28 four builds were released. The latest build has successfully passed
100% of the smoke test, and 76% of the critical path test. 98% of the requirements of high
importance are implemented correctly. All key quality metrics are in the green zone, so there
is every reason to expect the project completion on time (at the moment, real progress
exactly corresponds to the plan). At the next iteration (starting May 29) the remaining low-
priority test cases are scheduled for execution.
2. Test team
4. Timetable
EPAM Training Center: Software Testing Introduction Most Recent Update: 14.06.2019 10:51:43
«File Converter» Project
EPAM Training Center: Software Testing Introduction Most Recent Update: 14.06.2019 10:51:43
«File Converter» Project
8. Recommendations
No significant changes are needed at the current moment.
9. Attachments
Metrics through time changes:
Metrics
200
180
160
140
120
100
80
60
40
20
0
26.05.2015 26.05.2015 27.05.2015 27.05.2015 28.05.2015 28.05.2015
1 2 3 4 5 6
EPAM Training Center: Software Testing Introduction Most Recent Update: 14.06.2019 10:51:43
What is Test
Automation
Software Testing Introduction
Definitions Read and remember!
Manual testing
Automated testing
3
Test automation pros and cons: some factors to consider
Times to repeat
Support effort
Staff
4
Test automation pros and cons: pros
Speed
Reliability
Power
Statistics
Low-level actions
5
Test automation pros and cons: cons
Staff
Strategy
Tools
Changes
Hopes
6
Test automation: local conclusion
7
And one more thing…
2
Regression testing
3
Multi-environment testing
4
Configuration testing
5
Combinatory techniques
Valid
Free Invalid
Valid
Valid
Free Invalid
Valid
SOURCE_DIR
Valid
Free Invalid
Valid
Valid
Free Invalid
Valid
6
Unit testing
7
Some cases of integration testing
START
Начало
Предположим, что страница отправки файла уже
загружена в браузер
Веб-сервер в это время User enters an URL into
some web-client
Проверка
обрабатывает другие запросы
Кодирование данных
Выбор файла в диалоге корректности или находится в режиме
выбора файла и заполнения всех
Все поля Да формы (метод POST,
MySQL запущен и работает
отправка формы полей формы (с
заполнены верно? способ кодирования ожидания PHP может быть подключён как модуль веб-сервера, работать как No Client displays
multipart/form-data) совершенно независимо от веб- Client sends request to Firewall checks if this
an error
помощью JavaScript)
независимый «сервис» или запускаться веб-сервером по факту DNS-server connection is allowed
message
Нет сервера и интерпретатора PHP,
получения запроса – в любом случае PHP «узнаёт» о запросе
он просто ожидает поступления Yes
Извлечение данных только после того, как веб-сервер выполнит свою часть анализа END
Блокировка отправки Финальная подготовка и запроса, определение запросов (или входящих No
запроса и передаст управление интерпретатору PHP
DNS-server has this
Получение и первичный domain name is in it’s
формы, отображение
сообщения об ошибке
отправка запроса на
сервер
анализ запроса
MIME-типа
запрошенного файла и
соединений) own DNS-table?
Loop begin:
его доступности find the ip-address
Yes
Upper DNS-server
Получение и Инициализация движка either finds the IP
отображение Передача файла на Загрузка и анализ приложения, in his table, or
Конец, Да Нет В файле есть Нет Обнаружены Нет
сообщения об ошибке Есть ошибки? исполнение файла, являющегося подключение внешних sends the request
загрузка не выполнена ошибки? ошибки?
(здесь до корректной обработки ситуации
приложением может не дойти – будет
интерпретатору PHP «точкой входа» PHP-Файлов, создание further to his upper
просто сообщение от веб-сервера) объектов и т.д. DNS-server: up to
Да Да root DNS-servers.
Восстановление
Проверка логина,
сессии, Проверка типа, размера
Обнаружены Нет Установление пароля, хоста- Обнаружены Нет
инициализация и иных параметров
ошибки? соединения с СУБД инициатора, иных ошибки? DNS-server returns the
необходимых файла DNS-server returns the
параметров IP-address of the
данных error message to client
requested domain
Да Да
END
No Client displays
Формирование запроса Firewall checks if this
Предобработка и Финальная подготовка и an error END
к СУБД, проверяющего
подстановка выполнение запроса к
Обработка запроса от Здесь при connection is allowed
message
наличие такого файла приложения
на сервере
параметров запроса СУБД обработке Yes
запросов тоже
No Server OS sends Client displays
реализуется Server OS checks if this
connection is allowed an error message an error
Получение и
отображение
Передача результатов
Формирования полного
много стадий to client message
Конец, Отправка ответа веб-серверу Да Этот файл уже Нет Формирование хэша
загрузка не выполнена
сообщения об ошибке
браузеру
Отмена приёма файла (в этот момент веб-сервер может ещё
продолжать приём файла – зависит от есть? имени файла
имени файла для контроля и Yes
или страницы с хранения на сервере
сообщением об ошибке
способа подключения PHP К серверу и
множества иных условий) проверок – они Web-server receives the
END
опущены для request
упрощения
Перемещение Установка необходимых
Формирование запроса
к СУБД, добавляющего
Финальная подготовка и
Обработка запроса от
схемы
принятого файла в прав в файловой выполнение запроса к No Web-server sends Client displays
место хранения системе
информацию о
СУБД
приложения алгоритма Web-servers checks if the
requested domain is listed in an error message an error
принятом файле it’s virtual hosts table
to client message
Yes
Yes
Web-server END
Получение и Корректировка Web-servers checks if URL preprocesses URL
Конец, отображение страницы Отправка ответа Получение данных от Нет Файл сохранён Да данных сессии и preprocessing is needed with appropriate
загрузка не выполнена с сообщением об браузеру приложения успешно? объектов module
ошибке приложения
No
DYNAMIC
Web-server starts some Client analyses, parses
the content, performs
external software (ES) some other actions (starts
and sends all needed JS, flash-plugins, etc)
data to it
Client displays
ES analyses and parses the the content to
file (containing a script written
user
in some programming
language) or executes byte-
coded script
END
No
ES returns an error Web-server sends this Client displays an
Is script OK?
message to web-server error message to client error message
Yes
END
ES executes the script
ES establishes a
Yes
Is connection to connection to DBMS and
DBMS reuqired? sends a query to some
database
No
ES reacts at this message
No in some way, f.i. generates
DBMS checks if this DBMS returns an error
some special error page
connection is allowed message to DCGS and returns it to web-
server
Yes
Yes
Client analyses,
parses the content, Client displays
Web-server send this
performs some other the content to
data to client actions (starts JS, user
flash-plugins, etc)
END
8
Basic security testing
9
Areas of Test
Automation High
Efficiency – Part 1
Software Testing Introduction
Areas of Test
Automation High
Efficiency – Part 2
Software Testing Introduction
General overview
2
Performance testing
3
Smoke test for large systems
4
Applications without human interface
DBMS
Web-service
Web-server
Server side of client-server application
… and so on …
5
Technical and low-level operations
6
Long routine operations
7
Standard functionality
Cart
Payments
Registration
Settings management
… and so on …
8
Classic well-automated areas
Link-checking
Backups
System monitoring
Updates
… and so on …
9
But…
Beware of!
Complex user interface
Huge unstable technology domain
Usability and other human-related things
Unstable requirements
…
10
Areas of Test
Automation High
Efficiency – Part 2
Software Testing Introduction
Tips on Test
Automation
Software Testing Introduction
With test cases to be automated…
More details
1. Standard search page is loaded. 1. The search page is loaded:
• TITLE = “Search page”
• There is a form with fields:
• input type=”text”
• input type=“submit” value=“Go!”
• There is the logo (logo.jpg)
• There are no pictures except the logo.
• …
2
With test cases to be automated…
Miscellaneous tools/systems
1. Click the “Search” link. 1. Click the “Search” link.
2. Use clickAndWait for timing 2. Wait for the new page to load.
synchronization.
1. Sent the WM_CLICK message to any 1. Set focus to any non-minimized app window.
visible app window. 2. Simulate left mouse click (or tap) for this
focused window.
3
With test cases to be automated…
Timing synchronization
1. Click the “Refresh” button. 1. Click the “Refresh” button.
2. Check that the “Results” grid is empty. 2. Wait for all background AJAX queries to
complete (once they are, the “In progress” bar
becomes disabled).
3. Check that the “Results” grid is empty.
4
With test cases to be automated…
No hard-coding!
1. Open http://ourcoolapplication.com/ 1. Open {START_URL}.
5
With test cases to be automated…
Test independence
1. With the previously created file… … … 1. Create a file following the next rules: … … …
2. With the file created in Step 1… … …
6
With test cases to be automated…
Automation is programming
if ($date_value == '2012.08.22') if ($date_value == date('Y.m.d'))
{ {
… Hardcoding …
} }
7
Understand your tool, perform meaningful actions!
8
Understand your tool, perform meaningful actions!
Action Check
Enter the X value into the Y field. Check that the Y field contains the X value.
Click the A link on the B page. Check that the B page contains the A link.
Fill all fields of the form K on the page M with Check that the page M contains the form K.
valid values.
Click the N button. Check that the N button has the Z label.
9
Use proper data sources
A lot of data…
Random values
Values generation with some algorithm
Trusted external data sources (web-services, DB, etc)
Real existing user data
Manual generation
10
Tips on Test
Automation
Software Testing Introduction
The Record and Playback
Technology
2
The Record and Playback Technology: Pros and Cons
Pros Cons
3
The Record and Playback Technology: Conclusion
4
Selenium IDE: General Overview
6
The Record and Playback
Technology
2
Selenium Ecosystem Overview
4
Selenium IDE: Quick Preview of the Main Idea
5
Selenium IDE: Quick Preview of the Main Idea
6
Selenium IDE: Quick Preview of the Main Idea
7
Selenium IDE: Quick Preview of the Main Idea
8
Selenium IDE: Quick Preview of the Main Idea
9
Selenium IDE
Overview
Software Testing Introduction
Selenium IDE
Interface
Software Testing Introduction
Selenium IDE Interface
Record, playback, save, etc. tools
The list of
currently
loaded test
cases
Comment/uncomment Current test
current command case
Current
command
details
(editable)
Test cases
execution
log
2
Selenium IDE Interface
3
Selenium IDE Interface
4
Selenium IDE Interface
5
Selenium IDE Interface
Recording
Run all test cases on/off
Change test case Disable breakpoints
Run current execution speed (toggle a breakpoint Pause on
test case only Run current by clicking on exceptions
test case step command line
by step number)
6
Selenium IDE Interface
7
Selenium IDE Interface
8
Selenium IDE
Interface
Software Testing Introduction
Selenium IDE
Commands
Software Testing Introduction
Main Selenium IDE Commands Read and remember!
Actions Manipulate the state of the application (like “click this link”
and “select that option”). If an Action fails, or has an error, the
execution of the current test is stopped.
Accessors Examine the state of the application and store the results in
variables, e.g. “storeTitle”. They are also used to automatically
generate Assertions.
Assertions … are like Accessors, but verify that the state of the
application conforms to what is expected (e.g., “make sure
the page title is X” and “verify that this checkbox is checked”).
Actions Manipulate the state of the application (like “click this link”
and “select that option”). If an Action fails, or has an error, the
execution of the current test is stopped.
3
Main Selenium IDE Commands: examples
Accessors Examine the state of the application and store the results in
variables, e.g. “storeTitle”. They are also used to automatically
generate Assertions.
4
Main Selenium IDE Commands: examples
5
Main Selenium IDE Commands
Assertions … are like Accessors, but verify that the state of the
application conforms to what is expected (e.g., “make sure
the page title is X” and “verify that this checkbox is checked”).
6
Main Selenium IDE Commands: examples
Warning! Flow control operators are in active development stage for now. Some
strange things may happen. Read the manual carefully!
7
What can we do with one or another HTML element?
Sorry, this course is about simple automation with Selenium IDE. If you are not
familiar with HTML, please begin here:
https://www.w3schools.com/html/
8
Selenium IDE
Commands
Software Testing Introduction
Selenium IDE
Locators
Software Testing Introduction
Selenium IDE Locators Overview
For many Selenium IDE commands, a target is required. This target identifies
an element in the content of the web application, and consists of the location
strategy followed by the location in the format locatorType=location.
2
Selenium IDE Locators Overview
Context-insensitive Context-sensitive
id css
name xpath
linkText
partialLinkText
3
Selenium IDE Locators Overview
Context-insensitive Context-sensitive
Text
"Test" Attribute
<href>
Text
"Trainings"
4
Selenium IDE Locators: id
With id locator the first element with the id attribute value matching the
location will be used.
<html>
<body>
<form id="loginForm">
<input name="username" type="text" />
<input name="password" type="password" />
<input name="continue" type="submit" value="Login" />
<input name="continue" type="button" value="Clear" />
</form>
</body>
</html>
id=loginForm
5
Selenium IDE Locators: name
The name locator type will locate the first element with a matching name
attribute. If multiple elements have the same value for a name attribute, then
you can use filters to further refine your location strategy.
<html>
<body>
<form id="loginForm">
<input name="username" type="text" />
<input name="password" type="password" />
<input name="continue" type="submit" value="Login" />
<input name="continue" type="button" value="Clear" />
</form>
</body>
</html>
name=username
name=continue type=submit
name=continue value=Clear
6
Selenium IDE Locators: linkText and partialLinkText
The linkText and partialLinkText locator type will locate the first element with a
matching text value of an <a> attribute (or matching part of this text value for
partialLinkText).
<html>
<body>
<div id="someLinks">
<a href="https://epam.com" />EPAM</a>
<a href="https://training.by" />EPAM Training Center</a>
<a href="https://learn.by" />EPAM Open Trainings</a>
</div>
</body>
</html>
linkText=EPAM
partialLinkText=Center
partialLinkText=Open Trainings
7
Selenium IDE Locators: css
The css locators use CSS selectors for binding style properties to elements in
the document.
<html>
<body>
<form id="loginForm">
<input class="required" name="username" type="text" />
<input class="required passfield" name="password" type="password" />
<input name="continue" type="submit" value="Login" />
<input name="continue" type="button" value="Clear" />
</form>
</body>
</html>
css=form#loginForm
css=input[name="username"]
css=input.required[type="text"]
css=input.passfield
css=#loginForm input[type="button"]
css=#loginForm input:nth-child(2)
8
Selenium IDE Locators: xpath
The xpath locators use xPath syntax to locate elements. (It works because once
processed by browser the HTML document looks similar to XML document.)
<html>
<body>
<form id="loginForm">
<input class="required" name="username" type="text" />
<input class="required passfield" name="password" type="password" />
<input name="continue" type="submit" value="Login" />
<input name="continue" type="button" value="Clear" />
</form>
</body>
</html>
xpath=/html/body/form[1]
xpath=//form[1]
xpath=//form[@id='loginForm']
xpath=//input[@name='username']
xpath=//form[@id='loginForm']/input[1]
xpath=//input[@name='continue'][@type='button']
9
Selenium IDE Locators: WARNING!
You should NEVER use “view source” to find any locator! NEVER!
Browsers use correcting parsing algorithms, so the source page code and parsing result may differ!
10
Selenium IDE Locators: WARNING!
Browsers use correcting parsing algorithms, so the source page code and parsing result may differ!
11
Selenium IDE Locators: xpath and css
12
Selenium IDE Locators: what to choose?
Context-insensitive Context-sensitive
id css
name xpath
linkText
While xpath locators are more
partialLinkText common, css locators are
usually more convenient.
13
Selenium IDE
Locators
Software Testing Introduction
Selenium IDE CSS
Locators
Software Testing Introduction
Selenium IDE CSS Locators Overview
The css locators use CSS selectors for binding style properties to elements in
the document.
In CSS, selectors are patterns used to select the element(s) you want to work
with (usually, to apply some style while composing a web-page).
Disclaimer: this is NOT a complete CSS guide for frontend developers, this is
just a short overview of basic principles!
2
Selenium IDE CSS Locators: universal selector (*)
The universal selector (*) selects all elements (or all elements inside another
element). (Rarely used on its own.)
css=ul a
Looks for a elements inside any
elements inside ul elements.
<ul>
<li>Item <a href="site.com">1</a></li>
<li><p>Item 2</p></li>
</ul>
3
Selenium IDE CSS Locators: element
The element selector selects all elements with the specified element name.
(Rarely used on its own.)
<ul>
<li>Item <a href="site.com">1</a></li>
<li><p>Item 2</p></li>
</ul>
4
Selenium IDE CSS Locators: class
The class selector selects elements with a specific class attribute. Write a
period (.) character, followed by the name of the class.
css=p.red
<ul>
<li>Item <a class="red" href="site.com">1</a></li>
<li><p class="red">Item 2</p></li>
Looks for p elements with .red
<li><p class="green">Item 3</p></li>
</ul>
class.
5
Selenium IDE CSS Locators: id
css=p#marked
<ul>
<li>Item <a class="red" href="site.com">1</a></li>
<li><p id="marked" class="red">Item 2</p></li>
Looks for p element with #marked
<li><p class="green">Item 3</p></li>
</ul>
id.
6
Selenium IDE CSS Locators: attribute
css=a[target=_blank]
<a target="_self" href="http://site0.com">Site 0</a><br>
<a
<a
target="_blank" href="http://site1.com">Site 1</a><br>
href="http://site2.com">Site 2</a><br>
Looks for a element with target
<a href="http://site3.com">Site 3</a><br>
attribute that has _blank value.
7
Selenium IDE CSS Locators: descendant
The descendant selector (AKA element element) selects elements within other
elements (it works for any hierarchy depth).
8
Selenium IDE CSS Locators: child
9
Selenium IDE CSS Locators: immediately after
10
Selenium IDE CSS Locators: preceded by
11
Selenium IDE CSS Locators: pseudo-class
The pseudo-class selector selects elements with a specific state (defined by the
variety of CSS pseudo-classes).
12
Selenium IDE CSS Locators: pseudo-element
13
Selenium IDE CSS Locators: some real-life examples
h1
div.tagline
li#intro a
div.result > a
li ~ ul
a[href$=".pdf"]
span.alpha div#id > a:visited
14
Selenium IDE CSS
Locators
Software Testing Introduction
Selenium IDE xPath
Locators
Software Testing Introduction
Selenium IDE xPath Locators Overview
xPath is a syntax for defining parts of an XML document. xPath uses path
expressions to navigate in XML documents. This approach works for locating
HTML elements because DOM-tree meets all necessary XML document criteria.
2
Selenium IDE xPath and HTML
<html> Document
<head>
<title>Test</title>
</head> Root Element
<body> <html>
<a href="training.by">Trainings</a>
</body>
</html> Element Element
<head> <body>
Element Element
<title> <a>
Text
"Test" Attribute
<href>
Text
"Trainings"
3
Selenium IDE xPath Locators: how it works
Imagine HTML
document like a
set of nested
rectangles. So,
xPath is a path
through that
rectangles.
4
Selenium IDE xPath Locators: how it works
//html/body/table[1]
5
Selenium IDE xPath Locators: how it works
//html/body/table/tbody/tr[1]
Wait, wait! Where
is tbody?! It’s
there, trust me .
6
Selenium IDE Locators: WARNING!
You should NEVER use “view source” to find any locator! NEVER!
Browsers use correcting parsing algorithms, so the source page code and parsing result may differ!
7
Selenium IDE Locators: WARNING!
Browsers use correcting parsing algorithms, so the source page code and parsing result may differ!
8
Selenium IDE xPath Locators: how it works
//html/body/table/tbody/tr[2]/td[1]
9
Selenium IDE xPath Locators: how it works
//html/body/table/tbody/tr[2]/td/form/div/input
10
Selenium IDE xPath Locators: how it works
//div[2]
11
Selenium IDE xPath Locators: good approach
<tr>
<td>lalala</td>
<td> //html/body/table/tbody/tr[2]/td[2]/div/ul/li[2]
<div style="border: 1px solid blue">
<ul id="ono">
<li>One</li>
<li>Two</li>
<li>Three</li>
//li[2]
</ul>
</div>
</td>
<td>tratata</td> //ul[@id='ono']/li[2]
</tr>
//button[@id='submit']
//div[not(@style='display:none')]/a
//*[text()='the visible text' and @class = 'class1']
//li[contains(@value, 'choice1')]
//span[count(div)>=3]
//*[@class='search-result']/descendant-or-self::*[@id='training']
//a[ends-with(@href, '.pdf')]
13
Selenium IDE xPath
Locators
Software Testing Introduction
Selenium IDE
Usage Sample
Software Testing Introduction
General Idea
2
Check list to transform in Selenium IDE test cases
3
Test 1: all four operations with correct numbers
effectiveness we store
executeScript
1000
return Math.floor(Math.random() * (${max} - ${min} + 1)) + ${min}
max
a
generate random echo A = ${a}
executeScript return Math.floor(Math.random() * (${max} - ${min} + 1)) + ${min} b
numbers here. echo B = ${b}
executeScript return +${a} + +${b} c
echo Expected = ${c}
echo Main logic here
Following this open /calc.php
type name=a ${a}
sample, create type name=b ${b}
4
Test 2: division by zero (exp: “Division by zero” message)
5
Test 3: fraction digits (and rounding correctness)
situations.
6
Test 4c: “Surprise me”, all fields (except for “Next”) get random values
values. storeValue
storeValue
name=b
name=f
old_b
old_f
operations = document.getElementsByName("op"); old_op = '?'; if (operations[0].checked) {old_op = '+';} if
executeScript (operations[1].checked) {old_op = '-';} if (operations[2].checked) {old_op = '*';} if (operations[3].checked) old_op
{old_op = '/';} return old_op;
click css=input[type="submit"]
storeValue name=a new_a
Cases ‘a’ (“Save”) and ‘b’ storeValue
storeValue
name=b
name=f
new_b
new_f
7
Test 5: too large / small numbers handling
8
Selenium IDE
Usage Sample
Software Testing Introduction