{"action":"opened","issue":{"url":"https://api.github.com/repos/cs362sp16/cs362sp16_edwardrh/issues/2","repository_url":"https://api.github.com/repos/cs362sp16/cs362sp16_edwardrh","labels_url":"https://api.github.com/repos/cs362sp16/cs362sp16_edwardrh/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/cs362sp16/cs362sp16_edwardrh/issues/2/comments","events_url":"https://api.github.com/repos/cs362sp16/cs362sp16_edwardrh/issues/2/events","html_url":"https://github.com/cs362sp16/cs362sp16_edwardrh/issues/2","id":149585704,"number":2,"title":"Assignment 2","user":{"login":"edwardrh","id":16568257,"avatar_url":"https://avatars.githubusercontent.com/u/16568257?v=3","gravatar_id":"","url":"https://api.github.com/users/edwardrh","html_url":"https://github.com/edwardrh","followers_url":"https://api.github.com/users/edwardrh/followers","following_url":"https://api.github.com/users/edwardrh/following{/other_user}","gists_url":"https://api.github.com/users/edwardrh/gists{/gist_id}","starred_url":"https://api.github.com/users/edwardrh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edwardrh/subscriptions","organizations_url":"https://api.github.com/users/edwardrh/orgs","repos_url":"https://api.github.com/users/edwardrh/repos","events_url":"https://api.github.com/users/edwardrh/events{/privacy}","received_events_url":"https://api.github.com/users/edwardrh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-19T21:11:58Z","updated_at":"2016-04-19T21:11:58Z","closed_at":null,"body":"Assignment  2:\r\n \r\n1. Write unit tests for four functions (not card implementations, and not cardEffect) in dominion.c.  Check these tests in as unittest1.c, unittest2.c, unittest3.c, and unittest4.c.  At least two of these functions should be more than 5 lines of code.\r\n\r\n2. Write unit tests for four Dominion cards implemented in dominion.c.  Do not test more than two of the cards you chose to refactor.  Write these tests so that they work whether a card is implemented inside cardEffect or in its own function – go through the public dominon.h API.  These tests should be checked in as cardtest1.c, cardtest2.c, cardtest3.c, and cardtest4.c\r\n\r\n3. Execute your unit tests and describe any bugs you find in unittestbugs.txt.\r\n\r\n4. Use gcov to measure code coverage for all of these tests.  Report your findings, and describe their implications for the tests in as part of your “unittesting.txt” file (in step 6).\r\n\r\n5. Add a rule that will generate and execute all of these tests, and append complete testing results (including coverage %ages) into a file called “unittestresults.out”.  The rule should be named “unittestresults.out” (that is what it produces) and it should depend on all your test code as well as the dominion code.  Do this by extending the existing Makefile.  You will want to test this on a standard unixlike environment (flip, flop, Cygwin or a Mac OS X machine terminal).\r\n\r\n6. Discuss your unit testing efforts in a file called “unittesting.txt”.\r\nHelpful hint:  to avoid making it hard to collect coverage when a test fails, use your own asserttrue function instead of the standard C assert (which basically crashes the code and fails to collect coverage).  Your assert can also print out more information, and maybe have an option that controls whether it exits the program or not.  In these and other tests, I find it helpful to make all tests print “TEST SUCCESSFULLY COMPLETED” or some other message if and only if the entire test passes, and usually (this isn’t always possible for crashing bugs) print “TEST FAILED” for a failure.  This makes it easy to process failing and passing tests."}}