I’m happy to help with any git problems you have, also.
First, activate your virtualenv (see Using virtualenv). Then install coverage:
pip install -U coverage
(You may want to reactivate your virtualenv after installing this; I’ve had some path problems.)
Next, grab some code to run it on – let’s use the ‘hw2-solutions’ branch from https://github.com/ctb/cse491-serverz.
mkdir ~/cse491
cd ~/cse491
git clone https://github.com/ctb/cse491-serverz.git -b hw2-solutions day8
Run the tests with code coverage enabled:
cd day8
nosetests --with-coverage
Generate HTML output of your code coverage:
coverage html
which will put it in the directory ‘htmlcov’, and then post it to your arctic Web site:
mkdir ~/web/
cp -r htmlcov ~/web/day8-htmlcov
chmod -R a+rx ~/web/
Now go to http://www.cse.msu.edu/~$username/day8-htmlcov/ to look at the code coverage report – mine is here:
If you look at ‘server.py’, you’ll see some covered stuff (green) and some uncovered stuff (red):
Why? Can you think of any way to “cover” the red stuff in the tests?
Run code coverage on your own hw3. What did you fail to test in server.py?
Deactivate some of your tests by putting a ‘return’ right after the start of the function. Does the code coverage change in the expected way?
Do a review of someone else’s hw3, and either make comments on their pull request or on their code directly (by checking it out locally). Note, you can grab someone’s code by doing something like this, in an existing repo:
git fetch https://github.com/ctb/cse491-serverz hw3 ctb-hw3
git checkout ctb-hw3
If you make changes, comments, etc. then you can share them by first committing them, and then doing:
git push origin ctb-hw3:ctb-hw3
and setting up a pull request between YOUR copy of their branch (here, ctb-hw3 in your github repo) and THEIR hw3 branch.
If you use coverage analysis during your review, you might be able to find untested logic – and there might be bugs in there, too. Try writing a test that breaks their code (or at least covers it).
Basic rules:
massiek: github site - pulls - branches - repo URL for cloning
eunbong: github site - pulls - branches - repo URL for cloning
matheusldaraujo: github site - pulls - branches - repo URL for cloning
ConnorAvery: github site - pulls - branches - repo URL for cloning
jprickles: github site - pulls - branches - repo URL for cloning
jkteuber: github site - pulls - branches - repo URL for cloning
beckhamer: github site - pulls - branches - repo URL for cloning
john3209: github site - pulls - branches - repo URL for cloning
mill1256: github site - pulls - branches - repo URL for cloning
YourBestFriend: github site - pulls - branches - repo URL for cloning
hoffm386: github site - pulls - branches - repo URL for cloning
joshshadik: github site - pulls - branches - repo URL for cloning
msweet18: github site - pulls - branches - repo URL for cloning
juru13: github site - pulls - branches - repo URL for cloning
mcdonaldca: github site - pulls - branches - repo URL for cloning
filajust: github site - pulls - branches - repo URL for cloning
leflerja: github site - pulls - branches - repo URL for cloning
FireSBurnsmuP: github site - pulls - branches - repo URL for cloning
koppmana: github site - pulls - branches - repo URL for cloning
Karmeow: github site - pulls - branches - repo URL for cloning
curljosh: github site - pulls - branches - repo URL for cloning
yispencer: github site - pulls - branches - repo URL for cloning
glisto18: github site - pulls - branches - repo URL for cloning
mannin92: github site - pulls - branches - repo URL for cloning
westjour: github site - pulls - branches - repo URL for cloning
jbull477: github site - pulls - branches - repo URL for cloning
fakestuff: github site - pulls - branches - repo URL for cloning
msu-web-dev: github site - pulls - branches - repo URL for cloning
MaxwellGBrown: github site - pulls - branches - repo URL for cloning
xavierdhjr: github site - pulls - branches - repo URL for cloning
ettemaet: github site - pulls - branches - repo URL for cloning
lieblic2: github site - pulls - branches - repo URL for cloning
bjurgess1: github site - pulls - branches - repo URL for cloning
suhkang: github site - pulls - branches - repo URL for cloning
jonest31: github site - pulls - branches - repo URL for cloning
tsloncz: github site - pulls - branches - repo URL for cloning
zhopping: github site - pulls - branches - repo URL for cloning
MattyAyOh: github site - pulls - branches - repo URL for cloning
o2themar: github site - pulls - branches - repo URL for cloning
phammin1: github site - pulls - branches - repo URL for cloning
Badsauce: github site - pulls - branches - repo URL for cloning
DuncanCYoung: github site - pulls - branches - repo URL for cloning
cameronkeif: github site - pulls - branches - repo URL for cloning
majeedus: github site - pulls - branches - repo URL for cloning
polavar3: github site - pulls - branches - repo URL for cloning
brtaylor92: github site - pulls - branches - repo URL for cloning
labrenzm: github site - pulls - branches - repo URL for cloning
QSSS: github site - pulls - branches - repo URL for cloning
sarteleb: github site - pulls - branches - repo URL for cloning
JRucinski: github site - pulls - branches - repo URL for cloning
fenderic: github site - pulls - branches - repo URL for cloning
This file can be edited directly through the Web. Anyone can update and fix errors in this document with few clicks -- no downloads needed.
For an introduction to the documentation format please see the reST primer.