mudasobwa

mudasobwa

Creator of Cure

Another outcome of Language Agnostic Code Audit SaaS I’m currently working on is a PropWise library.

It scans the project content, and does its best on detecting and reporting places suitable for property-based testing, with examples using StreamData or PropEr.

An excerpt from docs:

PropWise analyzes your Elixir code to find functions that would benefit from property-based testing. It examines the Abstract Syntax Tree (AST) of your code to:

▸ Detect pure functions (functions without side effects)
▸ Identify common patterns suitable for property testing
▸ Find inverse function pairs (encode/decode, serialize/deserialize, etc.)
▸ Score and rank candidates by testability
▸ Provide specific testing suggestions for each candidate

The example of ouroborosing itself:

❯ mix propwise
Compiling 8 files (.ex)
Generated propwise app
Analyzing ....

================================================================================
PropWise Analysis Report
================================================================================

Summary:
  Total functions analyzed: 115
  Property test candidates: 30
  Candidates dropped (below threshold): 76
  Coverage: 26.1%

--------------------------------------------------------------------------------
Top Candidates (sorted by score):
--------------------------------------------------------------------------------

PropWise.Reporter.format_json_report/1
  Score: 10
  Location: lib/prop_wise/reporter.ex:133
  Type: private
  Patterns:
    - Numeric Algorithm: Arithmetic operations
    - Data Transformation: Map transformation
    - Collection Operation: Uses Enum collection operations
  Testing suggestions:
    - property "returns numeric result" do
        check all n <- one_of([integer(), float()]) do
          result = Reporter.format_json_report(n)
          assert is_number(result)
        end
      end

    - property "handles zero and negative inputs" do
        check all n <- one_of([integer(), float()]) do
          # Verify the function doesn't crash on edge-case numeric inputs.
          _ = Reporter.format_json_report(n)
        end
      end

…

https://github.com/Oeditus/propwise

Enjoy!

Showing Posts 1 to 3

dimitarvp

dimitarvp

Huh? What does that mean exactly?

Also awesome library. Will try that plus Telemetria soon.

mudasobwa

mudasobwa OP

Creator of Cure

I’m working on SaaS application providing the language-agnostic software audit. Three libraries I posted this week (this one, Muex, and OeditusCredo) are the part of this effort working with BEAM languages only. Proof of concept, to be precise.

mudasobwa

mudasobwa OP

Creator of Cure
— All posts loaded —

Where Next? Top

Trending in Announcing Top

woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
MRdotB
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
fuelen
Hi all! I want to present a small library which provides a mix task for generating an Entity-Relationship Diagram for Ecto schemas. You...
New
anuaralfetahe
Hello Published a new library - ProcessHub! ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
AstonJ
This showed up on my feed.. anyone heard of it? Just hype? Ox Alpha is a reasoning model designed for coding, sustained ag...
New
sergio
It’s not that it’s vocabulary is too advanced. It’s something worse. I get lost trying to follow even a paragraph written by Claude. It’...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
sorenone
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
akoutmos
@hugobarauna, Dr. Dimitrios Koutmos (my brother) and I (Alex Koutmos) have been hard at work on writing a book on how you can use Elixir ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews