Skip to content

Start adding tests #31

@cjerdonek

Description

@cjerdonek

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions