Liking cljdoc? Tell your friends :D

Apophis

Mutation inspired testing tools for Clojure.

Design Goals

Choose what you want to test

Choose whether to test an individual function, namespace, or project.

Assess quality of code base

Use mutation tests to check the quality of code bases at the namespace level.

Pluggable

Extend apophis to test pull requests or commits. Plug in different mutations at your choosing.

API

(ns my.test.ns
  (:require [clojure.test :as test]
            [tech.thomascothran.apophis :as apophis]))

(defn run-app-tests []
  (test/run-tests 'my.test.stuff-test))

;; Target one function.
(apophis/results run-app-tests
                 [:fn 'my.test.stuff/my-fn])

;; Function targets also accept Vars: [:fn #'my.test.stuff/my-fn].

;; Target every public, non-macro function in a namespace.
(apophis/results run-app-tests
                 [:ns 'my.test.stuff])

;; Return only mutants for which the tests still pass.
(apophis/survivors run-app-tests
                   [:ns 'my.test.stuff])

Each result has a :status of :survived, :killed, :invalid, or :run-error. A :run-error means the test runner itself threw, so the mutant's outcome is unknown.

Releasing

Releases use immutable versions in the form 0.1.<git-commit-count>. The release task requires a clean Git worktree and Clojars credentials in CLOJARS_USERNAME and CLOJARS_PASSWORD.

Store a Clojars deploy token outside the repository in ~/.secrets/.clojars, then release with:

env $(cat ~/.secrets/.clojars | xargs) clojure -T:build release

The release task runs the tests, builds and validates the JAR and POM, and deploys that exact tested artifact. To validate locally without deploying:

clojure -T:build install

Clojars coordinate: tech.thomascothran/apophis.

License

Copyright © Thomas Cothran

Distributed under the Eclipse Public License 1.0. See LICENSE.

Can you improve this documentation? These fine people already did:
Thomas Cothran & thomas
Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close