03 · What You Need to Know
What Researchers Should Document About Software Dependencies
What Is a Software Dependency in Research Code?
A software dependency is a component that a program requires to execute or perform a particular function.
Dependencies may include programming-language packages, libraries, external executables, runtime systems, application programming interfaces, and system-level components.
For example, a Python script might use pandas to manipulate tabular data, NumPy for numerical operations, and statsmodels to estimate statistical models. Another script might call an external executable that must be installed separately.
Research software can also depend on configuration files, data schemas, credentials, and external services. These are not all software packages, but they may be necessary for the workflow to operate correctly.
Dependency documentation should therefore describe the relevant requirements of the workflow rather than merely reproduce a list of import statements.
Why Does Dependency Documentation Matter?
Researchers often develop code incrementally. Packages may be installed during debugging, replaced by alternatives, or retained after the functions that required them have been removed.
Over time, the environment can accumulate software that is no longer relevant to the project.
Without clear documentation, collaborators may struggle to determine which components are essential, which versions were used, and which dependencies must be installed before executing the analysis.
Dependency documentation supports reproducibility, maintenance, troubleshooting, and the transfer of research software between collaborators.
It also helps researchers identify potential compatibility problems when packages are updated or moved to another computing environment.
What Is the Difference Between Direct and Transitive Dependencies?
A direct dependency is explicitly required by the research project. A transitive dependency is required by another dependency.
Direct dependency
A package or software component that the project explicitly uses or declares as a requirement.
Transitive dependency
A package or component required indirectly because another dependency needs it.
For example, a researcher may directly use a statistical package that depends on numerical libraries. Those libraries may be installed automatically even if the research script never imports them.
Transitive dependencies matter because changes in their versions can affect installation compatibility and sometimes computational behavior.
Researchers should distinguish between documenting the packages directly required by the project and preserving the resolved dependency information needed to reconstruct its environment.
What Can AI Identify by Reading Source Code?
AI can inspect import statements, function calls, package references, and configuration files to identify apparent dependencies.
It may also recognize that a particular function belongs to a known software package or that a script calls an external executable.
For example, AI might identify that a Python project imports pandas, SciPy, and matplotlib, then explain how each package contributes to the analysis.
However, source-code inspection has limitations. A package may be imported dynamically, used only under particular conditions, or loaded through a plugin system. External executables may be invoked indirectly.
Furthermore, import names do not always match the names of installable package distributions.
AI can therefore generate a useful preliminary inventory, but the inventory should not be treated as complete without verification.
Why Can't AI Determine Exact Package Versions From Imports?
An import statement identifies a software module, not the version installed when the analysis was executed.
For example, import pandas does not establish whether the researcher used a particular earlier or later release.
AI may suggest versions based on general compatibility knowledge, but those suggestions are not evidence of the historical environment.
Exact versions should be obtained from available package-manager records, lock files, environment exports, or other verified installation metadata.
Where those records are unavailable, researchers should distinguish inferred compatibility requirements from confirmed historical versions.
This distinction is particularly important when creating a reproducible software environment file from incomplete project materials.
What Should a Useful Dependency Inventory Contain?
A dependency inventory should explain more than the names of installed packages.
For consequential software components, useful information may include the package or tool name, its role in the project, the version used, the source of the version information, and any relevant platform requirements.
| Dependency information |
Purpose |
Possible evidence |
| Package or tool name |
Identifies the required component |
Import statement, configuration file, or package-manager record |
| Role in the analysis |
Explains why the dependency is needed |
Relevant functions and code references |
| Installed version |
Supports environment reconstruction |
Lock file, package inventory, or environment metadata |
| Dependency relationship |
Distinguishes direct from transitive requirements |
Package-manager dependency information |
| Platform requirements |
Identifies operating-system or architecture constraints |
Official installation documentation and system records |
| External services |
Documents runtime requirements beyond local packages |
API documentation, configuration, and execution records |
| Verification status |
Indicates whether the requirement was confirmed |
Installation and execution tests |
Not every project needs a separate table containing all these fields. A concise README and machine-readable dependency specification may be sufficient for simpler workflows.
The documentation should be detailed enough for another qualified researcher to understand and reconstruct the relevant computational requirements.
How Can Researchers Verify AI-Suggested Python Dependencies?
Python provides several ways to inspect package installations and dependencies.
The command python -m pip freeze lists installed distributions in the active environment. The command python -m pip show can display information about a specified installed package, while python -m pip inspect provides structured information about the installed environment.
Researchers may also use dependency-management tools that maintain project specifications or lock files.
AI can help interpret these outputs, but the underlying records should come from the actual environment whenever possible.
Researchers should be careful when removing apparently unused dependencies. A package may be required through dynamic imports, optional functionality, or execution paths not evident from a simple code inspection.
Fresh-environment testing is a useful way to determine whether the documented dependencies are sufficient.
How Can Researchers Document Dependencies in R Projects?
R projects may use packages installed through CRAN, Bioconductor, GitHub, or other repositories.
Tools such as renv can record project dependencies and package versions in a lock file, supporting later restoration.
AI may help explain package roles, interpret renv metadata, or identify apparent dependencies in R scripts.
However, the actual dependency record should be checked using the R project and its package-management tools.
Some R packages also require system libraries, compilers, or external software. These requirements may not be fully represented by package names alone.
Researchers should document such requirements when they are necessary for installation or execution.
Should Researchers Document Dependencies That Are No Longer Used?
Not necessarily as active project requirements.
Development environments often contain packages installed for abandoned experiments or earlier versions of the analysis.
A dependency inventory intended to describe the current analytical workflow should distinguish active requirements from historical or unused installations.
However, researchers should avoid removing dependencies solely because AI believes they are unnecessary. Some requirements may be invoked indirectly or only during particular execution paths.
When preparing a clean project specification, researchers can test whether the workflow runs without the suspected dependency.
Historical environment records associated with published results should be preserved separately rather than silently rewritten to reflect a later simplified configuration.
What About Dependencies on External APIs and Online Services?
Some research code relies on services outside the local software environment, including APIs, remote databases, cloud computing services, or hosted machine-learning models.
These dependencies introduce additional reproducibility concerns because the service may change independently of the researcher's code.
Researchers should document the service provider, relevant API or model version when available, required configuration, and the role of the service in the workflow.
Where permitted and appropriate, preserving authorized inputs and outputs can help establish what the external service returned during the original analysis.
Credentials should never be included in publicly shared dependency records. Documentation can identify required environment variables or authentication procedures without exposing secrets.
If an external service is essential to reproducing the analysis, researchers should explain the limitations created by its availability, access conditions, and potential changes.
Can AI Help Identify Dependency Conflicts?
Yes. AI can interpret error messages, compare package constraints, and suggest possible explanations for installation failures.
For example, it may recognize that two packages require incompatible versions of a shared dependency.
However, AI suggestions should be verified using package-manager diagnostics and official documentation. A proposed version combination may be outdated, unavailable, or incompatible with the project's platform.
Researchers should avoid changing dependencies simply to eliminate an installation error without checking whether the revised environment preserves the analytical behavior associated with the original results.
Dependency troubleshooting should therefore include both installation checks and execution tests.
How Should Researchers Document Dependency Updates?
Updating a dependency can change software behavior even when the research code itself remains unchanged.
Researchers should preserve the earlier dependency specification and document significant updates, particularly when they affect analytical calculations or compatibility.
Version control can associate dependency-file changes with the corresponding code revisions.
For consequential updates, researchers should rerun relevant tests and compare the resulting outputs with previously established reference results.
These records support traceable changes to AI-assisted research software and help distinguish environment changes from modifications to analytical logic.
Does Dependency Documentation Make Research Code Reproducible?
Dependency documentation is necessary for many computational workflows, but it is not sufficient on its own.
A complete package inventory cannot compensate for missing input data, undocumented preprocessing, incorrect code, or unavailable external services.
Likewise, a documented environment may install successfully while producing different outputs because of changes in numerical behavior or execution conditions.
Researchers should therefore test whether the documented dependencies support execution of the actual analysis.
The dependency record should be preserved with the code, relevant data specifications, tests, and execution instructions needed for reproducible AI-generated research code.
Should Dependency Documentation Be Archived With the Research Code?
Yes, when the dependencies are necessary to reconstruct the computational workflow.
A research software release should preserve the dependency specifications associated with the code used to produce the reported findings.
Depending on the project, this may include requirements files, lock files, container definitions, documentation of external tools, and relevant environment metadata.
Researchers should distinguish the preserved analytical environment from later development updates.
Long-term archiving of AI-assisted research code should account for the availability of dependencies as well as the source code itself.