Giter VIP home page Giter VIP logo

learnlib / alex Goto Github PK

View Code? Open in Web Editor NEW
34.0 11.0 5.0 106.64 MB

Automata Learning EXperience (ALEX) - A free and open-source web application for testing and learning web applications via active automata learning

Home Page: https://learnlib.github.io/alex/

License: Apache License 2.0

Java 63.94% JavaScript 0.26% HTML 9.24% TypeScript 25.88% Dockerfile 0.07% SCSS 0.56% CSS 0.06%
java automata-learning-algorithms web-application machine-learning automata-learning selenium learnlib

alex's Introduction

LearnLib

CI Coverage Maven Central

LearnLib is a free, open source (Apache License, v2.0) Java library for automata learning algorithms.

About

LearnLib is mainly developed at TU Dortmund University, Germany. Its original purpose is to provide a framework for research on automata learning algorithms as well as for their application in practice.

The public version is a re-implemented version of the former closed-source version of LearnLib. While certain features have been stripped for improved modularity, development has since then extended the features offered. Currently, the following learning algorithms with respective target models are supported:

Algorithm (active) Target models Algorithm (passive) Models
AAAR DFA Mealy Moore OSTIA SST
ADT Mealy RPNI (incl. variants) DFA Mealy Moore
DHC Mealy
Kearns & Vazirani DFA Mealy
L* (incl. variants) DFA Mealy Moore
NL* NFA
Observation Pack DFA Mealy Moore VPA
OML DFA Mealy
Procedural SPA SBA SPMM
TTT DFA Mealy Moore VPA

Additionally, LearnLib offers a variety of tools to ease the practical application of automata learning on real-world systems. This includes drivers and mappers for interfacing software systems with the LearnLib API as well as caches and parallelization for improving the overall performance of the learning setup. Also, more nuanced setups such as Black-Box-Checking (via LTSMin) or inferring partial machines are possible.

While we strive to deliver code at a high quality, please note that there exist parts of the library that still need thorough testing. Contributions -- whether it is in the form of new features, better documentation or tests -- are welcome.

Build Instructions

For simply using LearnLib you may use the Maven artifacts which are available in the Maven Central repository. It is also possible to download a bundled distribution artifact if you want to use LearnLib without Maven support. Note that LearnLib requires Java 11 (or newer) to build but still supports Java 8 at runtime.

Building development versions

If you intend to use development versions of LearnLib, you can either use the deployed SNAPSHOT artifacts from the continuous integration server (see Using Development Versions), or build them yourself. Simply clone the development branch of the repository

git clone -b develop --single-branch https://github.com/LearnLib/learnlib.git

and run a single mvn clean install. This will build all the required maven artifacts and will install them in your local Maven repository so that you can reference them in other projects.

If you plan to use a development version of LearnLib in an environment where no Maven support is available, simply run mvn clean package -Pbundles. The respective JARs are then available under distribution/target/bundles.

Note: Development versions of LearnLib usually depend on development versions of AutomataLib. For building development versions of AutomataLib, see the corresponding documentation on the project's README.

Developing LearnLib

For developing the code base of LearnLib it is suggested to use one of the major Java IDEs which come with out-of-the-box Maven support.

  • For IntelliJ IDEA:

    1. Select File -> New -> Project from existing sources and select the folder containing the development checkout.
    2. Choose "Import Project from external model", select "Maven" and click Create.
    3. In order to have both development versions of AutomataLib and LearnLib available at once, continue to import AutomataLib as documented in the project's README, but choose File -> New -> Module from existing sources as the first step.
  • For Eclipse:

    1. Note: LearnLib uses annotation processing on several occasions throughout the build process. This is usually handled correctly by Maven. However, for Eclipse, you may need to manually enable annotation processing under Preferences -> Maven -> Annotation Processing.
    2. Select File -> Import... and select "Existing Maven Projects".
    3. Select the folder containing the development checkout as the root directory and click Finish.
    4. In order to have both development versions of AutomataLib and LearnLib available at once, continue to import AutomataLib as documented in the project's README.

Documentation

Questions?

If you have any questions regarding the usage of LearnLib or if you want to discuss new and exciting ideas for future contributions, feel free to use the Discussions page to get in touch with the LearnLib community.

