Skip to content
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

Support for multiple reports with different granularity (file, class, method) #9

Open
wants to merge 42 commits into
base: master
Choose a base branch
from

Conversation

victorgveloso
Copy link

@victorgveloso victorgveloso commented Mar 1, 2021

Added 2 csv optional reports (enabled by default). Each report contains test smells that affects a different granularity.

  • File is the old/default report,
  • Class is class-only reports, e.g. Lazy Test, Default Test, and Constructor Initialization
  • Method is for test smells that affects methods, e.g. Assertion Roulette, Empty Test, and Conditional Test Logic

Tests included

…renamed to hasSmell and hasProductionFile, reformatted code, pulled up similar members between TestClass and TestMethod, removed commented code, redundant comments and unused methods and variables, moved member initializeSmells to Main, extracted parseIntoCompilationUnit from duplication on detectSmells and reorganized for-loop on detectSmells
… fixed some warnings from GeneralFixture.java
…n the validation methods from AbstractSmell to MethodValidator
…l -> addDetectableSmell, TestFile.addSmell -> addDetectedSmell, ResultsWriter.writeColumnName -> writeColumnNames)
…BeforeEach' as setUp annotation and empty catch block on detectSmells (preventing FileNotFoundException propagation)
…writeCSV, moved output file handling methods from Main to ResultsWriter, related CSV header definition with properties through HashMap on TestFile.getTestDescriptionEntries method
…sWriter), removed code duplication by extracting methods (TestFile.removeExtension and TestFile.extractFileFromPath), removed TestSmellDetector.detectSmells return confusion (it was returning the param it received)
…lename without "." (dot) remain the same when its extension is removed
…rator aren't treated as special cases, they throw an IllegalArgumentException instead
…erclass of SmellyElement, TestClass and TestMethod TestSmellDetector add Smells on them (they now are compatible to ResultsWriter operations).
…anularity cfg by properties and handled by ReportController. Supported granularities: CLASS, METHOD and FILE.
…d with custom annotation and configured properly on maven). Necessary changes to TestSmellDetector to handle tested code on resources (also included on commit).
…ct' and improved assertions (validates no smells is detected); Dropped lambda usage on MethodValidatorTest (using Command pattern instead)
…e type smells on SmellsContainer.addDetectedSmell
…SmellDetector.detectSmells (it prevents duplicate smells removal on smells merging)
…when required). IgnoredTest results in false positive; ConstructorInitialization and GeneralFixture are not detected.
… path extraction based on first occurrence instead of last (fixing Queue test-case), ReportController tests partially implemented (FILE granularity is working)
…ty tests and missing Queue (smells-free) project resource
@victorgveloso
Copy link
Author

For optional reports configuration check properties file at https://github.com/victorgveloso/TestSmellDetector/blob/master/src/resources/test-smells.properties

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants