|
| 1 | +'https://editor.plantuml.com/ |
| 2 | +'Клас Диаграма 1: Как работи HybridArtificialBeeColonyTestCaseGenerator |
| 3 | + |
| 4 | +@startuml |
| 5 | +' === Визуален стил === |
| 6 | +skinparam classAttributeIconSize 0 |
| 7 | +skinparam interfaceBackgroundColor #D0E4F5 |
| 8 | +skinparam classBackgroundColor White |
| 9 | +skinparam classBorderColor Black |
| 10 | +skinparam interfaceBorderColor Black |
| 11 | +skinparam shadowing false |
| 12 | +skinparam linetype ortho |
| 13 | +skinparam roundcorner 0 |
| 14 | +skinparam nodesep 2.0 |
| 15 | +skinparam ranksep 2.5 |
| 16 | +top to bottom direction |
| 17 | + |
| 18 | +' === Интерфейси === |
| 19 | +interface ITestCaseGenerator { |
| 20 | + +GenerateTestCases(parameters: List<object>): HashSet<TestCase> |
| 21 | +} |
| 22 | + |
| 23 | +interface ITestCaseEvaluator { |
| 24 | + +EvaluatePopulation(population: HashSet<TestCase>): void |
| 25 | + +Evaluate(testCase: TestCase, evaluatedTestCases: HashSet<TestCase>): double |
| 26 | + +EvaluatePopulationToDictionary(population: HashSet<TestCase>): Dictionary<TestCase, double> |
| 27 | +} |
| 28 | + |
| 29 | +interface ITestCaseOutputGenerator { |
| 30 | + +GenerateOutput(methodName: string, testCases: IEnumerable<TestCase>, testCaseCategory: TestCaseCategory): void |
| 31 | +} |
| 32 | + |
| 33 | +' === Абстрактна база === |
| 34 | +abstract class TestCaseOutputGenerator implements ITestCaseOutputGenerator { |
| 35 | + +GenerateOutput(methodName: string, testCases: IEnumerable<TestCase>, testCaseCategory: TestCaseCategory): void |
| 36 | +} |
| 37 | + |
| 38 | +' === Имплементации на генератори === |
| 39 | +class PairwiseTestCaseGenerator implements ITestCaseGenerator{ |
| 40 | + +GenerateTestCases(parameters: List<object>): HashSet<TestCase> |
| 41 | +} |
| 42 | + |
| 43 | +class CombinatorialTestCaseGenerator implements ITestCaseGenerator { |
| 44 | + +GenerateTestCases(parameters: List<object>): HashSet<TestCase> |
| 45 | +} |
| 46 | + |
| 47 | +' === Имплементации на Output === |
| 48 | + |
| 49 | +class JsonTestCaseOutputGenerator extends TestCaseOutputGenerator{ |
| 50 | + +GenerateOutput(methodName: string, testCases: IEnumerable<TestCase>, testCaseCategory: TestCaseCategory): void |
| 51 | +} |
| 52 | + |
| 53 | +class CsvTestCaseOutputGenerator extends TestCaseOutputGenerator{ |
| 54 | + +GenerateOutput(methodName: string, testCases: IEnumerable<TestCase>, testCaseCategory: TestCaseCategory): void |
| 55 | +} |
| 56 | + |
| 57 | +' === Имплементация на Evaluator === |
| 58 | +class TestCaseEvaluator implements ITestCaseEvaluator { |
| 59 | + -_allowMultipleInvalidInputs: bool |
| 60 | + +EvaluatePopulation(population: HashSet<TestCase>): void |
| 61 | + +Evaluate(testCase: TestCase, evaluatedTestCases: HashSet<TestCase>): double |
| 62 | + +EvaluatePopulationToDictionary(population: HashSet<TestCase>): Dictionary<TestCase, double> |
| 63 | +} |
| 64 | + |
| 65 | +' === ABC Генератор === |
| 66 | +class HybridArtificialBeeColonyTestCaseGenerator { |
| 67 | + -_config: ABCGenerationSettings |
| 68 | + -_testCaseEvaluator: ITestCaseEvaluator |
| 69 | + -_testCaseGenerator: ITestCaseGenerator |
| 70 | + -_outputGenerator: ITestCaseOutputGenerator |
| 71 | + -_random: Random |
| 72 | + -_initialPopulationSize: int |
| 73 | + -_elitCount: int |
| 74 | + +GenerateTestCases(methodName: string, parameters: List<object>, testCaseCategory: TestCaseCategory): HashSet<TestCase> |
| 75 | + +GetGeneratedTestCases(parameters: List<object>): HashSet<TestCase> |
| 76 | + -RunABCAlgorithm(parameters: List<object>): HashSet<TestCase> |
| 77 | +} |
| 78 | + |
| 79 | +HybridArtificialBeeColonyTestCaseGenerator --> ITestCaseGenerator : uses |
| 80 | +HybridArtificialBeeColonyTestCaseGenerator --> ITestCaseEvaluator : uses |
| 81 | +HybridArtificialBeeColonyTestCaseGenerator --> ITestCaseOutputGenerator : uses |
| 82 | +HybridArtificialBeeColonyTestCaseGenerator --> ABCGenerationSettings : has |
| 83 | + |
| 84 | +' === Конфигурация === |
| 85 | +class ABCGenerationSettings { |
| 86 | + +TotalPopulationGenerations: int |
| 87 | + +MutationRate: double |
| 88 | + +FinalPopulationSelectionRatio: double |
| 89 | + +EliteSelectionRatio: double |
| 90 | + +OnlookerSelectionRatio: double |
| 91 | + +ScoutSelectionRatio: double |
| 92 | + +EnableOnlookerSelection: bool |
| 93 | + +EnableScoutPhase: bool |
| 94 | + +EnforceMutationUniqueness: bool |
| 95 | + +StagnationThresholdPercentage: double |
| 96 | + +CoolingRate: double |
| 97 | + +AllowMultipleInvalidInputs: bool |
| 98 | + +Seed: int |
| 99 | + +TestCaseGenerator: ITestCaseGenerator |
| 100 | + +TestCaseEvaluator: ITestCaseEvaluator |
| 101 | + +OutputGenerator: ITestCaseOutputGenerator |
| 102 | +} |
| 103 | + |
| 104 | +@enduml |
0 commit comments