Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start adding tests #31

Open
cjerdonek opened this issue Sep 12, 2018 · 0 comments
Open

Start adding tests #31

cjerdonek opened this issue Sep 12, 2018 · 0 comments

Comments

@cjerdonek
Copy link
Collaborator

cjerdonek commented Sep 12, 2018

To address an issue raised in the blog, I wanted to suggest an easy way to start adding tests that doesn't require installing or learning to use any tooling (e.g. of the kind that professional software developers normally use).

The purpose would be to address the following comment in the "QED version 2.0: an interactive text in first-order logic" blog post:

But writing this text (particularly the first-order logic sections) has brought me close to the limit of my programming ability, as the number of bugs introduced with each new feature implemented has begun to grow at an alarming rate.

The idea is to add a test.html file which, when viewed locally, loads and runs a file called test.js. The test.js file can contain tests of functions in the other JS files (e.g. functions which are more bug-prone or otherwise difficult to get right). To start out, the tests can be simple, hand-coded assertions that raise or display an error on failure. Helper test functions could be added to facilitate making assertions, and test inputs and corresponding expected outputs could be stored in arrays to make the tests more compact.

If a test framework is later added, the hand-coded tests could be adapted to fit into whatever framework is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant