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.