DeepExplore is an automated functional exploration testing framework that combines Finite State Machine (FSM) and Model-Based Testing (MBT) principles. It provides a flexible, configuration-driven approach for testing complex state transitions in cloud platforms and distributed systems.
- State Machine Support: Track instance states with automatic cache and retry mechanisms
- Model-Based Testing: Multiple execution strategies (random/sequential scenarios and actions)
- Flexible Stopping Conditions: Time-based, step-based, or custom ending criteria
- Precondition Validation: Status matching, data matching, and custom function-based checks
- Scenario Composition: Combine multiple actions into complex test scenarios
- Configuration-Driven: Define tests via YAML/JSON without code modification
- Extensible Architecture: Factory patterns for easy extension of modes, conditions, and checks
pip install deep-exploreFor development with YAML support:
pip install deep-explore[yaml,dev]from deep_explore import DeepExploreObject
class MyTestObject(DeepExploreObject):
def _do_update_state(self):
# Fetch current state from your system
self.data = self.client.get_instance_info()
def get_status(self):
# Return the current status
return self.data.get('status')
def instance_id(self):
# Resolver for dynamic parameters
return self.data['id']
mode_type: random_scenario
stopping_criteria_list:
- criteria_type: step
max_steps: 100
scenario_list:
- scenario_name: "Create and Delete Test"
scenario_precondition_list:
- precondition_type: status
precondition_data: ["available"]
compare_result: true
action_list:
- action_name: "create_resource"
action_public_client: "my_client.ResourceClient"
action_args:
- name: "test-resource"
- "_resolver_instance_id"
action_post_check_list:
- check_info: ["my_checks.check_created"]
check_result: true
- action_name: "delete_resource"
action_public_client: "my_client.ResourceClient"
action_args:
- "_resolver_instance_id"
action_precondition_list:
- precondition_type: status
precondition_data: ["running"]
compare_result: trueimport yaml
from deep_explore import DeepExploreLoader
# Create your test object
test_obj = MyTestObject()
# Load configuration
with open('config.yaml') as f:
config = yaml.safe_load(f)
# Create test mode
mode = DeepExploreLoader.load_deep_explore_mode(test_obj, config)
# Run the test
mode.exec_test()
┌─────────────────────────────────────────────────────────┐
│ DeepExplore Framework │
├─────────────────────────────────────────────────────────┤
│ DeepExploreMode (MBT Strategies) │
│ • RandomScenario • SequenceScenario │
├─────────────────────────────────────────────────────────┤
│ DeepExploreObject (FSM State Management) │
│ • State Tracking • ERIS Integration │
│ • Parameter Resolvers │
├─────────────────────────────────────────────────────────┤
│ Scenarios & Actions │
│ • Preconditions • Pre/Post Checks │
│ • Action Execution │
├─────────────────────────────────────────────────────────┤
│ Stopping Criteria & Validation │
│ • Step/Time Based • Custom Conditions │
└─────────────────────────────────────────────────────────┘
For detailed architecture documentation, see docs/deep_explore架构设计文档.md.
| Mode | Description |
|---|---|
random_scenario |
Randomly select and execute scenarios |
sequence_scenario |
Execute scenarios in order (supports reverse) |
Note: When a scenario contains only one action, it functions equivalently to the former action mode.
| Type | Description |
|---|---|
step |
Stop after N steps |
time |
Stop after T seconds |
end_time |
Stop at specific timestamp |
| Type | Description |
|---|---|
status |
Match object status against list |
data |
Match object data structure |
function |
Execute custom check function |
See the examples/ directory for comprehensive usage examples demonstrating all features of DeepExplore.
| Example | Level | Description |
|---|---|---|
| Basic Setup | Beginner | Core concepts, test objects, resolvers, and basic execution modes |
| Scenario Testing | Intermediate | Complex scenarios with multiple actions and scenario-level preconditions |
| Custom Mode | Advanced | Creating custom test modes and extending the framework |
| Advanced Usage | Advanced | Data matching, multiple stopping criteria, error handling, and update control |
| YAML Configuration | All | Example YAML configuration for scenario-based testing |
All examples share a common mock module (examples/common/) that provides reusable mock clients and check functions:
Available Mock Clients:
ResourceClient- Resource management (start, stop, restart)VMClient- Virtual machine operations (create, start, stop, delete)TaskClient- Task queue management (process, retry, complete)DatabaseClient- Database operations (create, scale, add replica, delete)
Available Check Functions:
check_resource_started,check_resource_stoppedcheck_vm_created,check_vm_running,check_vm_stoppedcheck_database_created,check_database_scaledcheck_high_priority
# Run individual examples
python examples/basic_setup.py
python examples/scenario_test.py
python examples/custom_mode.py
python examples/advanced_usage.py
# Or run from examples directory
cd examples
python basic_setup.pyFor detailed documentation of each example, see examples/README.md.
We welcome contributions! Please see CONTRIBUTING.md for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- Built for testing complex cloud platform state transitions
- Inspired by model-based testing and state machine design patterns