for-ais-only/tcedocs/TESTING_IMPROVEMENTS.md
redis> prompt weren't being extracted> formatredis> and > formatsbuild/components/cli_parser.py, build/components/markdown_parser.pybuild/test_command_lists.py (13 tests)for-ais-only/tcedocs/SPECIFICATION.mdLesson: Writing comprehensive tests revealed edge cases that weren't obvious from the code.
Example: The test test_cli_parser_ignores_output() initially failed because the variable name list was being treated as a subcommand. This revealed a subtle bug in the heuristic that distinguishes subcommands from arguments.
Recommendation: When implementing features, write tests BEFORE finalizing the implementation. Tests serve as both validation and documentation.
Lesson: The original specification had no testing section, making it unclear how to validate new features.
What was added:
Recommendation: Always include a "Testing" section in technical specifications that covers:
Lesson: Tests should be organized by component/feature, not by test type.
Current structure:
test_cli_parser.py - Tests for CLI parser moduletest_command_lists.py - Tests for entire command list featuretest_jupyterize.py - Tests for Jupyter conversiontest_railroad.py - Tests for railroad diagramsRecommendation: Keep tests close to the code they test. Use descriptive names that indicate what feature is being tested.
Lesson: Unit tests alone don't catch integration issues.
Example: The CLI parser works correctly in isolation, but the markdown parser integration needed separate testing to ensure commands were extracted from markdown blocks correctly.
Recommendation: For each feature, include:
Lesson: When fixing bugs or adding features, update the specification immediately.
What was updated:
SPECIFICATION.md - Added supported prompt formatsCLI_COMMAND_EXTRACTION_QUICK_REFERENCE.md - Added examples of both formatsRecommendation: Treat specification updates as part of the feature implementation, not an afterthought.
build/components/cli_parser.py - Fixed prompt format supportbuild/components/markdown_parser.py - Fixed prompt format supportbuild/test_cli_parser.py - Created (5 tests)build/test_command_lists.py - Created (13 tests)for-ais-only/tcedocs/SPECIFICATION.md - Added Testing sectionfor-ais-only/tcedocs/CLI_COMMAND_EXTRACTION_QUICK_REFERENCE.md - Updated examples✅ All tests passing:
test_cli_parser.py: 5/5 teststest_command_lists.py: 13/13 tests