# Day-0 Python-to-Java diagnostic

Complete this diagnostic yourself in one uninterrupted 75-minute block without AI. The supplied Python files are input. Do not edit them during the diagnostic.

## Your can-do target

> I can read tested Python behavior, reproduce it in Java 17 with tests, and explain where Java requires different type, error, and collection decisions.

## Before the clock

- Confirm that Python 3.14 and pytest work in a project-local environment. This separates a tool failure from a programming misunderstanding during the timed work.
- Confirm that your separate Java project and Maven Wrapper work. The Wrapper gives the diagnostic and CI the same project-owned build entry point.
- Close assistants, generated-code tools, and solution tabs. The purpose is to observe what you can currently retrieve and transfer without hidden help.
- Create a private Issue named `Day-0 Python to Java diagnostic`; do not put answers in the course materials. The Issue is your small SDLC record: prediction, evidence, decision, and unfinished work.

If a prerequisite is missing, return to Week 0. Do not consume the diagnostic clock installing or repairing tools.

## The 75-minute clock

| Elapsed | What you do | What this teaches | Evidence you produce |
|---|---|---|---|
| 0:00–0:10 | Read `python_reference.py` and predict the supplied tests before running them. | A prediction exposes your current model of the code before test output can influence it. A wrong prediction is useful evidence, not a penalty. | Prediction notes in your private Issue |
| 0:10–0:20 | Run the supplied Python tests and trace one happy path plus one exception path. | The test output establishes the observable contract; the two traces show how normal control flow differs from error control flow. | Redacted test result and two traces |
| 0:20–0:50 | Reproduce all three functions' observable behavior in Java 17. | You transfer a contract between languages while choosing Java types, collection operations, and exception behavior deliberately. You are not translating punctuation line by line. | Java source you wrote in your separate project |
| 0:50–1:05 | Write JUnit tests for the supplied cases plus one additional boundary per function. | Supplied cases check contract transfer; your added boundaries test whether you can identify risks the example did not hand you. | Tests you wrote and Maven Wrapper output |
| 1:05–1:15 | Add one Python-to-Java contrast to your Rosetta notes and record a two-minute explain-back. | Contrasting the languages and explaining from memory checks understanding that copied code cannot demonstrate. | Commit hash, Rosetta entry, and explain-back link |

Use explicit Java loops for `scoreSummary`; do not use streams or summary-statistics helpers in this diagnostic. This constraint is temporary: it makes initialization, iteration, accumulation, and boundary handling visible so you can explain them. It is not a claim that explicit loops are always the best production design.

Match the documented exceptions by meaning; the exact Python exception text does not need to become Java text. The contract is what callers can observe, while exception class names and messages are language-specific design choices.

## How to work through each stage

1. **Predict:** Write the expected result before running the code. Do not edit a prediction after seeing the result; add an observation beside it.
2. **Observe:** Run only the named check and record what actually happened, including a failure or incomplete result.
3. **Interpret:** State which part of your prediction the evidence supports or disproves. Output without interpretation is not complete evidence.
4. **Act:** Make the smallest implementation or test change that follows from that interpretation.
5. **Explain back:** Without notes, explain the behavior, the Java decision you made, and one input that could expose a flaw.

## Completion check

- [ ] All supplied Python tests pass unchanged when you run them.
- [ ] Your three Java functions have equivalent observable behavior for the supplied cases.
- [ ] Your JUnit tests cover every supplied case and at least three additional boundaries total.
- [ ] You ran the project test command yourself and recorded its output.
- [ ] You can explain one Python-to-Java type contrast and one error-handling contrast without notes.
- [ ] You stopped at 75 minutes and recorded incomplete work honestly.

This diagnostic calibrates route size; it does not award a pass or fail. Ask for review only after the clock ends and your commit is sealed.
