Skip to content

Display the results in the GUI #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion .github/workflows/Publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,28 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ github.event.release.tag_name }} $(ls reta-*.msi reta*.deb reta*.rpm reta-*.zip 2>/dev/null)


publish-page:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
- name: Build Site
run: ./mvnw -B clean site site:stage
- name: Publish GitHub Pages
run: |
git config user.name ben12
git config user.email [email protected]
git clone --depth 1 --branch gh-pages https://github.com/ben12/reta.git gh-pages
cd gh-pages
rm -rf *
cp -r ../target/staging/* ./
git add --all
git commit -m "Update GitHub Pages"
git push

54 changes: 50 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,53 @@
reta
====

Requirement Engineering Traceability Analysis
Requirement Engineering Traceability Analysis (RETA)
===

http://reta.ben12.eu

RETA (Requirement Engineering Traceability Analysis) can read any source of documents or code, extracts the requirements and requirement references, and analyses them for generate the traceability matrix.

# Installation

Download then install [the last release](https://github.com/ben12/reta/releases/latest).

# Plugins

## TIKA plugin

TIKA plugin uses [Apache Tika](https://tika.apache.org/) to read any document (doc, xls, pdf, ...) and extracts requirements and requirement references from it.

### Configuration

Requirements and references are extracted from documents using regular expression. You can find documentation on the web and for example here : [Pattern JAVADOC](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/regex/Pattern.html#construct)

So, if your requirements are formatted like this in your document :

> REQ_RETA_SRS_*NNNN*_*v* - *summary*
>
> *content*
>
> REQ_END

Where "NNNN" is the requirement number, "v" the version, "summary" the summary description and "content" the detailed description.

Then, regular expression to match requirement start may be :
`^[ \t]*REQ_((RETA_SRS_\d+)_(\w+)[\s-]+(.*?))$`
And regular expression to match requirement end may be :
`^[ \t]*REQ_END[ \t]*$`

Bracket will capture part of text which will be used, for example, for identify the requirement reference using "Id" attribute ([Pattern JAVADOC](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/regex/Pattern.html#cg)).
For done this, you must identify each capture group using "Index of regular expression groups in requirement starts" table and "Index of regular expression groups in references" table.
In this sample:
- "Text" attribute must be set to *1* for capture "RETA_SRS_*NNNN*_*v* - *summary*",
- "Id" attribute must be set to *2* for capture "RETA_SRS_*NNNN*",
- "Version" attribute must be set to *3* for capture "*v*",
- "Summary" attribute must be set to *4* for capture "*summary*",

Text and Id attributes are required to build the matrix.

# Export

RETA allows you to export the analysis result to an Excel file.

# Alternatives to RETA

- Reqtify (https://www.3ds.com/products/catia/reqtify)
4 changes: 2 additions & 2 deletions RETA-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.11.2</version>
<configuration>
<windowtitle>RETA API JavaDocs</windowtitle>
<header><![CDATA[ <a href="https://reta.ben12.eu">RETA ${project.version}</a> ]]></header>
</configuration>
</plugin>
</plugins>
Expand All @@ -61,7 +61,7 @@
<licenses>
<license>
<name>GNU General Public License (GPL)</name>
<url>http://www.gnu.org/licenses/gpl-3.0.txt</url>
<url>../LICENSE</url>
</license>
</licenses>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
*
* @param <T>
* value type to validate
* @see javax.validation.Validation
* @see javax.validation.Validator
* @see jakarta.validation.Validation
* @see jakarta.validation.Validator
* @author Beno�t Moreau (ben.12)
*/
public interface BeanPropertyValidation<T> extends PropertyValidation
Expand Down
21 changes: 8 additions & 13 deletions RETA-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
<artifactId>reta-parent</artifactId>
<version>1.1.0</version>
</parent>
<properties>
<poi.version>5.4.0</poi.version>
</properties>
<contributors>
<contributor>
<name>ben.12</name>
Expand All @@ -33,14 +30,6 @@
<artifactId>reta-api</artifactId>
</dependency>

<!-- Add Tika dependencies for using reta-tika-plugin in Eclipse IDE -->
<dependency>
<groupId>com.ben12</groupId>
<artifactId>reta-tika-plugin</artifactId>
<scope>runtime</scope>
</dependency>

<!-- Use non beta POI version -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
Expand All @@ -56,6 +45,12 @@
<artifactId>poi-scratchpad</artifactId>
<version>${poi.version}</version>
</dependency>

<dependency>
<groupId>net.sourceforge.plantuml</groupId>
<artifactId>plantuml</artifactId>
<version>1.2025.2</version>
</dependency>
</dependencies>
<build>
<resources>
Expand Down Expand Up @@ -91,9 +86,9 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.11.2</version>
<configuration>
<windowtitle>RETA CORE JavaDocs</windowtitle>
<header><![CDATA[ <a href="https://reta.ben12.eu">RETA ${project.version}</a> ]]></header>
</configuration>
</plugin>
</plugins>
Expand All @@ -110,7 +105,7 @@
<licenses>
<license>
<name>GNU General Public License (GPL)</name>
<url>http://www.gnu.org/licenses/gpl-3.0.txt</url>
<url>../LICENSE</url>
</license>
</licenses>
</project>
7 changes: 5 additions & 2 deletions RETA-core/src/main/java/com/ben12/reta/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,14 @@ public void start(final Stage stage) throws Exception
loader.setResources(labels);
final Parent root = (Parent) loader.load();

final var title = labels.getString("title");
final var controller = (MainConfigurationController) loader.getController();
stage.titleProperty().bind(controller.bufferingProperty().map(b -> title + (b.booleanValue() ? " *" : "")));

stage.setScene(new Scene(root));
stage.setTitle(labels.getString("title"));
stage.getIcons()
.add(new Image(Main.class.getResourceAsStream("/com/ben12/reta/resources/images/reta.png")));
stage.sizeToScene();
stage.setMaximized(true);
stage.show();

final Parameters parameters = getParameters();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Package : com.ben12.reta.export
// File : ExcelExporter.java
//
// Copyright (C) 2025 benmo
// Copyright (C) 2025 Beno�t Moreau (ben.12)
//
// This file is part of RETA (Requirement Engineering Traceability Analysis).
//
Expand Down Expand Up @@ -452,7 +452,7 @@ private void exportCoverBy(final InputRequirementSource source, final XSSFSheet
{
final var rateRow = addNewRow(sheet, 1);
final var rateCell = addNewCell(rateRow);
rateCell.setCellValue(source.getName() + " is cover by " + coverBy.getKey().getName() + " at "
rateCell.setCellValue(source.getName() + " is covered by " + coverBy.getKey().getName() + " at "
+ (coverBy.getValue() * 100) + " %");
addColspan(sheet, rateCell, 2);

Expand Down
138 changes: 138 additions & 0 deletions RETA-core/src/main/java/com/ben12/reta/model/GraphData.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
// Package : com.ben12.reta.model
// File : GraphData.java
//
// Copyright (C) 2025 Beno�t Moreau (ben.12)
//
// This file is part of RETA (Requirement Engineering Traceability Analysis).
//
// RETA is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// RETA is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with RETA. If not, see <http://www.gnu.org/licenses/>.
package com.ben12.reta.model;

import java.util.Map;

/**
* @author Beno�t Moreau (ben.12)
*/
public class GraphData
{
private final String html;

private final Map<String, InputRequirementSource> sourceEntities;

private final Map<String, Link> links;

/**
* @param pHtml
* SVG source
* @param pSourceEntities
* requirement source alias
* @param pLinks
* links identifiers
*/
public GraphData(final String pHtml, final Map<String, InputRequirementSource> pSourceEntities,
final Map<String, Link> pLinks)
{
this.html = pHtml;
this.sourceEntities = pSourceEntities;
this.links = pLinks;
}

/**
* @return the svg source
*/
public String getHtml()
{
return html;
}

/**
* @return the requirement source alias
*/
public Map<String, InputRequirementSource> getSourceEntities()
{
return sourceEntities;
}

/**
* @return the links identifiers
*/
public Map<String, Link> getLinks()
{
return links;
}

public static class Link
{
private final String line;

private final InputRequirementSource source1;

private final RequirementImpl req1;

private final InputRequirementSource source2;

private final RequirementImpl req2;

public Link(final String pLine, final InputRequirementSource pSource1, final RequirementImpl pReq1,
final InputRequirementSource pSource2, final RequirementImpl pReq2)
{
this.line = pLine;
this.source1 = pSource1;
this.req1 = pReq1;
this.source2 = pSource2;
this.req2 = pReq2;

}

/**
* @return the line
*/
public String getLine()
{
return line;
}

/**
* @return the source1
*/
public InputRequirementSource getSource1()
{
return source1;
}

/**
* @return the req1
*/
public RequirementImpl getReq1()
{
return req1;
}

/**
* @return the source2
*/
public InputRequirementSource getSource2()
{
return source2;
}

/**
* @return the req2
*/
public RequirementImpl getReq2()
{
return req2;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class RequirementImpl implements Requirement, Comparable<RequirementImpl>
/** Requirement extra attributes name and value. */
private Map<String, String> attributes = null;

/** Set of requirements cover by this requirement. */
/** Set of requirements covered by this requirement. */
private Set<RequirementImpl> references = null;

/** Set of requirements covering this requirement. */
Expand Down Expand Up @@ -306,7 +306,7 @@ public int getReferredByCount()
*/
public List<RequirementImpl> getReferredByRequirement()
{
return (referredBy == null ? new ArrayList<RequirementImpl>(0) : new ArrayList<RequirementImpl>(referredBy));
return (referredBy == null ? new ArrayList<>(0) : new ArrayList<>(referredBy));
}

/**
Expand All @@ -316,7 +316,7 @@ public List<RequirementImpl> getReferredByRequirement()
*/
public List<RequirementImpl> getReferredByRequirementFor(final InputRequirementSource aSource)
{
return (referredBy == null ? new ArrayList<RequirementImpl>(0)
return (referredBy == null ? new ArrayList<>(0)
: referredBy.stream().filter((r) -> r.getSource() == aSource).distinct().collect(Collectors.toList()));
}

Expand All @@ -325,9 +325,12 @@ public List<RequirementImpl> getReferredByRequirementFor(final InputRequirementS
*/
public List<InputRequirementSource> getReferredBySource()
{
return (referredBy == null ? new ArrayList<InputRequirementSource>(0)
: referredBy.stream().map(RequirementImpl::getSource).filter(Objects::nonNull).distinct().collect(
Collectors.toList()));
return (referredBy == null ? new ArrayList<>(0)
: referredBy.stream()
.map(RequirementImpl::getSource)
.filter(Objects::nonNull)
.distinct()
.collect(Collectors.toList()));
}

/*
Expand Down
Loading