WGU D385
Software Security and Testing
Static Code Analysis & Flake8 Practice Lab
Task 1 Skills Practice - September 2026 Study Edition
Academic-use note: This is a complete worked practice lab built from original code. It is designed to teach the skills associated
with D385, not to provide a completed WGU Task 1 submission. Your actual rubric, starter code, screenshots, filenames, and
evaluator requirements may differ.
Includes: static analysis concepts, Flake8 setup, issue interpretation, remediation, logging, defensive coding, testing,
log analysis, report-writing model, independent practice, and answer key.
All sample code and practice findings in this document are original teaching examples.
Original study resource - not an official WGU assessment, rubric, answer key, or submission. Page 1
,WGU D385 - Static Code Analysis & Flake8 Practice Lab | September 2026 Study Edition
1. September 2026 Alignment and Evidence Base
The September 2026 WGU Institutional Catalog lists D385 - Software Security and Testing as a 3-CU course and describes its
purpose as preparing learners to recognize software security vulnerabilities, plan interventions, develop fixes, and test those
interventions. The catalog specifically names Web security, permissions and identity security, debugging, log-file analysis, API
security, and encryption/cryptography as course topics. [1]
The public catalog does not publish the detailed Task 1 rubric. Recent 2026 student reports about the newer two-task version
describe Task 1 work involving static code analysis, issue identification, Python logging, exception handling, assertions, test
evidence, and interpretation of log abnormalities. Those reports are useful for study planning but are unofficial and can change. [2]
[3]
Alignment rule: Use your current WGU task instructions and rubric as the final authority. This lab deliberately teaches
transferable skills without copying WGU starter code or producing a submit-ready answer.
Practice-Lab Alignment Map
Skill area What you do in this lab Basis
Recognize vulnerabilities Inspect intentionally flawed Python code; Official D385 course goal [1]
classify lint findings and security concerns.
Plan interventions Prioritize fixes by correctness, reliability, and Official D385 course goal [1]
security impact.
Develop and test interventions Refactor code, add validation/logging, then run Official D385 course goal [1]
unit tests.
Debugging and log analysis Generate troubleshooting logs and interpret Official topic + 2026 public reports [1][2]
abnormal events.
Static code analysis Run/interpret Flake8-style findings; distinguish 2026 public reports [2]
lint findings from security findings.
Defensive coding Use explicit validation, targeted exceptions, 2026 public reports [2]
and carefully scoped assertions.
What "partly covered in Task 1" means here
This lab treats Flake8 as one component of a broader Task 1 skill set. Flake8 is primarily a Python linting and quality tool. It can
expose patterns that contribute to defects - such as undefined names, unused imports, bare except clauses, style problems, and
excessive complexity - but it is not a complete security vulnerability scanner. Security analysis still requires reasoning about
authentication, secret handling, input validation, logging, permissions, data flow, and misuse cases.
Original study resource - not an official WGU assessment, rubric, answer key, or submission. Page 2
, WGU D385 - Static Code Analysis & Flake8 Practice Lab | September 2026 Study Edition
2. Lab Outcomes and Completion Standard
By the end of this worked practice lab, you should be able to complete the following without copying the model solution:
Explain static code analysis in plain language and distinguish it from dynamic testing.
Install and invoke Flake8 against a Python file or project.
Interpret common E, W, and F findings and explain why they matter.
Separate lint/style findings from genuine security vulnerabilities.
Document at least five distinct findings with line references and remediation rationale.
Replace broad exception handling with specific exceptions and useful log events.
Validate untrusted input before using it in business or authentication logic.
Use assertions only for internal invariants, not as the sole security boundary.
Create troubleshooting logs without exposing secrets or sensitive values.
Run tests that prove both normal behavior and rejected/abnormal behavior.
Interpret log abnormalities and connect them to security or reliability concerns.
Write a concise technical report that ties evidence to remediation and testing.
Completion Standard for This Practice Lab
Area Evidence expected Target
Static analysis You can explain what the tool found and what Mastery
it did not find.
Issue documentation At least 5 unique findings include line, code, Mastery
risk, and fix.
Remediation The revised code removes lint defects and Mastery
improves defensive behavior.
Logging Normal and abnormal events are recorded Mastery
without logging credentials.
Testing Positive and negative tests pass; rejected Mastery
inputs are intentionally exercised.
Reflection You can explain why each change improves Mastery
quality or security.
Important technical nuance: Assertions can be disabled when Python runs with optimization. For production security
boundaries, use explicit validation and exceptions. This lab includes one assertion only to demonstrate an internal invariant,
while untrusted input is protected by normal control flow.
Original study resource - not an official WGU assessment, rubric, answer key, or submission. Page 3