bike-barn / red-green-refactor

A very simple calculator designed to teach software testing.
ISC License
4 stars 2 forks source link

Create project meta files. Closes #2 #6

Closed reillysiemens closed 8 years ago

reillysiemens commented 8 years ago

I've added issue and pull request templates, contributing guidelines, a blank features file, module scaffolding, requirements files, a tests module, and some setuptools files. I've omitted grammar diagrams from this commit because I don't know what those should look like yet.

rawrgulmuffins commented 8 years ago

I think that, rather then doing the normal sane thing, I'm going to propose that we do a slightly insane thing for ease of teaching.

Rather then have a single test directory I would like to split our code base up into

calc
    calc.py
    feature
        feature.py
        feature_tests.py

This way students can run

python -m py.test feature/feature_tests.py

to run unit tests that are specific just to their feature and they don't have to do a lot of thinking / directory searching to find tests.

The counter argument is that this isn't how testing is done in the wild and might teach bad habits. My feeling on the matter is that is outweighed by the simplicity in this case. I'm interested in both of your opinions.

RadicalZephyr commented 8 years ago

@rawrgulmuffins at first I was kind of opposed to your alternate testing strategy. But in the couple hours since, I've apparently come around. I think there are advantages to organizing code semantically like that, particularly for didactic purposes. Also, it's not as uncommon anymore. I know of a few testing frameworks in Clojure that encourage tests being co-located with the source they work with and in Rust it's idiomatic to have the unit tests in the same file.

I say :shipit:

rawrgulmuffins commented 8 years ago

Paging @reillysiemens

reillysiemens commented 8 years ago

@rawrgulmuffins: I think your proposed directory structure will break my assumption that py.test isn't installed globally. setuptools will actually download it and run it without having to install it globally or in a virtualenv if the students run python3 setup.py test from the root project directory, but I don't know how that'll work if we run tests in the way you propose...

rawrgulmuffins commented 8 years ago

Ooooo, huh.

reillysiemens commented 8 years ago

Ideas on how to resolve that, @rawrgulmuffins or @RadicalZephyr?

reillysiemens commented 8 years ago

So, @rawrgulmuffins, after our last discussion how do you feel about this structure?