agentsclimarketplace

Test coverage for edge cases

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/test-coverage-for-edge-cases

Curated, evidence-grounded skill and software-tool collections for scientific AI agents, generated by the AgenticScienceBuilder

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill test-coverage-for-edge-cases

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 14 stars14 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Use when integrating a new metadata validation step into a conversion pipeline that fetches structured chemical identifiers (SMILES, InChI, CAS numbers, IUPAC names) from external services.

The file declares its own license as CC-BY-4.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

7.8 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it

test-coverage-for-edge-cases

Summary

Design and implement pytest-based unit tests that verify metadata validation logic accepts correctly formatted annotation values while rejecting malformed data for each supported attribute type (SMILES, InChI, CAS number). This ensures data quality gates in MSMetaEnhancer catch edge cases before validated metadata is committed to .msp files.

When to use

Apply this skill when integrating a new metadata validation step into a conversion pipeline that fetches structured chemical identifiers (SMILES, InChI, CAS numbers, IUPAC names) from external services. Use it specifically when you need to verify that a Validator class correctly intercepts converter output dictionaries and applies attribute-specific format rules before data is written to spectra files.

When NOT to use

  • Input is unstructured free-text metadata with no well-defined format specification — validation schemas require formal acceptance criteria.
  • Metadata has already been manually curated and validated upstream — redundant testing adds no data quality benefit.
  • Services return only opaque identifiers (e.g., database IDs) with no parseable structure — attribute-level validation rules cannot be designed.

Inputs

  • Converter output dictionaries (attribute name → fetched value pairs)
  • Sample .msp files with diverse metadata
  • Service-specific specification documents (API response formats, valid value ranges)

Outputs

  • pytest test suite with parameterized unit tests per attribute type
  • Test report showing pass/fail status for each validation rule
  • Validation logs capturing attribute name, fetched value, validation rule applied, pass/fail status, and service source

How to apply

First, design a validation schema that defines acceptance criteria for each metadata attribute type based on service specifications (e.g., SMILES must follow SMILES syntax rules, InChI strings must begin with 'InChI=', CAS numbers must match '^[0-9]{1,7}-[0-9]{2}-[0-9]$'). Second, create pytest test cases for each attribute that exercise both valid and invalid inputs: valid cases confirm the validator passes correctly formatted values, invalid cases confirm it rejects malformed data. Third, use pytest fixtures to parameterize tests across multiple example values per attribute type. Fourth, run the full test suite with pytest to ensure validation rules accept all correct formats while uniformly rejecting malformed inputs. Fifth, include end-to-end tests with sample .msp files to confirm only validated metadata reaches output files and validation logs capture all decisions.

Related tools

Examples

pytest MSMetaEnhancer/tests/test_validator.py::test_smiles_validation -v; pytest MSMetaEnhancer/tests/test_validator.py::test_inchi_validation -v; pytest MSMetaEnhancer/tests/test_validator.py::test_cas_validation -v

Evaluation signals

  • All pytest tests execute without error and report pass/fail status for each attribute type.
  • Validation logs contain structured records (attribute name, fetched value, rule applied, pass/fail, service source) for every validation decision.
  • End-to-end test confirms only validated metadata appears in output .msp files; rejected values are either omitted or logged as failures.
  • Test suite covers both boundary cases (empty strings, maximum-length values, special characters) and service-specific malformations (invalid SMILES syntax, missing InChI prefix, incorrect CAS number checksum).
  • Validation rules are consistent across all supported services — identical attribute types from different sources follow the same acceptance criteria.

Limitations

  • Validation schema must be manually maintained as service specifications change; automated schema updates are not discussed in the article.
  • Edge cases specific to local metadata curation (e.g., user-entered values with typos) may require additional validation rules beyond service-level format checking.
  • Some valid chemical identifiers may fail validation if the schema is overly restrictive (e.g., if SMILES validator does not handle all valid SMILES dialect variants).

Evidence

  • [other] Design a validation schema defining acceptance criteria for each metadata attribute type (e.g., SMILES format, InChI prefix, CAS number format) based on service specifications.: "Design a validation schema defining acceptance criteria for each metadata attribute type (e.g., SMILES format, InChI prefix, CAS number format) based on service specifications."
  • [other] Add unit tests using pytest that verify validation accepts correct formats and rejects malformed data for each supported attribute type.: "Add unit tests using pytest that verify validation accepts correct formats and rejects malformed data for each supported attribute type."
  • [other] Test end-to-end with sample .msp files, confirming only validated metadata reaches output files and validation logs capture all decisions.: "Test end-to-end with sample .msp files, confirming only validated metadata reaches output files and validation logs capture all decisions."
  • [readme] All functionality is tested with the pytest framework.: "All functionality is tested with the pytest framework."
  • [other] make sure the existing tests still work by running pytest: "make sure the existing tests still work by running pytest"

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 326,984. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.