Maintainers

alex's People

Contributors

abainczyk avatar aschieweck avatar dependabot[bot] avatar fetchandadd avatar mkrumrey avatar mtf90 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alex's Issues

Disable test steps

Similar to steps in a symbol, it should be possible to disable test steps for debugging purposes

Tests - execute button should save the test

Hi,
after the creation of a test, it would be nice, if the "execute" button saves and executes the test and does not discard it. So I do not need to push save -> execute.

Firefox: Opening a new tab requires new Login

Firefox 69.0.3

Steps to reproduce

  1. Use Firefox
  2. Sign in to Alex
  3. Open a Alex-Link in a new tab
  4. You have to login again (in the new tab). After that you're redirected to the start page of Alex

Cloning symbols

Hi again :),

One of the students was a bit bothered by the amount of work it requires to define a symbol. Now, often symbols are very similar. So it would be nice to have a button to copy a symbol, so that you just apply the differences.

Invalid driver configuration is not reported properly

This is related to #19. I expected the configuration to be saved between runs, but it wasn't, so my configuration was "driver": "remote", "browser": null. This is an invalid config, but instead of getting a proper error message ALEX only showed that the first step in each action is failing. I wasted quite some time suspecting that the reset api was somehow broken. A better error message would help here.

libs.min.js:1 TypeError: Cannot set property project of #<r> which has only a getter

When I am trying to perform inspect element on an action, I am getting the following error in the console and the inspector window does not open

libs.min.js:1 TypeError: Cannot set property project of # which has only a getter
at r (alex.min.js:1)
at Object.invoke (libs.min.js:1)
at $t.instance (libs.min.js:1)
at W (libs.min.js:1)
at libs.min.js:1
at libs.min.js:1
at o.value (alex.min.js:1)
at t.value (alex.min.js:1)
at fn (eval at compile (libs.min.js:1), :4:166)
at e (libs.min.js:1)

Any ideas how to resolve this issue, please?

Search and select actions

Hi,
if I want to search and select an action, the selection does not work.
The dropdown box just closes, but nothing is selected.

Bug: A user with the email already exists

I've updated my local Alex Enviroment to the latest Docker-Version from learnlib/alex:unstable avaibale at 26.11.2019 23:00 Uhr.

After the update Alex fails to start with an exception:
"javax.validation.ValidationException: A user with the email already exists"

After i deleted the alex docker-volume the error was "fixed". However this is a bug in the current Alesx-Version. I've never created an User manually.

Full Exception and Stack Trace:
logs.txt

Unsaved Test-Cases are passed

Steps to reproduce:

  1. Create a new test case
  2. Add any symbol
  3. Dont save!
  4. Click on Execute
  5. Message "The test case passed." appears but no smybol has been executed

A warning is displayed if you try to execute a test-case without any symbol. But there is no warning or auto-save if you add a symbol and execute without a save.

I think the Execute-Button should automaticly save the current test-case. Alternatively, at least a warning should be displayed.

Associate test runs and learning experiments with the user who started them

  • Add property executedBy of type User to LearnerResult and TestReport
  • Display the user that initiated a test run / learning process in the frontend where it makes sense to have that information
  • In the TestStatusComponent, display the name of the user who executed the test process in the queue beside the test number
  • In the LearnerStatusWidgetComponent, display the name of the user who started the learning process in the queue beside the test number
  • A member of a project can only abort their own learning and testing processes in a project
    • Hide or disable the Abort button in TestStatusComponent and LearnerStatusWidgetComponent
  • A project owner can abort all learning and testing processes in a project
  • For database migration, associate an arbitrary project owner with existing learner results and test reports.

Check/ Uncheck all LTL Formulas

Hi,
it would be nice, if it would be possible to have a checkbox that check/uncheck all LTL-Formulas in the View - Learning - Results - [Select a Result] - Checking.

Cache problem?

We gave a tutorial on ALEX at the BSR winter school. Some issues popped up.

This is directly from one of the students, he didn't show me the issues, just send this via email:

