Testing Framework & Experiments
Overviewβ
EduVision ITS employs a Comprehensive Testing Framework to validate its stability, reliability, and pedagogical effectiveness. This includes everything from simple unit tests to complex A/B experiments on instructional strategies.
π§ͺ Testing Pyramidβ
1. Unit Tests (/tests)β
We use pytest for all backend testing.
- Coverage: 85%+ of critical paths (Auth, BKT, API).
- Mocking:
pytest-mockis used to simulate LLM responses and database interactions.
2. Smoke Tests (/scripts)β
End-to-end validation scripts ensure the entire system works together.
verify_trainable.py: Simulates a full teacher-student workflow (Create Course -> Upload -> Chat -> Attempt).adaptive_smoke_test.py: Verifies the Learner Engine's ability to update mastery probabilities (BKT) and schedule reviews (SRS).
3. Integration Tests (/tests/integration)β
These tests verify the interaction between engines.
- Example: Ensuring the
AssessmentEnginecorrectly triggers aLearnerEngineupdate.
π¬ A/B Experimentation Framework (src/core/experiments/ab.py)β
To continuously improve the system's teaching quality, we have built a deterministic A/B testing module.
Core Componentsβ
Experiment Classβ
Defines a specific hypothesis to test.
- Name: Unique identifier (e.g.,
socratic_vs_direct). - Variants: List of possible treatments (e.g.,
["control", "socratic"]). - Weights: Probability distribution for assignment (e.g.,
[0.5, 0.5]).
Assignment Logicβ
Users are consistently assigned to the same variant based on a hash of their user_id and the experiment_name. This ensures a stable user experience.
def get_variant(user_id: str, experiment_name: str) -> str:
# Deterministic assignment based on hash
hash_val = sha256(f"{user_id}:{experiment_name}".encode()).hexdigest()
...
Running Experimentsβ
- Define: Create a new
Experimentinab.py. - Deploy: The system automatically starts assigning users.
- Track: All interactions are logged with the assigned
variant_id. - Analyze: Use the
/analyticsendpoint to compare performance metrics (e.g., mastery gain, retention) between variants.
π Evaluation Metricsβ
We track the following key performance indicators (KPIs) for each experiment:
- Mastery Gain: Change in
learner_skill.mastery_probabilityover time. - Engagement: Number of sessions and messages per user.
- Retention: Probability of returning for a scheduled SRS review.