[Tutor] Reversi Game Logic

Danny Yoo dyoo at hashcollision.org
Fri Mar 20 05:50:59 CET 2015


>>>> From: Danny Yoo
>>>> Do you have any tests?


>>> On Thu, Mar 19, 2015 at 6:29 PM,  <niyanaxx95 at gmail.com> wrote:
>>> Yes the code is to be tested with the main code and the gui. I have
>>> attached
>>> it in this email.


>> From: Danny Yoo
>> Sent: ‎Thursday‎, ‎March‎ ‎19‎, ‎2015 ‎9‎:‎31‎ ‎PM
>> To: Ni'Yana Morgan
>>
>> I can't help you directly.  Please send messages to the mailing list.


On Thu, Mar 19, 2015 at 6:32 PM,  <niyanaxx95 at gmail.com> wrote:
> What? What are you saying?
> I sent my question to the mailing list.



Hi Ni'Yana,

You sent your *reply* only just to me.  This means no one else on the
mailing list saw your response.  Please try again: make sure you are
using Reply To All.

You can see that your reply is missing on the mailing list archive,
for example.  As of this writing, the only messages in the thread that
the list has seen are:

    https://mail.python.org/pipermail/tutor/2015-March/104554.html
    https://mail.python.org/pipermail/tutor/2015-March/104555.html
    https://mail.python.org/pipermail/tutor/2015-March/104557.html


I tried to tell you this earlier, but I had no time to elaborate.  I
was literally running to catch an appointment at the exact time that
you replied just to me.  I did not have time to answer your question.

The other issue is that, because this is homework, we do not have free
action to tell you everything that you should do to fix your program.
I personally restrict myself to either point to areas that you should
look at.  In this case, the more direct think I can think of that will
help is to point you to learning how to test your own programs.

My apologies for not being clearer.

------

When I say "tests", I mean something very specific.  I do not mean the
GUI code that you sent me in your reply.


I really mean "unit tests" in the sense that I mentioned earlier, the
last time we talked:

    https://mail.python.org/pipermail/tutor/2015-March/104421.html

I am guessing that you do not understand what I'm asking?  If so, then
you're missing a crucial beginner programming skill.  Please ask your
instructor: "How do I write unit tests?"  At the very least, your
instructor might be impressed and will help teach you this skill.
Some instructors out there do not realize that unit testing is
considered a standard technique for introductory programming.  Ask,
and maybe that will change.


The reason it's so important here is because you're sending us a bunch
of code and saying that it's broken.... but as far as I can tell, it
will run without any significant runtime errors.  It's also very long,
too long for the problem to be obvious.  What you're really saying is
that your program doesn't *behave* the way that you want.  And that's
precisely what unit tests are meant to capture, to let you express
formally what you *want* your code to do.

Without unit tests, we can't tell that your program is broken.  It
looks perfectly fine to me, because I do not know the rules of
Othello.


Recently, we've had a few people ask about unit testing.  See:

    https://mail.python.org/pipermail/tutor/2015-March/104389.html
    https://mail.python.org/pipermail/tutor/2015-March/104513.html

for examples of basic unit testing.


Please feel free to ask questions!


More information about the Tutor mailing list