-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from DurieuxPol/feat/newOps
New mutant operators
- Loading branch information
Showing
58 changed files
with
521 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Class { | ||
#name : 'MTAssignmentNullifierOperator', | ||
#superclass : 'MTBlockBasedMutantOperator', | ||
#category : 'MuTalk-Model-Operators', | ||
#package : 'MuTalk-Model', | ||
#tag : 'Operators' | ||
} | ||
|
||
{ #category : 'printing' } | ||
MTAssignmentNullifierOperator >> description [ | ||
|
||
^ 'Nullify the value assigned' | ||
] | ||
|
||
{ #category : 'applying' } | ||
MTAssignmentNullifierOperator >> expressionToReplace [ | ||
|
||
^ [ :aNode | aNode isAssignment & aNode value isNotNil ] | ||
] | ||
|
||
{ #category : 'applying' } | ||
MTAssignmentNullifierOperator >> newExpression [ | ||
|
||
^ [ :anOldNode | | ||
| nodeCopy | | ||
nodeCopy := anOldNode copy. | ||
nodeCopy value: (RBLiteralValueNode value: nil). | ||
nodeCopy ] | ||
] |
19 changes: 19 additions & 0 deletions
19
src/MuTalk-Model/MTReplaceWhileFalseReceiverOperator.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Class { | ||
#name : 'MTReplaceWhileFalseReceiverOperator', | ||
#superclass : 'MTReplaceReceiverOperator', | ||
#category : 'MuTalk-Model-Operators', | ||
#package : 'MuTalk-Model', | ||
#tag : 'Operators' | ||
} | ||
|
||
{ #category : 'testing' } | ||
MTReplaceWhileFalseReceiverOperator class >> isAbstract [ | ||
|
||
^ self == MTReplaceWhileFalseReceiverOperator | ||
] | ||
|
||
{ #category : 'applying' } | ||
MTReplaceWhileFalseReceiverOperator >> selector [ | ||
|
||
^ #whileFalse: | ||
] |
13 changes: 13 additions & 0 deletions
13
src/MuTalk-Model/MTReplaceWhileFalseReceiverWithFalseOperator.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Class { | ||
#name : 'MTReplaceWhileFalseReceiverWithFalseOperator', | ||
#superclass : 'MTReplaceWhileFalseReceiverOperator', | ||
#category : 'MuTalk-Model-Operators', | ||
#package : 'MuTalk-Model', | ||
#tag : 'Operators' | ||
} | ||
|
||
{ #category : 'applying' } | ||
MTReplaceWhileFalseReceiverWithFalseOperator >> newReceiverExpression [ | ||
|
||
^ 'false' | ||
] |
13 changes: 13 additions & 0 deletions
13
src/MuTalk-Model/MTReplaceWhileFalseReceiverWithTrueOperator.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Class { | ||
#name : 'MTReplaceWhileFalseReceiverWithTrueOperator', | ||
#superclass : 'MTReplaceWhileFalseReceiverOperator', | ||
#category : 'MuTalk-Model-Operators', | ||
#package : 'MuTalk-Model', | ||
#tag : 'Operators' | ||
} | ||
|
||
{ #category : 'applying' } | ||
MTReplaceWhileFalseReceiverWithTrueOperator >> newReceiverExpression [ | ||
|
||
^ 'true' | ||
] |
19 changes: 19 additions & 0 deletions
19
src/MuTalk-Model/MTReplaceWhileFalseWithWhileTrueMutantOperator.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Class { | ||
#name : 'MTReplaceWhileFalseWithWhileTrueMutantOperator', | ||
#superclass : 'MTSelectorReplacementMutantOperator', | ||
#category : 'MuTalk-Model-Operators', | ||
#package : 'MuTalk-Model', | ||
#tag : 'Operators' | ||
} | ||
|
||
{ #category : 'accessing' } | ||
MTReplaceWhileFalseWithWhileTrueMutantOperator >> newSelector [ | ||
|
||
^ #whileTrue: | ||
] | ||
|
||
{ #category : 'accessing' } | ||
MTReplaceWhileFalseWithWhileTrueMutantOperator >> oldSelector [ | ||
|
||
^ #whileFalse: | ||
] |
19 changes: 19 additions & 0 deletions
19
src/MuTalk-Model/MTReplaceWhileTrueReceiverOperator.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Class { | ||
#name : 'MTReplaceWhileTrueReceiverOperator', | ||
#superclass : 'MTReplaceReceiverOperator', | ||
#category : 'MuTalk-Model-Operators', | ||
#package : 'MuTalk-Model', | ||
#tag : 'Operators' | ||
} | ||
|
||
{ #category : 'testing' } | ||
MTReplaceWhileTrueReceiverOperator class >> isAbstract [ | ||
|
||
^ self == MTReplaceWhileTrueReceiverOperator | ||
] | ||
|
||
{ #category : 'applying' } | ||
MTReplaceWhileTrueReceiverOperator >> selector [ | ||
|
||
^ #whileTrue: | ||
] |
13 changes: 13 additions & 0 deletions
13
src/MuTalk-Model/MTReplaceWhileTrueReceiverWithFalseOperator.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Class { | ||
#name : 'MTReplaceWhileTrueReceiverWithFalseOperator', | ||
#superclass : 'MTReplaceWhileTrueReceiverOperator', | ||
#category : 'MuTalk-Model-Operators', | ||
#package : 'MuTalk-Model', | ||
#tag : 'Operators' | ||
} | ||
|
||
{ #category : 'applying' } | ||
MTReplaceWhileTrueReceiverWithFalseOperator >> newReceiverExpression [ | ||
|
||
^ 'false' | ||
] |
13 changes: 13 additions & 0 deletions
13
src/MuTalk-Model/MTReplaceWhileTrueReceiverWithTrueOperator.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Class { | ||
#name : 'MTReplaceWhileTrueReceiverWithTrueOperator', | ||
#superclass : 'MTReplaceWhileTrueReceiverOperator', | ||
#category : 'MuTalk-Model-Operators', | ||
#package : 'MuTalk-Model', | ||
#tag : 'Operators' | ||
} | ||
|
||
{ #category : 'applying' } | ||
MTReplaceWhileTrueReceiverWithTrueOperator >> newReceiverExpression [ | ||
|
||
^ 'true' | ||
] |
19 changes: 19 additions & 0 deletions
19
src/MuTalk-Model/MTReplaceWhileTrueWithWhileFalseMutantOperator.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Class { | ||
#name : 'MTReplaceWhileTrueWithWhileFalseMutantOperator', | ||
#superclass : 'MTSelectorReplacementMutantOperator', | ||
#category : 'MuTalk-Model-Operators', | ||
#package : 'MuTalk-Model', | ||
#tag : 'Operators' | ||
} | ||
|
||
{ #category : 'accessing' } | ||
MTReplaceWhileTrueWithWhileFalseMutantOperator >> newSelector [ | ||
|
||
^ #whileFalse: | ||
] | ||
|
||
{ #category : 'accessing' } | ||
MTReplaceWhileTrueWithWhileFalseMutantOperator >> oldSelector [ | ||
|
||
^ #whileTrue: | ||
] |
56 changes: 56 additions & 0 deletions
56
src/MuTalk-Tests/MTAssignmentNullifierOperatorTest.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
Class { | ||
#name : 'MTAssignmentNullifierOperatorTest', | ||
#superclass : 'MTMutantOperatorTest', | ||
#category : 'MuTalk-Tests', | ||
#package : 'MuTalk-Tests' | ||
} | ||
|
||
{ #category : 'accessing' } | ||
MTAssignmentNullifierOperatorTest >> methodWithNoSenders [ | ||
|
||
^ 1 + 2 | ||
] | ||
|
||
{ #category : 'accessing' } | ||
MTAssignmentNullifierOperatorTest >> methodWithOneSender [ | ||
|
||
| i | | ||
i := 1 | ||
] | ||
|
||
{ #category : 'accessing' } | ||
MTAssignmentNullifierOperatorTest >> methodWithOneSenderModified [ | ||
|
||
| i | | ||
i := nil | ||
] | ||
|
||
{ #category : 'accessing' } | ||
MTAssignmentNullifierOperatorTest >> methodWithTwoSenders [ | ||
|
||
| i j | | ||
i := 1. | ||
j := 2 | ||
] | ||
|
||
{ #category : 'accessing' } | ||
MTAssignmentNullifierOperatorTest >> methodWithTwoSendersModifiedFirst [ | ||
|
||
| i j | | ||
i := nil. | ||
j := 2 | ||
] | ||
|
||
{ #category : 'accessing' } | ||
MTAssignmentNullifierOperatorTest >> methodWithTwoSendersModifiedSecond [ | ||
|
||
| i j | | ||
i := 1. | ||
j := nil | ||
] | ||
|
||
{ #category : 'accessing' } | ||
MTAssignmentNullifierOperatorTest >> operator [ | ||
|
||
^ MTAssignmentNullifierOperator new | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.