I think for most high-school level work, use of the "assert" statement would be the first thing to teach. It can be used in an "if __name__ == '__main__': " construct in a module to make a good quick test. see https://launchpad.net/romanclass as an example. Simple modules do not need anything as complex as unittest. It would be a good advanced subject, though. -- Vernon Cole
On Thu, Feb 24, 2011 at 11:25 AM, Vernon Cole <vernondcole@gmail.com> wrote:
I think for most high-school level work, use of the "assert" statement would be the first thing to teach.
Doctests can also be good way to introduce the idea of testing. It's maybe a bit easier for beginners to grasp and a very natural Python technique. Vern
It can be used in an "if __name__ == '__main__': " construct in a module to make a good quick test.
see https://launchpad.net/romanclass as an example.
Simple modules do not need anything as complex as unittest. It would be a good advanced subject, though. -- Vernon Cole
_______________________________________________ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig
-- Vern Ceder vceder@gmail.com, vceder@dogsinmotion.com The Quick Python Book, 2nd Ed - http://bit.ly/bRsWDW
Yeah these are both good suggestions. It's fun to throw maybe one or two examples of unittest into the mix, maybe already written (so-called scaffolding). But unless it's a course about programming / development and nothing more, flogging unittest (aka PyUnit) might seem too much of a detour. In the OST course, there's some doctest towards the end of Python 1, with unittest the main opening topic of Python 2 (which also includes using MySQL as a back end and the Tk GUI was a front end). In a more purely math-oriented course, I still think of Sqlite as a great place to stash polyhedrons in relational tables. VPython is still my favorite library for geometry topics, though I'm still a big fan of POV-Ray after all these years. http://www.4dsolutions.net/ocn/numeracy0.html http://www.4dsolutions.net/ocn/pymath.html Kirby On Thu, Feb 24, 2011 at 8:31 AM, Vern Ceder <vceder@gmail.com> wrote:
On Thu, Feb 24, 2011 at 11:25 AM, Vernon Cole <vernondcole@gmail.com> wrote:
I think for most high-school level work, use of the "assert" statement would be the first thing to teach.
Doctests can also be good way to introduce the idea of testing. It's maybe a bit easier for beginners to grasp and a very natural Python technique.
Vern
It can be used in an "if __name__ == '__main__': " construct in a module to make a good quick test.
see https://launchpad.net/romanclass as an example.
Simple modules do not need anything as complex as unittest. It would be a good advanced subject, though. -- Vernon Cole
_______________________________________________ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig
-- Vern Ceder vceder@gmail.com, vceder@dogsinmotion.com The Quick Python Book, 2nd Ed - http://bit.ly/bRsWDW _______________________________________________ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig
participants (3)
-
kirby urner
-
Vern Ceder
-
Vernon Cole