This tool can detect test smells written with xUnit package in C# projects. Currently, we support the following test smells:
- Assertion Roulette Test Smell
- Conditional Test Smell
- Constructor Initialization Test Smell
- Duplicate Assert Test Smell
- Empty Test Smell
- Eager Test Smell
- Ignored Test Smell
- Lack of Cohesion Smell
- Magic Number Test Smell
- Obscure In-Line Setup Test Smell
- Redundant Assertion Test Smell
- Redundant Print Smell
- Sleepy Test Smell
- Sensitive Equality Test Smell
- Unknown Test Smell
- Equal in Assert Test Smell (C# specific)
- Bool in Assert Equal Test Smell (C# specific)
- Cyclomatic Complexity Test Smell (C# specific)
To run this tool you have to download this repository in your local device. Then follow the steps to run it with command line(CMD).
** Prerequisite: You have already installed C# environment in your pc and it's already associated with your command line. **
- Go to the xNose directory
- Open terminal and type the following command
dotnet run --project xNose.Core/xNose.Core.csproj "<solution_path>"
Here the solution_path
is the path to your C# project solution file.
This will generate a JSON
file of the given project to the root path of that project. This JSON
file will have the info about test smells of the given project.
Otherwise, you can run the xNose.sln
file with your visual studio. You have to provide the solution path of the desired project in the argument section.
[
{
"Class_Name": ***,
"Message": <if Lack of Cohesion present for this class>,
"Methods": [
{
"Name":***,
"Body":***,
"Smells":[]
},
...
]
},
...
]