Performance testing

Содержание

Слайд 2

Required technical knowledge

Required technical knowledge

Слайд 3

User workflow vs Application workflow User Clicks Selects Checks Types Uploads

User workflow vs Application workflow

User
Clicks
Selects
Checks
Types
Uploads
Downloads
Navigates

Application
Sends request
Receives response
Sends request
Receives response
Sends request
Receives sub-response
Sends

sub-request
Receives sub-response
Sends sub-request
Receives response

Performance tests look like

THIS

NOT THIS

Слайд 4

Client-server application architecture Request Response Transaction Request Response Async transaction sub-response sub-request sub-response sub-request

Client-server application architecture

Request

Response

Transaction

Request

Response

Async transaction

sub-response

sub-request

sub-response

sub-request

Слайд 5

Request structure Protocol/method Headers Data Attachments

Request structure

Protocol/method
Headers
Data
Attachments

Слайд 6

Response structure Protocol/method Headers Data Attachments

Response structure

Protocol/method
Headers
Data
Attachments

Слайд 7

HTTP Protocol Methods Get – “show me the data that I

HTTP Protocol

Methods
Get – “show me the data that I want”
Post –

“take the data and process it”
Put – “keep the data please”
Delete – “delete the data please”
+5 more

Theoretically | Best Practices | Classic approach

Each method has its own role

Слайд 8

HTTP Protocol Methods Get – “show me the data that I

HTTP Protocol

Methods
Get – “show me the data that I want”
Post –

“take the data and process it”
Put – “keep the data please”
Delete – “delete the data please”
+5 more

“Always be prepared…”

Technically – “Nothing is impossible”

Слайд 9

HTTP Protocol Examples where http methods are used properly: in public

HTTP Protocol

Examples where http methods are used properly:
in public web services
in

projects where coding best practices are strictly followed
Examples where http methods can be messed up:
in http server based web applications
in projects where best practices aren’t strictly enforced
“Bad” practices that you can face
use POST for searches
use POST to delete something
never use DELETE, PUT
etc.

“Always be prepared…”

Слайд 10

HTTP Protocol Headers format – [header name]:[header value] groups General Headers

HTTP Protocol

Headers
format – [header name]:[header value]
groups
General Headers – must bet present

in ALL requests
Request Headers – are present in CLIENT requests only
Response Headers – are present in SERVER responses only
Entity Headers – details related to content of a request/response
some headers belong to few groups
Слайд 11

HTTP Protocol Headers (examples)

HTTP Protocol

Headers (examples)

Слайд 12

HTTP Protocol Message body Optional Content Overall: any text can be

HTTP Protocol

Message body
Optional
Content
Overall: any text can be sent
In particular: text that

target server understands
+ Entity Headers if/where needed
Слайд 13

HTTP Protocol Attachments Message body Sent in forms Key http headers:

HTTP Protocol

Attachments Message body
Sent in forms
Key http headers:
Content-Type: multipart/form-data
Content-Disposition: form-data
Content-Type:[text/plan |

application/x-object | etc.]
Слайд 14

HTTP Protocol Message body (example)

HTTP Protocol

Message body (example)

Слайд 15

HTTP Protocol Message body (example) 2 empty lines Request headers Message

HTTP Protocol

Message body (example)

2 empty lines

Request headers

Message body

Delimiter of form fields

Content

of a particular field

Empty line between headers and content

Content of a file is sent as binary code

Слайд 16

HTTP Protocol Status codes 1xx Informational Request received, continuing process 2xx

HTTP Protocol

Status codes
1xx Informational
Request received, continuing process
2xx Success
Request was received, understood,

accepted and processed successfully
3xx Redirection
Client must take additional action to complete the request
4xx Client Error
Client seems to have erred
5xx Server Error
The server failed to fulfil an apparently valid request
Слайд 17

HTTP Protocol Status codes: We knew it!: 200 – everything is

HTTP Protocol

Status codes:
We knew it!:
200 – everything is OK
401 – something

