Problem
This repository has no automated check of any kind — no test framework, no build system, no CI workflow, and no script that compiles the tree. The closest thing to a test is Message.main (Message.java:79-89), which round-trips process=square,number=10, and prints both strings without asserting anything, leaving the comparison to a human.
Any change to Protocol, Message, or either end of the socket can therefore break the program with nothing to contradict it.
Proposed change
A single POSIX sh script at the repository root that:
- Compiles every
.java file under src/ and fails on any error or warning.
- Runs
SimpleServer.Message and checks the round-trip output.
- Starts
ServerApp, drives the real protocol over a real socket, and checks the responses for a valid square, a non-numeric number, and an unrecognised process.
Constraints that keep this proportionate to a 484-line teaching exercise:
- One file, POSIX
sh, no framework and no dependency beyond the JDK, nc, and the shell. Adding Maven, Gradle, or JUnit is a separate decision belonging to the repository owner.
- Characterisation, not correction. Each case must assert what the code does today. Where writing a case reveals a bug, the bug gets its own issue and a separate change — the case is not used to smuggle in a fix.
- The script must skip cleanly rather than fail when no JDK is present: probing for
javac and exiting 0 with a printed SKIP: no JDK keeps a local run and a future CI job behaving identically.
- Every invocation that opens a socket must be wrapped in
timeout, and the server must be killed afterward. A server that fails to bind is expected to spin without bound, and a client against a server that never closes the connection will hang.
Note for whoever implements this
The script cannot be written responsibly without running it. A JDK, a JRE, and nc all need to be available to whoever picks this up.
This issue was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
drafted by Claude on behalf of Daniel Stephenson
Problem
This repository has no automated check of any kind — no test framework, no build system, no CI workflow, and no script that compiles the tree. The closest thing to a test is
Message.main(Message.java:79-89), which round-tripsprocess=square,number=10,and prints both strings without asserting anything, leaving the comparison to a human.Any change to
Protocol,Message, or either end of the socket can therefore break the program with nothing to contradict it.Proposed change
A single POSIX
shscript at the repository root that:.javafile undersrc/and fails on any error or warning.SimpleServer.Messageand checks the round-trip output.ServerApp, drives the real protocol over a real socket, and checks the responses for a valid square, a non-numericnumber, and an unrecognisedprocess.Constraints that keep this proportionate to a 484-line teaching exercise:
sh, no framework and no dependency beyond the JDK,nc, and the shell. Adding Maven, Gradle, or JUnit is a separate decision belonging to the repository owner.javacand exiting 0 with a printedSKIP: no JDKkeeps a local run and a future CI job behaving identically.timeout, and the server must be killed afterward. A server that fails to bind is expected to spin without bound, and a client against a server that never closes the connection will hang.Note for whoever implements this
The script cannot be written responsibly without running it. A JDK, a JRE, and
ncall need to be available to whoever picks this up.This issue was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
drafted by Claude on behalf of Daniel Stephenson