There’s a cache problem. When I run multiple learning runs I seem to get the same result back (takes long the first time, is quick every time after). I need to delete the results under Learning/Results to make it run with the updated project.

Maybe he used the wrong buttons (continue instead of start learning). But since I didn't see it, I don't know.

Categorize LTL formulas

Hi,
it is difficult to categorize the LTL formulas.
It would be nice to have an Interface, similar to the Testing Interface, to build Check Suites.
It should offer the possibility to Group Temporal Logic Formulas into Checksuites with an expected outcome, a description and related automata.

Add ability to save configuration for Remote Selenium Server

We use the Remote Selenium Server. Under Settings we can set Remote Selenium Server as default Web driver.

But if we execute a single test-case we have to reconfigure the settings for the WebDriver every time (e.g. Use headless mode, Browser, Width and Height, Timeouts...)

alex-remote-driver-settings

These settings are lost if we reload the page or select antoher test-case. Is it possible to save these settings permanently? Maybe for all test-cases?

Docker Image - Remote Debug

Hi,

it would be helpful when we could run the ALEX in debug mode. Probably via an environment variable set as a flag in the docker run command.

Add Support for multiple Base URLs

Feature suggestion:

Add Support for multiple Base URLs per Project. In each Action, one of the base URL should be selectable.

Use Case:

Imagine you want to test your Frontend and Backend, both have different URLs. You could set the Frontend URL as base URL and use absolute URL to test your Backend. You could also use absolut URLs for your Reset-API, too.

It would be better if we could set three Base URLs in our Project and select one from a list per Action. We would be able to switch our Environments (testing, staging, production...) more easily.
For now we have to replace the absolute URLs every time

Build fails with latest nodeJS version (10.0.0)

After upgrading the nodeJS version to 10.0.0, building the frontend of ALEX fails with following error message:

[INFO] --- exec-maven-plugin:1.4.0:exec (npm-build) @ alex-frontend ---

> [email protected] build /home/frohme/workspace/alex/frontend/src/main/javascript
> grunt

Loading "sass.js" tasks...ERROR
>> Error: Node Sass does not yet support your current environment: Linux 64-bit with Unsupported runtime (64)
>> For more information on which environments are supported please see:
>> https://github.com/sass/node-sass/releases/tag/v4.5.3

Running "concat:libs" (concat) task

Running "uglify:libs" (uglify) task
>> 1 file created 2.16 MB → 611.87 kB

Running "browserify:dist" (browserify) task
Warning: Cannot find module 'browserify-ngannotate' from '/home/frohme/workspace/alex/frontend/src/main/javascript' Use --force to continue.

Aborted due to warnings.
npm ERR! code ELIFECYCLE
npm ERR! errno 6
npm ERR! [email protected] build: `grunt`
npm ERR! Exit status 6
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

JNA error

One of the students found this error while running ALEX:

The word could not be executed. java.lang.Error: There is an incompatible JNA natice library installed on this system [...] To resolve this issue you may do one of the following: - remove or uninstall the offending library - set the system propery jna.nosys=true - set jna.boot.library.path to include the path to the version of the jnidispatch library included with the JNA jar file you are using.

He added -Djna.nosys=true when running ALEX. This seemed to fix it, and it worked well afterwards.

Saving actions

We gave a tutorial on ALEX at the BSR winter school. Some issues popped up.

It's too easy to forget to save the actions for a symbol. When you go back or to another page, you get this message "Are you sure you want to leave?" With two buttons (Yes/No). It's easy to mistake it with the question "Do you want to save?", like any other piece of software does.

So I think it would be good to replace that message with "Do you want to save" with three buttons: Yes/No/Cancel.

JUnit export of test report broken

When I try to export a JUnit report of a test run I get the following exception:

{
    "timestamp": "2019-07-30T12:12:53.057+0000",
    "status": 500,
    "error": "Internal Server Error",
    "message": "java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal",
    "path": "/rest/projects/1838/tests/reports/2291"
}

Execution of a single test-case is not added to the queue

Execute a test-case:

  1. Click at the menu item "Manage" in the category "Testing"
  2. Select a single test-case
  3. Page with a single test-case and the assigned symbols is displayed
  4. Click on "Execute"

