Version Control and Unit Testing for Scientific Software, SciPy2013 Tutorial, Part 3 of 3





Rating is available when the video has been rented.
This feature is not available right now. Please try again later.
Published on Jun 27, 2013

Presenters: Matt Davis, Katy Huff


Writing software can be a frustrating process but developers have come up with ways to make it less stressful and error prone. Version control saves the history of your project and makes it easier for multiple people to participate in development. Unit testing and testing frameworks help ensure the correctness of your code and help you find errors by quickly executing and testing your entire code base. These tools can save you time and stress and are valuable to anyone writing software of any description.

This collaborative, hands-on tutorial will cover version control with Git plus writing and running unit tests in Python (and IPython!) using the nose testing framework. Attendees should be comfortable with the basics of Python and the command line but no experience with scientific Python is necessary.


The tutorial will be split into two two-hour lessons. The first lesson will cover git/GitHub and the second lesson will cover unit testing. Throughout the entirety of the tutorial students will be working in pairs. Our teaching style is to have frequent, short exercises for students. Ideally instructors aren't talking for more than a few minutes before they stop and students do something on their own machines. Instructors then give an explanation and example, then move on to the next item.

Lesson 1: git/GitHub

Students will work in pairs and in each pair one student will make a GitHub repo, then give the other student commit access on that repo. Students will take turns making modifications to learn various bits of git functionality.

Lesson 2: Unit Testing

Continuing to work in pairs, students will use test driven development to construct a small scientific program in the IPython Notebook and then take their work to .py files to see how nose works from the command line.

Required Packages

In addition to standard Python this tutorial will require the nose testing framework, the IPython Notebook, and the command line interface to Git. Installing Git varies by platform. Windows users should install Git Bash (aka msysgit), Mac users should install the Mac OS X Command Line Tools, and Linux users should use the packaging system for their particular Linux distribution. The Anaconda CE Python installer includes nose and the IPython Notebook.


Material will be adapted from existing Software Carpentry lessons, especially: https://github.com/swcarpentry/boot-c... https://github.com/swcarpentry/boot-c...

Other links: http://software-carpentry.org/ - The software carpentry organization with links to many lessons and past boot camps. https://github.com/swcarpentry/boot-c... - Standard Software Carpentry boot camp curriculum. https://github.com/thehackerwithin/Py... - Early Software Carpentry curriculum from a two week boot camp at the International Center for Theoretical Physics. https://code.google.com/p/hacker-with... - Lesson notes for a three hour lightning lesson at the American Nuclear Society Conference 2011. http://software-carpentry.org/blog/20... - A blog post about the first week of the two week ICTP boot camp. http://software-carpentry.org/blog/20... - A blog post about a two day boot camp at the University of Chicago. http://software-carpentry.org/blog/20... - A blog post about what the hacker within did before it was absorbed into Software Carpentry (it's no longer really its own entity).


to add this to Watch Later

Add to

Loading playlists...