Description
The Useless Test EA Smell is derived from a BPM process anti-pattern. It arises when the modeled process takes into account only a subset of possible scenarios and neglects others.
Context
Derived from: “Useless Test”
Cause
A single responsibility has been split up among a large number of classes. This can happen after overzealous reduction of Multifaceted Abstraction. All was well as long as the structure stayed small. But with new components being added, making changes has become harder and harder.
Consequences
Not considering all possible outcomes in models hinders enterprise architects to analyze other outcomes and handle the unexpected behavior.
Detection
We search for element names that denote a test. Such verbs may include “evaluate,” “verify,” and “validate”. Typically, a test scenario can yield two potential outcomes, either successful or unsuccessful. Therefore, if the test element is not followed by an OR Junction or has only one leaving path presenting only one possible outcome of the test, then the model suffers from the Useless Test EA Smell.
Solution
Move existing behaviors into a single component. If there’s no component appropriate for this, create a new one. If moving code to the same element leaves the original one almost empty, try to get rid of these now-redundant components.
Example
The element “Evaluate money withdrawal request“ has only one possible output “Process money withdrawal“, but a negative case is not considered in the model.
Cypher query
MATCH p = (m)-->(n) <br /> WHERE ANY (name in $testVerbs where toLower(m.name) CONTAINS toLower(name)) <br /> and NOT EXISTS ((m)-->(:Junction {type: "or"})) <br /> RETURN p <br /> UNION <br /> MATCH (m)-->(Junction {type: 'or'})-->(n) <br /> WITH m, COUNT (n) as testReslults <br /> WHERE testReslults=1 <br /> MATCH p=(m)-->(Junction {type: 'or'})-->(n) <br /> WHERE any (name in $testVerbs where toLower(m.name) CONTAINS toLower(name)) <br /> RETURN pCypher count query
MATCH p = (m)-->(n) WHERE any (name in $testVerbs where toLower(m.name) CONTAINS toLower(name)) and NOT EXISTS ((m)-->(:Junction {type: 'or'})) RETURN count(DISTINCT m)Diagram

Tags
Understandability Problems, Process
Query parameters
[
{
"name": "testVerbs",
"type": "list",
"default": [
"test",
"verify",
"execute",
"evaluate"
],
"description": "List of verbs that indicates a test or verification."
}
]Related smells
- Multifaceted Abstraction (relates)
- Nanoservices (follows)