How are system behavior and performance tested? code example

Example 1: performance testing

PERFORMANCE TESTING

What is Load testing?
Load testing is the process that simulates
actual user load on any application or website.
It checks how the application behaves during normal
and high loads. This type of testing is applied
when a development project nears to its completion.
Load testing is performed to determine how many
users the system can handle.

What is Stress testing?
Stress testing is testing that checks the upper
limits of your system by testing it under extreme loads. 
Stress testing is a type of testing that determines
the stability and robustness of the system. 
It is a non-functional testing technique.
This technique uses auto-generated simulation
model that checks all the hypothetical scenarios.

When do you use Performance Testing?
Performance testing is done to check the
performance of website servers, database, and network.
If you are adopting waterfall methodology,
then it is important for you to check each time
release of a new version. However,
if you are using the agile software development approach,
then you need to test application continuously.

Example 2: performance testing

In software quality assurance, performance testing is in general a testing practice performed to determine how a system performs in terms of responsiveness and stability under a particular workload.