XNose
A Test Smell Detector for C#
Install / Use
/learn @tonoy30/XNoseREADME
xNose: A Test Smell Detector for C#
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)
Setup
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.
JSON File Format
[
{
"Class_Name": ***,
"Message": <if Lack of Cohesion present for this class>,
"Methods": [
{
"Name":***,
"Body":***,
"Smells":[]
},
...
]
},
...
]
Related Skills
node-connect
339.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
339.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.8kCommit, push, and open a PR
