Skip to main content
Version: Current

Software Engineering for AI

Core SystemsModule 1 · Required

Write Python code that another person can understand, test, change, and run. Apply these habits to software, data analysis, computer vision, and AI projects throughout Core Systems.

Illustration of application components and a build, test, deploy, and monitor workflow.

Write maintainable code

Use clear names, focused functions, and simple module boundaries.

Verify and improve behavior

Test useful cases, diagnose failures, and refactor safely.

Make your work usable by others

Document setup, submit reviewable changes, and respond to feedback.

1. Readable Python​

Make the purpose and behavior of your code easy to follow.

Before you start: Engineering Fundamentals Python, Git, terminal, environments, and debugging skills.

Learn​

  • Choose meaningful names and write functions with a clear responsibility.
  • Make inputs, outputs, assumptions, and side effects explicit. Avoid hidden dependencies on global state or notebook execution order.
  • Use comments to explain decisions and docstrings to describe how to use a function.
  • Read simple classes: instances, attributes, __init__, and instance methods. Recognize when state belongs together in an object and when a function is sufficient.

Resources​

Practice​

Choose one small project and keep improving it throughout the module. Start with an existing script or notebook, or build a small file-processing task if you need a starting point.

Your directionExample project
Software engineeringFile processing or input-validation utility
AI / MLDataset validation or preprocessing helper
Computer visionImage-loading, resizing, and input-checking utility
GenAIParser and validator for saved structured responses
Data scienceData-cleaning and aggregation workflow

Clarify its inputs and expected outputs. Improve confusing names, extract a focused function, and document an important assumption. Explain a simple class from the teaching examples, including the state it stores and what a method changes.

Expected output​

A small working project with understandable functions and documented behavior. You can explain its control flow and the difference between a function and an instance method.

2. Testing and debugging​

Check behavior deliberately and use failures to find the cause of a bug.

Before you start: your working project from section 1.

Learn​

  • Distinguish a unit test from a small integration test that checks connected parts.
  • Use pytest to express expected results and expected exceptions.
  • Choose normal, boundary, and invalid-input cases from the code's intended behavior.
  • Use fixtures when setup is shared and parametrization when the same rule needs several examples.
  • Reproduce a failure, inspect the relevant state, fix the cause, and retain a regression test.
  • Validate inputs and handle expected failures clearly. Preserve useful error context rather than silently continuing.

Resources​

Practice​

Apply the testing approach to your project. Cover ordinary behavior, a meaningful boundary, and a realistic failure. Add a small integration test for its main flow. Use fixed sample inputs so tests run predictably and independently of live services.

Find or deliberately introduce a realistic bug. Show a failing test, diagnose the cause, and demonstrate the fix.

Expected output​

A repeatable test command, tests that check meaningful behavior, and a regression test that catches the demonstrated bug. You can explain what the suite checks and what it leaves unchecked.

3. Refactoring and project structure​

Improve the structure of working code while preserving its intended behavior.

Before you start: a working version and baseline tests from section 2.

Learn​

  • Separate input/output operations from transformations or calculations.
  • Group related logic into modules with understandable interfaces.
  • Reduce duplication and long functions through small, justified changes.
  • Distinguish a structural refactor from an intentional behavior change.
  • Use existing tests and representative outputs to check that a refactor preserves behavior.

Resources​

Practice​

Refactor your project in small steps. Separate reusable logic from file access, display, or other external interactions. Keep an obvious entry point and place tests separately from implementation code. If you use a notebook, make reusable logic importable from it.

Run the baseline tests after each meaningful change. Explain one structural decision and its tradeoff.

Expected output​

A clear project structure, reusable logic, and evidence that the refactor preserved the tested behavior.

4. Collaboration and handover​

Make a change that another person can review and a project they can run.

Before you start: your refactored project and test suite.

Learn​

  • Describe a bounded change and its acceptance criteria in an issue or pull request.
  • Review a diff for correctness, clarity, test quality, and unintended changes.
  • Give actionable feedback and revise your work after review.
  • Record the Python version, dependencies, configuration, sample inputs, and commands needed to run and test the project.
  • Recreate a usable environment using your chosen tool. Keep credentials outside committed code.

Resources​

Practice​

Submit a bounded change through a pull request with a short explanation and verification evidence. Review a peer's change and respond to feedback on your own. A mentor can act as reviewer when peer review is unavailable.

Write a README covering setup, dependencies, configuration, sample data, run and test commands, and expected output. Ask the reviewer to follow it in a fresh environment and fix any missing steps. Review AI-assisted code with the same criteria whenever you use it.

Expected output​

A reviewed and revised pull request, useful review feedback, and a repository another person can set up, run, and test using the README.

Workload​

Workload remains pending pilot. Include learning, implementation, debugging, review, and revision. Required resource assignments refer only to the stated scope.

Finish this module​

Keep one repository containing your implementation, tests, README, and reviewed changes. During review, explain a design choice, diagnose a relevant failure, and show how your tests detect it. Revise incomplete evidence after feedback.

Resource completion supports learning; the practical outputs determine completion. Keep applying these habits in subsequent Core Systems modules.