Class: Aidp::Planning::Generators::UserTestPlanGenerator
- Inherits:
-
Object
- Object
- Aidp::Planning::Generators::UserTestPlanGenerator
- Defined in:
- lib/aidp/planning/generators/user_test_plan_generator.rb
Overview
Generates user testing plan with recruitment criteria and survey templates Uses AI to create contextual testing questions based on feature set Follows Zero Framework Cognition (ZFC) pattern
Instance Method Summary collapse
-
#format_as_markdown(test_plan) ⇒ String
Format user test plan as markdown.
-
#generate(mvp_scope:, target_users: nil) ⇒ Hash
Generate user test plan from MVP scope.
-
#initialize(ai_decision_engine:, config: nil) ⇒ UserTestPlanGenerator
constructor
A new instance of UserTestPlanGenerator.
Constructor Details
#initialize(ai_decision_engine:, config: nil) ⇒ UserTestPlanGenerator
Returns a new instance of UserTestPlanGenerator.
12 13 14 15 |
# File 'lib/aidp/planning/generators/user_test_plan_generator.rb', line 12 def initialize(ai_decision_engine:, config: nil) @ai_decision_engine = ai_decision_engine @config = config || Aidp::Config.agile_config end |
Instance Method Details
#format_as_markdown(test_plan) ⇒ String
Format user test plan as markdown
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
# File 'lib/aidp/planning/generators/user_test_plan_generator.rb', line 49 def format_as_markdown(test_plan) Aidp.log_debug("user_test_plan_generator", "format_as_markdown") output = ["# User Testing Plan", ""] output << "**Generated:** #{test_plan[:metadata][:generated_at]}" output << "**Features to Test:** #{test_plan[:metadata][:mvp_feature_count]}" output << "**Testing Stages:** #{test_plan[:metadata][:testing_stage_count]}" output << "" output << "## Overview" output << "" output << test_plan[:overview] output << "" output << "## Target Users" output << "" test_plan[:target_users].each do |segment| output << "### #{segment[:name]}" output << "" output << "**Description:** #{segment[:description]}" output << "" output << "**Characteristics:**" segment[:characteristics].each do |char| output << "- #{char}" end output << "" output << "**Sample Size:** #{segment[:sample_size]}" output << "" end output << "## Recruitment Criteria" output << "" output << "### Screener Questions" output << "" test_plan[:recruitment][:screener_questions].each_with_index do |q, idx| output << "#{idx + 1}. **#{q[:question]}**" output << " - Type: #{q[:type]}" output << " - Qualifying Answer: #{q[:qualifying_answer]}" if q[:qualifying_answer] output << "" end output << "### Recruitment Channels" output << "" test_plan[:recruitment][:channels].each do |channel| output << "- #{channel}" end output << "" output << "### Incentives" output << "" output << test_plan[:recruitment][:incentives] output << "" output << "## Testing Stages" output << "" test_plan[:testing_stages].each_with_index do |stage, idx| output << "### Stage #{idx + 1}: #{stage[:name]}" output << "" output << "**Objective:** #{stage[:objective]}" output << "" output << "**Duration:** #{stage[:duration]}" output << "" output << "**Participants:** #{stage[:participants]}" output << "" output << "**Activities:**" stage[:activities].each do |activity| output << "- #{activity}" end output << "" output << "**Success Criteria:**" stage[:success_criteria].each do |criterion| output << "- #{criterion}" end output << "" end output << "## Survey Questions" output << "" output << "### Likert Scale Questions (1-5: Strongly Disagree to Strongly Agree)" output << "" test_plan[:survey_questions][:likert].each_with_index do |q, idx| output << "#{idx + 1}. #{q}" end output << "" output << "### Multiple Choice Questions" output << "" test_plan[:survey_questions][:multiple_choice].each_with_index do |q, idx| output << "#{idx + 1}. **#{q[:question]}**" q[:options].each_with_index do |opt, oidx| output << " #{("a".."z").to_a[oidx]}. #{opt}" end output << "" end output << "### Open-Ended Questions" output << "" test_plan[:survey_questions][:open_ended].each_with_index do |q, idx| output << "#{idx + 1}. #{q}" end output << "" output << "## Interview Script" output << "" output << "### Introduction" output << "" output << test_plan[:interview_script][:introduction] output << "" output << "### Main Questions" output << "" test_plan[:interview_script][:main_questions].each_with_index do |q, idx| output << "#{idx + 1}. #{q[:question]}" output << " - **Follow-ups:** #{q[:follow_ups].join(", ")}" if q[:follow_ups]&.any? output << "" end output << "### Closing" output << "" output << test_plan[:interview_script][:closing] output << "" output << "## Success Metrics" output << "" test_plan[:success_metrics].each do |metric| output << "- **#{metric[:name]}:** #{metric[:description]}" output << " - Target: #{metric[:target]}" output << "" end output << "## Timeline" output << "" test_plan[:timeline].each do |phase| output << "- **#{phase[:phase]}:** #{phase[:duration]}" end output << "" output.join("\n") end |
#generate(mvp_scope:, target_users: nil) ⇒ Hash
Generate user test plan from MVP scope
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/aidp/planning/generators/user_test_plan_generator.rb', line 21 def generate(mvp_scope:, target_users: nil) Aidp.log_debug("user_test_plan_generator", "generate", feature_count: mvp_scope[:mvp_features]&.size || 0) # Use AI to generate contextual testing plan test_plan = generate_test_plan_with_ai(mvp_scope, target_users) { overview: test_plan[:overview], target_users: test_plan[:target_users], recruitment: test_plan[:recruitment], testing_stages: test_plan[:testing_stages], survey_questions: test_plan[:survey_questions], interview_script: test_plan[:interview_script], success_metrics: test_plan[:success_metrics], timeline: test_plan[:timeline], metadata: { generated_at: Time.now.iso8601, mvp_feature_count: mvp_scope[:mvp_features]&.size || 0, testing_stage_count: test_plan[:testing_stages]&.size || 0, survey_question_count: test_plan[:survey_questions]&.size || 0 } } end |