The test-case is executed but there is no chance to abort the execution of the test-case. Sometimes some symbols hang and there is no option to abort them.
Another problem is that if you open another (Alex-)page or reload the current page we have no information that a test-case is beeing executed.

I can image three possible solutions:

  1. If we run multiple test cases, they will be queued and the status of the tests will be displayed even after reloading the page. Maybe you could use that queue for a single test-case as well?
  2. Implement an abort button which should be visible after reloading the page as well
  3. if this is too hard: Implement an abort button which is visible until reload

ReST API documentation not found

I tried to open the ReST documentation as described here. (There does not seem to exist a 1.6.0 documentation version for ALEX, is that correct?)

However, I get the following error message:

Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Fri Oct 19 16:36:20 CEST 2018
There was an unexpected error (type=Not Found, status=404).
No message available

Version: ALEX 1.6.0
System: Windows 10

Unable to Start the Application

Hi,
i have downloaded the latest version of Alex from learnlib.github.io/alex and tried to launche it according to the instructions given at the home page, i.e.,

  1. downloading the war file and executing the following command:
    java -jar alex-1.6.1.war [--alex.port=XXXX]
    which gives me an exception containing the following message:
    Unable to start embedded container; nested exception is org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat

  2. compiling the source code with maven which again fails with the following message:
    Failed to execute goal org.codehaus.mojo:cobertura-maven-plugin:2.7:instrument (verify) on project alex-parent: Execution verify of goal org.codehaus.mojo:cobertura-maven-plugin:2.7:instrument failed: Plugin org.codehaus.mojo:cobertura-maven-plugin:2.7 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:0 at specified [PATH]

Any solutions?

Best ragards

Bug: Project import fails with 401

I've updated my local Alex Enviroment to the latest Docker-Version from learnlib/alex:unstable avaibale at 26.11.2019 23:00 Uhr.
After the update i cannot import projects anymore.

Steps to reproduce:

  • Export Project or use this one (just rename to .json): GC.txt
  • Login to another Alex Instance with default credentials. User [email protected] and Pwd admin
  • Click on the Import-Button
  • Select the previously exported filed
  • Click Import
  • Error msg "The project could not be imported. You could not be authenticated." appears and you're redirected to the login page :(

Firefox shows that the import POST-request to 'http://localhost:8000/rest/projects/import' has the following json repsonse:
{"timestamp":"2019-11-26T22:44:20.203+0000","status":401,"error":"Unauthorized","message":"You could not be authenticated.","path":"/rest/projects/import"}

Full Exception and Stacktrace from docker-compose logs:
alex_import_logs.txt

Maybe this is related to #50 ?

Remove post symbol for learning

Hi,
if I select a previous configuration to learn, then remove the post symbol and start learning, the post symbol will be executed.

Symbol export doesn't work in Firefox

For me the symbol export works in Chromium, but not in Firefox. I simply get no download prompt. I can provide more info if this issue isn't easily reproducible.
Version: 1.8.0-SNAPSHOT

Symbol "Make request" doesnt work

We updated from an unknown older version to the version of the dev-Branch from yesterday afternoon. Both version-strings are 1.8.0-SNAPSHOT. Since the update the "Make request"-Symbol doesn't work any more.

