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
107 changes: 55 additions & 52 deletions SHARED_TASK_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,65 @@
# Unit Test Coverage Task Notes

## Current Status
Unit tests increased from 82 to 119 tests (37 new tests added this iteration).

## Tests Added This Iteration (Iteration 4)

### overlap.rs Edge Cases
- `match_region_to_genes_intron_overlap`: Region in intron gap
- `match_region_to_genes_negative_strand`: Negative strand exon numbering
- `match_region_to_genes_upstream_proximity`: Upstream region detection
- `match_region_to_genes_downstream_proximity`: Downstream region detection
- `match_region_to_genes_multiple_genes`: Region overlapping multiple genes
- `match_region_to_genes_gene_body`: Region in gene body (not exons)

### tss.rs Edge Cases
- `tss_exon_info_creation`: Struct creation
- `entirely_in_tss_zone`: 100% TSS overlap
- `entirely_in_promoter_zone`: Promoter-only overlap
- `spans_promoter_and_upstream`: Multi-zone spanning
- `entirely_in_upstream_zone`: Upstream-only
- `neg_strand_entirely_in_tss`: Negative strand TSS
- `neg_strand_upstream`: Negative strand upstream

### tts.rs Edge Cases
- `tts_exon_info_creation`: Struct creation
- `entirely_in_tts_zone`: 100% TTS overlap
- `entirely_in_downstream_zone`: Downstream-only
- `neg_strand_entirely_in_tts`: Negative strand TTS
- `neg_strand_entirely_in_downstream`: Negative strand downstream
- `tts_zero_distance`: Zero TTS distance
- `tts_pctg_calculations`: Percentage verification

### rules.rs Additional Tests
- `empty_grouped_by`: Empty input handling
- `pctg_area_threshold_filter`: pctg_area filtering
- `multiple_groups`: Multiple transcript groups
- `rules_no_matching_area`: No rule matches fallback
- `select_transcript_empty`: Empty input
- `select_transcript_no_rules_match`: Rule fallback
- `select_transcript_multiple_genes`: Multi-gene selection

### output.rs Tests
- Basic output formatting
- Metadata handling (empty, multiple columns)
- Header generation (0, 6, 9 columns)
- Precision verification (2 decimal places)
- Edge cases (zero values, large values, all areas)
Unit tests increased from 119 to 168 tests (49 new tests added this iteration).

## Tests Added This Iteration (Iteration 6)

### 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

### 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

### 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`

### 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

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

## Next Steps for Coverage
1. Add tests for `parser/bed.rs` BedReader with gzip files
2. Add tests for `parser/gtf.rs` edge cases (custom ID tags)
3. Add integration tests with real BED/GTF sample files
4. Test Config with various parameter combinations
5. Increase coverage of error paths in parsers
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
Loading