Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate client-server interactions in the tests #9

Open
UtkarshKr007 opened this issue Dec 1, 2020 · 2 comments
Open

Validate client-server interactions in the tests #9

UtkarshKr007 opened this issue Dec 1, 2020 · 2 comments

Comments

@UtkarshKr007
Copy link

UtkarshKr007 commented Dec 1, 2020

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".

@NicMcPhee
Copy link
Contributor

At the moment there's no way to know if the client is even talking to the server. I'm not sure how the testing would work out, but it would be nice to have some sort of "conversation" where we know both parties were involved. If the server performed some sort of "complex" calculation or modification of the text sent to it, then it would almost certainly avoid honest mistakes like this.

@NicMcPhee
Copy link
Contributor

I don't really see how to do this as long as they're making both the client and the server. If they can make the server, then they can hack around and fake things out.

If we made the server then we could presumably have it include some kind of cryptographic secret that they wouldn't be able to "fake out", but that would really change the nature of the lab. For now, we'll leave this well enough alone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants