Sample questions
Pf Scripting Correlation ParameterizationDifficulty 1
In performance test scripting, what does "correlation" mean?
- aRunning two scripts at the same time to compare their throughput
- bGrouping requests into logical transactions for reporting purposes
- cExtracting a dynamic value from a server response and reusing it in a later request✓
- dMatching the ratio of virtual users to the ratio of real production users
Explanation:Correlation is the technique of capturing a dynamic value (session ID, token, CSRF value, etc.) returned by the server and feeding it into subsequent requests so the script behaves like a real client.
Pf Scripting Correlation ParameterizationDifficulty 1
Why does a recorded performance test script often fail on replay without correlation?
- aBecause recorded scripts never contain valid HTTP headers
- bBecause session tokens captured during recording get hard-coded and go stale on replay✓
- cBecause the recording tool always compresses the response body
- dBecause replay tools cannot send POST requests
Explanation:During recording, dynamic server-generated values get baked into the script as literal text. On replay, the server issues new values, so the hard-coded ones are invalid unless they are correlated (extracted and re-injected dynamically).
Pf Scripting Correlation ParameterizationDifficulty 1
What is a common example of a value that must be correlated in a login-then-checkout performance test scenario?
- aA CSRF token returned in the login page HTML and required in the login POST request✓
- bThe static CSS file path used to style the login page
- cThe virtual user's think-time configured in the test plan
- dThe number of threads configured for the test run
Explanation:A CSRF token embedded in the login form response is a classic dynamic value: it changes per session/request and must be extracted from the response and sent back in the next request, unlike static assets or test-runner configuration values.
Pf Scripting Correlation ParameterizationDifficulty 1
What is "parameterization" in performance test scripting?
- aFixing the exact number of virtual users used for the entire duration of the test run
- bExtracting a dynamic token from an HTTP response header for reuse in a later request
- cSetting the ramp-up time for a load test scenario before it starts sending any real traffic at all
- dReplacing hard-coded input values in a script with values pulled from an external data source✓
Explanation:Parameterization means substituting hard-coded literals (e.g. a single username) with values sourced from a data file or generator so each virtual user or iteration can use different, realistic input data.
Pf Scripting Correlation ParameterizationDifficulty 1
Why is parameterization important when load-testing a login endpoint with 500 virtual users?
- aIt reduces the CPU usage of the load generator machine
- bWithout it, all 500 users submit identical credentials, which can hit single-session-per-account limits✓
- cIt automatically encrypts the password field in the request before it is ever sent to the server
- dIt removes the need for correlation entirely for the rest of the checkout flow
Explanation:If every virtual user logs in with the same hard-coded credentials, the test does not represent realistic concurrent usage and may trigger unrelated failures (e.g. account lockouts, session collisions) that mask the real performance behavior.
Pf Scripting Correlation ParameterizationDifficulty 2
In k6, which construct is recommended for loading a large parameterization dataset (e.g. thousands of usernames) once and sharing it read-only across all virtual users?
- aA regular JavaScript array declared inside the default function
- bA k6 Counter metric, since it can store arbitrary array data
- cThe __ENV object, which is meant for holding large tabular datasets
- dSharedArray, which parses the data once in init and shares it across VUs without duplicating memory✓
Explanation:k6's SharedArray loads and parses data once in the init context, then shares the same memory across all VUs, avoiding the memory overhead of each VU parsing its own copy of a large dataset.