practicalli / practicalli/clojure

Unit testing approaches

Open
#170 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Makefile
Stars
117
Forks
36
PR merge metrics
No merged PRs in 30d

Description

Example based testing

  • using are to have a range of selected values for unit tests.
    This is a simple approach and easy to do, it is very obvious as to what data is being tested.
    The flaw in this approach it that it relies on the quality of the test data created by the development team. There may be edge cases not considered.
    Also if there is a refactoring that changes the behaviour of the function being tested and the kind of arguments passed, then refactoring of the test data is also required.

Generative testing
This requires about the same initial setup, however once the basics specifications for generators are established very little extra work is required.
Use the properties (specifications) of the system to generate truely random tests.
Generative testing typically catches far more edge cases and runs far more tests than example based testing can comfortably maintain.

Simulation testing
System model
Random
Simulate the user interacting with the system (all the events triggered from some user interaction or possibly an event stream.
simulant - https://github.com/Datomic/simulant

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. Start by reviewing the comparison of example-based, generative, and simulation testing and the linked simulant project. Clarify whether the intended contribution is documentation or implementation, then define what a completed contribution should contain.

Written by the indexing model from the issue text.

Assessment

Domain
testing
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.