Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subclass replacement operator #75

Merged
merged 24 commits into from
Feb 14, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactoring mutant operator tests
Durieux Pol committed Feb 12, 2024
commit 35ed327015046c3828792cb7dc5edf6d21ddcf0e
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Class {
#name : 'MTAuxiliarClassForSubclassReplacementOperatorBis',
#superclass : 'Object',
#category : 'MuTalk-TestResources',
#package : 'MuTalk-TestResources'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Class {
#name : 'MTAuxiliarSubclassForSubclassReplacementOperatorBis',
#superclass : 'MTAuxiliarClassForSubclassReplacementOperatorBis',
#category : 'MuTalk-TestResources',
#package : 'MuTalk-TestResources'
}
26 changes: 25 additions & 1 deletion src/MuTalk-Tests/MTAssignmentNullifierOperatorTest.class.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Class {
#name : 'MTAssignmentNullifierOperatorTest',
#superclass : 'MTMutantOperatorTest',
#superclass : 'MTPredicateBasedMutantOperatorTest',
#category : 'MuTalk-Tests',
#package : 'MuTalk-Tests'
}
@@ -49,6 +49,30 @@ MTAssignmentNullifierOperatorTest >> methodWithTwoSendersModifiedSecond [
j := nil
]

{ #category : 'accessing' }
MTAssignmentNullifierOperatorTest >> newNodeOneSender [

^ RBAssignmentNode
variable: (RBVariableNode named: #i)
value: (RBLiteralValueNode value: nil)
]

{ #category : 'accessing' }
MTAssignmentNullifierOperatorTest >> newNodeTwoSendersFirst [

^ RBAssignmentNode
variable: (RBVariableNode named: #i)
value: (RBLiteralValueNode value: nil)
]

{ #category : 'accessing' }
MTAssignmentNullifierOperatorTest >> newNodeTwoSendersSecond [

^ RBAssignmentNode
variable: (RBVariableNode named: #j)
value: (RBLiteralValueNode value: nil)
]

{ #category : 'accessing' }
MTAssignmentNullifierOperatorTest >> operator [

8 changes: 7 additions & 1 deletion src/MuTalk-Tests/MTEmptyMethodOperatorTest.class.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Class {
#name : 'MTEmptyMethodOperatorTest',
#superclass : 'MTMutantOperatorTest',
#superclass : 'MTPredicateBasedMutantOperatorTest',
#category : 'MuTalk-Tests',
#package : 'MuTalk-Tests'
}
@@ -18,6 +18,12 @@ MTEmptyMethodOperatorTest >> methodWithOneSenderModified [

]

{ #category : 'accessing' }
MTEmptyMethodOperatorTest >> newNodeOneSender [

^ RBSequenceNode statements: #( )
]

{ #category : 'accessing' }
MTEmptyMethodOperatorTest >> operator [

20 changes: 19 additions & 1 deletion src/MuTalk-Tests/MTLiteralBooleanNegateOperatorTest.class.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Class {
#name : 'MTLiteralBooleanNegateOperatorTest',
#superclass : 'MTMutantOperatorTest',
#superclass : 'MTPredicateBasedMutantOperatorTest',
#category : 'MuTalk-Tests',
#package : 'MuTalk-Tests'
}
@@ -41,6 +41,24 @@ MTLiteralBooleanNegateOperatorTest >> methodWithTwoSendersModifiedSecond [
^ true & true
]

{ #category : 'accessing' }
MTLiteralBooleanNegateOperatorTest >> newNodeOneSender [

^ RBLiteralValueNode value: false
]

{ #category : 'accessing' }
MTLiteralBooleanNegateOperatorTest >> newNodeTwoSendersFirst [

^ RBLiteralValueNode value: false
]

{ #category : 'accessing' }
MTLiteralBooleanNegateOperatorTest >> newNodeTwoSendersSecond [

^ RBLiteralValueNode value: true
]

{ #category : 'accessing' }
MTLiteralBooleanNegateOperatorTest >> operator [

20 changes: 19 additions & 1 deletion src/MuTalk-Tests/MTLiteralIntegersIncreaseOperatorTest.class.st
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ A LiteralIntegersIncreaseOperatorTest is a test class for testing the behavior o
"
Class {
#name : 'MTLiteralIntegersIncreaseOperatorTest',
#superclass : 'MTMutantOperatorTest',
#superclass : 'MTPredicateBasedMutantOperatorTest',
#category : 'MuTalk-Tests',
#package : 'MuTalk-Tests'
}
@@ -44,6 +44,24 @@ MTLiteralIntegersIncreaseOperatorTest >> methodWithTwoSendersModifiedSecond [
^ 1 >= 3
]

{ #category : 'accessing' }
MTLiteralIntegersIncreaseOperatorTest >> newNodeOneSender [

^ RBLiteralValueNode value: 2
]

{ #category : 'accessing' }
MTLiteralIntegersIncreaseOperatorTest >> newNodeTwoSendersFirst [

^ RBLiteralValueNode value: 2
]

{ #category : 'accessing' }
MTLiteralIntegersIncreaseOperatorTest >> newNodeTwoSendersSecond [

^ RBLiteralValueNode value: 3
]

{ #category : 'accessing' }
MTLiteralIntegersIncreaseOperatorTest >> operator [

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Class {
#name : 'MTMessageSendArguments1stNullifierOperatorTest',
#superclass : 'MTMutantOperatorTest',
#superclass : 'MTPredicateBasedMutantOperatorTest',
#category : 'MuTalk-Tests',
#package : 'MuTalk-Tests'
}
@@ -22,7 +22,6 @@ MTMessageSendArguments1stNullifierOperatorTest >> methodWithOneSender [
{ #category : 'accessing' }
MTMessageSendArguments1stNullifierOperatorTest >> methodWithOneSenderModified [


| o |
o := OrderedCollection new.
o at: nil put: 2
@@ -31,11 +30,10 @@ MTMessageSendArguments1stNullifierOperatorTest >> methodWithOneSenderModified [
{ #category : 'accessing' }
MTMessageSendArguments1stNullifierOperatorTest >> methodWithTwoSenders [


| o |
o := OrderedCollection new.
o at: 1 put: 2.
o at: 1 .
o at: 1
]

{ #category : 'accessing' }
@@ -56,6 +54,37 @@ MTMessageSendArguments1stNullifierOperatorTest >> methodWithTwoSendersModifiedSe
o at: nil
]

{ #category : 'accessing' }
MTMessageSendArguments1stNullifierOperatorTest >> newNodeOneSender [

^ RBMessageNode
receiver: (RBVariableNode named: #o)
selector: #at:put:
arguments: {
(RBLiteralValueNode value: nil).
(RBLiteralValueNode value: 2) }
]

{ #category : 'accessing' }
MTMessageSendArguments1stNullifierOperatorTest >> newNodeTwoSendersFirst [

^ RBMessageNode
receiver: (RBVariableNode named: #o)
selector: #at:put:
arguments: {
(RBLiteralValueNode value: nil).
(RBLiteralValueNode value: 2) }
]

{ #category : 'accessing' }
MTMessageSendArguments1stNullifierOperatorTest >> newNodeTwoSendersSecond [

^ RBMessageNode
receiver: (RBVariableNode named: #o)
selector: #at:
arguments: { (RBLiteralValueNode value: nil) }
]

{ #category : 'accessing' }
MTMessageSendArguments1stNullifierOperatorTest >> operator [

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Class {
#name : 'MTMessageSendArguments3rdNullifierOperatorTest',
#superclass : 'MTMutantOperatorTest',
#superclass : 'MTPredicateBasedMutantOperatorTest',
#category : 'MuTalk-Tests',
#package : 'MuTalk-Tests'
}
@@ -17,7 +17,7 @@ MTMessageSendArguments3rdNullifierOperatorTest >> methodWithOneSender [
| o |
o := OrderedCollection new.
o at: 1 put: 2.
o collect: [:s | s] from: 0 to: 2.
o collect: [ :s | s ] from: 0 to: 2.
o at: 1 put: 2
]

@@ -64,6 +64,50 @@ MTMessageSendArguments3rdNullifierOperatorTest >> methodWithTwoSendersModifiedSe
o at: 1 put: 2
]

{ #category : 'accessing' }
MTMessageSendArguments3rdNullifierOperatorTest >> newNodeOneSender [

^ RBMessageNode
receiver: (RBVariableNode named: #o)
selector: #collect:from:to:
arguments: {
(RBBlockNode
arguments: { (RBVariableNode named: #s) }
body: (RBSequenceNode statements: { (RBVariableNode named: #s) })).
(RBLiteralValueNode value: 0).
(RBLiteralValueNode value: nil) }
]

{ #category : 'accessing' }
MTMessageSendArguments3rdNullifierOperatorTest >> newNodeTwoSendersFirst [

^ RBMessageNode
receiver: (RBVariableNode named: #o)
selector: #collect:from:to:
arguments: {
(RBBlockNode
arguments: { (RBVariableNode named: #s) }
body:
(RBSequenceNode statements: { (RBVariableNode named: #s) })).
(RBLiteralValueNode value: 0).
(RBLiteralValueNode value: nil) }
]

{ #category : 'accessing' }
MTMessageSendArguments3rdNullifierOperatorTest >> newNodeTwoSendersSecond [

^ RBMessageNode
receiver: (RBVariableNode named: #o)
selector: #collect:from:to:
arguments: {
(RBBlockNode
arguments: { (RBVariableNode named: #s) }
body:
(RBSequenceNode statements: { (RBVariableNode named: #s) })).
(RBLiteralValueNode value: 0).
(RBLiteralValueNode value: nil) }
]

{ #category : 'accessing' }
MTMessageSendArguments3rdNullifierOperatorTest >> operator [

31 changes: 28 additions & 3 deletions src/MuTalk-Tests/MTMessageSendToYourselfOperatorTest.class.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Class {
#name : 'MTMessageSendToYourselfOperatorTest',
#superclass : 'MTMutantOperatorTest',
#superclass : 'MTPredicateBasedMutantOperatorTest',
#category : 'MuTalk-Tests',
#package : 'MuTalk-Tests'
}
@@ -26,8 +26,9 @@ MTMessageSendToYourselfOperatorTest >> methodWithOneSenderModified [
{ #category : 'accessing' }
MTMessageSendToYourselfOperatorTest >> methodWithTwoSenders [

| dict |
dict:= Dictionary new. dict at: 1 put: 2
| dict |
dict := Dictionary new.
dict at: 1 put: 2
]

{ #category : 'accessing' }
@@ -46,6 +47,30 @@ MTMessageSendToYourselfOperatorTest >> methodWithTwoSendersModifiedSecond [
dict yourself
]

{ #category : 'accessing' }
MTMessageSendToYourselfOperatorTest >> newNodeOneSender [

^ RBSequenceNode statements: { (RBMessageNode
receiver: (RBVariableNode named: #self)
selector: #yourself) }
]

{ #category : 'accessing' }
MTMessageSendToYourselfOperatorTest >> newNodeTwoSendersFirst [

^ RBSequenceNode statements: { (RBMessageNode
receiver: (RBVariableNode named: #Dictionary)
selector: #yourself) }
]

{ #category : 'accessing' }
MTMessageSendToYourselfOperatorTest >> newNodeTwoSendersSecond [

^ RBSequenceNode statements: { (RBMessageNode
receiver: (RBVariableNode named: #dict)
selector: #yourself) }
]

{ #category : 'accessing' }
MTMessageSendToYourselfOperatorTest >> operator [

Loading