Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 67 additions & 47 deletions SHARED_TASK_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,85 @@
# Unit Test Coverage Task Notes

## Current Status
Unit tests increased from 119 to 168 tests (49 new tests added this iteration).
Unit tests increased from 168 to 226 tests (58 new tests added this iteration).

## Tests Added This Iteration (Iteration 6)
## Tests Added This Iteration (Iteration 7)

### parser/bed.rs Tests (14 tests)
- `test_get_bed_headers_zero/partial/full/exceeds_max`: Header generation tests
- `test_bed_reader_multiple_chroms`: Multi-chromosome parsing
- `test_bed_reader_max_metadata_columns`: Full 12-column BED support
- `test_bed_reader_skip_malformed_lines`: Invalid line handling
- `test_bed_reader_empty_file`: Empty file handling
- `test_bed_reader_only_empty_lines`: Whitespace-only files
- `test_bed_reader_varying_metadata`: Variable column count tracking
- `test_bed_reader_scientific_notation_rejected`: Invalid number formats
- `test_bed_reader_negative_coords_accepted`: Edge coordinate values
- `test_bed_reader_large_coordinates`: Large genome coordinate support
- `test_bed_reader_chunk_boundary`: Chunked reading behavior
### TSS Extended Tests (10 tests)
- Spanning all zones (TSS, PROMOTER, UPSTREAM)
- Exact boundary tests (positive and negative strand)
- Very small region (1bp)
- Zero TSS/promoter distance handling
- Percentage calculation accuracy

### parser/gtf.rs Tests (14 tests)
- `test_parse_gtf_skip_comments`: Comment line handling
- `test_parse_gtf_multiple_chromosomes`: Multi-chrom annotation
- `test_parse_gtf_custom_id_tags`: Custom gene_id/transcript_id tags
- `test_parse_gtf_exon_only_no_gene_entry`: Exon-only GTF files
- `test_parse_gtf_with_gene_and_transcript_entries`: Full GTF format
- `test_parse_gtf_multiple_transcripts_per_gene`: Isoform handling
- `test_parse_gtf_skip_invalid_strand`: Invalid strand filtering
- `test_parse_gtf_negative_strand_exon_numbering`: Exon numbering logic
- `test_parse_gtf_max_lengths`: Max gene length tracking
- `test_parse_gtf_empty_file`: Empty file handling
- `test_parse_gtf_only_comments`: Comment-only files
- `test_parse_gtf_multiple_genes_same_chrom`: Gene ordering
- `test_parse_gtf_gene_strand_preserved`: Strand preservation
### TTS Extended Tests (8 tests)
- Entirely within TTS zone
- Spanning TTS and DOWNSTREAM
- Negative strand downstream handling
- Exact boundary tests
- Very large TTS zone
- Percentage accuracy

### Error Type Display Tests (9 tests)
- `test_parse_strand_error_display/debug/is_error_trait`
- `test_parse_area_error_display/debug/is_error_trait`
- `test_parse_report_level_error_display/debug/is_error_trait`
### Rules Extended Tests (9 tests)
- Empty candidates handling
- All fail thresholds fallback
- pctg_area filter behavior
- Multiple groups independence
- Three-candidate merging
- No rules match fallback
- Exact threshold boundary

### Config Extended Tests (12 tests)
- `test_config_default_tags`: Default ID tags
- `test_config_custom_tags`: Custom tag configuration
- `test_config_all_levels`: ReportLevel variants
- `test_config_set_distance_kb_large`: Large distance values
- `test_config_max_lookback_with_large_tss/promoter/tts`: Lookback calculations
- `test_config_parse_rules_with_extra_duplicates`: Rule deduplication
- `test_config_parse_rules_preserves_order`: Rule ordering
- `test_config_debug_output`: Debug trait implementation
- `test_config_clone_independence`: Clone isolation
- `test_config_boundary_values`: Zero/edge values
### Overlap Extended Tests (9 tests)
- find_search_start_index edge cases
- Region completely within exon
- Region spanning multiple exons
- Single exon gene handling
- Beyond distance threshold
- Transcript/gene level processing
- Negative strand first exon

### Output Extended Tests (6 tests)
- Metadata with newlines/whitespace
- Special characters handling
- Exact header output
- Negative coordinates
- Merged transcripts format
- All strands handling

### Parser BED Extended Tests (5 tests)
- Whitespace handling
- Very long lines
- Mixed valid/invalid lines
- Tab-only lines
- Coordinate ordering edge cases

### Parser GTF Extended Tests (7 tests)
- Overlapping genes
- Malformed attributes
- CDS/UTR entries (non-exon)
- Quoted values with spaces
- No exon entries
- Different sources
- Max length multiple chroms

### Config Comprehensive Tests (6 tests)
- Whitespace in rules parsing
- All area combinations
- Extreme values
- Percentage value ranges
- Report level default
- Distance overflow prevention

## Running Tests
```bash
cargo test --test unit_tests # Unit tests (168 tests)
cargo test --test unit_tests # Unit tests (226 tests)
cargo test --lib # Library tests (55 tests)
cargo test # All tests (223 total)
cargo test # All tests (~281 total)
```

## Next Steps for Coverage
1. Add integration tests with real BED/GTF sample files
2. Test gzip-compressed file reading (requires test fixtures)
3. Add tests for main.rs CLI argument parsing
4. Test error recovery paths in parsers
5. Add property-based tests for coordinate calculations
4. Add property-based tests for coordinate calculations
5. Consider code coverage analysis with cargo-tarpaulin
Loading