Skip to content

Latest commit

 

History

History
37 lines (30 loc) · 3.96 KB

Contributing.md

File metadata and controls

37 lines (30 loc) · 3.96 KB

Adding a Test Smell Inspection

Adding a test smell is a straightforward process

1. Create a class that extend SmellInspection

This class should follow the naming convention SmellNameInspection.java. It may be helpful to look at the existing smells as example, such as Empty Method Inspection.

2. Add an enum for the SmellType

  • This should follow the capital camel case naming convention: SMELL_NAME
    • In the case of single name smells, we have defaulted to appending _TEST to the end

    • Ex. VERBOSE_TEST rather than just VERBOSE

  • This must be unique as it is used in the text.properties.

3. Add SmellNameInspection.class file to TestSmellInspectionProvider

  • This should be the same name as the smell inspection that was created in step 1.

4. Add text data to text.properties files in Properties files

  • All lines must be prefixed with INSPECTION.SMELL.
  • This is followed by the enum for the smell as defined in step 2
  • Then the following must be defined
    • INSPECTION.SMELL.SMELL_NAME.DESCRIPTION=Description of the smell that is being defined
    • INSPECTION.SMELL.SMELL_NAME.NAME.DISPLAY=Name that is displayed in the UI
    • INSPECTION.SMELL.SMELL_NAME.NAME.SHORT=Abbreviation for the name of Smell
  • Any QuickFixes that are defined must have a description given to them like below
    • INSPECTION.SMELL.SMELL_NAME.FIX.COMMENT=Comment about how commenting of the highlighted elements fixes the issue
    • INSPECTION.SMELL.SMELL_NAME.FIX.REMOVE=Comment about how removal of the highlighted elements fixes the issue

5. For testing this new smell, see the ReadMe in the Tests directory

  • This must be completed before a test can be accepted into the suite of test smells