Execute the main test generation loop until coverage goals are met or iterations exhausted. The process involves: 1. Initializing the environment 2. Repeatedly generating and validating tests 3. Checking progress after each iteration 4. Final
(self)
| 369 | self.logger.info(f"Desired Coverage: {self.test_validator.desired_coverage}%") |
| 370 | |
| 371 | def run(self): |
| 372 | """ |
| 373 | Execute the main test generation loop until coverage goals are met or iterations exhausted. |
| 374 | |
| 375 | The process involves: |
| 376 | 1. Initializing the environment |
| 377 | 2. Repeatedly generating and validating tests |
| 378 | 3. Checking progress after each iteration |
| 379 | 4. Finalizing and reporting results |
| 380 | """ |
| 381 | iteration_count = 0 |
| 382 | failed_test_runs, language, test_framework, coverage_report = self.init() |
| 383 | |
| 384 | while iteration_count < self.config.max_iterations: |
| 385 | self.logger.info(f"Iteration {iteration_count + 1} of {self.config.max_iterations}.") |
| 386 | self.generate_and_validate_tests(failed_test_runs, language, test_framework, coverage_report) |
| 387 | |
| 388 | failed_test_runs, language, test_framework, coverage_report, target_reached = self.check_iteration_progress() |
| 389 | if target_reached: |
| 390 | break |
| 391 | |
| 392 | iteration_count += 1 |
| 393 | |
| 394 | self.finalize_test_generation(iteration_count) |