[Edu-sig] K–12 Computer Science Framework -- k12cs.org

Wes Turner wes.turner at gmail.com
Mon Oct 17 20:40:18 EDT 2016


On Mon, Oct 17, 2016 at 7:37 PM, Wes Turner <wes.turner at gmail.com> wrote:
> There is a new K–12 Computer Science Framework:
> [...]
>
> - Additionally,
>   I can't help but wonder whether it makes sense it start with TDD
> (Test-Driven Development) first when teaching Python (and STEM, and CS, in
> general).

Hello World with TDD (and links to {Wikipedia, DBPedia} concept URIs):
https://westurner.org/2016/10/17/teaching-test-driven-development-first.html

import unittest

class TestHelloWorld(unittest.Testcase):

    def setUp(self):
        # print("setUp")
        self.data = {'name': 'TestName'}

    def test_hello_world(self, data=None):
        if data is None:
            data = self.data
        name = data['name']
        expected_output = "Hello, {}!".format(name)
        output = hello_world(name)
        assert expected_output == output
        self.assertEqual(ouput, expected_output)

     # def tearDown(self):
     #    print("tearDown")
     #    print(json.dumps(self.data, indent=2))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/edu-sig/attachments/20161017/28bd66a4/attachment.html>


More information about the Edu-sig mailing list