0
0
Testing Fundamentalstesting~20 mins

Why security testing protects users in Testing Fundamentals - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Security Testing Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Why is security testing important for users?

Choose the best reason why security testing helps protect users of software applications.

AIt ensures the software has no spelling mistakes in the user interface.
BIt improves the software's speed and performance for users.
CIt checks if the software's colors and fonts are user-friendly.
DIt finds vulnerabilities that attackers could exploit to steal user data.
Attempts:
2 left
💡 Hint

Think about what could happen if attackers find weak spots in software.

Predict Output
intermediate
2:00remaining
Output of a security test log analysis

What is the output of this simple security test log filter code?

Testing Fundamentals
logs = ["INFO: User login successful", "WARNING: Password attempt failed", "ERROR: SQL injection detected", "INFO: Data saved"]
security_alerts = [log for log in logs if 'ERROR' in log or 'WARNING' in log]
print(security_alerts)
A["WARNING: Password attempt failed", "ERROR: SQL injection detected"]
B["INFO: User login successful", "INFO: Data saved"]
C["ERROR: SQL injection detected"]
D[]
Attempts:
2 left
💡 Hint

Look for logs containing 'ERROR' or 'WARNING'.

assertion
advanced
2:00remaining
Correct assertion for checking user password encryption

Which assertion correctly verifies that a user's password is stored encrypted (not plain text)?

Testing Fundamentals
def test_password_encryption(user_password, stored_password):
    # user_password is plain text input
    # stored_password is what is saved in database
    pass  # Fill in assertion here
Aassert stored_password.startswith('plain:')
Bassert user_password == stored_password
Cassert user_password != stored_password
Dassert stored_password == ''
Attempts:
2 left
💡 Hint

Encrypted passwords should not match the plain text password.

🔧 Debug
advanced
2:00remaining
Find the error in this security test code

Identify the error in this code snippet that tests if a user input is sanitized to prevent XSS attacks.

Testing Fundamentals
def test_input_sanitization(user_input):
    sanitized = sanitize(user_input)
    assert '<script>' not in sanitized
    assert '<script>' not in sanitized
AThe first assertion should check sanitized, not user_input.
BThe sanitize function is missing parentheses.
CThe assertions should use 'in' instead of 'not in'.
DThe function should return sanitized value.
Attempts:
2 left
💡 Hint

Check which variable should be free of script tags after sanitization.

framework
expert
2:00remaining
Best practice for integrating security tests in CI/CD pipeline

Which option describes the best way to include security testing in a continuous integration/continuous deployment (CI/CD) pipeline?

ARun manual security tests only when users report issues.
BRun automated security tests during the build phase before deployment.
CRun automated security tests after deployment to production only.
DSkip security tests to speed up deployment.
Attempts:
2 left
💡 Hint

Think about catching security issues early before software reaches users.