dogweather

dogweather

A self-testing application?

Anyone know about work along the lines of HAL?

Dave, I hate to interrupt, but I’ve detected a fault in one of my circuits.

I’ve stumbled on a need for this as well as a way to implement it: Software that re-runs its test suite on itself after updating its fixtures based on new environmental factors. The next step (which I’ll start working on) is software that fixes itself.

I realized that maybe people in the Elixir/Erlang community may have done work in this area, given the hot-swappable nature of the system. Anybody heard of work like this? It’s been surprisingly tricky to search for because I end up with lots of hits for automated testing, which is only a lower-level component of what I’m talking about.

EDIT: It looks like self-healing might be the thing I’m after.

Most Liked

dimitarvp

dimitarvp

Have you looked at mix test.watch?

A far cry from HAL but it allows you to have your tests re-ran as you are modifying your code.

gausby

gausby

If you code for the “happy” path—and make your pattern matches really strict—you will see it in your error logs every time your application encounter something unexpected. You can then decide on what to do in these discovered cases.

Besides the stuff that is build in to OTP (i.e. Supervision), patterns such as safety-valves and fuses can help you detecting and handling errors in regards to third-party systems—this way you can detect if something is wrong in your circuits and act accordingly :slight_smile:

dimitarvp

dimitarvp

You should probably view this in context. Any “true” AI – like a sentient, intelligent being – that is much better and more durable than us, will likely have a stream of consciousness. Part of that includes continuously pulling diagnostic information and evaluating it; sort of like you will know if you suddenly got a leg cramp in the next milliseconds of it happening.

Truth is, having an artificially sentient entity will mean a lot of not-so-energy-efficient activities happening all the time; it cannot just react to things, it has to take the initiative and continuously process sensory information… sort of like us.


To create a software that fixes itself you’ll need a ton of specifications, goal-oriented programming, and you also must have a feedback mechanism (which answers the question “is the result of this function correct”?). I am not saying it’s impossible; it definitely is possible. And you’ll also probably need some logic programming as well (Prolog).

xlphs

xlphs

I know some embedded engineers write code that checks memory content at runtime to ensure the code being executed is actually what is supposed to be executed. Something to do unstable hardware. And of course fixing that after detecting mismatch.

dogweather

dogweather

Actually, it’s a piece of an ETL pipeline that will run daily. And so I’d it to refuse to run if the input format has changed too much. It’s Haskell that I’m going to try implementing in Elixir: GitHub - public-law/nevada-revised-statutes-parser: Parses the Nevada NRS into well formed JSON · GitHub

My tests mostly run on fixtures which are full files: nevada-revised-statutes-parser/test/fixtures at master · public-law/nevada-revised-statutes-parser · GitHub

Where Next?

Popular in Questions Top

Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
vac
Hi, I’m quite new in Elixir and I’m trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and I...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call t...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New

Other popular topics Top

skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New

We're in Beta

About us Mission Statement