is wrong with sent credentials
404 – requested page is absent
500 – server is down
Do you know more codes?
1xx – 3 codes
2xx – 10 codes
3xx – 10 codes
4xx – 43 codes
5xx – 16 codes
Слайд 18

Regular expressions

Regular expressions

Слайд 19

Regular expressions Regular expressions are quite easy to learn

Regular expressions
Regular expressions are quite easy to learn

Слайд 20

Regular expressions But doing this by slides is as easy…

Regular expressions
But doing this by slides is as easy…

Слайд 21

Regular expressions …as learning Chinese

Regular expressions
…as learning Chinese

Слайд 22

Regular expressions You will have to learn it by yourself

Regular expressions
You will have to learn it by yourself

Слайд 23

Regular expressions Theory https://en.wikipedia.org/wiki/Regular_expression http://www.rexegg.com/ Interactive online tutorial http://regexone.com/ Online regular

Regular expressions

Theory
https://en.wikipedia.org/wiki/Regular_expression
http://www.rexegg.com/
Interactive online tutorial
http://regexone.com/
Online regular expression editors
http://rubular.com/
http://www.regexr.com/
https://regex101.com/#javascript
Desktop regular expression editor
http://www.weitz.de/regex-coach/

Слайд 24

Regular expressions But here is some basic understanding

Regular expressions
But here is some basic understanding

Слайд 25

Regular expressions What to search Where to search How many times it should appear Searching algorithm

Regular expressions

What to search
Where to search
How many times it should appear
Searching

algorithm
Слайд 26

Regular expressions What to search Characters abc123 use backslash for meta

Regular expressions

What to search

Characters abc123
use backslash for meta characters! ^$.?*
Character classes []
Groups ()
Alternatives |

Слайд 27

Regular expressions Where to search Start/End of text ^ and $

Regular expressions
Where to search

Start/End of text ^ and $
Start/End of a word \b
After

text ?=<
Before text ?=
Слайд 28

Regular expressions How many times it should appear (quantification) Particular number

Regular expressions
How many times it should appear (quantification)

Particular number of times {n}
Range {m,

n}
Not less then {m,}
Not more then {,n}
Zero or one time ?
Zero or any number of times *
One or more times +
Слайд 29

Regular expressions Searching algorithm Greedy repeat a quantifier as many times

Regular expressions
Searching algorithm

Greedy
repeat a quantifier as many times as possible
Lazy
Repeat a

quantifier as little as possible
Слайд 30

Regular expressions Greedy Example: “stress” testing and “capacity” testing are not

Regular expressions

Greedy

Example: “stress” testing and “capacity” testing are not the same

Take

anything that starts from a quote and ends with a quote, and it doesn’t matter what is between the quotes

/”.*/”

He said “anything” – I’ll take “everything”

“stress” testing and “capacity”

Lazy

The shorter the better

“stress” , “capacity”

/”.*?/”

http://javascript.info/tutorial/greedy-and-lazy

Слайд 31

Tools that can help SoapUI Check available functions on an endpoint

Tools that can help

SoapUI
Check available functions on an endpoint (WADL/WSDL)
List of

all functions
Structure of request/response
Try your requests before using them in JMeter
Developer Tools (Chrome browser)
Compare requests in your tests with requests sent by application
Headers
Content
Cookies
Слайд 32

Tools that can help SoapUI http://www.soapui.org Chapters recommended for reading/watching About

Tools that can help

SoapUI http://www.soapui.org
Chapters recommended for reading/watching
About SoapUI
Videos
Functional Testing
REST Testing
Getting

started
Installing SoapUI
Your First SoapUI Project
REST Testing
SOAP and WSDL
Operations and Requests
Headers and Attachments
REST
Understanding REST Parameters
Слайд 33

Tools that can help Chrome Developer Tools https://developer.chrome.com/devtools/docs/network Network tab is

Tools that can help

Chrome Developer Tools https://developer.chrome.com/devtools/docs/network
Network tab is the most

important here
Note! Even if you have been working with Chrome Developer Tools for ages we strongly recommend you to read the tool documentation anyway.