-1

Is it possible to give someone your test program without giving away the logic? For example, how can the teachers give their test class that the students could use to compare their results, without actually giving the logic away of the assignment?

Thanks.

  • 3
    Use unit tests instead of giving an actual implementation. Or learn about obfuscators. – SLaks Oct 14 '16 at 14:55
  • 1
    Give them a compiled version? (It's technically still readable but that requires a bit of knowledge and effort) – UnholySheep Oct 14 '16 at 14:55
  • ^This. They can still look at it with a decompiler, but this may be the best way. Give them test input and expected output values and let them run the jar file. – jordaniac89 Oct 14 '16 at 14:56
  • I don't think this question is a duplicate since it is more global than asking how to prevent decompilation. Or in other words, the only possible answer is not necessarily *a way to prevent decompilation*. – Spotted Oct 14 '16 at 15:07
  • Thank you everyone for the suggestions! – Raahim Ghauri Oct 14 '16 at 15:18

1 Answers1

1

Give only the interfaces and the unit tests suite (that should describes all the program behaviour).

Students will then have to implement the solution and can compare their results by running their implementation against this test suite. As long as all tests don't pass, they know something is wrong in their implementation.

Spotted
  • 3,991
  • 16
  • 33