Skip to content

Validate client-server interactions in the tests #9

@UtkarshKr007

Description

@UtkarshKr007

The current bats tests pass without enforcing interaction with the server. One such solution is shown below where the client writes the information immediately after reading it.

    while ((line = System.in.read()) != -1) {
        System.out.write(line);
        System.out.flush();
      } 

We could write extensive test that don't allow hacky solutions, but "easy-hacky solutions" like these are likely achieved by mistake rather than on purpose. Especially if the students are learning something brand new and all the tests passing is their indication of validating their code. If we can point out something like "You never connected to the server"(via failing tests if possible), we should be able to prevent any "easy-hacky solutions".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions