Skip to content

260 Aspec Reporter#261

Merged
redcatbear merged 62 commits into
developfrom
feature/260-aspec_reporter
May 24, 2021
Merged

260 Aspec Reporter#261
redcatbear merged 62 commits into
developfrom
feature/260-aspec_reporter

Conversation

@poldi2015

Copy link
Copy Markdown
Contributor

The Aspec Report is a new reporter with name "apec" that reports all items and their coverage and linkage as XML file so that that tracing renerated by openfasttrace can be processed by other tools.

Closes #260

Bernd Haberstumpf added 16 commits February 6, 2021 17:36
… copy of the Specobject exporter. No tests yet.
…verCoveredAttributeTypes within addLinkToItemWithStatus. Removed mthods to update coveredAttributeTypes and overCoveredAttributeTypes from outside. Updated related test. Added getCoveredApprovedAttributeTypes(). Added isCoveredShallowWithApprovedItems(). Added getDeepCoverageStatusOnlyAcceptApprovedItems().
…pport to only considered approved requirement for coverage.
…o provide coverred shallow and transient coverage honouring item status.
@poldi2015 poldi2015 self-assigned this Apr 26, 2021
@poldi2015 poldi2015 changed the title WIP: 260 Aspec Reporter 260 Aspec Reporter Apr 29, 2021
@poldi2015

Copy link
Copy Markdown
Contributor Author

@redcatbear , @kaklakariada please review

Comment thread doc/user_guide.md

@kaklakariada kaklakariada left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you for your changes!
Please still wait for @redcatbear 's review.

Comment thread exporter/common/pom.xml

@redcatbear redcatbear left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First review. Until mid of user_guide.md.

Comment thread doc/user_guide.md Outdated
Comment thread doc/user_guide.md Outdated
Comment thread doc/user_guide.md Outdated
Comment thread doc/user_guide.md Outdated
Comment thread doc/user_guide.md Outdated
poldi2015 and others added 9 commits May 11, 2021 15:40
Co-authored-by: Sebastian Bär <redcatbear@ursus-minor.de>
Co-authored-by: Sebastian Bär <redcatbear@ursus-minor.de>
Co-authored-by: Sebastian Bär <redcatbear@ursus-minor.de>
Co-authored-by: Sebastian Bär <redcatbear@ursus-minor.de>
Co-authored-by: Sebastian Bär <redcatbear@ursus-minor.de>
Co-authored-by: Sebastian Bär <redcatbear@ursus-minor.de>
Co-authored-by: Sebastian Bär <redcatbear@ursus-minor.de>
Co-authored-by: Sebastian Bär <redcatbear@ursus-minor.de>
Co-authored-by: Sebastian Bär <redcatbear@ursus-minor.de>
@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 12 Code Smells

87.1% 87.1% Coverage
0.0% 0.0% Duplication

private DeepCoverageStatus adjustDeepCoverageStatusIfApprovedRequired(boolean onlyAcceptApprovedItemStatus,
DeepCoverageStatus deepCoveredStatus)
{
if (onlyAcceptApprovedItemStatus && deepCoveredStatus == DeepCoverageStatus.COVERED && !isApproved())

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the method as such.
To keep things final, please replace if by return statement using the ? operator. This way the parameters don't need to be modified.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DONE

Comment on lines +105 to +116
writer.writeStartDocument( "UTF-8", "1.0" );
writer.writeStartElement( "specdocument" );

for( final Map.Entry<String, List<LinkedSpecificationItem>> entry : items.entrySet() )
{
final String doctype = entry.getKey();
final List<LinkedSpecificationItem> specItems = entry.getValue();
writeItems( writer, doctype, specItems );
}

writer.writeEndElement();
writer.writeEndDocument();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
writer.writeStartDocument( "UTF-8", "1.0" );
writer.writeStartElement( "specdocument" );
for( final Map.Entry<String, List<LinkedSpecificationItem>> entry : items.entrySet() )
{
final String doctype = entry.getKey();
final List<LinkedSpecificationItem> specItems = entry.getValue();
writeItems( writer, doctype, specItems );
}
writer.writeEndElement();
writer.writeEndDocument();
writer.writeStartDocument( "UTF-8", "1.0" );
writer.writeStartElement( "specdocument" );
for( final Map.Entry<String, List<LinkedSpecificationItem>> entry : items.entrySet() )
{
final String doctype = entry.getKey();
final List<LinkedSpecificationItem> specItems = entry.getValue();
writeItems( writer, doctype, specItems );
}
writer.writeEndElement();
writer.writeEndDocument();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extract for loop to method.

final IndentingXMLStreamWriter indentingXmlWriter = new IndentingXMLStreamWriter( xmlWriter );
final Map<String, List<LinkedSpecificationItem>> items = groupByDoctype( this.trace.getItems().stream() );

LOG.info( "aspec starting" );

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On log level INFO you should be a bit more specific. :-)

Remember, this is the default level, so users will always see this.

Otherwise adhere to E. S. Raymond's rule of silence: "If an application has nothing interesting to say, it should say nothing." :-)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a tracing message. Change to fine()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DONE

writer.writeEndElement();
}

private void writeItem( final XMLStreamWriter writer, final LinkedSpecificationItem item ) throws XMLStreamException

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please split this method into section by extracting cohesive parts to methods with speaking names.

Comment on lines +215 to +230
if( linkStatus == LinkStatus.COVERED_SHALLOW && deepCoverageStatus == DeepCoverageStatus.COVERED )
{
writeElement( writer, "coveringStatus", CoveringStatus.COVERING.getLabel() );
}
else if( linkStatus == LinkStatus.COVERED_SHALLOW )
{
writeElement( writer, "coveringStatus", CoveringStatus.UNCOVERED.getLabel() );
}
else if( linkStatus == LinkStatus.COVERED_PREDATED || linkStatus == LinkStatus.COVERED_OUTDATED )
{
writeElement( writer, "coveringStatus", CoveringStatus.OUTDATED.getLabel() );
}
else if( linkStatus == LinkStatus.AMBIGUOUS || linkStatus == LinkStatus.COVERED_UNWANTED )
{
writeElement( writer, "coveringStatus", CoveringStatus.UNEXPECTED.getLabel() );
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extract method.

@redcatbear redcatbear left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with one minor change left.

…SpecificationItem.java

Co-authored-by: Sebastian Bär <redcatbear@ursus-minor.de>
@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 9 Code Smells

88.0% 88.0% Coverage
0.0% 0.0% Duplication

@redcatbear redcatbear merged commit 4a1e879 into develop May 24, 2021
@redcatbear redcatbear deleted the feature/260-aspec_reporter branch May 24, 2021 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

XML exporter

3 participants