Steps to reproduce:

  1. Create an "Debug" symbol
  2. Add the "Make-Request" Action
  3. Select a valid Base-URL and enter an url (Maybe this is not important but we didn't choose the default base-url)
  4. Select GET as method (should be the same error for any other HTTP-Method. At least Get and Post doesn't work)
  5. Create the action
  6. Create action "Check status", use HTTP Status 200
  7. Save the symbol
  8. Create a test-case with the new symbol
  9. Save the symbol
  10. Configure the test configuration (see below)
  11. Execute the test-case

The test-case will be failed at the symbol, action 2. If we execute the same request from our local machines (e.g. with Insomnia or Postman), the request works quite well.

Test-Configuration:
alex-test-config

Frontend-side locking of symbols and tests during multi user usage

Towards a collaborative usage, we want users to know which other users are currently working in a project. Therefor, websockets should be integrated in the backend and frontend of ALEX. In the following, we assume there are two users: userA and userB.

App

  • Add a menu item to the top navigation, left of the dropdown menu of the current user.
    • The item should display how many and which users are currently active in the project. This should be implemented as a dropdown menu, where the item displays users online, and the dropdown menu lists all active users.
  • Each user should be assigned a unique color as soon as he enters the project (not white, gray, black) which is submitted to each other user in the project.
  • Each user can lock multiple tests and symbols at the same time by having multiple tabs open.

Symbols page (/projects/{projectId}/symbols)

  • if userA is actively working on a symbol, userB should not be able to click the symbol in the tree
    • The link should not work and should be greyed out
    • A lock icon with the color of userA should be displayed beside the name
    • If userB hovers over the lock icon, a tooltip with the message "In use by userA for ... minutes" should be displayed
    • It should be visible in the symbol group hierarchy, where a user currently is. Display an indicator (not a lock, a circle?) beside the symbol group name for all ancestors of the current symbol
    • As soon as userB leaves the page for a symbol (closes the tab or looses the connection to the server) the symbol should be unlocked again.

Symbol page (/projects/{projectId}/symbols/{symbolId})

  • if userA is actively working on the symbol and userB accesses the symbol with the ID symbolId via another link in the app or the direct link, he should be redirected to /projects/{projectId}/symbols and a notification should be displayed that the symbol is in use by userA.

  • Apply the same behavior to test cases and the corresponding views.

Add support for usernames

As a first step in the direction of supporting collaboration between users in ALEX, we want to extend the user model by a username property.

Todos

  • update the user model to have the field 'username'
    • the username should be unique
  • create a component for the user registration form
    • it should be possible to specify a username in that form
  • on the start page, one should be able to switch between login and registration form via tabs
    • if the registration was successfull, the view should switch to the login form and insert the email and password combination
  • display the username in the top right corner in the header instead of the email prefix
  • when an admin creates / edits a new user via the user management view, he should be able to specify / edit the username
  • extend the table in the user management view to display the username of a user

Share projects with other users

To enable collaboration between users, it should be possible for multiple users to work with the same project.
Therefor, there should be several roles within a project:

Owner

  • Can add users to the project as member by email or username
  • Can make members owner of the project
  • Can make owners member of the project
  • Can remove owners and members from the project
  • Can leave the project
  • Each project can have multiple owners
  • The last owner cannot leave the project

Member

  • Cannot edit / delete the project, project environments, environment variables, base URLs
  • Can leave the project

Todos

  • Extend Project by 'owners' and 'members' property (list of User)
    • The 'user' property should be removed
  • Add view to manage users within a project
    • Add route /project/{ID}/users
    • Add item to the sidebar that is only visible to owners
  • Add checks to the ProjectDAO so that members and owners are not able to edit / delete the project
  • Add checks to the ProjectEnvironmentsDAO so that members cannot create / edit / delete environments, base URLs and variables
  • On the view where all projects are displayed (/projects), separate by projects the user is owner of and projects the user is member of in two lists
    • In the list of projects, a dropdown menu with the item Leave project should be displayed
      • Leaving the project requires confirmation with a confirm dialog
      • The last owner cannot leave the project
    • Display a label Owner or Member to the corresponding projects
  • Members should not be able to access the environments view (/projects/ID/environments)
    • The Environments item in the sidebar should not be displayed

Firefox Web Driver not saved

Version

Alex Version: 1.7.2
Browser: Firefox 68

Problem

Firefox cannot be selected as Default Web Driver

Steps to reproduce:

  1. Open Alex, Login as Admin
  2. Click "Settings" in the left menu
  3. Choose Firefox as Default Web Browser (Blue/green "Default"-Button on the right)
  4. Click Save. Green PopUp "The settings have been updated" appears
  5. Firefox seems to be the default Web Driver
  6. Reload Page -> "HTML Unit" is selected as Default Web Driver :(

The Path to the geckodriver is set

Symbol name must be unique

We gave a tutorial on ALEX at the BSR winter school. Some issues popped up.

When making a reset symbol, and adding actions some people ran into the problem that the actions cannot be saved as the symbol must be a unique name. But it actually has a unique name, so that's a bit weird. We could not really reproduce it, although we had it once too.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.