michaeljabbour / michaeljabbour/altairbasic

Comprehensive Test Suite Implementation

Open
#4 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

# Comprehensive Test Suite Implementation

## Issue Description
The project needs a more comprehensive automated test suite to verify all aspects of the interpreter. Currently, there are basic tests for the lexer, parser, and interpreter, but a more structured and thorough approach is needed.

## Goals
1. Create a complete test suite covering all language features
2. Automate testing to run with each build
3. Provide coverage metrics
4. Ensure backward compatibility with classic BASIC programs

## Proposed Test Categories
1. **Lexer Tests**: Verify correct tokenization of all language constructs
2. **Parser Tests**: Ensure AST is built correctly for all valid programs
3. **Interpreter Tests**: Check execution of all statements and expressions
4. **Integration Tests**: Run complete programs and verify output
5. **Edge Case Tests**: Handle invalid input, boundary conditions, error recovery
6. **Performance Tests**: Measure execution time for benchmark programs

## Technical Approach
1. Create BASIC programs that test each feature individually
2. Build a test harness to automate execution and validation
3. Compare output to expected results
4. Integrate with the build system (CMake)
5. Generate coverage reports

## Specific Tests Needed
- Variable assignment and retrieval
- All mathematical operations
- String handling and functions
- Control flow (IF/THEN, FOR/NEXT, GOTO, GOSUB)
- Array operations
- Input/Output operations
- User-defined functions
- Error handling

## Priority
High - A comprehensive test suite is essential for maintaining the interpreter's quality and facilitating further development.

## Additional Notes
- Consider using historical BASIC programs as test cases
- Test programs should be well-documented with expected output
- All tests should be runnable from the command line with clear pass/fail indicators

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing lexer, parser, and interpreter tests, then inspect the CMake build configuration. Define a test harness around BASIC programs and expected output, covering the listed language features and edge cases. Done means the suite runs from the command line and with each build, reports pass/fail results, and produces coverage metrics.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system, testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.