• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 3 out of 30 pages
Other

WGU D385 Pytest & Security Unit Testing Workbook | 48 Practice Tests, Python Security, API Testing & Vulnerability Verification | 2026

Document preview thumbnail
Preview 3 out of 30 pages

Prepare for WGU D385 – Software Security and Testing with this detailed Pytest & Security Unit Testing Workbook, created for students who want practical experience with security-focused testing, Python unit tests, API validation, and vulnerability verification. This workbook contains 48 original practice tests covering the major testing patterns needed to strengthen software security skills, including positive and negative testing, boundary conditions, invalid input, exception handling, authentication, authorization, API responses, regression testing, parameterized tests, and expected-vs-actual behavior. The resource is designed to help students understand not only how to write a test, but also why the test matters, what security behavior it verifies, and how testing confirms that a vulnerability has actually been fixed. What’s Included 48 original pytest practice tests Positive test cases Negative test cases Boundary-condition testing Invalid-input testing Exception testing Authentication testing Authorization testing Role-based access testing API response validation Security regression testing Parameterized pytest examples Expected-vs-actual behavior checks Vulnerability verification Password-security tests Token and session testing Secure-input validation tests Error-handling tests Original Python security application Complete pytest practice suite Test-results matrix Remediation verification examples Independent practice exercises Security-testing reasoning Final readiness checklist Why This Workbook Is Useful This guide helps students build confidence with the full security-testing workflow: Identify behavior → Write the test → Run the test → Compare expected vs. actual → Fix the weakness → Retest → Verify the vulnerability stays fixed It is especially useful for reviewing: Pytest | Unit Testing | Security Testing | Authentication | Authorization | API Responses | Input Validation | Exceptions | Regression Testing | Parameterized Tests | Vulnerability Remediation Best For WGU D385 Software Security and Testing D385 security-testing practice Python pytest review Unit-testing practice API-security testing Authentication and authorization testing Vulnerability-remediation verification Secure-coding validation Regression-testing practice Updated for 2026 study preparation.

Content preview

WGU D385 - Pytest & Security Unit Testing Practice Workbook | 2026




WGU D385
Pytest & Security Unit Testing Workbook
48 Original, Executed & Passing Tests
Positive • Negative • Boundary • Exceptions • Authentication • Authorization • API • Regression •
Parameterized Testing




VERIFIED RUN: The complete included pytest suite was executed in a clean local run: 48 passed. The workbook
records expected results and uses the verified execution as the actual result for each case.




ALIGNMENT: Built as an original practice workbook for WGU D385 Software Security and Testing. The September
2026 catalog describes D385 as recognizing software vulnerabilities, planning interventions, and developing and
testing those interventions, with coverage of Web security, permissions and identity security, debugging, log-file
analysis, API security, encryption, and cryptography. This workbook concentrates on testing and verification skills
that support those areas.




IMPORTANT: This is an independent study and practice resource. It is not an official WGU assessment, rubric,
answer key, or guaranteed-pass submission. Pytest is used here as a practical testing framework; the catalog does
not prescribe Pytest specifically.




September 2026 Edition




Page 1

, WGU D385 - Pytest & Security Unit Testing Practice Workbook | 2026



Contents
1. 1. September 2026 D385 Alignment and Workbook Scope
2. 2. Testing Strategy: From Requirement to Evidence
3. 3. Practice Application Architecture
4. 4. Running Pytest and Reading Results
5. 5. Tests 1-5: Positive Behavior
6. 6. Tests 6-12: Negative and Invalid Input
7. 7. Tests 13-17: Boundary Conditions
8. 8. Tests 18-22: Exception Behavior
9. 9. Tests 23-29: Authentication
10. 10. Tests 30-34: Authorization
11. 11. Tests 35-39: API Response Contracts
12. 12. Tests 40-44: Security Regression Verification
13. 13. Tests 45-48: Parameterized Expected-vs-Actual Testing
14. 14. Complete 48-Test Results Matrix
15. 15. Full Practice Application Source Code
16. 16. Full Pytest Suite
17. 17. Independent Practice Challenges
18. 18. Answer Guide and Remediation Thinking
19. 19. Final Readiness Checklist and References




Page 2

, WGU D385 - Pytest & Security Unit Testing Practice Workbook | 2026



1. September 2026 D385 Alignment and Workbook Scope
The September 2026 WGU Institutional Catalog describes D385 - Software Security and Testing as a course that
prepares learners to recognize security vulnerabilities, plan interventions, and develop and test those
interventions. The catalog also names Web security, permissions and identity security, debugging, log-file
analysis, API security, encryption, and cryptography as course topics.

This workbook focuses on the “develop and test interventions” portion of that scope. Its mini-application
deliberately includes identity, authentication, authorization, API-like responses, input validation, password
handling, sessions, and security regression checks so that the tests demonstrate both ordinary correctness and
security-focused verification.

Scope boundary: The workbook does not claim to reproduce a WGU task. It uses original Python code and original
test cases to practice software security and testing skills in a way that is consistent with the published course
description.



Learning objectives
 Distinguish positive, negative, boundary, exception, authentication, authorization, API contract, and
regression tests.
 Write pytest assertions that compare expected and actual behavior clearly.
 Use fixtures to isolate test state and reduce duplication.
 Validate secure error behavior without leaking sensitive implementation details.
 Prove that remediated vulnerabilities remain fixed through regression tests.
 Use parameterization to increase coverage without repetitive test code.
 Read a pytest execution summary and connect each passing test to a requirement or security control.



2. Testing Strategy: From Requirement to Evidence
A strong security test starts with a requirement, identifies the risk if the requirement fails, executes a controlled
action, and records evidence that the observed result matches the expected result. This workbook uses the
following cycle:

1. Define the behavior or control.

2. Choose a representative valid, invalid, or edge-case input.

3. Arrange isolated state.

4. Act by calling the function or API-like endpoint.

5. Assert the expected status, exception, field, or security property.

6. Interpret the result as evidence.

7. Retain the test as a regression guard after remediation.

Core test categories
Category Purpose

Positive tests Confirm that valid inputs and allowed actions work.

Negative tests Confirm that invalid inputs and prohibited actions fail safely.

Boundary tests Exercise values at, just below, or just above allowed limits.

Exception tests Verify that abnormal conditions produce controlled, meaningful



Page 3

Document information

Uploaded on
September 10, 2026
Number of pages
30
Written in
2026/2027
Type
Other
Person
Unknown
$18.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
EvaTee
3.9
(990)
Sold
5490
Followers
3584
Items
59527
Last sold
3 hours ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions