-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Created a variable replacer mutation operator * Fixed typo in variable replacer operator examples * Work item now stores parameter information * Work DB now stores operator args and applies them * Initialisation only tries mutation operators without args if none are specified * Mutate and test now robust to lack of operator_args * Added a variable inserter mutation operator * Updated VariableInserter documentation * Removed unneccessary comment from variable inserter * VariableReplacer now replaces all usages of variable in statement * Example dataclass added and tests updated * Added exception to TypeError to catch operator args typos * Refactored getting operator args in init * Config is now loaded with a configuration or None
- Loading branch information
Andrew Clark
authored
Sep 3, 2022
1 parent
aff93d9
commit e02b8ec
Showing
22 changed files
with
316 additions
and
93 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"""Data class to store example applications of mutation operators. | ||
These structures are used for testing purposes.""" | ||
import dataclasses | ||
|
||
from typing import Optional | ||
|
||
|
||
@dataclasses.dataclass(frozen=True) | ||
class Example: | ||
"""A structure to store pre and post mutation operator code snippets, | ||
including optional specification of occurrence and operator args. | ||
This is used for testing whether the pre-mutation code is correctly | ||
mutated to the post-mutation code at the given occurrence (if specified) | ||
and for the given operator args (if specified). | ||
""" | ||
|
||
pre_mutation_code: str | ||
post_mutation_code: str | ||
occurrence: Optional[int] = 0 | ||
operator_args: Optional[dict] = None | ||
|
||
def __post_init__(self): | ||
if not self.operator_args: | ||
object.__setattr__(self, "operator_args", {}) |
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.